6#include <amdis/common/FakeContainer.hpp>
7#include <amdis/common/FieldMatVec.hpp>
8#include <amdis/functions/EntitySet.hpp>
9#include <amdis/functions/HierarchicNodeToRangeMap.hpp>
10#include <amdis/functions/NodeIndices.hpp>
11#include <amdis/linearalgebra/Traits.hpp>
12#include <amdis/operations/Assigner.hpp>
13#include <amdis/typetree/Traversal.hpp>
22 template <
class Basis,
23 class TreePath = Dune::TypeTree::HybridTreePath<>>
26 template <
class Coeff,
class Gr
idFct,
class BitVector>
27 void operator()(Coeff& coeff, GridFct
const& gf, BitVector
const& bitVec)
const
30 std::map<typename Basis::MultiIndex, typename Coeff::value_type> values;
31 std::map<typename Basis::MultiIndex, std::uint8_t> counter;
33 std::vector<typename Coeff::value_type> localCoeff;
36 auto lf = localFunction(gf);
37 auto localView = basis_.localView();
38 for (
const auto& e : entitySet(basis_))
43 auto&& subTree = Dune::TypeTree::child(localView.tree(),treePath_);
44 Traversal::forEachLeafNode(subTree, [&](
auto const& node,
auto const& tp)
48 for (std::size_t i = 0; i < node.size(); ++i) {
49 auto idx = localView.index(node.localIndex(i));
63 for (std::size_t i = 0; i < node.size(); ++i) {
64 auto idx = localView.index(node.localIndex(i));
67 values[idx] += localCoeff[i];
75 assert(values.size() == counter.size());
78 auto value_it = values.begin();
79 auto count_it = counter.begin();
80 for (; value_it != values.end(); ++value_it, ++count_it) {
81 coeff.set(value_it->first, value_it->second/
double(count_it->second));
86 template <
class Coeff,
class Gr
idFct>
87 void operator()(Coeff& coeff, GridFct
const& gf)
const
98 TreePath treePath_ = {};
105 template <
class Basis,
106 class TreePath = Dune::TypeTree::HybridTreePath<>>
107 static auto create(Basis
const& basis, TreePath treePath = {})
A container-like data-structure not storing anything and with empty implementations in many container...
Definition: FakeContainer.hpp:36
Definition: HierarchicNodeToRangeMap.hpp:42
Definition: SimpleInterpolator.hpp:80
Definition: LocalAverageInterpolator.hpp:25
Definition: LocalAverageInterpolator.hpp:19