OGS
ProcessLib::BoundaryConditionAndSourceTerm::LocalAssemblerFactory< LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs > Class Template Referencefinal

Detailed Description

template<typename LocalAssemblerInterface, template< typename, typename, int > class LocalAssemblerImplementation, int GlobalDim, typename... ConstructorArgs>
class ProcessLib::BoundaryConditionAndSourceTerm::LocalAssemblerFactory< LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs >

Definition at line 25 of file LocalAssemblerFactory.h.

#include <LocalAssemblerFactory.h>

Inheritance diagram for ProcessLib::BoundaryConditionAndSourceTerm::LocalAssemblerFactory< LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs >:
[legend]
Collaboration diagram for ProcessLib::BoundaryConditionAndSourceTerm::LocalAssemblerFactory< LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs >:
[legend]

Classes

struct  HasSuitableDimension
 
struct  Is2ndOrderElementOfSuitableDimension
 

Public Member Functions

 LocalAssemblerFactory (NumLib::LocalToGlobalIndexMap const &dof_table, const unsigned shapefunction_order)
 
- Public Member Functions inherited from ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, ConstructorArgs... >
LocAsmIntfPtr operator() (std::size_t const id, MeshLib::Element const &mesh_item, ConstructorArgs &&... args) const
 

Private Types

using Base = ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, ConstructorArgs... >
 
template<typename ShapeFunction >
using LocAsmBuilderFactory = ProcessLib::LocalAssemblerBuilderFactory< ShapeFunction, LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs... >
 

Additional Inherited Members

- Public Types inherited from ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, ConstructorArgs... >
using LocAsmIntfPtr = std::unique_ptr< LocalAssemblerInterface >
 
using LocAsmBuilder = std::function< LocAsmIntfPtr(MeshLib::Element const &e, std::size_t const local_matrix_size, ConstructorArgs &&...)>
 
- Protected Member Functions inherited from ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, ConstructorArgs... >
 GenericLocalAssemblerFactory (NumLib::LocalToGlobalIndexMap const &dof_table)
 
- Protected Attributes inherited from ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, ConstructorArgs... >
std::unordered_map< std::type_index, LocAsmBuilder_builders
 Mapping of element types to local assembler builders. More...
 

Member Typedef Documentation

◆ Base

template<typename LocalAssemblerInterface , template< typename, typename, int > class LocalAssemblerImplementation, int GlobalDim, typename... ConstructorArgs>
using ProcessLib::BoundaryConditionAndSourceTerm::LocalAssemblerFactory< LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs >::Base = ProcessLib::GenericLocalAssemblerFactory<LocalAssemblerInterface, ConstructorArgs...>
private

Definition at line 29 of file LocalAssemblerFactory.h.

◆ LocAsmBuilderFactory

template<typename LocalAssemblerInterface , template< typename, typename, int > class LocalAssemblerImplementation, int GlobalDim, typename... ConstructorArgs>
template<typename ShapeFunction >
using ProcessLib::BoundaryConditionAndSourceTerm::LocalAssemblerFactory< LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs >::LocAsmBuilderFactory = ProcessLib::LocalAssemblerBuilderFactory<ShapeFunction, LocalAssemblerInterface, LocalAssemblerImplementation, GlobalDim, ConstructorArgs...>
private

Definition at line 34 of file LocalAssemblerFactory.h.

Constructor & Destructor Documentation

◆ LocalAssemblerFactory()

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

Definition at line 67 of file LocalAssemblerFactory.h.

69 : Base(dof_table)
70 {
71 if (shapefunction_order < 1 || 2 < shapefunction_order)
72 {
73 OGS_FATAL("The given shape function order {:d} is not supported",
74 shapefunction_order);
75 }
76
77 if (shapefunction_order == 1)
78 {
79 // 1st order is enabled on all elements with suitable dimension
80 using EnabledElementTraits =
81 decltype(BaseLib::TMP::filter<EnabledElementTraitsLagrange>(
82 std::declval<HasSuitableDimension>()));
83
84 BaseLib::TMP::foreach<EnabledElementTraits>(
85 [this]<typename ET>(ET*)
86 {
87 using MeshElement = typename ET::Element;
88 // this will use linear shape functions on higher order
89 // elements and the linear shape function on linear elements
90 using LowerOrderShapeFunction =
91 typename ET::LowerOrderShapeFunction;
92 Base::_builders[std::type_index(typeid(MeshElement))] =
93 LocAsmBuilderFactory<LowerOrderShapeFunction>::create();
94 });
95 }
96 else if (shapefunction_order == 2)
97 {
98 // 2nd order only on 2nd order elements
99 using EnabledElementTraits =
100 decltype(BaseLib::TMP::filter<EnabledElementTraitsLagrange>(
101 std::declval<Is2ndOrderElementOfSuitableDimension>()));
102
103 BaseLib::TMP::foreach<EnabledElementTraits>(
104 [this]<typename ET>(ET*)
105 {
106 using MeshElement = typename ET::Element;
107 using ShapeFunction2ndOrder = typename ET::ShapeFunction;
108 Base::_builders[std::type_index(typeid(MeshElement))] =
109 LocAsmBuilderFactory<ShapeFunction2ndOrder>::create();
110 });
111 }
112 }
#define OGS_FATAL(...)
Definition: Error.h:26
ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, ConstructorArgs... > Base
std::unordered_map< std::type_index, LocAsmBuilder > _builders
Mapping of element types to local assembler builders.

References ProcessLib::GenericLocalAssemblerFactory< LocalAssemblerInterface, ConstructorArgs... >::_builders, and OGS_FATAL.


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