OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
AmrInterpolater.h
Go to the documentation of this file.
1//
2// Class AmrInterpolater
3// Abstract base class for all coarse to fine cell interpolaters.
4//
5// Copyright (c) 2017 - 2020, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved
7//
8// Implemented as part of the PhD thesis
9// "Precise Simulations of Multibunches in High Intensity Cyclotrons"
10//
11// This file is part of OPAL.
12//
13// OPAL is free software: you can redistribute it and/or modify
14// it under the terms of the GNU General Public License as published by
15// the Free Software Foundation, either version 3 of the License, or
16// (at your option) any later version.
17//
18// You should have received a copy of the GNU General Public License
19// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
20//
21#ifndef AMR_INTERPOLATER_H
22#define AMR_INTERPOLATER_H
23
24#include "Amr/AmrDefs.h"
25
26template <class Level>
28
29public:
30 typedef typename Level::go_t go_t;
31 typedef typename Level::lo_t lo_t;
32 typedef typename Level::scalar_t scalar_t;
33 typedef typename Level::umap_t umap_t;
34 typedef typename Level::basefab_t basefab_t;
36
37public:
38
39 virtual ~AmrInterpolater() = default;
40
44 AmrInterpolater(lo_t nPoints) : nPoints_m(nPoints) { }
45
49 const lo_t& getNumberOfPoints() const {
50 return nPoints_m;
51 }
52
63 virtual void stencil(const AmrIntVect_t& iv,
64 const basefab_t& fab,
65 umap_t& map,
66 const scalar_t& scale,
67 Level* mglevel) = 0;
68
85 virtual void coarse(const AmrIntVect_t& iv,
86 umap_t& map,
87 const scalar_t& scale,
88 lo_t dir, lo_t shift, const basefab_t& rfab,
89 const AmrIntVect_t& riv,
90 Level* mglevel) = 0;
91
108 virtual void fine(const AmrIntVect_t& /*iv*/,
109 umap_t& /*map*/,
110 const scalar_t& /*scale*/,
111 lo_t /*dir*/, lo_t /*shift*/, const basefab_t& /*fab*/,
112 Level* /*mglevel*/)
113 { };
114
130 virtual void fine(const AmrIntVect_t& /*iv*/,
131 umap_t& /*map*/,
132 const scalar_t& /*scale*/,
133 lo_t /*dir*/, lo_t /*shift*/,
134 Level* /*mglevel*/)
135 { };
136
137protected:
139};
140
141#endif
amrex::IntVect AmrIntVect_t
Definition AmrDefs.h:48
AmrInterpolater(lo_t nPoints)
amr::AmrIntVect_t AmrIntVect_t
virtual void fine(const AmrIntVect_t &, umap_t &, const scalar_t &, lo_t, lo_t, const basefab_t &, Level *)
Level::scalar_t scalar_t
Level::umap_t umap_t
virtual void fine(const AmrIntVect_t &, umap_t &, const scalar_t &, lo_t, lo_t, Level *)
virtual void coarse(const AmrIntVect_t &iv, umap_t &map, const scalar_t &scale, lo_t dir, lo_t shift, const basefab_t &rfab, const AmrIntVect_t &riv, Level *mglevel)=0
virtual void stencil(const AmrIntVect_t &iv, const basefab_t &fab, umap_t &map, const scalar_t &scale, Level *mglevel)=0
const lo_t nPoints_m
Number of points used for interpolation.
const lo_t & getNumberOfPoints() const
virtual ~AmrInterpolater()=default
Level::basefab_t basefab_t