Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Src/Amr/AMReX_Amr.H
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,7 @@ protected:
LevelBld* levelbld;
bool abort_on_stream_retry_failure;
int stream_max_tries;
int regrid_level0_int;
int loadbalance_with_workestimates;
int loadbalance_level0_int;
Real loadbalance_max_fac;
Expand Down
19 changes: 14 additions & 5 deletions Src/Amr/AMReX_Amr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,9 @@ Amr::InitAmr ()
#undef STRIP
}

regrid_level0_int = -1;
pp.query("regrid_level0_int", regrid_level0_int);

loadbalance_with_workestimates = 0;
pp.query("loadbalance_with_workestimates", loadbalance_with_workestimates);

Expand Down Expand Up @@ -1935,16 +1938,13 @@ Amr::timeStep (int level,
// Update so that by default, we don't force a post-step regrid.
amr_level[level]->setPostStepRegrid(0);

if(max_level==0 && force_regrid_level_zero){
regrid_level_0_on_restart();
}

//
// Allow regridding of level 0 calculation on restart.
//
if (max_level == 0 && regrid_on_restart)
if (max_level == 0 && (regrid_on_restart || force_regrid_level_zero))
{
regrid_level_0_on_restart();
level_count[0] = 0;
}
else
{
Expand Down Expand Up @@ -1994,6 +1994,15 @@ Amr::timeStep (int level,
}
}

if (max_level == 0 && regrid_level0_int > 0)
{
if (level_count[0] >= regrid_level0_int)
{
regrid_level_0_on_restart();
level_count[0] = 0;
}
}

if (max_level == 0 && loadbalance_level0_int > 0 && loadbalance_with_workestimates)
{
if (level_steps[0] == 1 || level_count[0] >= loadbalance_level0_int) {
Expand Down
Loading