Alamo
BC.cpp
Go to the documentation of this file.
1#include "BC.H"
2#include "AMReX_BC_TYPES.H"
3
4namespace BC
5{
6namespace BCUtil
7{
8int ReadString(std::string bcstring)
9{
10 // From <AMReX_BC_TYPES.H>
11 if (bcstring == "BOGUS_BC") return amrex::BCType::mathematicalBndryTypes::bogus;
12 if (bcstring == "INT_DIR") return amrex::BCType::mathematicalBndryTypes::int_dir;
13 if (bcstring == "REFLECT_ODD") return amrex::BCType::mathematicalBndryTypes::reflect_odd;
14 if (bcstring == "REFLECT_EVEN") return amrex::BCType::mathematicalBndryTypes::reflect_even;
15 if (bcstring == "FOEXTRAP") return amrex::BCType::mathematicalBndryTypes::foextrap;
16 if (bcstring == "EXT_DIR") return amrex::BCType::mathematicalBndryTypes::ext_dir;
17 if (bcstring == "HOEXTRAP") return amrex::BCType::mathematicalBndryTypes::hoextrap;
18
19 // From <AMReX_LO_BCTYPES.H>
20 if (bcstring == "interior" ) return (int)amrex::LinOpBCType::interior;
21 if (bcstring == "Dirichlet" ||
22 bcstring == "dirichlet") return (int)amrex::LinOpBCType::Dirichlet;
23 if (bcstring == "Neumann" ||
24 bcstring == "neumann") return (int)amrex::LinOpBCType::Neumann;
25 if (bcstring == "reflect_odd") return (int)amrex::LinOpBCType::reflect_odd;
26 if (bcstring == "Marshak") return (int)amrex::LinOpBCType::Marshak;
27 if (bcstring == "SanchezPomraning") return (int)amrex::LinOpBCType::SanchezPomraning;
28 if (bcstring == "inflow") return (int)amrex::LinOpBCType::inflow;
29 if (bcstring == "Periodic" ||
30 bcstring == "periodic") return (int)amrex::LinOpBCType::Periodic;
31 return 0;
32}
33bool IsPeriodic(int bctype)
34{
35 ///\todo We need to clean up these operators
36 if (bctype == (int)amrex::BCType::mathematicalBndryTypes::int_dir) return true;
37 if (bctype == (int)amrex::LinOpBCType::interior) return true;
38 if (bctype == (int)amrex::LinOpBCType::Periodic) return true;
39 else return false;
40}
41bool IsNeumann(int bctype)
42{
43 //if (bctype == INT_DIR) return true;
44 //if (bctype == Interior) return true;
45 if (bctype == (int)amrex::LinOpBCType::Neumann) return true;
46 else return false;
47}
48bool IsDirichlet(int bctype)
49{
50 if (bctype == (int)amrex::BCType::mathematicalBndryTypes::ext_dir) return true;
51 if (bctype == (int)amrex::LinOpBCType::Dirichlet) return true;
52 else return false;
53}
54bool IsReflectEven(int bctype)
55{
56 if (bctype == (int)amrex::BCType::mathematicalBndryTypes::reflect_even) return true;
57 else return false;
58}
59bool IsReflectOdd(int bctype)
60{
61 if (bctype == (int)amrex::BCType::mathematicalBndryTypes::reflect_odd) return true;
62 else return false;
63}
64}
65}
bool IsDirichlet(int bctype)
Definition BC.cpp:48
bool IsPeriodic(int bctype)
Definition BC.cpp:33
bool IsNeumann(int bctype)
Definition BC.cpp:41
bool IsReflectOdd(int bctype)
Definition BC.cpp:59
bool IsReflectEven(int bctype)
Definition BC.cpp:54
int ReadString(std::string bcstring)
Definition BC.cpp:8
Collection of boundary condition (BC) objects.
Definition BC.cpp:5