OGS
LocalAssemblerFactoryTaylorHood.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "EnabledElements.h"
15
16namespace ProcessLib
17{
18template <typename ShapeFunction,
19 typename LowerOrderShapeFunction,
20 typename LocalAssemblerInterface,
21 template <typename /* shp fct */,
22 typename /* lower order shp fct */,
23 typename /* int meth */,
24 int /* global dim */>
25 class LocalAssemblerImplementation,
26 int GlobalDim,
27 typename... ConstructorArgs>
29{
31 ConstructorArgs...>;
34
36 typename ShapeFunction::MeshElement>::IntegrationMethod;
37
38 using LocAsmImpl = LocalAssemblerImplementation<ShapeFunction,
39 LowerOrderShapeFunction,
41 GlobalDim>;
42
44
45public:
49 {
50 return [](MeshLib::Element const& e,
51 std::size_t const local_matrix_size,
52 ConstructorArgs&&... args)
53 {
54 return std::make_unique<LocAsmImpl>(
55 e, local_matrix_size, std::forward<ConstructorArgs>(args)...);
56 };
57 }
58};
59
71template <int MinShapeFctOrder,
72 int MinElementDim,
73 typename LocalAssemblerInterface,
74 template <typename /* shp fct */,
75 typename /* lower order shp fct */,
76 typename /* int meth */,
77 int /* global dim */>
78 class LocalAssemblerImplementation,
79 int GlobalDim,
80 typename... ConstructorArgs>
82 : public ProcessLib::GenericLocalAssemblerFactory<LocalAssemblerInterface,
83 ConstructorArgs...>
84{
85 using Base =
87 ConstructorArgs...>;
88
89 template <typename ShapeFunction, typename LowerOrderShapeFunction>
92 LowerOrderShapeFunction,
94 LocalAssemblerImplementation,
95 GlobalDim,
96 ConstructorArgs...>;
97
99 {
100 template <typename ElementTraits>
101 constexpr bool operator()(ElementTraits*) const
102 {
103 if constexpr (GlobalDim < ElementTraits::ShapeFunction::DIM)
104 {
105 return false;
106 }
107
108 if constexpr (ElementTraits::Element::dimension < MinElementDim)
109 {
110 return false;
111 }
112
113 return ElementTraits::ShapeFunction::ORDER >= MinShapeFctOrder;
114 }
115 };
116
117public:
119 NumLib::LocalToGlobalIndexMap const& dof_table)
120 : Base(dof_table)
121 {
122 using EnabledElementTraits =
123 decltype(BaseLib::TMP::filter<EnabledElementTraitsLagrange>(
124 std::declval<IsElementEnabled>()));
125
126 BaseLib::TMP::foreach<EnabledElementTraits>(
127 [this]<typename ET>(ET*)
128 {
129 using MeshElement = typename ET::Element;
130 using ShapeFunction = typename ET::ShapeFunction;
131 using LowerOrderShapeFunction =
132 typename ET::LowerOrderShapeFunction;
133
134 Base::_builders[std::type_index(typeid(MeshElement))] =
135 LocAsmBuilderFactory<ShapeFunction,
136 LowerOrderShapeFunction>::create();
137 });
138 }
139};
140
142template <typename LocalAssemblerInterface,
143 template <typename, typename, typename, int>
144 class LocalAssemblerImplementation,
145 int GlobalDim,
146 typename... ConstructorArgs>
148 LocalAssemblerFactoryTaylorHood<1 /* also on linear elements */,
149 2 /* only in 2D and 3D */,
151 LocalAssemblerImplementation,
152 GlobalDim,
153 ConstructorArgs...>;
154
156template <typename LocalAssemblerInterface,
157 template <typename, typename, typename, int>
158 class LocalAssemblerImplementation,
159 int GlobalDim,
160 typename... ConstructorArgs>
162 LocalAssemblerFactoryTaylorHood<2 /* only for higher-order elements */,
163 2 /* only in 2D and 3D */,
165 LocalAssemblerImplementation,
166 GlobalDim,
167 ConstructorArgs...>;
168
169} // namespace ProcessLib
typename NumLib::GaussLegendreIntegrationPolicy< typename ShapeFunction::MeshElement >::IntegrationMethod IntegrationMethod
LocalAssemblerImplementation< ShapeFunction, LowerOrderShapeFunction, IntegrationMethod, GlobalDim > LocAsmImpl
LocalAssemblerFactoryTaylorHood(NumLib::LocalToGlobalIndexMap const &dof_table)
std::function< LocAsmIntfPtr(MeshLib::Element const &e, std::size_t const local_matrix_size, ConstructorArgs &&...)> LocAsmBuilder