13#include <dune/functions/backends/istlvectorbackend.hh>
29template <
typename Wrapper,
typename Assembler>
33 using FEC =
typename Assembler::FEContainer;
34 using DV =
typename Assembler::DirichletValuesType;
50 sfs.emplace_back(std::forward<F>(f));
52 std::vector<FunctionType>
sfs;
56 ScalarType& sca = underlying().base_getScalarImpl(feRequirements, affordance);
57 for (
const auto& sf :
sfs)
58 sf(underlying().base(), feRequirements, affordance, sca);
64 const auto& underlying()
const {
return static_cast<const WrappedAssembler&
>(*this); }
73template <
typename Wrapper,
typename Assembler>
78 using FEC =
typename Assembler::FEContainer;
79 using DV =
typename Assembler::DirichletValuesType;
84 typename Assembler::DirichletValuesType,
typename Assembler::VectorType>;
98 vfs.emplace_back(std::forward<F>(f));
100 std::vector<FunctionType>
vfs;
104 VectorType& vec = underlying().base_getRawVectorImpl(feRequirements, affordance);
105 for (
const auto& vf :
vfs)
106 vf(underlying().base(), feRequirements, affordance,
DBCOption::Raw, vec);
111 VectorType& vec = underlying().base_getVectorImpl(feRequirements, affordance);
112 for (
const auto& vf :
vfs)
113 vf(underlying().base(), feRequirements, affordance,
DBCOption::Full, vec);
118 VectorType& vec = underlying().base_getReducedVectorImpl(feRequirements, affordance);
119 for (
const auto& vf :
vfs)
126 const auto& underlying()
const {
return static_cast<const WrappedAssembler&
>(*this); }
135template <
typename Wrapper,
typename Assembler>
139 using FEC =
typename Assembler::FEContainer;
140 using DV =
typename Assembler::DirichletValuesType;
145 typename Assembler::DirichletValuesType,
typename Assembler::MatrixType>;
155 template <
typename F>
159 mfs.emplace_back(std::forward<F>(f));
161 std::vector<FunctionType>
mfs;
165 MatrixType& mat = underlying().base_getRawMatrixImpl(feRequirements, affordance);
166 for (
const auto& mf :
mfs)
167 mf(underlying().base(), feRequirements, affordance,
DBCOption::Raw, mat);
172 MatrixType& mat = underlying().base_getMatrixImpl(feRequirements, affordance);
173 for (
const auto& mf :
mfs)
174 mf(underlying().base(), feRequirements, affordance,
DBCOption::Full, mat);
179 MatrixType& mat = underlying().base_getReducedMatrixImpl(feRequirements, affordance);
180 for (
const auto& mf :
mfs)
187 const auto& underlying()
const {
return static_cast<const WrappedAssembler&
>(*this); }
Definition of the LinearElastic class for finite element mechanics computations.
Definition: assemblermanipulatorbuildingblocks.hh:22
MatrixAffordance
A strongly typed enum class representing the matrix affordance.
Definition: ferequirements.hh:63
DBCOption
Definition: dirichletbcenforcement.hh:7
VectorAffordance
A strongly typed enum class representing the vector affordance.
Definition: ferequirements.hh:48
ScalarAffordance
A strongly typed enum class representing the scalar affordance.
Definition: ferequirements.hh:37
Base class for a wrapper to a scalar assembler.
Definition: assemblermanipulatorbuildingblocks.hh:31
std::vector< FunctionType > sfs
Definition: assemblermanipulatorbuildingblocks.hh:52
void bind(F &&f)
A helper function to add functions that can be used to manipulate the assembled quantity.
Definition: assemblermanipulatorbuildingblocks.hh:49
typename Assembler::FERequirement FERequirement
Definition: assemblermanipulatorbuildingblocks.hh:35
typename Assembler::ScalarType ScalarType
Definition: assemblermanipulatorbuildingblocks.hh:36
std::function< void(const Assembler &, const FERequirement &, ScalarAffordance, ScalarType &)> FunctionType
Definition: assemblermanipulatorbuildingblocks.hh:40
typename Assembler::DirichletValuesType DV
Definition: assemblermanipulatorbuildingblocks.hh:34
ScalarType & getScalarImpl(const FERequirement &feRequirements, ScalarAffordance affordance)
Definition: assemblermanipulatorbuildingblocks.hh:55
friend Interface
Definition: assemblermanipulatorbuildingblocks.hh:38
Wrapper WrappedAssembler
Definition: assemblermanipulatorbuildingblocks.hh:32
typename Assembler::FEContainer FEC
Definition: assemblermanipulatorbuildingblocks.hh:33
Base class for a wrapper to a vector assembler.
Definition: assemblermanipulatorbuildingblocks.hh:76
typename Assembler::DirichletValuesType DV
Definition: assemblermanipulatorbuildingblocks.hh:79
Wrapper WrappedAssembler
Definition: assemblermanipulatorbuildingblocks.hh:77
typename Assembler::FEContainer FEC
Definition: assemblermanipulatorbuildingblocks.hh:78
typename Assembler::VectorType VectorType
Definition: assemblermanipulatorbuildingblocks.hh:82
std::function< void(const Assembler &, const FERequirement &, VectorAffordance, DBCOption, VectorType &)> FunctionType
Definition: assemblermanipulatorbuildingblocks.hh:87
std::vector< FunctionType > vfs
Definition: assemblermanipulatorbuildingblocks.hh:100
typename Assembler::FERequirement FERequirement
Definition: assemblermanipulatorbuildingblocks.hh:80
VectorType & getRawVectorImpl(const FERequirement &feRequirements, VectorAffordance affordance)
Definition: assemblermanipulatorbuildingblocks.hh:103
VectorType & getReducedVectorImpl(const FERequirement &feRequirements, VectorAffordance affordance)
Definition: assemblermanipulatorbuildingblocks.hh:117
VectorType & getVectorImpl(const FERequirement &feRequirements, VectorAffordance affordance)
Definition: assemblermanipulatorbuildingblocks.hh:110
void bind(F &&f)
A helper function to add functions that can be used to manipulate the assembled quantity.
Definition: assemblermanipulatorbuildingblocks.hh:97
friend Interface
Definition: assemblermanipulatorbuildingblocks.hh:85
Base class for a wrapper to a matrix assembler.
Definition: assemblermanipulatorbuildingblocks.hh:137
std::vector< FunctionType > mfs
Definition: assemblermanipulatorbuildingblocks.hh:161
std::function< void(const Assembler &, const FERequirement &, MatrixAffordance, DBCOption, MatrixType &)> FunctionType
Definition: assemblermanipulatorbuildingblocks.hh:148
typename Assembler::FEContainer FEC
Definition: assemblermanipulatorbuildingblocks.hh:139
MatrixType & getMatrixImpl(const FERequirement &feRequirements, MatrixAffordance affordance)
Definition: assemblermanipulatorbuildingblocks.hh:171
MatrixType & getReducedMatrixImpl(const FERequirement &feRequirements, MatrixAffordance affordance)
Definition: assemblermanipulatorbuildingblocks.hh:178
friend Interface
Definition: assemblermanipulatorbuildingblocks.hh:146
typename Assembler::MatrixType MatrixType
Definition: assemblermanipulatorbuildingblocks.hh:143
MatrixType & getRawMatrixImpl(const FERequirement &feRequirements, MatrixAffordance affordance)
Definition: assemblermanipulatorbuildingblocks.hh:164
typename Assembler::FERequirement FERequirement
Definition: assemblermanipulatorbuildingblocks.hh:141
void bind(F &&f)
A helper function to add functions that can be used to manipulate the assembled quantity.
Definition: assemblermanipulatorbuildingblocks.hh:158
Wrapper WrappedAssembler
Definition: assemblermanipulatorbuildingblocks.hh:138
typename Assembler::DirichletValuesType DV
Definition: assemblermanipulatorbuildingblocks.hh:140
The ScalarAssembler provides an interface for an assembler that assembles scalar quantities.
Definition: assembler/interface.hh:267
The VectorAssembler provides an interface for an assembler that assembles vector quantities.
Definition: assembler/interface.hh:312
The MatrixAssembler provides an interface for an assembler that assembles matrix quantities.
Definition: assembler/interface.hh:389
Concept defining the requirements for functors with arguments.
Definition: concepts.hh:347
Defines the interface for flat, scalar, vector and matrix assemblers.
Definition of DirichletValues class for handling Dirichlet boundary conditions.