OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
AmrLagrangeInterpolater.h
Go to the documentation of this file.
1 #ifndef AMR_LAGRANGE_INTERPOLATER_H
2 #define AMR_LAGRANGE_INTERPOLATER_H
3 
4 #include "AmrInterpolater.h"
5 
6 #if AMREX_SPACEDIM == 3
7  #include <bitset>
8  #include <iterator>
9  #include <array>
10 #endif
11 
12 #include "Ippl.h"
13 
14 template <class Level>
16 {
17 public:
18 
19  typedef typename Level::go_t go_t;
20  typedef typename Level::lo_t lo_t;
21  typedef typename Level::scalar_t scalar_t;
22  typedef typename Level::umap_t umap_t;
23  typedef typename Level::basefab_t basefab_t;
25 
26  enum Order {
27  LINEAR = 1,
29  };
30 
31 #if AMREX_SPACEDIM == 3
32  typedef std::bitset<25> qbits_t;
33  typedef std::bitset<9> lbits_t;
34  typedef std::array<unsigned int long, 9> qpattern_t;
35  typedef std::array<unsigned int long, 4> lpattern_t;
36 #endif
37 
38 public:
39 
41 
42  void stencil(const AmrIntVect_t& iv,
43  const basefab_t& fab,
44  umap_t& map,
45  const scalar_t& scale,
46  Level* mglevel);
47 
48  void coarse(const AmrIntVect_t& iv,
49  umap_t& map,
50  const scalar_t& scale,
51  lo_t dir, lo_t shift, const basefab_t& rfab,
52  const AmrIntVect_t& riv,
53  Level* mglevel);
54 
55  void fine(const AmrIntVect_t& iv,
56  umap_t& map,
57  const scalar_t& scale,
58  lo_t dir, lo_t shift,
59  Level* mglevel);
60 
61 private:
62 
78  void fineLinear_m(const AmrIntVect_t& iv,
79  umap_t& map,
80  const scalar_t& scale,
81  lo_t dir, lo_t shift,
82  Level* mglevel);
83 
99  void fineQuadratic_m(const AmrIntVect_t& iv,
100  umap_t& map,
101  const scalar_t& scale,
102  lo_t dir, lo_t shift,
103  Level* mglevel);
104 
120  void crseLinear_m(const AmrIntVect_t& iv,
121  umap_t& map,
122  const scalar_t& scale,
123  lo_t dir, lo_t shift, const basefab_t& rfab,
124  const AmrIntVect_t& riv,
125  Level* mglevel);
126 
143  void crseQuadratic_m(const AmrIntVect_t& iv,
144  umap_t& map,
145  const scalar_t& scale,
146  lo_t dir, lo_t shift, const basefab_t& rfab,
147  const AmrIntVect_t& riv,
148  Level* mglevel);
149 
150 private:
151 #if AMREX_SPACEDIM == 3
152  static constexpr qpattern_t qpattern_ms {
153  473536,
154  14798,
155  236768,
156  15153152,
157  947072,
158  29596,
159  7399,
160  7576576,
161  30306304
162  };
163 
164  static constexpr lpattern_t lpattern_ms {
165  27,
166  216,
167  432,
168  54
169  };
170 #endif
171 
172  // y_b y_t
173  static const scalar_t lookup1a_ms[2];
174  static const scalar_t lookup2a_ms[2];
175  static const scalar_t lookup1b_ms[2];
176  static const scalar_t lookup2b_ms[2];
177 #if AMREX_SPACEDIM == 3
178  static const scalar_t lookup3_ms[2];
179  static const scalar_t lookup3r_ms[2];
180  static const scalar_t lookup4_ms[2];
181  static const scalar_t lookup4r_ms[2];
182  static const scalar_t lookup5_ms[2];
183  static const scalar_t lookup5r_ms[2];
184  static const scalar_t lookup6_ms;
185  static const scalar_t factor_ms;
186 #endif
187 };
188 
190 
191 #endif
void stencil(const AmrIntVect_t &iv, const basefab_t &fab, umap_t &map, const scalar_t &scale, Level *mglevel)
&lt; Abstract base class for all coarse to fine cell interpolaters
static const scalar_t lookup2b_ms[2]
void crseLinear_m(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)
amrex::IntVect AmrIntVect_t
Definition: AmrDefs.h:28
static const scalar_t lookup1b_ms[2]
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)
void fineLinear_m(const AmrIntVect_t &iv, umap_t &map, const scalar_t &scale, lo_t dir, lo_t shift, Level *mglevel)
static const scalar_t lookup1a_ms[2]
void crseQuadratic_m(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)
static const scalar_t lookup2a_ms[2]
void fineQuadratic_m(const AmrIntVect_t &iv, umap_t &map, const scalar_t &scale, lo_t dir, lo_t shift, Level *mglevel)
void fine(const AmrIntVect_t &iv, umap_t &map, const scalar_t &scale, lo_t dir, lo_t shift, Level *mglevel)
double scalar_t