OGS
ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs > Class Template Referencefinal

Detailed Description

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
class ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >

The LocalDataInitializer is a functor creating a local assembler data with corresponding to the mesh element type shape functions and calling initialization of the new local assembler data. For example for MeshLib::Quad a local assembler data with template argument NumLib::ShapeQuad4 is created.

Attention
This is modified version of the ProcessLib::LocalDataInitializer class which does not include line elements, allows only shapefunction of order 2, and provides additional template argument DisplacementDim.

Definition at line 44 of file LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h.

#include <LocalDataInitializer.h>

Collaboration diagram for ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >:
[legend]

Classes

struct  IsElementEnabled

Public Types

using LADataIntfPtr = std::unique_ptr<LocalAssemblerInterface>

Public Member Functions

 LocalDataInitializer (NumLib::LocalToGlobalIndexMap const &dof_table, NumLib::IntegrationOrder const integration_order)
LADataIntfPtr operator() (std::size_t const id, MeshLib::Element const &mesh_item, ConstructorArgs &&... args) const

Private Types

using LADataBuilder

Static Private Member Functions

template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure>
static LADataBuilder makeLocalAssemblerBuilder (NumLib::IntegrationOrder const integration_order)

Private Attributes

std::unordered_map< std::type_index, LADataBuilder_builder
 Mapping of element types to local assembler constructors.
NumLib::LocalToGlobalIndexMap const & _dof_table

Member Typedef Documentation

◆ LADataBuilder

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
using ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::LADataBuilder
private
Initial value:
std::function<LADataIntfPtr(
MeshLib::Element const& e,
std::size_t const n_variables,
std::size_t const local_matrix_size,
std::vector<unsigned> const& dofIndex_to_localIndex,
ConstructorArgs&&...)>

Definition at line 174 of file LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h.

◆ LADataIntfPtr

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
using ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::LADataIntfPtr = std::unique_ptr<LocalAssemblerInterface>

Constructor & Destructor Documentation

◆ LocalDataInitializer()

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::LocalDataInitializer ( NumLib::LocalToGlobalIndexMap const & dof_table,
NumLib::IntegrationOrder const integration_order )
inlineexplicit

Definition at line 65 of file LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h.

69 {
73
75 [this, integration_order]<typename ET>(ET*)
76 {
77 using MeshElement = typename ET::Element;
78 using ShapeFunction = typename ET::ShapeFunction;
81
86 });
87 }
static LADataBuilder makeLocalAssemblerBuilder(NumLib::IntegrationOrder const integration_order)
std::unordered_map< std::type_index, LADataBuilder > _builder
Mapping of element types to local assembler constructors.
void foreach(Function &&f)
Definition TMP.h:150
decltype(auto) filter(Pred pred)
Definition TMP.h:71

References _builder, _dof_table, BaseLib::TMP::filter(), BaseLib::TMP::foreach(), and makeLocalAssemblerBuilder().

Member Function Documentation

◆ makeLocalAssemblerBuilder()

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
template<typename ShapeFunctionDisplacement, typename ShapeFunctionPressure>
LADataBuilder ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::makeLocalAssemblerBuilder ( NumLib::IntegrationOrder const integration_order)
inlinestaticprivate

Generates a function that creates a new LocalAssembler of type LAData<ShapeFunctionDisplacement>. Only functions with shape function's dimension less or equal to the global dimension are instantiated, e.g. following combinations of shape functions and global dimensions: (Line2, 1), (Line2, 2), (Line2, 3), (Hex20, 3) but not (Hex20, 2) or (Hex20, 1).

Definition at line 189 of file LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h.

References MeshLib::Element::getDimension().

Referenced by LocalDataInitializer().

◆ operator()()

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
LADataIntfPtr ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::operator() ( std::size_t const id,
MeshLib::Element const & mesh_item,
ConstructorArgs &&... args ) const
inline

Returns data pointer to the newly created local assembler data.

Attention
The index id is not necessarily the mesh item's id. Especially when having multiple meshes it will differ from the latter.

Definition at line 94 of file LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h.

97 {
98 auto const type_idx = std::type_index(typeid(mesh_item));
99 auto const it = _builder.find(type_idx);
100
101 if (it == _builder.end())
102 {
103 OGS_FATAL(
104 "You are trying to build a local assembler for an unknown mesh "
105 "element type ({:s})."
106 " Maybe you have disabled this mesh element type in your build "
107 "configuration, or a mesh element order does not match shape "
108 "function order given in the project file.",
109 type_idx.name());
110 }
111
112 auto const n_local_dof = _dof_table.getNumberOfElementDOF(id);
113 auto const varIDs = _dof_table.getElementVariableIDs(id);
114 bool const isPressureDeactivated = (varIDs.front() != 0);
115 std::vector<int> involved_varIDs; // including deactivated elements
116 involved_varIDs.reserve(varIDs.size() + 1);
118 {
119 involved_varIDs.push_back(0); // always pressure come in
120 }
121 involved_varIDs.insert(involved_varIDs.end(), varIDs.begin(),
122 varIDs.end());
123
125
126 // matrix and fracture assemblers with enrichments
129 // TODO how to get the shape function order for each variable?
130 vec_n_element_nodes.push_back(
131 mesh_item.getNumberOfBaseNodes()); // pressure
132 auto const max_varID = *std::max_element(varIDs.begin(), varIDs.end());
133 for (int i = 1; i < max_varID + 1; i++)
134 {
135 vec_n_element_nodes.push_back(
136 mesh_item.getNumberOfNodes()); // displacements
137 }
138
139 unsigned local_id = 0;
140 unsigned dof_id = 0;
141 for (unsigned i = 0; i < involved_varIDs.size(); i++)
142 {
143 auto const var_id = involved_varIDs[i];
144 auto const n_var_comp =
145 _dof_table.getNumberOfVariableComponents(var_id);
148 {
149 auto const& ms = _dof_table.getMeshSubset(var_id, var_comp_id);
150 auto const mesh_id = ms.getMeshID();
151 for (unsigned k = 0; k < n_var_element_nodes; k++)
152 {
156 auto global_index =
157 _dof_table.getGlobalIndex(l, var_id, var_comp_id);
160 {
162 }
163 local_id++;
164 }
165 }
166 }
167
168 return it->second(mesh_item, involved_varIDs.size(), n_local_dof,
171 }
#define OGS_FATAL(...)
Definition Error.h:19

References _builder, _dof_table, MeshLib::Element::getNumberOfBaseNodes(), MeshLib::Element::getNumberOfNodes(), MeshLib::Node, NumLib::MeshComponentMap::nop, and OGS_FATAL.

Member Data Documentation

◆ _builder

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
std::unordered_map<std::type_index, LADataBuilder> ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::_builder
private

Mapping of element types to local assembler constructors.

Definition at line 231 of file LIE/HydroMechanics/LocalAssembler/LocalDataInitializer.h.

Referenced by LocalDataInitializer(), and operator()().

◆ _dof_table

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerDataMatrix, template< typename, typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
NumLib::LocalToGlobalIndexMap const& ProcessLib::LIE::HydroMechanics::LocalDataInitializer< LocalAssemblerInterface, LocalAssemblerDataMatrix, LocalAssemblerDataMatrixNearFracture, LocalAssemblerDataFracture, DisplacementDim, ConstructorArgs >::_dof_table
private

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