OPAL (Object Oriented Parallel Accelerator Library) 2022.1
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
42 AmrInterpolater(lo_t nPoints) : nPoints_m(nPoints) { }
43
47 const lo_t& getNumberOfPoints() const {
48 return nPoints_m;
49 }
50
61 virtual void stencil(const AmrIntVect_t& iv,
62 const basefab_t& fab,
63 umap_t& map,
64 const scalar_t& scale,
65 Level* mglevel) = 0;
66
83 virtual void coarse(const AmrIntVect_t& iv,
84 umap_t& map,
85 const scalar_t& scale,
86 lo_t dir, lo_t shift, const basefab_t& rfab,
87 const AmrIntVect_t& riv,
88 Level* mglevel) = 0;
89
106 virtual void fine(const AmrIntVect_t& /*iv*/,
107 umap_t& /*map*/,
108 const scalar_t& /*scale*/,
109 lo_t /*dir*/, lo_t /*shift*/, const basefab_t& /*fab*/,
110 Level* /*mglevel*/)
111 { };
112
128 virtual void fine(const AmrIntVect_t& /*iv*/,
129 umap_t& /*map*/,
130 const scalar_t& /*scale*/,
131 lo_t /*dir*/, lo_t /*shift*/,
132 Level* /*mglevel*/)
133 { };
134
135protected:
137};
138
139#endif
amrex::IntVect AmrIntVect_t
Definition: AmrDefs.h:48
double scalar_t
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::lo_t lo_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
Level::go_t go_t
Level::basefab_t basefab_t