Skip to content

Commit

Permalink
some nse_test cleaning (#2653)
Browse files Browse the repository at this point in the history
quiet clang-tidy warnings
redirect convergence output into files
this also makes it use simplified-SDC by default
  • Loading branch information
zingale authored Feb 19, 2024
1 parent 73aacc4 commit 56d243e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions Exec/reacting_tests/nse_test/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ USE_MPI = TRUE

USE_REACT = TRUE

USE_SIMPLIFIED_SDC := TRUE

CASTRO_HOME ?= ../../..

Expand Down
11 changes: 7 additions & 4 deletions Exec/reacting_tests/nse_test/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nse_test
# `nse_test`

This is a simple test problem designed to explore how well hydro and
reactions are coupled when a system enters NSE.
Expand All @@ -7,7 +7,10 @@ This version is based on ``reacting_convergence`` (which is in turn
based on ``acoustic_pulse_general``), but using the ``aprox19``
network with the NSE table enabled.

You can run the Strang convergence test with the script convergence_strang.sh
You can run the simplified-SDC convergence test with the script
`convergence_simplified_sdc_w_vel.sh`

The script `create_pretty_tables.py` will take the 2 (or 3) output
files and make a single LaTeX-formatted table of the results. Use
the `--simple` argument to format in plaintext.

The script create_pretty_tables.py will take the 2 output files and
make a single LaTeX-formatted table of the results.
10 changes: 5 additions & 5 deletions Exec/reacting_tests/nse_test/convergence_simplified_sdc_w_vel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ problem.u0=1.e8
problem.v0=1.e8
"

mpiexec -n 8 ${EXEC} inputs.32 ${RUNPARAMS} >& /dev/null
mpiexec -n 8 ${EXEC} inputs.64 ${RUNPARAMS} >& /dev/null
mpiexec -n 8 ${EXEC} inputs.128 ${RUNPARAMS} >& /dev/null
mpiexec -n 8 ${EXEC} inputs.32 ${RUNPARAMS} >& 32.out
mpiexec -n 8 ${EXEC} inputs.64 ${RUNPARAMS} >& 64.out
mpiexec -n 8 ${EXEC} inputs.128 ${RUNPARAMS} >& 128.out

RichardsonConvergenceTest2d.gnu.ex coarFile=nse_test_32_plt00080 mediFile=nse_test_64_plt00160 fineFile=nse_test_128_plt00320 >& nse_convergence_simple_sdc_vlo.out

mpiexec -n 8 ${EXEC} inputs.256 ${RUNPARAMS} >& /dev/null
mpiexec -n 8 ${EXEC} inputs.256 ${RUNPARAMS} >& 256.out

RichardsonConvergenceTest2d.gnu.ex coarFile=nse_test_64_plt00160 mediFile=nse_test_128_plt00320 fineFile=nse_test_256_plt00640 >& nse_convergence_simple_sdc_lo.out

mpiexec -n 8 ${EXEC} inputs.512 ${RUNPARAMS} >& /dev/null
mpiexec -n 8 ${EXEC} inputs.512 ${RUNPARAMS} >& 512.out

RichardsonConvergenceTest2d.gnu.ex coarFile=nse_test_128_plt00320 mediFile=nse_test_256_plt00640 fineFile=nse_test_512_plt01280 >& nse_convergence_simple_sdc_hi.out

Expand Down
9 changes: 4 additions & 5 deletions Exec/reacting_tests/nse_test/problem_initialize_state_data.H
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ void problem_initialize_state_data (int i, int j, int k,
Array4<Real> const& state,
const GeometryData& geomdata)
{
int coord_type = geomdata.Coord();

const Real* dx = geomdata.CellSize();
const Real* problo = geomdata.ProbLo();
Expand Down Expand Up @@ -101,11 +100,11 @@ void problem_initialize_state_data (int i, int j, int k,
// since the species are interpolated, normalize them

Real sumX = 0.0_rt;
for (int n = 0; n < NumSpec; n++) {
sumX += burn_state.xn[n];
for (auto X : burn_state.xn) {
sumX += X;
}
for (int n = 0; n < NumSpec; n++) {
burn_state.xn[n] /= sumX;
for (auto & X : burn_state.xn) {
X /= sumX;
}

#ifdef NSE_NET
Expand Down

0 comments on commit 56d243e

Please sign in to comment.