LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
assemble_concepts.h
1
8
9#ifndef INCG_69d30d4083db4e6382d513cd030df97b
10#define INCG_69d30d4083db4e6382d513cd030df97b
11
12#include <lf/mesh/mesh.h>
13
14namespace lf::assemble {
15
95template <class EMP>
96concept EntityMatrixProvider = requires(EMP& emp, const mesh::Entity& e) {
97 { emp.isActive(e) } -> std::same_as<bool>;
98 { emp.Eval(e) } -> base::EigenMatrix<void, -1, -1>;
99};
100
107template <class SCALAR>
111
114
116 auto operator=(const EntityMatrixProviderAT&) noexcept
117 -> EntityMatrixProviderAT& = delete;
118
120 auto operator=(EntityMatrixProviderAT&&) noexcept -> EntityMatrixProviderAT& =
121 delete;
122
124 ~EntityMatrixProviderAT() noexcept = delete;
125
133 bool isActive(const mesh::Entity& e) { // NOLINT(misc-unused-parameters)
134 LF_VERIFY_MSG(false, "Should never be called");
135 return true;
136 }
137
144 Eigen::Matrix<SCALAR, Eigen::Dynamic, Eigen::Dynamic> Eval(
145 const mesh::Entity& e) { // NOLINT(misc-unused-parameters)
146 LF_VERIFY_MSG(false, "Should never be called");
147 return {};
148 }
149};
150
210template <class EVP>
211concept EntityVectorProvider = requires(EVP& evp, const mesh::Entity& e) {
212 { evp.isActive(e) } -> std::same_as<bool>;
213 { evp.Eval(e) } -> base::EigenMatrix<void, -1, 1>;
214};
215
222template <class SCALAR>
226
229
231 auto operator=(const EntityVectorProviderAT&) noexcept
232 -> EntityVectorProviderAT& = delete;
233
235 auto operator=(EntityVectorProviderAT&&) noexcept -> EntityVectorProviderAT& =
236 delete;
237
239 ~EntityVectorProviderAT() noexcept = default;
240
248 bool isActive(const mesh::Entity& e) { // NOLINT(misc-unused-parameters)
249 LF_VERIFY_MSG(false, "Should never be called");
250 return true;
251 }
252
259 Eigen::Vector<SCALAR, Eigen::Dynamic> Eval(
260 const mesh::Entity& e) { // NOLINT(misc-unused-parameters)
261 LF_VERIFY_MSG(false, "Should never be called");
262 return {};
263 }
264};
265
266} // namespace lf::assemble
267
268#endif // INCG_69d30d4083db4e6382d513cd030df97b
Interface class representing a topological entity in a cellular complex
Definition entity.h:42
Provides the local element matrix for a mesh entity.
Provides the local element vector for a mesh entity.
Check if a given type T is an Eigen::Matrix.
Definition eigen_tools.h:70
D.o.f. index mapping and assembly facilities.
Definition assemble.h:34
Defines a set of interface classes that define a mesh manager and provides mesh-related tools that bu...
Definition entity.cc:5
EntityMatrixProviderAT(const EntityMatrixProviderAT &) noexcept=delete
Copy constructor deleted because not part of the concept.
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > Eval(const mesh::Entity &e)
Returns the local element matrix for mesh entity e. Is only called if emp.isActive(e)==true.
bool isActive(const mesh::Entity &e)
Defines whether the entity e is taken into account by the assembly routine.
EntityMatrixProviderAT(EntityMatrixProviderAT &&) noexcept=delete
Move constructor deleted because not part of the concept.
EntityVectorProviderAT(EntityVectorProviderAT &&) noexcept=delete
Move constructor deleted because not part of the concept.
Eigen::Vector< SCALAR, Eigen::Dynamic > Eval(const mesh::Entity &e)
Returns the local element vector for mesh entity e. Is only called if evp.isActive(e)==true.
EntityVectorProviderAT(const EntityVectorProviderAT &) noexcept=delete
Copy constructor deleted because not part of the concept.
bool isActive(const mesh::Entity &e)
Defines whether the entity e is taken into account by the assembly routine.