Skip to content

Commit

Permalink
fix restart for 2d case
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnonaka committed Feb 13, 2025
1 parent b890e29 commit 3150717
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
9 changes: 4 additions & 5 deletions src_compressible_stag/Checkpoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ void ReadCheckPoint(int& step,
// spatialCrossMF
if (do_1D && all_correl) {
spatialCrossMF.define(ba,dmap,ncross*5,0); // for five x*: [0, fl(n_cells[0]/4), fl(n_cells[0]/2), fl(n_cells[0]*3/4), n_cells[0]-1]
} else if (do_2D) {
} else if (do_1D || do_2D) {
spatialCrossMF.define(ba,dmap,ncross,0);
}

Expand Down Expand Up @@ -506,11 +506,10 @@ void ReadCheckPoint(int& step,

Read_Copy_MF_Checkpoint(coVars,"coVars",checkpointname,ba_old,dmap_old,26,0);

if (do_1D && all_correl == 0) {
Read_Copy_MF_Checkpoint(spatialCrossMF,"spatialCrossMF",checkpointname,ba_old,dmap_old,ncross,0);
}
else if (do_2D) {
if (do_1D && all_correl) {
Read_Copy_MF_Checkpoint(spatialCrossMF,"spatialCrossMF",checkpointname,ba_old,dmap_old,ncross*5,0);
} else if (do_1D || do_2D) {
Read_Copy_MF_Checkpoint(spatialCrossMF,"spatialCrossMF",checkpointname,ba_old,dmap_old,ncross,0);
}

Read_Copy_MF_Checkpoint(velMeans[0],"velmeanx",checkpointname,ba_old,dmap_old,1,0,0);
Expand Down
10 changes: 5 additions & 5 deletions src_compressible_stag/main_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@ void main_driver(const char* argv)
if (do_2D and slicepoint >= 0) {
Abort("Cannot use do_2D and slicepoint");
}
if (do_2D and n_ads_spec>0 and ads_wall_dir == 2) {
Abort("do_2D with n_ads_spec>0 requires ads_wall_dir != 2");
}
if (project_dir >= 0) {
if (do_slab_sf and ((membrane_cell <= 0) or (membrane_cell >= n_cells[project_dir]-1))) {
Abort("Slab structure factor needs a membrane cell within the domain: 0 < membrane_cell < n_cells[project_dir] - 1");
Expand All @@ -268,8 +265,11 @@ void main_driver(const char* argv)
}
}
}
if ((all_correl > 1) or (all_correl < 0)) {
Abort("all_correl can be 0 or 1");
if (do_2D and n_ads_spec>0 and ads_wall_dir == 2) {
Abort("do_2D with n_ads_spec>0 requires ads_wall_dir != 2");
}
if (do_1D and n_ads_spec>0 and ads_wall_dir != 0) {
Abort("do_1D with n_ads_spec>0 requires ads_wall_dir = 0");
}
if ((all_correl == 1) and (cross_cell > 0) and (cross_cell < n_cells[0]-1)) {
amrex::Print() << "Correlations will be done at four equi-distant x* because all_correl = 1" << "\n";
Expand Down

0 comments on commit 3150717

Please sign in to comment.