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 42 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 149 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 62 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

66 {
67 // REMARKS: At the moment, only a 2D mesh with 1D elements are
68 // supported.
69
73
75 [this, integration_order]<typename ET>(ET*)
76 {
77 using MeshElement = typename ET::Element;
78 using ShapeFunction = typename ET::ShapeFunction;
79
82 });
83 }
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:157
decltype(auto) filter(Pred pred)
Definition TMP.h:78

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 162 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 90 of file LIE/SmallDeformation/LocalAssembler/LocalDataInitializer.h.

93 {
94 auto const type_idx = std::type_index(typeid(mesh_item));
95 auto const it = _builder.find(type_idx);
96
97 if (it == _builder.end())
98 {
100 "You are trying to build a local assembler for an unknown mesh "
101 "element type ({:s})."
102 " Maybe you have disabled this mesh element type in your build "
103 "configuration, or a mesh element order does not match shape "
104 "function order given in the project file.",
105 type_idx.name());
106 }
107
108 auto const n_local_dof = _dof_table.getNumberOfElementDOF(id);
109 auto const n_global_components =
110 _dof_table.getNumberOfElementComponents(id);
111 auto const varIDs = _dof_table.getElementVariableIDs(id);
112
114 if (mesh_item.getDimension() < DisplacementDim ||
116 {
118 unsigned dof_id = 0;
119 unsigned local_id = 0;
120 for (auto i : varIDs)
121 {
122 for (int j = 0; j < _dof_table.getNumberOfVariableComponents(i);
123 j++)
124 {
125 auto const& ms = _dof_table.getMeshSubset(i, j);
126 auto const mesh_id = ms.getMeshID();
127 for (unsigned k = 0; k < mesh_item.getNumberOfNodes(); k++)
128 {
132 auto global_index = _dof_table.getGlobalIndex(l, i, j);
134 {
136 }
137 local_id++;
138 }
139 }
140 }
141 }
142
143 return it->second(mesh_item, varIDs.size(), n_local_dof,
146 }
#define OGS_FATAL(...)
Definition Error.h:26

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 203 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: