Block-Structured AMR Software Framework
AMReX_BoundCond.H
Go to the documentation of this file.
1 
2 #ifndef AMREX_BOUNDCOND_H_
3 #define AMREX_BOUNDCOND_H_
4 #include <AMReX_Config.H>
5 
6 #include <AMReX_BLassert.H>
7 #include <AMReX_GpuQualifiers.H>
8 
9 namespace amrex {
10 
19 class BoundCond
20 {
21 public:
22  //
24  BoundCond () noexcept = default;
25  //
27  // Many codes rely on implicit conversion. So no explicit here.
28  BoundCond (int _bctype) noexcept : bctype(_bctype) {}
29  //
32  operator int () const noexcept
33  {
34  BL_ASSERT(bctype != -1);
35  return bctype;
36  }
37  //
39  BoundCond& operator= (const int _bctype) noexcept
40  {
41  bctype = _bctype;
42  return *this;
43  }
44 private:
45  //
47  int bctype = -1;
48 };
49 
50 }
51 
52 #endif /*_BOUNDCOND_H_*/
#define BL_ASSERT(EX)
Definition: AMReX_BLassert.H:39
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
Maintain an identifier for boundary condition types.
Definition: AMReX_BoundCond.H:20
BoundCond() noexcept=default
Initializes boundary condition type to default.
BoundCond & operator=(const int _bctype) noexcept
Set index of boundary condition type.
Definition: AMReX_BoundCond.H:39
int bctype
Index of boundary condition type.
Definition: AMReX_BoundCond.H:47
Definition: AMReX_Amr.cpp:49
const int[]
Definition: AMReX_BLProfiler.cpp:1664