OGS
ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation > Class Template Referencefinal

Detailed Description

template<typename BoundaryConditionData, template< typename, int > class LocalAssemblerImplementation>
class ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >

Definition at line 23 of file GenericNaturalBoundaryCondition.h.

#include <GenericNaturalBoundaryCondition.h>

Inheritance diagram for ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >:
[legend]
Collaboration diagram for ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >:
[legend]

Public Member Functions

template<typename Data >
 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
 
- Public Member Functions inherited from ProcessLib::BoundaryCondition
virtual void getEssentialBCValues (const double, GlobalVector const &, NumLib::IndexValueVector< GlobalIndexType > &) const
 Writes the values of essential BCs to bc_values.
 
virtual void preTimestep (const double, std::vector< GlobalVector * > const &, int const)
 
virtual void postTimestep (const double, std::vector< GlobalVector * > const &, int const)
 
virtual ~BoundaryCondition ()=default
 

Private Attributes

BoundaryConditionData _data
 Data used in the assembly of the specific boundary condition.
 
MeshLib::Mesh const & _bc_mesh
 A lower-dimensional mesh on which the boundary condition is defined.
 
std::unique_ptr< NumLib::LocalToGlobalIndexMap_dof_table_boundary
 
std::vector< std::unique_ptr< GenericNaturalBoundaryConditionLocalAssemblerInterface > > _local_assemblers
 Local assemblers for each element of number of _elements.
 

Constructor & Destructor Documentation

◆ GenericNaturalBoundaryCondition()

template<typename BoundaryConditionData , template< typename, int > class LocalAssemblerImplementation>
template<typename Data >
ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::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 )

Create a boundary condition process from given config, DOF-table, and a mesh subset for a given variable and its component. A local DOF-table, a subset of the given one, is constructed.

Definition at line 21 of file GenericNaturalBoundaryCondition-impl.h.

27 : _data(std::forward<Data>(data)), _bc_mesh(bc_mesh)
28{
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.");
32
33 // check basic data consistency
34 if (variable_id >=
35 static_cast<int>(dof_table_bulk.getNumberOfVariables()) ||
36 component_id >=
37 dof_table_bulk.getNumberOfVariableComponents(variable_id))
38 {
40 "Variable id or component id too high. Actual values: ({:d}, "
41 "{:d}), "
42 "maximum values: ({:d}, {:d}).",
43 variable_id, component_id, dof_table_bulk.getNumberOfVariables(),
44 dof_table_bulk.getNumberOfVariableComponents(variable_id));
45 }
46
47 if (!_bc_mesh.getProperties().template existsPropertyVector<std::size_t>(
49 {
51 "The required bulk node ids map does not exist in the boundary "
52 "mesh '{:s}'.",
54 }
55
56 std::vector<MeshLib::Node*> const& bc_nodes = _bc_mesh.getNodes();
57 DBUG(
58 "Found {:d} nodes for Natural BCs for the variable {:d} and component "
59 "{:d}",
60 bc_nodes.size(), variable_id, component_id);
61
62 MeshLib::MeshSubset bc_mesh_subset(_bc_mesh, bc_nodes);
63
64 // Create local DOF table from the BC mesh subset for the given variable and
65 // component id.
66 _dof_table_boundary = dof_table_bulk.deriveBoundaryConstrainedMap(
67 variable_id, {component_id}, std::move(bc_mesh_subset));
68
70 LocalAssemblerImplementation>(
72 shapefunction_order, _local_assemblers,
73 NumLib::IntegrationOrder{integration_order},
75}
#define OGS_FATAL(...)
Definition Error.h:26
void DBUG(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:30
A subset of nodes on a single mesh.
Definition MeshSubset.h:26
bool isAxiallySymmetric() const
Definition Mesh.h:137
std::vector< Node * > const & getNodes() const
Get the nodes-vector for the mesh.
Definition Mesh.h:106
std::vector< Element * > const & getElements() const
Get the element-vector for the mesh.
Definition Mesh.h:109
Properties & getProperties()
Definition Mesh.h:134
const std::string getName() const
Get name of the mesh.
Definition Mesh.h:103
MeshLib::Mesh const & _bc_mesh
A lower-dimensional mesh on which the boundary condition is defined.
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)
Definition Properties.h:188
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)

References DBUG(), MeshLib::getBulkIDString(), MeshLib::Node, and OGS_FATAL.

Member Function Documentation

◆ applyNaturalBC()

template<typename BoundaryConditionData , template< typename, int > class LocalAssemblerImplementation>
void ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::applyNaturalBC ( const double t,
std::vector< GlobalVector * > const & x,
int const process_id,
GlobalMatrix & K,
GlobalVector & b,
GlobalMatrix * Jac )
overridevirtual

Calls local assemblers which calculate their contributions to the global matrix and the right-hand-side.

Reimplemented from ProcessLib::BoundaryCondition.

Definition at line 81 of file GenericNaturalBoundaryCondition-impl.h.

88{
91 _local_assemblers, *_dof_table_boundary, t, x, process_id, K, b, Jac);
92}
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
static void executeMemberOnDereferenced(Method method, Container const &container, Args &&... args)

References NumLib::SerialExecutor::executeMemberOnDereferenced().

Member Data Documentation

◆ _bc_mesh

template<typename BoundaryConditionData , template< typename, int > class LocalAssemblerImplementation>
MeshLib::Mesh const& ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::_bc_mesh
private

A lower-dimensional mesh on which the boundary condition is defined.

Definition at line 47 of file GenericNaturalBoundaryCondition.h.

◆ _data

template<typename BoundaryConditionData , template< typename, int > class LocalAssemblerImplementation>
BoundaryConditionData ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::_data
private

Data used in the assembly of the specific boundary condition.

Definition at line 44 of file GenericNaturalBoundaryCondition.h.

◆ _dof_table_boundary

template<typename BoundaryConditionData , template< typename, int > class LocalAssemblerImplementation>
std::unique_ptr<NumLib::LocalToGlobalIndexMap> ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::_dof_table_boundary
private

Local dof table, a subset of the global one restricted to the participating number of _elements of the boundary condition.

Definition at line 51 of file GenericNaturalBoundaryCondition.h.

◆ _local_assemblers

template<typename BoundaryConditionData , template< typename, int > class LocalAssemblerImplementation>
std::vector< std::unique_ptr<GenericNaturalBoundaryConditionLocalAssemblerInterface> > ProcessLib::GenericNaturalBoundaryCondition< BoundaryConditionData, LocalAssemblerImplementation >::_local_assemblers
private

Local assemblers for each element of number of _elements.

Definition at line 56 of file GenericNaturalBoundaryCondition.h.


The documentation for this class was generated from the following files: