AMDiS 2.10
The Adaptive Multi-Dimensional Simulation Toolbox
Interpolate.hpp
1#pragma once
2
3#include <amdis/common/Concepts.hpp>
4#include <amdis/gridfunctions/GridFunction.hpp>
5#include <amdis/interpolators/AverageInterpolator.hpp>
6#include <amdis/interpolators/LocalAverageInterpolator.hpp>
7#include <amdis/interpolators/SimpleInterpolator.hpp>
8
9namespace AMDiS
10{
13 template <class Tag = tag::assign, class B, class C, class F, class BV,
14 REQUIRES(Concepts::GlobalBasis<B>),
15 REQUIRES(Concepts::AnyGridFunction<F>)>
16 void interpolate(const B& basis, C& coeff, F&& f, const BV& bitVector)
17 {
18 auto gridFunction = makeGridFunction(FWD(f), basis.gridView());
19 auto interpolator = InterpolatorFactory<Tag>::create(basis.rootBasis(), basis.prefixPath());
20 interpolator(coeff, gridFunction, bitVector);
21 }
22
24 template <class Tag = tag::assign, class B, class C, class F,
25 REQUIRES(Concepts::GlobalBasis<B>),
26 REQUIRES(Concepts::AnyGridFunction<F>)>
27 void interpolate(const B& basis, C& coeff, F&& f)
28 {
29 auto gridFunction = makeGridFunction(FWD(f), basis.gridView());
30 auto interpolator = InterpolatorFactory<Tag>::create(basis.rootBasis(), basis.prefixPath());
31 interpolator(coeff, gridFunction);
32 }
33
34} // end namespace AMDiS
decltype(auto) makeGridFunction(PreGridFct const &preGridFct, GridView const &gridView)
Generator for Gridfunctions from Expressions (PreGridfunctions)
Definition: GridFunction.hpp:168