AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
InterpolationDataTransfer.hpp
1#pragma once
2
3#include <map>
4#include <memory>
5
6#include <amdis/DataTransfer.hpp>
7
8#include <dune/typetree/treecontainer.hh>
9
10namespace AMDiS {
11
17namespace tag {
18
21 {};
22
23} // end namespace tag
24
25
26// forward declaration
27template <class Node, class Container, class Basis>
29
30
35template <class Basis, class Container>
37{
38 using LocalView = typename Basis::LocalView;
39 using Tree = typename LocalView::Tree;
40 using GridView = typename Basis::GridView;
41 using Grid = typename GridView::Grid;
42
43 using Element = typename GridView::template Codim<0>::Entity;
44 using Geometry = typename Element::Geometry;
45 using LocalCoordinate = typename Geometry::LocalCoordinate;
46 using IdType = typename Grid::LocalIdSet::IdType;
47
48 template <class Node>
49 using NodeElementData = typename NodeDataTransfer<Node, Container, Basis>::NodeElementData;
50 using ElementData = Dune::TypeTree::TreeContainer<NodeElementData,Tree>;
51
52public:
53 InterpolationDataTransfer() = default;
54
58 void preAdapt(Basis const& basis, Container const& coeff, bool mightCoarsen);
59
63 // [[expects: basis is updated in gridView]]
64 // [[expects: comm is updated in basis]]
65 void adapt(Basis const& basis, Container& coeff);
66
70 void postAdapt(Container& coeff);
71
72private:
74 using PersistentContainer = std::map<IdType, ElementData>;
75 PersistentContainer persistentContainer_{};
76
78 template <class Node>
80 using NodeDataTransferContainer = Dune::TypeTree::TreeContainer<NDT,Tree>;
81 NodeDataTransferContainer nodeDataTransfer_{};
82};
83
84template <>
85struct DataTransferFactory<tag::interpolation_datatransfer>
86{
87 template <class Basis, class T, template <class> class Impl,
88 REQUIRES(Concepts::GlobalBasis<Basis>)>
89 static DataTransfer<Basis,VectorFacade<T,Impl>> create(Basis const&, VectorFacade<T,Impl> const&)
90 {
92 }
93};
94
96
97} // end namespace AMDiS
98
99#include "InterpolationDataTransfer.inc.hpp"
The base class for data transfer classes.
Definition: DataTransfer.hpp:68
Definition: InterpolationDataTransfer.hpp:37
void preAdapt(Basis const &basis, Container const &coeff, bool mightCoarsen)
Definition: InterpolationDataTransfer.inc.hpp:49
void postAdapt(Container &coeff)
Definition: InterpolationDataTransfer.inc.hpp:244
void adapt(Basis const &basis, Container &coeff)
Definition: InterpolationDataTransfer.inc.hpp:158
typename Super::Tree Tree
Tree of local finite elements / local shape function sets.
Definition: LocalView.hpp:24
Definition: InterpolationDataTransfer.inc.hpp:255
The basic container that stores a base vector and a corresponding basis.
Definition: VectorFacade.hpp:39
constexpr bool LocalView
A Dune::Functions::LocalView type.
Definition: Concepts.hpp:181
Definition: DataTransfer.hpp:133
Base tag type for all data transfer tags.
Definition: DataTransfer.hpp:121
Definition: InterpolationDataTransfer.hpp:21