OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
AmrBoundary.h
Go to the documentation of this file.
1 #ifndef AMR_BOUNDARY_H
2 #define AMR_BOUNDARY_H
3 
4 #include <vector>
5 
6 #include "Amr/AmrDefs.h"
7 
8 template <class Level>
9 class AmrBoundary {
10 
11 public:
12  typedef typename Level::umap_t umap_t;
13  typedef typename Level::lo_t lo_t;
14  typedef typename Level::go_t go_t;
15  typedef typename Level::scalar_t scalar_t;
16  typedef typename Level::basefab_t basefab_t;
18 
19 public:
20 
24  AmrBoundary(go_t nPoints) : nPoints_m(nPoints) { };
25 
26 
32  bool isBoundary(const AmrIntVect_t& iv, const go_t* nr) const {
33  return AMREX_D_TERM( isBoundary(iv, 0, nr),
34  || isBoundary(iv, 1, nr),
35  || isBoundary(iv, 2, nr));
36  }
37 
43  bool isBoundary(const AmrIntVect_t& iv,
44  const lo_t& dir,
45  const go_t* nr) const {
46  return ( iv[dir] < 0 || iv[dir] >= nr[0] );
47  }
48 
58  virtual void apply(const AmrIntVect_t& iv,
59  const lo_t& dir,
60  umap_t& map,
61  const scalar_t& value,
62  Level* mglevel,
63  const go_t* nr) = 0;
64 
68  const go_t& getNumberOfPoints() const {
69  return nPoints_m;
70  }
71 
72 private:
73  const go_t nPoints_m;
74 };
75 
76 #endif
amr::AmrIntVect_t AmrIntVect_t
Definition: AmrBoundary.h:17
Level::basefab_t basefab_t
Definition: AmrBoundary.h:16
Level::lo_t lo_t
Definition: AmrBoundary.h:13
Level::umap_t umap_t
Definition: AmrBoundary.h:12
bool isBoundary(const AmrIntVect_t &iv, const go_t *nr) const
Definition: AmrBoundary.h:32
const int nr
Definition: ClassicRandom.h:24
bool isBoundary(const AmrIntVect_t &iv, const lo_t &dir, const go_t *nr) const
Definition: AmrBoundary.h:43
amrex::IntVect AmrIntVect_t
Definition: AmrDefs.h:28
Level::go_t go_t
Definition: AmrBoundary.h:14
AmrBoundary(go_t nPoints)
Definition: AmrBoundary.h:24
virtual void apply(const AmrIntVect_t &iv, const lo_t &dir, umap_t &map, const scalar_t &value, Level *mglevel, const go_t *nr)=0
const go_t & getNumberOfPoints() const
Definition: AmrBoundary.h:68
Level::scalar_t scalar_t
Definition: AmrBoundary.h:15
const go_t nPoints_m
Number of points used for boundary.
Definition: AmrBoundary.h:73
double scalar_t