OGS
ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs > Class Template Referencefinal

Detailed Description

template<typename LocalAssemblerInterface, template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
class ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, 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 117 of file LocalDataInitializer.h.

#include <LocalDataInitializer.h>

Collaboration diagram for ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >:
[legend]

Public Types

using LADataIntfPtr = std::unique_ptr< LocalAssemblerInterface >
 
using LADataIntfPtr = std::unique_ptr< LocalAssemblerInterface >
 

Public Member Functions

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

Private Types

using LADataBuilder = std::function< LADataIntfPtr(MeshLib::Element const &e, std::size_t const local_matrix_size, ConstructorArgs &&...)>
 
template<typename ShapeFunction >
using IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement >::IntegrationMethod
 
template<typename ShapeFunction >
using LAData = SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod< ShapeFunction >, GlobalDim >
 
using LADataBuilder = std::function< LADataIntfPtr(MeshLib::Element const &e, std::size_t const local_matrix_size, ConstructorArgs &&...)>
 
template<typename ShapeFunction >
using IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement >::IntegrationMethod
 
template<typename ShapeFunction >
using LAData = LocalAssemblerData< ShapeFunction, IntegrationMethod< ShapeFunction >, GlobalDim >
 

Static Private Member Functions

template<typename ShapeFunction >
static LADataBuilder makeLocalAssemblerBuilder ()
 
template<typename ShapeFunction >
static LADataBuilder makeLocalAssemblerBuilder (std::true_type *)
 
template<typename ShapeFunction >
static LADataBuilder makeLocalAssemblerBuilder (std::false_type *)
 
template<typename ShapeFunction >
static LADataBuilder makeLocalAssemblerBuilder ()
 
template<typename ShapeFunction >
static LADataBuilder makeLocalAssemblerBuilder (std::true_type *)
 
template<typename ShapeFunction >
static LADataBuilder makeLocalAssemblerBuilder (std::false_type *)
 

Private Attributes

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

Member Typedef Documentation

◆ IntegrationMethod [1/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement>::IntegrationMethod
private

Definition at line 243 of file LocalDataInitializer.h.

◆ IntegrationMethod [2/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::IntegrationMethod = typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement>::IntegrationMethod
private

Definition at line 325 of file LocalDataInitializer.h.

◆ LAData [1/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LAData = SmallDeformationLocalAssembler< ShapeFunction, IntegrationMethod<ShapeFunction>, GlobalDim>
private

Definition at line 247 of file LocalDataInitializer.h.

◆ LAData [2/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LAData = LocalAssemblerData<ShapeFunction, IntegrationMethod<ShapeFunction>, GlobalDim>
private

Definition at line 329 of file LocalDataInitializer.h.

◆ LADataBuilder [1/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LADataBuilder = std::function<LADataIntfPtr(MeshLib::Element const& e, std::size_t const local_matrix_size, ConstructorArgs&&...)>
private

Definition at line 237 of file LocalDataInitializer.h.

◆ LADataBuilder [2/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LADataBuilder = std::function<LADataIntfPtr(MeshLib::Element const& e, std::size_t const local_matrix_size, ConstructorArgs&&...)>
private

Definition at line 319 of file LocalDataInitializer.h.

◆ LADataIntfPtr [1/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LADataIntfPtr = std::unique_ptr<LocalAssemblerInterface>

Definition at line 120 of file LocalDataInitializer.h.

◆ LADataIntfPtr [2/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
using ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LADataIntfPtr = std::unique_ptr<LocalAssemblerInterface>

Definition at line 127 of file LocalDataInitializer.h.

Constructor & Destructor Documentation

◆ LocalDataInitializer() [1/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LocalDataInitializer ( NumLib::LocalToGlobalIndexMap const &  dof_table)
inlineexplicit

Definition at line 122 of file LocalDataInitializer.h.

124  : _dof_table(dof_table)
125  {
126 // /// Quads and Hexahedra ///////////////////////////////////
127 
128 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_QUAD) != 0 && \
129  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 1
130  _builder[std::type_index(typeid(MeshLib::Quad))] =
131  makeLocalAssemblerBuilder<NumLib::ShapeQuad4>();
132 #endif
133 
134 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_CUBOID) != 0 && \
135  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
136  _builder[std::type_index(typeid(MeshLib::Hex))] =
137  makeLocalAssemblerBuilder<NumLib::ShapeHex8>();
138 #endif
139 
140 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_QUAD) != 0 && \
141  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 2
142  _builder[std::type_index(typeid(MeshLib::Quad8))] =
143  makeLocalAssemblerBuilder<NumLib::ShapeQuad8>();
144  _builder[std::type_index(typeid(MeshLib::Quad9))] =
145  makeLocalAssemblerBuilder<NumLib::ShapeQuad9>();
146 #endif
147 
148 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_CUBOID) != 0 && \
149  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
150  _builder[std::type_index(typeid(MeshLib::Hex20))] =
151  makeLocalAssemblerBuilder<NumLib::ShapeHex20>();
152 #endif
153 
154 // /// Simplices ////////////////////////////////////////////////
155 
156 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_TRI) != 0 && \
157  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 1
158  _builder[std::type_index(typeid(MeshLib::Tri))] =
159  makeLocalAssemblerBuilder<NumLib::ShapeTri3>();
160 #endif
161 
162 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_SIMPLEX) != 0 && \
163  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
164  _builder[std::type_index(typeid(MeshLib::Tet))] =
165  makeLocalAssemblerBuilder<NumLib::ShapeTet4>();
166 #endif
167 
168 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_TRI) != 0 && \
169  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 2
170  _builder[std::type_index(typeid(MeshLib::Tri6))] =
171  makeLocalAssemblerBuilder<NumLib::ShapeTri6>();
172 #endif
173 
174 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_SIMPLEX) != 0 && \
175  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
176  _builder[std::type_index(typeid(MeshLib::Tet10))] =
177  makeLocalAssemblerBuilder<NumLib::ShapeTet10>();
178 #endif
179 
180 // /// Prisms ////////////////////////////////////////////////////
181 
182 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PRISM) != 0 && \
183  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
184  _builder[std::type_index(typeid(MeshLib::Prism))] =
185  makeLocalAssemblerBuilder<NumLib::ShapePrism6>();
186 #endif
187 
188 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PRISM) != 0 && \
189  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
190  _builder[std::type_index(typeid(MeshLib::Prism15))] =
191  makeLocalAssemblerBuilder<NumLib::ShapePrism15>();
192 #endif
193 
194 // /// Pyramids //////////////////////////////////////////////////
195 
196 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PYRAMID) != 0 && \
197  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
198  _builder[std::type_index(typeid(MeshLib::Pyramid))] =
199  makeLocalAssemblerBuilder<NumLib::ShapePyra5>();
200 #endif
201 
202 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PYRAMID) != 0 && \
203  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
204  _builder[std::type_index(typeid(MeshLib::Pyramid13))] =
205  makeLocalAssemblerBuilder<NumLib::ShapePyra13>();
206 #endif
207  }
NumLib::LocalToGlobalIndexMap const & _dof_table
std::unordered_map< std::type_index, LADataBuilder > _builder
Mapping of element types to local assembler constructors.

References ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_builder.

◆ LocalDataInitializer() [2/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::LocalDataInitializer ( NumLib::LocalToGlobalIndexMap const &  dof_table,
const unsigned  shapefunction_order 
)
inline

Definition at line 129 of file LocalDataInitializer.h.

131  : _dof_table(dof_table)
132  {
133  if (shapefunction_order < 1 || 2 < shapefunction_order)
134  OGS_FATAL("The given shape function order {:d} is not supported",
135  shapefunction_order);
136 
137  if (shapefunction_order == 1)
138  {
139  // /// Lines and points ///////////////////////////////////
140 
141 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_LINE) != 0 && \
142  OGS_MAX_ELEMENT_DIM >= 1 && OGS_MAX_ELEMENT_ORDER >= 1
143  _builder[std::type_index(typeid(MeshLib::Line))] =
144  makeLocalAssemblerBuilder<NumLib::ShapeLine2>();
145 #endif
146 
147 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_LINE) != 0 && \
148  OGS_MAX_ELEMENT_DIM >= 1 && OGS_MAX_ELEMENT_ORDER >= 2
149  _builder[std::type_index(typeid(MeshLib::Line3))] =
150  makeLocalAssemblerBuilder<NumLib::ShapeLine2>();
151 #endif
152 
153  // /// Quads and Hexahedra ///////////////////////////////////
154 
155 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_QUAD) != 0 && \
156  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 1
157  _builder[std::type_index(typeid(MeshLib::Quad))] =
158  makeLocalAssemblerBuilder<NumLib::ShapeQuad4>();
159 #endif
160 
161 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_CUBOID) != 0 && \
162  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
163  _builder[std::type_index(typeid(MeshLib::Hex))] =
164  makeLocalAssemblerBuilder<NumLib::ShapeHex8>();
165 #endif
166 
167 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_QUAD) != 0 && \
168  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 2
169  _builder[std::type_index(typeid(MeshLib::Quad8))] =
170  makeLocalAssemblerBuilder<NumLib::ShapeQuad4>();
171  _builder[std::type_index(typeid(MeshLib::Quad9))] =
172  makeLocalAssemblerBuilder<NumLib::ShapeQuad4>();
173 #endif
174 
175 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_CUBOID) != 0 && \
176  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
177  _builder[std::type_index(typeid(MeshLib::Hex20))] =
178  makeLocalAssemblerBuilder<NumLib::ShapeHex8>();
179 #endif
180 
181  // /// Simplices ////////////////////////////////////////////////
182 
183 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_TRI) != 0 && \
184  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 1
185  _builder[std::type_index(typeid(MeshLib::Tri))] =
186  makeLocalAssemblerBuilder<NumLib::ShapeTri3>();
187 #endif
188 
189 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_SIMPLEX) != 0 && \
190  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
191  _builder[std::type_index(typeid(MeshLib::Tet))] =
192  makeLocalAssemblerBuilder<NumLib::ShapeTet4>();
193 #endif
194 
195 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_TRI) != 0 && \
196  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 2
197  _builder[std::type_index(typeid(MeshLib::Tri6))] =
198  makeLocalAssemblerBuilder<NumLib::ShapeTri3>();
199 #endif
200 
201 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_SIMPLEX) != 0 && \
202  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
203  _builder[std::type_index(typeid(MeshLib::Tet10))] =
204  makeLocalAssemblerBuilder<NumLib::ShapeTet4>();
205 #endif
206 
207  // /// Prisms ////////////////////////////////////////////////////
208 
209 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PRISM) != 0 && \
210  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
211  _builder[std::type_index(typeid(MeshLib::Prism))] =
212  makeLocalAssemblerBuilder<NumLib::ShapePrism6>();
213 #endif
214 
215 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PRISM) != 0 && \
216  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
217  _builder[std::type_index(typeid(MeshLib::Prism15))] =
218  makeLocalAssemblerBuilder<NumLib::ShapePrism6>();
219 #endif
220 
221  // /// Pyramids //////////////////////////////////////////////////
222 
223 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PYRAMID) != 0 && \
224  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 1
225  _builder[std::type_index(typeid(MeshLib::Pyramid))] =
226  makeLocalAssemblerBuilder<NumLib::ShapePyra5>();
227 #endif
228 
229 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PYRAMID) != 0 && \
230  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
231  _builder[std::type_index(typeid(MeshLib::Pyramid13))] =
232  makeLocalAssemblerBuilder<NumLib::ShapePyra5>();
233 #endif
234  }
235  else if (shapefunction_order == 2)
236  {
237 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_LINE) != 0 && \
238  OGS_MAX_ELEMENT_DIM >= 1 && OGS_MAX_ELEMENT_ORDER >= 2
239  _builder[std::type_index(typeid(MeshLib::Line3))] =
240  makeLocalAssemblerBuilder<NumLib::ShapeLine3>();
241 #endif
242 
243  // /// Quads and Hexahedra ///////////////////////////////////
244 
245 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_QUAD) != 0 && \
246  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 2
247  _builder[std::type_index(typeid(MeshLib::Quad8))] =
248  makeLocalAssemblerBuilder<NumLib::ShapeQuad8>();
249  _builder[std::type_index(typeid(MeshLib::Quad9))] =
250  makeLocalAssemblerBuilder<NumLib::ShapeQuad9>();
251 #endif
252 
253 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_CUBOID) != 0 && \
254  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
255  _builder[std::type_index(typeid(MeshLib::Hex20))] =
256  makeLocalAssemblerBuilder<NumLib::ShapeHex20>();
257 #endif
258 
259  // /// Simplices ////////////////////////////////////////////////
260 
261 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_TRI) != 0 && \
262  OGS_MAX_ELEMENT_DIM >= 2 && OGS_MAX_ELEMENT_ORDER >= 2
263  _builder[std::type_index(typeid(MeshLib::Tri6))] =
264  makeLocalAssemblerBuilder<NumLib::ShapeTri6>();
265 #endif
266 
267 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_SIMPLEX) != 0 && \
268  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
269  _builder[std::type_index(typeid(MeshLib::Tet10))] =
270  makeLocalAssemblerBuilder<NumLib::ShapeTet10>();
271 #endif
272 
273  // /// Prisms ////////////////////////////////////////////////////
274 
275 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PRISM) != 0 && \
276  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
277  _builder[std::type_index(typeid(MeshLib::Prism15))] =
278  makeLocalAssemblerBuilder<NumLib::ShapePrism15>();
279 #endif
280 
281  // /// Pyramids //////////////////////////////////////////////////
282 
283 #if (OGS_ENABLED_ELEMENTS & ENABLED_ELEMENT_TYPE_PYRAMID) != 0 && \
284  OGS_MAX_ELEMENT_DIM >= 3 && OGS_MAX_ELEMENT_ORDER >= 2
285  _builder[std::type_index(typeid(MeshLib::Pyramid13))] =
286  makeLocalAssemblerBuilder<NumLib::ShapePyra13>();
287 #endif
288  }
289  }
#define OGS_FATAL(...)
Definition: Error.h:26

References ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_builder, and OGS_FATAL.

Member Function Documentation

◆ makeLocalAssemblerBuilder() [1/6]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
static LADataBuilder ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder ( )
inlinestaticprivate

A helper forwarding to the correct version of makeLocalAssemblerBuilder depending whether the global dimension is less than the shape function's dimension or not.

Definition at line 254 of file LocalDataInitializer.h.

255  {
256  return makeLocalAssemblerBuilder<ShapeFunction>(
257  static_cast<std::integral_constant<
258  bool, (GlobalDim >= ShapeFunction::DIM)>*>(nullptr));
259  }

◆ makeLocalAssemblerBuilder() [2/6]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
static LADataBuilder ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder ( )
inlinestaticprivate

A helper forwarding to the correct version of makeLocalAssemblerBuilder depending whether the global dimension is less than the shape function's dimension or not.

Definition at line 337 of file LocalDataInitializer.h.

338  {
339  return makeLocalAssemblerBuilder<ShapeFunction>(
340  static_cast<std::integral_constant<
341  bool, (GlobalDim >= ShapeFunction::DIM)>*>(nullptr));
342  }

◆ makeLocalAssemblerBuilder() [3/6]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
static LADataBuilder ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder ( std::false_type *  )
inlinestaticprivate

Returns nullptr for shape functions whose dimensions are less than the global dimension.

Definition at line 287 of file LocalDataInitializer.h.

288  {
289  return nullptr;
290  }

◆ makeLocalAssemblerBuilder() [4/6]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
static LADataBuilder ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder ( std::false_type *  )
inlinestaticprivate

Returns nullptr for shape functions whose dimensions are less than the global dimension.

Definition at line 371 of file LocalDataInitializer.h.

372  {
373  return nullptr;
374  }

◆ makeLocalAssemblerBuilder() [5/6]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
static LADataBuilder ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder ( std::true_type *  )
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 274 of file LocalDataInitializer.h.

275  {
276  return [](MeshLib::Element const& e,
277  std::size_t const local_matrix_size,
278  ConstructorArgs&&... args) {
279  return LADataIntfPtr{new LAData<ShapeFunction>{
280  e, local_matrix_size, std::forward<ConstructorArgs>(args)...}};
281  };
282  }
std::unique_ptr< LocalAssemblerInterface > LADataIntfPtr

◆ makeLocalAssemblerBuilder() [6/6]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
static LADataBuilder ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::makeLocalAssemblerBuilder ( std::true_type *  )
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 357 of file LocalDataInitializer.h.

358  {
359  return [](MeshLib::Element const& e,
360  std::size_t const local_matrix_size,
361  ConstructorArgs&&... args)
362  {
363  return LADataIntfPtr{new LAData<ShapeFunction>{
364  e, local_matrix_size, std::forward<ConstructorArgs>(args)...}};
365  };
366  }

◆ operator()() [1/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
LADataIntfPtr ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, 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 214 of file LocalDataInitializer.h.

217  {
218  auto const type_idx = std::type_index(typeid(mesh_item));
219  auto const it = _builder.find(type_idx);
220 
221  if (it != _builder.end())
222  {
223  auto const num_local_dof = _dof_table.getNumberOfElementDOF(id);
224  return it->second(mesh_item, num_local_dof,
225  std::forward<ConstructorArgs>(args)...);
226  }
227  OGS_FATAL(
228  "You are trying to build a local assembler for an unknown mesh "
229  "element type ({:s})."
230  " Maybe you have disabled this mesh element type in your build "
231  "configuration, or a mesh element order does not match shape "
232  "function order given in the project file.",
233  type_idx.name());
234  }
std::size_t getNumberOfElementDOF(std::size_t const mesh_item_id) const

References ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_builder, ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_dof_table, NumLib::LocalToGlobalIndexMap::getNumberOfElementDOF(), and OGS_FATAL.

◆ operator()() [2/2]

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
LADataIntfPtr ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, 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 296 of file LocalDataInitializer.h.

299  {
300  auto const type_idx = std::type_index(typeid(mesh_item));
301  auto const it = _builder.find(type_idx);
302 
303  if (it != _builder.end())
304  {
305  auto const num_local_dof = _dof_table.getNumberOfElementDOF(id);
306  return it->second(mesh_item, num_local_dof,
307  std::forward<ConstructorArgs>(args)...);
308  }
309  OGS_FATAL(
310  "You are trying to build a local assembler for an unknown mesh "
311  "element type ({:s})."
312  " Maybe you have disabled this mesh element type in your build "
313  "configuration, or a mesh element order does not match shape "
314  "function order given in the project file.",
315  type_idx.name());
316  }

References ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_builder, ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_dof_table, NumLib::LocalToGlobalIndexMap::getNumberOfElementDOF(), and OGS_FATAL.

Member Data Documentation

◆ _builder

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
std::unordered_map< std::type_index, LADataBuilder > ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_builder
private

◆ _dof_table

template<typename LocalAssemblerInterface , template< typename, typename, int > class SmallDeformationLocalAssembler, int GlobalDim, typename... ConstructorArgs>
NumLib::LocalToGlobalIndexMap const & ProcessLib::LocalDataInitializer< LocalAssemblerInterface, SmallDeformationLocalAssembler, GlobalDim, ConstructorArgs >::_dof_table
private

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