version 0.4.1
fefactory.hh
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2021-2024 The Ikarus Developers mueller@ibb.uni-stuttgart.de
2// SPDX-License-Identifier: LGPL-3.0-or-later
3
10#pragma once
12namespace Ikarus {
21template <typename BH, typename SK, bool useFlat = true, bool useEigenRef = false>
23{
24 using Skills = SK;
25
26private:
27 const BH* basisHandler_;
28 SK skills_;
29
30public:
36 template <typename SK2 = SK>
37 FEFactory(const BH& basisHandler, const SK2& sk)
38 : basisHandler_{&basisHandler},
39 skills_{sk} {}
40
41 auto operator()() {
42 return std::apply(
43 [&]<typename... Args>(Args&&... args) {
44 // the template would not be needed,
45 // when https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1814r0.html
46 // will be implemented in clang. It is already implemented in gcc 12.2
48 *basisHandler_, std::forward<Args>(args)...);
49
50 return fe;
51 },
52 skills_.args);
53 }
54};
55
67template <bool useFlat = true, bool useEigenRef = false, typename BH, typename SK>
68auto makeFE(const BH& basisHandler, const SK& sk) {
69 FEFactory<BH, SK, useFlat, useEigenRef> factory(basisHandler, sk);
70
71 return factory();
72}
73
84template <bool useEigenRef = false, typename BH, typename SK>
85auto makeFEWithUnTouchedBasis(const BH& basisHandler, SK&& sk) {
86 FEFactory<BH, SK, false, useEigenRef> factory(basisHandler, std::forward<SK>(sk));
87
88 return factory();
89}
90
91} // namespace Ikarus
Contains the FE class, which is used as a base class for all finite elements. It provides information...
Definition: assemblermanipulatorbuildingblocks.hh:22
auto makeFE(const BH &basisHandler, const SK &sk)
A function to create a finite element using the flat version of the basis.
Definition: fefactory.hh:68
auto makeFEWithUnTouchedBasis(const BH &basisHandler, SK &&sk)
A function to create a finite element using the untouched version of the basis.
Definition: fefactory.hh:85
FE class is a base class for all finite elements.
Definition: febase.hh:79
PreFE struct acts as a convenient wrapper for the FE class to access different type traits.
Definition: febase.hh:33
FEFactory is a convenient wrapper to forward arguments to PreFE and create and construct a factory of...
Definition: fefactory.hh:23
auto operator()()
Definition: fefactory.hh:41
FEFactory(const BH &basisHandler, const SK2 &sk)
constructor for FEFactory
Definition: fefactory.hh:37
SK Skills
Definition: fefactory.hh:24