5 #include <amdis/GridFunctionOperator.hpp> 6 #include <amdis/Output.hpp> 7 #include <amdis/common/StaticSize.hpp> 23 template <
class LC,
class Gr
idFct>
31 static_assert( static_size_v<typename GridFct::Range> == dow,
"Expression must be of vector type." );
38 template <
class CG,
class Node,
class Vec>
39 void getElementVector(CG
const& contextGeo, Node
const& node, Vec& elementVector)
41 static_assert(Node::isLeaf,
"Node must be Leaf-Node.");
43 auto const& quad = this->getQuadratureRule(contextGeo.type(), node);
44 std::size_t feSize = node.size();
46 using RangeFieldType =
typename Node::LocalBasis::Traits::RangeFieldType;
47 using WorldVector = FieldVector<RangeFieldType,CG::dow>;
48 std::vector<WorldVector> gradients;
50 for (
auto const& qp : quad) {
52 auto&& local = contextGeo.local(qp.position());
55 const auto jacobian = contextGeo.geometry().jacobianInverseTransposed(local);
58 const auto factor = Super::coefficient(local);
59 const auto dx = contextGeo.integrationElement(qp.position()) * qp.weight();
62 auto const& shapeGradients = node.localBasisJacobiansAt(local);
65 gradients.resize(shapeGradients.size());
67 for (std::size_t i = 0; i < gradients.size(); ++i)
68 jacobian.mv(shapeGradients[i][0], gradients[i]);
70 for (std::size_t i = 0; i < feSize; ++i) {
71 const auto local_i = node.localIndex(i);
72 elementVector[local_i] += dx * (factor * gradients[i]);
The base-template for GridFunctionOperators.
Definition: GridFunctionOperator.hpp:242
Definition: FirstOrderGradTest.hpp:18
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
The main implementation of an CRTP-base class for operators using a grid-function coefficient to be u...
Definition: GridFunctionOperator.hpp:39