diff --git a/example/advection/advection_driver.cpp b/example/advection/advection_driver.cpp index b6890ede133c..43c3ca3e7c9e 100644 --- a/example/advection/advection_driver.cpp +++ b/example/advection/advection_driver.cpp @@ -149,8 +149,7 @@ TaskCollection AdvectionDriver::MakeTaskCollection(BlockList_t &blocks, const in // set physical boundaries // note "false" in call to ApplyBoundaryConditions. // AddTask is not smart enough to resolve function overloads or default arguments. - auto set_bc = - tl.AddTask(prolongBound, parthenon::ApplyBoundaryConditions, sc1, false); + auto set_bc = tl.AddTask(prolongBound, parthenon::ApplyBoundaryConditions, sc1); // fill in derived fields auto fill_derived = diff --git a/src/bvals/boundary_conditions.cpp b/src/bvals/boundary_conditions.cpp index 4dc7eb3ac519..05a27bbd33d2 100644 --- a/src/bvals/boundary_conditions.cpp +++ b/src/bvals/boundary_conditions.cpp @@ -45,7 +45,7 @@ TaskStatus ProlongateBoundaries(std::shared_ptr> &rc) { rc->RestrictBoundaries(); // Step 1: restrict physical boundaries // Step 2. Re-apply physical boundaries on the coarse boundary, - ApplyBoundaryConditions(rc, true); + ApplyBoundaryConditionsOnCoarseOrFine(rc, true); // Step 3. Finally, the ghost-ghost zones are ready for prolongation: rc->ProlongateBoundaries(); @@ -53,8 +53,8 @@ TaskStatus ProlongateBoundaries(std::shared_ptr> &rc) { return TaskStatus::complete; } -TaskStatus ApplyBoundaryConditions(std::shared_ptr> &rc, - bool coarse) { +TaskStatus ApplyBoundaryConditionsOnCoarseOrFine(std::shared_ptr> &rc, + bool coarse) { using namespace boundary_cond_impl; std::shared_ptr pmb = rc->GetBlockPointer(); Mesh *pmesh = pmb->pmy_mesh; diff --git a/src/bvals/boundary_conditions.hpp b/src/bvals/boundary_conditions.hpp index 388e1444f332..eca4abe58a62 100644 --- a/src/bvals/boundary_conditions.hpp +++ b/src/bvals/boundary_conditions.hpp @@ -30,8 +30,12 @@ using BValFunc = std::function> &, bool TaskStatus ProlongateBoundaries(std::shared_ptr> &rc); -TaskStatus ApplyBoundaryConditions(std::shared_ptr> &rc, - bool coarse = false); +TaskStatus ApplyBoundaryConditionsOnCoarseOrFine(std::shared_ptr> &rc, + bool coarse); + +inline TaskStatus ApplyBoundaryConditions(std::shared_ptr> &rc) { + return ApplyBoundaryConditionsOnCoarseOrFine(rc, false); +} namespace BoundaryFunction { diff --git a/src/interface/meshblock_data.cpp b/src/interface/meshblock_data.cpp index c46e7a238bd7..161a3e1aac76 100644 --- a/src/interface/meshblock_data.cpp +++ b/src/interface/meshblock_data.cpp @@ -818,46 +818,16 @@ TaskStatus MeshBlockData::ClearBoundary(BoundaryCommSubset phase) { template void MeshBlockData::RestrictBoundaries() { + // TODO(JMM): Change this upon refactor of BoundaryValues auto pmb = GetBlockPointer(); pmb->pbval->RestrictBoundaries(); - // TODO(JMM): once we have variable-level pbvals we can do this - /* - for (auto &v : varVector_) { - if (v->IsSet(Metadata::FillGhost)) { - v->pbvals->RestrictBoundaries(); - } - } - for (auto &sv : sparseVector_) { - if (sv->IsSet(Metadata::FillGhost)) { - CellVariableVector vvec = sv->GetVector(); - for (auto &v : vvec) { - v->pbvals->RestrictBoundaries(); - } - } - } - */ } template void MeshBlockData::ProlongateBoundaries() { + // TODO(JMM): Change this upon refactor of BoundaryValues auto pmb = GetBlockPointer(); pmb->pbval->ProlongateBoundaries(); - // TODO(JMM): once we have variable-level pbvals we can do this - /* - for (auto &v : varVector_) { - if (v->IsSet(Metadata::FillGhost)) { - v->pbvals->ProlongateBoundaries(); - } - } - for (auto &sv : sparseVector_) { - if (sv->IsSet(Metadata::FillGhost)) { - CellVariableVector vvec = sv->GetVector(); - for (auto &v : vvec) { - v->pbvals->ProlongateBoundaries(); - } - } - } - */ } template diff --git a/src/mesh/mesh.cpp b/src/mesh/mesh.cpp index 597a5f4c8d6d..1274b2a67a91 100644 --- a/src/mesh/mesh.cpp +++ b/src/mesh/mesh.cpp @@ -75,12 +75,12 @@ Mesh::Mesh(ParameterInput *pin, ApplicationInput *app_in, Properties_t &properti pin->GetInteger("parthenon/mesh", "nx2"), pin->GetInteger("parthenon/mesh", "nx3")}, mesh_bcs{ - GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ix1_bc", "periodic")), - GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ox1_bc", "periodic")), - GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ix2_bc", "periodic")), - GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ox2_bc", "periodic")), - GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ix3_bc", "periodic")), - GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ox3_bc", "periodic"))}, + GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ix1_bc", "reflecting")), + GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ox1_bc", "reflecting")), + GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ix2_bc", "reflecting")), + GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ox2_bc", "reflecting")), + GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ix3_bc", "reflecting")), + GetBoundaryFlag(pin->GetOrAddString("parthenon/mesh", "ox3_bc", "reflecting"))}, ndim((mesh_size.nx3 > 1) ? 3 : ((mesh_size.nx2 > 1) ? 2 : 1)), adaptive(pin->GetOrAddString("parthenon/mesh", "refinement", "none") == "adaptive" ? true