OGS
CreateEmbeddedAnchor.cpp
Go to the documentation of this file.
1
10
12
13#include "BaseLib/ConfigTree.h"
14#include "BaseLib/Logging.h"
15#include "EmbeddedAnchor.h"
16#include "ParameterLib/Utils.h"
17
18namespace ProcessLib
19{
20template <int GlobalDim>
21std::unique_ptr<SourceTermBase> createEmbeddedAnchor(
22 BaseLib::ConfigTree const& config, MeshLib::Mesh const& st_mesh,
23 MeshLib::Mesh const& bulk_mesh,
24 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
25 std::size_t const source_term_mesh_id, const int variable_id)
26{
27 DBUG("Constructing EmbeddedAnchor from config.");
28 // ...special is necessary, because EmbeddedAnchor has no configuration via
29 // child tags, hence it wouldn't be handled properly by the documentation
30 // scripts otherwise.
33 config.checkConfigParameter("type", "EmbeddedAnchor");
34
35 for (MeshLib::Element const* const element : st_mesh.getElements())
36 {
37 if (element->getNumberOfNodes() != 2)
38 {
40 "Every anchor element needs to have precisely two nodes.");
41 }
42 }
43#ifdef USE_PETSC
45 "The EmbeddedAnchor source term has not been tested with PETSc yet.");
46#endif
47
48 return std::make_unique<EmbeddedAnchor<GlobalDim>>(
49 bulk_mesh, dof_table_bulk, source_term_mesh_id, st_mesh, variable_id);
50}
51
52template std::unique_ptr<SourceTermBase> createEmbeddedAnchor<2>(
53 BaseLib::ConfigTree const& config, MeshLib::Mesh const& st_mesh,
54 MeshLib::Mesh const& bulk_mesh,
55 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
56 std::size_t const source_term_mesh_id, const int variable_id);
57
58template std::unique_ptr<SourceTermBase> createEmbeddedAnchor<3>(
59 BaseLib::ConfigTree const& config, MeshLib::Mesh const& st_mesh,
60 MeshLib::Mesh const& bulk_mesh,
61 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
62 std::size_t const source_term_mesh_id, const int variable_id);
63} // namespace ProcessLib
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
void checkConfigParameter(std::string const &param, std::string_view const value) const
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:111
template std::unique_ptr< SourceTermBase > createEmbeddedAnchor< 2 >(BaseLib::ConfigTree const &config, MeshLib::Mesh const &st_mesh, MeshLib::Mesh const &bulk_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, std::size_t const source_term_mesh_id, const int variable_id)
template std::unique_ptr< SourceTermBase > createEmbeddedAnchor< 3 >(BaseLib::ConfigTree const &config, MeshLib::Mesh const &st_mesh, MeshLib::Mesh const &bulk_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, std::size_t const source_term_mesh_id, const int variable_id)
std::unique_ptr< SourceTermBase > createEmbeddedAnchor(BaseLib::ConfigTree const &config, MeshLib::Mesh const &st_mesh, MeshLib::Mesh const &bulk_mesh, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, std::size_t const source_term_mesh_id, const int variable_id)