OGS
ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs > Struct Template Reference

Detailed Description

template<typename LocalAssemblerInterface, NumLib::IntegrationMethodProvider IntegrationMethodProvider, typename... ConstructorArgs>
struct ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >

A functor creating a local assembler with shape functions corresponding to the mesh element type.

Definition at line 39 of file GenericLocalAssemblerFactory.h.

#include <GenericLocalAssemblerFactory.h>

Collaboration diagram for ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >:
[legend]

Public Types

using LocAsmIntfPtr = std::unique_ptr< LocalAssemblerInterface >
 
using LocAsmBuilder = std::function< LocAsmIntfPtr(MeshLib::Element const &e, std::size_t const local_matrix_size, IntegrationMethodProvider const &integration_method_provider, ConstructorArgs &&...)>
 

Public Member Functions

LocAsmIntfPtr operator() (std::size_t const id, MeshLib::Element const &mesh_item, ConstructorArgs &&... args) const
 

Protected Member Functions

 GenericLocalAssemblerFactory (NumLib::LocalToGlobalIndexMap const &dof_table, IntegrationMethodProvider const &integration_method_provider)
 

Protected Attributes

std::unordered_map< std::type_index, LocAsmBuilder_builders
 Mapping of element types to local assembler builders.
 

Private Attributes

NumLib::LocalToGlobalIndexMap const & _dof_table
 
IntegrationMethodProvider const & _integration_method_provider
 

Member Typedef Documentation

◆ LocAsmBuilder

template<typename LocalAssemblerInterface , NumLib::IntegrationMethodProvider IntegrationMethodProvider, typename... ConstructorArgs>
using ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::LocAsmBuilder = std::function<LocAsmIntfPtr( MeshLib::Element const& e, std::size_t const local_matrix_size, IntegrationMethodProvider const& integration_method_provider, ConstructorArgs&&...)>

Definition at line 42 of file GenericLocalAssemblerFactory.h.

◆ LocAsmIntfPtr

template<typename LocalAssemblerInterface , NumLib::IntegrationMethodProvider IntegrationMethodProvider, typename... ConstructorArgs>
using ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::LocAsmIntfPtr = std::unique_ptr<LocalAssemblerInterface>

Definition at line 41 of file GenericLocalAssemblerFactory.h.

Constructor & Destructor Documentation

◆ GenericLocalAssemblerFactory()

template<typename LocalAssemblerInterface , NumLib::IntegrationMethodProvider IntegrationMethodProvider, typename... ConstructorArgs>
ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::GenericLocalAssemblerFactory ( NumLib::LocalToGlobalIndexMap const &  dof_table,
IntegrationMethodProvider const &  integration_method_provider 
)
inlineexplicitprotected

Definition at line 49 of file GenericLocalAssemblerFactory.h.

52 : _dof_table{dof_table},
53 _integration_method_provider{integration_method_provider}
54 {
55 }
IntegrationMethodProvider const & _integration_method_provider
NumLib::LocalToGlobalIndexMap const & _dof_table

Member Function Documentation

◆ operator()()

template<typename LocalAssemblerInterface , NumLib::IntegrationMethodProvider IntegrationMethodProvider, typename... ConstructorArgs>
LocAsmIntfPtr ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::operator() ( std::size_t const  id,
MeshLib::Element const &  mesh_item,
ConstructorArgs &&...  args 
) const
inline

Returns the newly created local assembler.

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 63 of file GenericLocalAssemblerFactory.h.

66 {
67 auto const type_idx = std::type_index(typeid(mesh_item));
68 auto const it = _builders.find(type_idx);
69
70 if (it != _builders.end())
71 {
72 auto const num_local_dof = _dof_table.getNumberOfElementDOF(id);
73 return it->second(mesh_item, num_local_dof,
75 std::forward<ConstructorArgs>(args)...);
76 }
78 "You are trying to build a local assembler for an unknown mesh "
79 "element type ({:s})."
80 " Maybe you have disabled this mesh element type in your build "
81 "configuration, or a mesh element order does not match shape "
82 "function order given in the project file.",
83 type_idx.name());
84 }
#define OGS_FATAL(...)
Definition: Error.h:26
std::size_t getNumberOfElementDOF(std::size_t const mesh_item_id) const
std::unordered_map< std::type_index, LocAsmBuilder > _builders
Mapping of element types to local assembler builders.

References ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::_builders, ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::_dof_table, ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::_integration_method_provider, NumLib::LocalToGlobalIndexMap::getNumberOfElementDOF(), and OGS_FATAL.

Member Data Documentation

◆ _builders

template<typename LocalAssemblerInterface , NumLib::IntegrationMethodProvider IntegrationMethodProvider, typename... ConstructorArgs>
std::unordered_map<std::type_index, LocAsmBuilder> ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::_builders
protected

◆ _dof_table

◆ _integration_method_provider

template<typename LocalAssemblerInterface , NumLib::IntegrationMethodProvider IntegrationMethodProvider, typename... ConstructorArgs>
IntegrationMethodProvider const& ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, IntegrationMethodProvider, ConstructorArgs >::_integration_method_provider
private

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