Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_InterpBase.H
Go to the documentation of this file.
1#ifndef AMREX_INTERP_BASE_H_
2#define AMREX_INTERP_BASE_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_BCRec.H>
6#include <AMReX_Box.H>
7#include <AMReX_Vector.H>
8
9#include <typeindex>
10
15
16namespace amrex {
17
18class InterpBase;
19
21 : public BoxConverter
22{
23public:
25 InterpolaterBoxCoarsener (InterpBase* mapper_, const IntVect& ratio_);
27 [[nodiscard]] Box doit (const Box& fine) const override;
29 [[nodiscard]] BoxConverter* clone () const override;
31 [[nodiscard]] bool equals (const BoxConverter& other) const override;
32private:
33 InterpBase* mapper;
34 IntVect ratio;
35 std::type_index m_type;
36};
37
39{
40public:
41 InterpBase () = default;
42 virtual ~InterpBase () = default;
43 InterpBase (InterpBase const&) noexcept = default;
44 InterpBase (InterpBase &&) noexcept = default;
45 InterpBase& operator= (InterpBase const&) noexcept = default;
46 InterpBase& operator= (InterpBase &&) noexcept = default;
47
51 virtual Box CoarseBox (const Box& fine, int ratio) = 0;
52
59 virtual Box CoarseBox (const Box& fine, const IntVect& ratio) = 0;
60
63
65 static Vector<int> GetBCArray (const Vector<BCRec>& bcr);
66};
67
68}
69
70#endif
Boundary condition descriptors used throughout AMReX.
Integer-lattice boxes and helpers for defining index-space regions.
Boundary condition record storing low/high face types per coordinate.
Definition AMReX_BCRec.H:25
Definition AMReX_Box.H:1292
Definition AMReX_InterpBase.H:39
InterpBase(InterpBase const &) noexcept=default
InterpBase(InterpBase &&) noexcept=default
virtual Box CoarseBox(const Box &fine, int ratio)=0
Return the coarsened box bounding fine for scalar refinement ratio ratio.
virtual ~InterpBase()=default
InterpolaterBoxCoarsener BoxCoarsener(const IntVect &ratio)
Convenience helper that returns a BoxConverter bound to this interpolater.
Definition AMReX_InterpBase.cpp:31
static Vector< int > GetBCArray(const Vector< BCRec > &bcr)
Convert BCRec entries to an integer array that interpolaters can consume.
Definition AMReX_InterpBase.cpp:37
InterpBase()=default
Definition AMReX_InterpBase.H:22
Box doit(const Box &fine) const override
Apply the coarse-box logic to the supplied fine box.
Definition AMReX_InterpBase.cpp:12
bool equals(const BoxConverter &other) const override
True if other has the same interpolater class and ratio.
Definition AMReX_InterpBase.cpp:24
BoxConverter * clone() const override
Clone this converter (used by FAB factory code).
Definition AMReX_InterpBase.cpp:18
InterpolaterBoxCoarsener(InterpBase *mapper_, const IntVect &ratio_)
Construct a BoxConverter that delegates to mapper_ with refinement ratio ratio_.
Definition AMReX_InterpBase.cpp:7
This class is a thin wrapper around std::vector. Unlike vector, Vector::operator[] provides bound che...
Definition AMReX_Vector.H:29
Definition AMReX_Amr.cpp:50
BoxND< 3 > Box
Box is an alias for amrex::BoxND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:35
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38