AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
AdaptionInterface.hpp
1#pragma once
2
3#include <amdis/common/ConceptsBase.hpp>
4
5namespace AMDiS
6{
12 namespace Concepts
13 {
14 namespace Definition
15 {
17 {
18 template <class Data>
19 auto require(Data const& data) -> decltype(
20 const_cast<Data&>(data).preAdapt(true),
21 const_cast<Data&>(data).postAdapt(true)
22 );
23 };
24
26 {
27 template <class Basis>
28 auto require(Basis const& basis) -> decltype(
29 const_cast<Basis&>(basis).update(basis.gridView())
30 );
31 };
32
33 } // end namespace Definition
34
35 template <class Data>
36 constexpr bool InterpolateData = models<Definition::InterpolateData(Data)>;
37
38 template <class Data>
39 using InterpolateData_t = models_t<Definition::InterpolateData(Data)>;
40
41
42 template <class Basis>
43 constexpr bool UpdateData = models<Definition::UpdateData(Basis)>;
44
45 template <class Basis>
46 using UpdateData_t = models_t<Definition::UpdateData(Basis)>;
47
48 } // end namespace Concepts
49
51
52
60 {
61 public:
62 virtual ~AdaptionInterface() = default;
63
65 virtual bool preAdapt() = 0;
66
68 virtual bool adapt() = 0;
69
70 // Perform data adaption to the new grid
71 virtual void postAdapt() = 0;
72 };
73
75
76} // end namespace AMDiS
Interface for transfer between grid changes.
Definition: AdaptionInterface.hpp:60
virtual bool preAdapt()=0
Prepare the grid and the data for the adaption.
virtual bool adapt()=0
Do the grid adaption.
Definition: AdaptionInterface.hpp:17
Definition: AdaptionInterface.hpp:26