Skip to content

Commit

Permalink
Some diffusion_test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zingale committed Oct 2, 2023
1 parent 4d895d9 commit aa22acf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
20 changes: 13 additions & 7 deletions Exec/unit_tests/diffusion_test/Prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ void Castro::problem_post_simulation(Vector<std::unique_ptr<AmrLevel> >& amr_lev
Castro& castro = dynamic_cast<Castro&>(*amr_level[n]);
Real time = castro.get_state_data(State_Type).curTime();

const int* domain_lo = castro.geom.Domain().loVect();
const int* domain_hi = castro.geom.Domain().hiVect();
auto domain_lo = castro.geom.Domain().loVect3d();
auto domain_hi = castro.geom.Domain().hiVect3d();

// the state data
MultiFab& S = castro.get_new_data(State_Type);
Expand All @@ -33,12 +33,18 @@ void Castro::problem_post_simulation(Vector<std::unique_ptr<AmrLevel> >& amr_lev
#ifdef TRUE_SDC
// if we are fourth-order, we need to convert to averages
if (sdc_order == 4) {
for (MFIter mfi(*analytic); mfi.isValid(); ++mfi) {
FArrayBox tmp;

const Box& gbx = mfi.growntilebox(1);
ca_make_fourth_in_place(AMREX_INT_ANYD(gbx.loVect()), AMREX_INT_ANYD(gbx.hiVect()),
BL_TO_FORTRAN_FAB((*analytic)[mfi]),
AMREX_INT_ANYD(domain_lo), AMREX_INT_ANYD(domain_hi));
for (MFIter mfi(*analytic); mfi.isValid(); ++mfi) {

const Box& bx = mfi.tilebox();
tmp.resize(bx, 1);
auto tmp_arr = tmp.array();

castro.make_fourth_in_place(bx,
analytic->array(mfi),
tmp_arr,
domain_lo, domain_hi);

}
}
Expand Down
8 changes: 4 additions & 4 deletions Exec/unit_tests/diffusion_test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ analytic solution, giving:
A convergence test of the 4th-order SDC algorithm can be run as:

```
./Castro1d.gnu.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=64
./Castro1d.gnu.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=128
./Castro1d.gnu.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=256
./Castro1d.gnu.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=512
./Castro1d.gnu.TRUESDC.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=64
./Castro1d.gnu.TRUESDC.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=128
./Castro1d.gnu.TRUESDC.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=256
./Castro1d.gnu.TRUESDC.ex inputs.1d castro.time_integration_method=2 castro.sdc_order=4 amr.n_cell=512
```

Note: this is Cartesian, not spherical (since we don't have spherical
Expand Down

0 comments on commit aa22acf

Please sign in to comment.