| 198 | } |
| 199 | |
| 200 | void |
| 201 | Castro::read_params () |
| 202 | { |
| 203 | static bool done = false; |
| 204 | |
| 205 | if (done) { |
| 206 | return; |
| 207 | } |
| 208 | |
| 209 | done = true; |
| 210 | |
| 211 | // this gets all of the parameters defined in _cpp_params, regardless of |
| 212 | // namespace |
| 213 | initialize_cpp_runparams(); |
| 214 | |
| 215 | ParmParse pp("castro"); |
| 216 | ParmParse ppa("amr"); |
| 217 | |
| 218 | using namespace castro; |
| 219 | |
| 220 | |
| 221 | // Get boundary conditions |
| 222 | Vector<int> lo_bc(AMREX_SPACEDIM), hi_bc(AMREX_SPACEDIM); |
| 223 | pp.getarr("lo_bc",lo_bc,0,AMREX_SPACEDIM); |
| 224 | pp.getarr("hi_bc",hi_bc,0,AMREX_SPACEDIM); |
| 225 | for (int i = 0; i < AMREX_SPACEDIM; i++) |
| 226 | { |
| 227 | phys_bc.setLo(i,lo_bc[i]); |
| 228 | phys_bc.setHi(i,hi_bc[i]); |
| 229 | } |
| 230 | |
| 231 | const Geometry& dgeom = DefaultGeometry(); |
| 232 | |
| 233 | // |
| 234 | // Check phys_bc against possible periodic geometry |
| 235 | // if periodic, must have internal BC marked. |
| 236 | // |
| 237 | if (dgeom.isAnyPeriodic()) |
| 238 | { |
| 239 | // |
| 240 | // Do idiot check. Periodic means interior in those directions. |
| 241 | // |
| 242 | for (int dir = 0; dir<AMREX_SPACEDIM; dir++) |
| 243 | { |
| 244 | if (dgeom.isPeriodic(dir)) |
| 245 | { |
| 246 | if (lo_bc[dir] != amrex::PhysBCType::interior) |
| 247 | { |
| 248 | std::cerr << "Castro::read_params:periodic in direction " |
| 249 | << dir |
| 250 | << " but low BC is not Interior\n"; |
| 251 | amrex::Error(); |
| 252 | } |
| 253 | if (hi_bc[dir] != amrex::PhysBCType::interior) |
| 254 | { |
| 255 | std::cerr << "Castro::read_params:periodic in direction " |
| 256 | << dir |
| 257 | << " but high BC is not Interior\n"; |
nothing calls this directly
no test coverage detected