5#include <amdis/GridFunctionOperator.hpp>
6#include <amdis/common/StaticSize.hpp>
27 template <
class CG,
class RN,
class CN,
class Quad,
class LocalFct,
class Mat>
28 void assemble(CG
const& contextGeo, RN
const& rowNode, CN
const& colNode,
29 Quad
const& quad, LocalFct
const& localFct, Mat& elementMatrix)
const
31 static_assert(static_size_v<typename LocalFct::Range> == 1,
"Expression must be of scalar type.");
32 static_assert(RN::isLeaf && CN::isPower,
33 "row-node must be Leaf-Node and col-node must be a Power-Node.");
35 assert( colNode.degree() == CG::dow );
37 std::size_t rowSize = rowNode.size();
38 std::size_t colSize = colNode.child(0).size();
40 using RangeFieldType =
typename CN::ChildType::LocalBasis::Traits::RangeFieldType;
41 using WorldVector = FieldVector<RangeFieldType,CG::dow>;
42 std::vector<WorldVector> colGradients;
44 for (
auto const& qp : quad) {
46 auto&& local = contextGeo.coordinateInElement(qp.position());
49 const auto jacobian = contextGeo.elementGeometry().jacobianInverseTransposed(local);
52 const auto factor = localFct(local) * contextGeo.integrationElement(qp.position()) * qp.weight();
55 auto const& shapeValues = rowNode.localBasisValuesAt(local);
58 auto const& shapeGradients = colNode.child(0).localBasisJacobiansAt(local);
61 colGradients.resize(shapeGradients.size());
63 for (std::size_t i = 0; i < colGradients.size(); ++i)
64 jacobian.mv(shapeGradients[i][0], colGradients[i]);
66 for (std::size_t i = 0; i < rowSize; ++i) {
67 const auto local_i = rowNode.localIndex(i);
68 const auto value = factor * shapeValues[i];
69 for (std::size_t j = 0; j < colSize; ++j) {
70 for (std::size_t k = 0; k < colNode.degree(); ++k) {
71 const auto local_kj = colNode.child(k).localIndex(j);
72 elementMatrix[local_i][local_kj] += value * colGradients[j][k];
84 static constexpr int degree = 1;
first-order operator
Definition: FirstOrderTestDivTrialvec.hpp:23
Registry to specify a tag for each implementation type.
Definition: GridFunctionOperator.hpp:216
Definition: FirstOrderTestDivTrialvec.hpp:17