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

Detailed Description

template<typename LocalAssemblerInterface, template< typename, int > class LocalAssemblerDataMatrix, template< typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
class ProcessLib::LIE::SmallDeformation::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.

Definition at line 35 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

#include <LocalDataInitializer.h>

Collaboration diagram for ProcessLib::LIE::SmallDeformation::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 ShapeFunction>
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, int > class LocalAssemblerDataMatrix, template< typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
using ProcessLib::LIE::SmallDeformation::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 142 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

◆ LADataIntfPtr

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

Constructor & Destructor Documentation

◆ LocalDataInitializer()

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

Definition at line 55 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

59 {
60 // REMARKS: At the moment, only a 2D mesh with 1D elements are
61 // supported.
62
66
68 [this, integration_order]<typename ET>(ET*)
69 {
70 using MeshElement = typename ET::Element;
71 using ShapeFunction = typename ET::ShapeFunction;
72
75 });
76 }
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, int > class LocalAssemblerDataMatrix, template< typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
template<typename ShapeFunction>
LADataBuilder ProcessLib::LIE::SmallDeformation::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<ShapeFunction>. 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 155 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

References MeshLib::Element::getDimension().

Referenced by LocalDataInitializer().

◆ operator()()

template<typename LocalAssemblerInterface, template< typename, int > class LocalAssemblerDataMatrix, template< typename, int > class LocalAssemblerDataMatrixNearFracture, template< typename, int > class LocalAssemblerDataFracture, int DisplacementDim, typename... ConstructorArgs>
LADataIntfPtr ProcessLib::LIE::SmallDeformation::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 83 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

86 {
87 auto const type_idx = std::type_index(typeid(mesh_item));
88 auto const it = _builder.find(type_idx);
89
90 if (it == _builder.end())
91 {
93 "You are trying to build a local assembler for an unknown mesh "
94 "element type ({:s})."
95 " Maybe you have disabled this mesh element type in your build "
96 "configuration, or a mesh element order does not match shape "
97 "function order given in the project file.",
98 type_idx.name());
99 }
100
101 auto const n_local_dof = _dof_table.getNumberOfElementDOF(id);
102 auto const n_global_components =
103 _dof_table.getNumberOfElementComponents(id);
104 auto const varIDs = _dof_table.getElementVariableIDs(id);
105
107 if (mesh_item.getDimension() < DisplacementDim ||
109 {
111 unsigned dof_id = 0;
112 unsigned local_id = 0;
113 for (auto i : varIDs)
114 {
115 for (int j = 0; j < _dof_table.getNumberOfVariableComponents(i);
116 j++)
117 {
118 auto const& ms = _dof_table.getMeshSubset(i, j);
119 auto const mesh_id = ms.getMeshID();
120 for (unsigned k = 0; k < mesh_item.getNumberOfNodes(); k++)
121 {
125 auto global_index = _dof_table.getGlobalIndex(l, i, j);
127 {
129 }
130 local_id++;
131 }
132 }
133 }
134 }
135
136 return it->second(mesh_item, varIDs.size(), n_local_dof,
139 }
#define OGS_FATAL(...)
Definition Error.h:19

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

Member Data Documentation

◆ _builder

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

Mapping of element types to local assembler constructors.

Definition at line 196 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

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

◆ _dof_table

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

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