Skip to content

Commit

Permalink
fix nvar=2 in InteriorGhostCells and add new inputs_ml for Scalar Reg…
Browse files Browse the repository at this point in the history
… tests (#1309)
  • Loading branch information
asalmgren authored Nov 19, 2023
1 parent a2bdb9e commit c78ccdb
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 7 deletions.
75 changes: 75 additions & 0 deletions Exec/RegTests/ScalarAdvDiff/inputs_ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# ------------------ INPUTS TO MAIN PROGRAM -------------------
max_step = 10

amrex.fpe_trap_invalid = 1

erf.no_substepping=0

fabarray.mfiter_tile_size = 1024 1024 1024

# PROBLEM SIZE & GEOMETRY
geometry.prob_extent = 1 1 1
amr.n_cell = 32 32 32

geometry.is_periodic = 1 1 0

zlo.type = "SlipWall"
zhi.type = "SlipWall"

# TIME STEP CONTROL
erf.fixed_dt = 5e-5
erf.fixed_fast_dt = 2.5e-5

# DIAGNOSTICS & VERBOSITY
erf.sum_interval = 1 # timesteps between computing mass
erf.v = 1 # verbosity in ERF.cpp
amr.v = 1 # verbosity in Amr.cpp

# CHECKPOINT FILES
erf.check_file = chk # root name of checkpoint file
erf.check_int = -100 # number of timesteps between checkpoints

# PLOTFILES
erf.plot_file_1 = plt # prefix of plotfile name
erf.plot_int_1 = 1 # number of timesteps between plotfiles
erf.plot_vars_1 = density rhoadv_0 x_velocity y_velocity z_velocity pressure temp theta

# SOLVER CHOICE
erf.alpha_T = 0.0
erf.alpha_C = 1.0
erf.use_gravity = false

erf.les_type = "None"
erf.molec_diff_type = "None"
erf.rho0_trans = 1.0
erf.dynamicViscosity = 0.0

erf.dycore_horiz_adv_type = "Centered_2nd"
erf.dycore_vert_adv_type = "Centered_2nd"
erf.dryscal_horiz_adv_type = "Centered_2nd"
erf.dryscal_vert_adv_type = "Centered_2nd"

erf.init_type = "uniform"
# PROBLEM PARAMETERS
prob.rho_0 = 1.0
prob.A_0 = 1.0
prob.u_0 = 100.0
prob.v_0 = 0.0

prob.prob_type = 10

# REFINEMENT / REGRIDDING
amr.max_level = 1 # maximum level number allowed

amr.ref_ratio_vect = 2 2 1
erf.refinement_indicators = box1
erf.box1.max_level = 1
erf.box1.in_box_lo = 0.25 0.0
erf.box1.in_box_hi = 0.75 1.0

erf.coupling_type = "TwoWay"
erf.coupling_type = "Mixed"
erf.coupling_type = "OneWay"

erf.cf_width = 3
erf.cf_set_width = 1
1 change: 0 additions & 1 deletion Source/BoundaryConditions/ERF_FillPatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ void ERFFillPatcher::InterpCell (MultiFab& fine,
Vector<BCRec> const& bcr,
int mask_val)
{

int ncomp = m_ncomp;
IntVect ratio = m_ratio;
IndexType m_ixt = fine.boxArray().ixType();
Expand Down
7 changes: 3 additions & 4 deletions Source/Utils/InteriorGhostCells.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,7 @@ fine_compute_interior_ghost_rhs (const Real& time,
// prim to conserved.

// Temp MF on box (distribution map differs w/ fine patch)
int num_var = 1;
if (ivar_idx == IntVar::cons) num_var = 2;
int num_var = fmf.nComp();
fmf_p_v.emplace_back(fmf.boxArray(), fmf.DistributionMap(), num_var, fmf.nGrowVect());
MultiFab& fmf_p = fmf_p_v[ivar_idx];
amrex::MultiFab::Copy(fmf_p,fmf, 0, 0, num_var, fmf.nGrowVect());
Expand Down Expand Up @@ -708,7 +707,7 @@ fine_compute_interior_ghost_rhs (const Real& time,
amrex::Real num = amrex::Real(Spec_z + Relax_z);
amrex::Real denom = amrex::Real(Relax_z - 1);
amrex::ParallelFor(vbx, num_var, [=] AMREX_GPU_DEVICE (int i, int j, int k, int n) noexcept
{
{
if (mask_arr(i,j,k) == relax_mask_val) {

// Indices
Expand Down Expand Up @@ -802,7 +801,7 @@ fine_compute_interior_ghost_rhs (const Real& time,
amrex::Real Laplacian = delta_xp + delta_xm + delta_yp + delta_ym - 4.0*delta;
rhs_arr(i,j,k,n) += (F1*delta - F2*Laplacian) * Factor;
}
});
});
} // mfi
} // ivar_idx
}
Expand Down
7 changes: 5 additions & 2 deletions Source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ void add_par () {

pp.add("max_grid_size",2048);

int bf=1;
pp.queryAdd("blocking_factor",bf);
// This will set the default value of blocking_factor to be 1, but will allow
// the user to override it in the inputs file or on command line
int blocking_factor = 1;
pp.queryAdd("blocking_factor",blocking_factor);

pp.add("n_error_buf",0);
}

Expand Down

0 comments on commit c78ccdb

Please sign in to comment.