16template <
typename BoundaryConditionData,
17 template <
typename ,
int >
18 class LocalAssemblerImplementation>
19template <typename Data>
21 LocalAssemblerImplementation>::
23 unsigned const integration_order, unsigned const shapefunction_order,
24 NumLib::LocalToGlobalIndexMap const& dof_table_bulk,
25 int const variable_id, int const component_id,
26 unsigned const global_dim, MeshLib::Mesh const& bc_mesh, Data&& data)
29 static_assert(std::is_same_v<typename std::decay_t<BoundaryConditionData>,
30 typename std::decay_t<Data>>,
31 "Type mismatch between declared and passed BC data.");
35 static_cast<int>(dof_table_bulk.getNumberOfVariables()) ||
37 dof_table_bulk.getNumberOfVariableComponents(variable_id))
40 "Variable id or component id too high. Actual values: ({:d}, "
42 "maximum values: ({:d}, {:d}).",
43 variable_id, component_id, dof_table_bulk.getNumberOfVariables(),
44 dof_table_bulk.getNumberOfVariableComponents(variable_id));
47 if (!
_bc_mesh.getProperties().template existsPropertyVector<std::size_t>(
51 "The required bulk node ids map does not exist in the boundary "
56 std::vector<MeshLib::Node*>
const& bc_nodes =
_bc_mesh.getNodes();
58 "Found {:d} nodes for Natural BCs for the variable {:d} and component "
60 bc_nodes.size(), variable_id, component_id);
67 variable_id, {component_id}, std::move(bc_mesh_subset));
70 LocalAssemblerImplementation>(
77template <
typename BoundaryConditionData,
78 template <
typename ,
int >
79 class LocalAssemblerImplementation>
81 LocalAssemblerImplementation>::
83 std::vector<GlobalVector*> const& x,
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
A subset of nodes on a single mesh.
virtual void assemble(std::size_t const id, NumLib::LocalToGlobalIndexMap const &dof_table_boundary, double const t, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix *K, GlobalVector &b, GlobalMatrix *Jac)=0
MeshLib::Mesh const & _bc_mesh
A lower-dimensional mesh on which the boundary condition is defined.
GenericNaturalBoundaryCondition(unsigned const integration_order, unsigned const shapefunction_order, NumLib::LocalToGlobalIndexMap const &dof_table_bulk, int const variable_id, int const component_id, unsigned const global_dim, MeshLib::Mesh const &bc_mesh, Data &&data)
void applyNaturalBC(const double t, std::vector< GlobalVector * > const &x, int const process_id, GlobalMatrix *K, GlobalVector &b, GlobalMatrix *Jac) override
BoundaryConditionData _data
Data used in the assembly of the specific boundary condition.
std::vector< std::unique_ptr< GenericNaturalBoundaryConditionLocalAssemblerInterface > > _local_assemblers
Local assemblers for each element of number of _elements.
std::unique_ptr< NumLib::LocalToGlobalIndexMap > _dof_table_boundary
constexpr std::string_view getBulkIDString(MeshItemType mesh_item_type)
void createLocalAssemblers(const unsigned dimension, std::vector< MeshLib::Element * > const &mesh_elements, NumLib::LocalToGlobalIndexMap const &dof_table, const unsigned shapefunction_order, std::vector< std::unique_ptr< LocalAssemblerInterface > > &local_assemblers, NumLib::IntegrationOrder const integration_order, ExtraCtorArgs &&... extra_ctor_args)
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)