Skip to content

Commit

Permalink
only do new gridding if max_grid_size not set (erf-model#1854)
Browse files Browse the repository at this point in the history
  • Loading branch information
asalmgren authored Oct 7, 2024
1 parent 0f89138 commit 444a187
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/ERF_make_new_level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,14 @@ void ERF::MakeNewLevelFromScratch (int lev, Real time, const BoxArray& ba_in,
{
BoxArray ba;
DistributionMapping dm;
if (lev == 0 && ba_in.size() != ParallelDescriptor::NProcs())
Box domain(Geom(0).Domain());
if (lev == 0 &&
(max_grid_size[0][0] >= domain.length(0)) &&
(max_grid_size[0][1] >= domain.length(1)) &&
ba_in.size() != ParallelDescriptor::NProcs())
{
// We only decompose in z if max_grid_size_z indicates we should
bool decompose_in_z = (max_grid_size[0][2] < Geom(0).Domain().length(2));
bool decompose_in_z = (max_grid_size[0][2] < domain.length(2));

ba = ERFPostProcessBaseGrids(Geom(0).Domain(),decompose_in_z);
dm = DistributionMapping(ba);
Expand Down

0 comments on commit 444a187

Please sign in to comment.