5#include <amdis/GridFunctionOperator.hpp>
6#include <amdis/common/StaticSize.hpp>
27 template <
class CG,
class Node,
class Quad,
class LF,
class Vec>
28 void assemble(CG
const& contextGeo, Node
const& node, Quad
const& quad,
29 LF
const& localFct, Vec& elementVector)
const
31 static_assert(Node::isPower,
"Node must be a Power-Node.");
32 static_assert(static_size_v<typename LF::Range> == 1,
33 "Expression must be of scalar type.");
34 assert(node.degree() == CG::dow);
36 std::size_t feSize = node.child(0).size();
38 using RangeFieldType =
typename Node::ChildType::LocalBasis::Traits::RangeFieldType;
39 using WorldVector = FieldVector<RangeFieldType,CG::dow>;
40 std::vector<WorldVector> gradients;
42 for (
auto const& qp : quad) {
44 auto&& local = contextGeo.coordinateInElement(qp.position());
47 const auto jacobian = contextGeo.elementGeometry().jacobianInverseTransposed(local);
50 const auto factor = localFct(local) * contextGeo.integrationElement(qp.position()) * qp.weight();
53 auto const& shapeGradients = node.child(0).localBasisJacobiansAt(local);
56 gradients.resize(shapeGradients.size());
58 for (std::size_t i = 0; i < gradients.size(); ++i)
59 jacobian.mv(shapeGradients[i][0], gradients[i]);
61 for (std::size_t j = 0; j < feSize; ++j) {
62 for (std::size_t k = 0; k < CG::dow; ++k) {
63 const auto local_kj = node.child(k).localIndex(j);
64 elementVector[local_kj] += factor * gradients[j][k];
75 static constexpr int degree = 1;
first-order operator
Definition: FirstOrderDivTestvec.hpp:23
Registry to specify a tag for each implementation type.
Definition: GridFunctionOperator.hpp:216
Definition: FirstOrderDivTestvec.hpp:17