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