OGS
CreateEmbeddedAnchor.cpp
Go to the documentation of this file.
1
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.");
29 config.checkConfigParameter("type", "EmbeddedAnchor");
30
31 for (MeshLib::Element const* const element : st_mesh.getElements())
32 {
33 if (element->getNumberOfNodes() != 2)
34 {
36 "Every anchor element needs to have precisely two nodes.");
37 }
38 }
39#ifdef USE_PETSC
41 "The EmbeddedAnchor source term has not been tested with PETSc yet.");
42#endif
43
44 return std::make_unique<EmbeddedAnchor<GlobalDim>>(
45 bulk_mesh, dof_table_bulk, source_term_mesh_id, st_mesh, variable_id);
46}
47
48template std::unique_ptr<SourceTermBase> createEmbeddedAnchor<2>(
49 BaseLib::ConfigTree const& config, MeshLib::Mesh const& st_mesh,
50 MeshLib::Mesh const& bulk_mesh,
51 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
52 std::size_t const source_term_mesh_id, const int variable_id);
53
54template std::unique_ptr<SourceTermBase> createEmbeddedAnchor<3>(
55 BaseLib::ConfigTree const& config, MeshLib::Mesh const& st_mesh,
56 MeshLib::Mesh const& bulk_mesh,
57 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
58 std::size_t const source_term_mesh_id, const int variable_id);
59} // 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)