5#include <amdis/GridFunctionOperator.hpp>
6#include <amdis/common/StaticSize.hpp>
27 template <
class CG,
class Node,
class Quad,
class LocalFct,
class Vec>
28 void assemble(CG
const& contextGeo, Node
const& node, Quad
const& quad,
29 LocalFct
const& localFct, Vec& elementVector)
const
31 static_assert(static_size_v<typename LocalFct::Range> == CG::dow,
"Expression must be of vector type.");
32 static_assert(Node::isLeaf,
"Node must be Leaf-Node.");
34 std::size_t feSize = node.size();
36 using RangeFieldType =
typename Node::LocalBasis::Traits::RangeFieldType;
37 using WorldVector = FieldVector<RangeFieldType,CG::dow>;
38 std::vector<WorldVector> gradients;
40 for (
auto const& qp : quad) {
42 auto&& local = contextGeo.coordinateInElement(qp.position());
45 const auto jacobian = contextGeo.elementGeometry().jacobianInverseTransposed(local);
48 const auto factor = localFct(local);
49 const auto dx = contextGeo.integrationElement(qp.position()) * qp.weight();
52 auto const& shapeGradients = node.localBasisJacobiansAt(local);
55 gradients.resize(shapeGradients.size());
57 for (std::size_t i = 0; i < gradients.size(); ++i)
58 jacobian.mv(shapeGradients[i][0], gradients[i]);
60 for (std::size_t i = 0; i < feSize; ++i) {
61 const auto local_i = node.localIndex(i);
62 elementVector[local_i] += dx * (factor * gradients[i]);
72 static constexpr int degree = 1;
first-order operator
Definition: FirstOrderGradTest.hpp:23
Registry to specify a tag for each implementation type.
Definition: GridFunctionOperator.hpp:216
Definition: FirstOrderGradTest.hpp:17