OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
AmrPeriodicBoundary.h
Go to the documentation of this file.
1 #ifndef AMR_PERIODIC_BOUNDARY_H
2 #define AMR_PERIODIC_BOUNDARY_H
3 
4 #include "AmrBoundary.h"
5 
10 template <class Level>
11 class AmrPeriodicBoundary : public AmrBoundary<Level> {
12 
13 public:
14  typedef typename Level::umap_t umap_t;
15  typedef typename Level::lo_t lo_t;
16  typedef typename Level::go_t go_t;
17  typedef typename Level::scalar_t scalar_t;
19 
20 public:
21 
22  AmrPeriodicBoundary() : AmrBoundary<Level>(1) { }
23 
24  void apply(const AmrIntVect_t& iv,
25  const lo_t& dir,
26  umap_t& map,
27  const scalar_t& value,
28  Level* mglevel,
29  const go_t* nr);
30 };
31 
32 
33 template <class Level>
35  const lo_t& dir,
36  umap_t& map,
37  const scalar_t& value,
38  Level* mglevel,
39  const go_t* nr)
40 {
41  // find interior neighbour cell on opposite site
42  AmrIntVect_t niv = iv;
43  niv[dir] = ( iv[dir] == -1 ) ? nr[dir] - 1 : 0;
44 
45  map[mglevel->serialize(niv)] += value;
46 }
47 
48 
49 #endif
amr::AmrIntVect_t AmrIntVect_t
Definition: AmrBoundary.h:17
Level::lo_t lo_t
Definition: AmrBoundary.h:13
Level::umap_t umap_t
Definition: AmrBoundary.h:12
const int nr
Definition: ClassicRandom.h:24
amrex::IntVect AmrIntVect_t
Definition: AmrDefs.h:28
Level::scalar_t scalar_t
void apply(const AmrIntVect_t &iv, const lo_t &dir, umap_t &map, const scalar_t &value, Level *mglevel, const go_t *nr)
Level::go_t go_t
Definition: AmrBoundary.h:14
amr::AmrIntVect_t AmrIntVect_t
Level::scalar_t scalar_t
Definition: AmrBoundary.h:15
double scalar_t