5 #include <amdis/GridFunctionOperator.hpp> 6 #include <amdis/Output.hpp> 7 #include <amdis/common/StaticSize.hpp> 24 template <
class LC,
class Gr
idFct>
32 static_assert( static_size_v<typename GridFct::Range> == dow,
"Expression must be of vector type." );
39 template <
class CG,
class RN,
class CN,
class Mat>
40 void getElementMatrix(CG
const& contextGeo, RN
const& rowNode, CN
const& colNode, Mat& elementMatrix)
42 static_assert(RN::isLeaf && CN::isLeaf,
43 "Operator can be applied to Leaf-Nodes only.");
45 auto const& quad = this->getQuadratureRule(contextGeo.type(), rowNode, colNode);
46 std::size_t rowSize = rowNode.size();
47 std::size_t colSize = colNode.size();
49 using RangeFieldType =
typename CN::LocalBasis::Traits::RangeFieldType;
50 using WorldVector = FieldVector<RangeFieldType,CG::dow>;
51 std::vector<WorldVector> colGradients;
53 for (
auto const& qp : quad) {
55 auto&& local = contextGeo.local(qp.position());
58 const auto jacobian = contextGeo.geometry().jacobianInverseTransposed(local);
61 const auto factor = contextGeo.integrationElement(qp.position()) * qp.weight();
62 const auto b = Super::coefficient(local);
65 auto const& shapeValues = rowNode.localBasisValuesAt(local);
68 auto const& shapeGradients = colNode.localBasisJacobiansAt(local);
71 colGradients.resize(shapeGradients.size());
73 for (std::size_t i = 0; i < colGradients.size(); ++i)
74 jacobian.mv(shapeGradients[i][0], colGradients[i]);
76 for (std::size_t j = 0; j < colSize; ++j) {
77 const auto local_j = colNode.localIndex(j);
78 const auto value = factor * (b * colGradients[j]);
79 for (std::size_t i = 0; i < rowSize; ++i) {
80 const auto local_i = rowNode.localIndex(i);
81 elementMatrix[local_i][local_j] += value * shapeValues[i];
91 template <
class Expr,
class... QuadratureArgs>
Definition: FirstOrderTestGradTrial.hpp:18
auto makeOperator(Tag tag, Expr &&expr, QuadratureArgs &&... args)
Store tag and expression into a PreGridFunctionOperator to create a GridFunctionOperator.
Definition: GridFunctionOperator.hpp:220
The base-template for GridFunctionOperators.
Definition: GridFunctionOperator.hpp:242
Contains all classes needed for solving linear and non linear equation systems.
Definition: AdaptBase.hpp:6
Wrapper class for element and geometry.
Definition: ContextGeometry.hpp:43
auto fot(Expr &&expr, tag::grad_test, QuadratureArgs &&... args)
Create a first-order term with derivative on trial-function.
Definition: FirstOrderGradTestTrial.hpp:40
The main implementation of an CRTP-base class for operators using a grid-function coefficient to be u...
Definition: GridFunctionOperator.hpp:39
Definition: FirstOrderTestGradTrial.hpp:19