parthenon-hpc-lab / parthenon

Parthenon AMR infrastructure
https://parthenon-hpc-lab.github.io/parthenon/
Other
125 stars 37 forks source link

Bondary conditions coarse/fine? #1213

Open pgrete opened 4 days ago

pgrete commented 4 days ago

I just noticed that AddBoundaryExchangeTasks set boundaries on fine and coarse cells:

  if (md->GetMeshPointer()->multilevel) {
    auto cbound = tl.AddTask(set, TF(ApplyBoundaryConditionsOnCoarseOrFineMD), md, true);
    pro = tl.AddTask(cbound, TF(ProlongateBounds<bounds>), md);
  }
  auto fbound = tl.AddTask(pro, TF(ApplyBoundaryConditionsOnCoarseOrFineMD), md, false)

whereas the manual functions (both MD and block)

TaskStatus ApplyBoundaryConditionsMD(std::shared_ptr<MeshData<Real>> &pmd) {
  for (int b = 0; b < pmd->NumBlocks(); ++b)
    ApplyBoundaryConditions(pmd->GetBlockData(b));
  return TaskStatus::complete;
}

inline TaskStatus ApplyBoundaryConditions(std::shared_ptr<MeshBlockData<Real>> &rc) {
  return ApplyBoundaryConditionsOnCoarseOrFine(rc, false);
}

only set boundaries on fine cells.

I don't think this is intentional, isn't it? And we should probably add the logic of the top block also the the bottom block, don't we? @Yurlungur @lroberts36

Yurlungur commented 4 days ago

The standalone tasks should be setting bounds on both coarse and fine. I think this is a mistake.