Skip to content

Commit

Permalink
clean up the true-SDC reaction source storage (#2588)
Browse files Browse the repository at this point in the history
we don't need the fluid state there
  • Loading branch information
zingale authored Oct 2, 2023
1 parent 59df5ae commit afcf69c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 17 deletions.
21 changes: 6 additions & 15 deletions Source/driver/Castro_advance_sdc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,23 +306,17 @@ Castro::do_advance_sdc (Real time,

if (sdc_order == 4) {

// convert S_new to cell-centers
U_center.resize(obx, NUM_STATE);
Elixir elix_u_center = U_center.elixir();
auto const U_center_arr = U_center.array();

make_cell_center(obx, Sborder.array(mfi), U_center_arr, domain_lo, domain_hi);

// pass in the reaction source and state at centers, including one ghost cell
// and derive everything that is needed including 1 ghost cell
// pass in the reaction source at centers (Sburn_arr), including
// one ghost cell and derive everything that is needed including
// 1 ghost cell
R_center.resize(obx, R_new.nComp());
Elixir elix_r_center = R_center.elixir();
auto const R_center_arr = R_center.array();

Array4<const Real> const Sburn_arr = Sburn.array(mfi);

// we don't worry about the difference between centers and averages
ca_store_reaction_state(obx, Sburn_arr, U_center_arr, R_center_arr);
ca_store_reaction_state(obx, Sburn_arr, R_center_arr);

// convert R_new from centers to averages in place
tmp.resize(bx, 1);
Expand All @@ -337,13 +331,10 @@ Castro::do_advance_sdc (Real time,
} else {

Array4<const Real> const R_old_arr = R_old[SDC_NODES-1]->array(mfi);
Array4<const Real> const S_new_arr = S_new.array(mfi);
Array4<Real> const R_new_arr = R_new.array(mfi);

// we don't worry about the difference between centers and averages
ca_store_reaction_state(bx,
R_old_arr,
S_new_arr,
R_new_arr);
ca_store_reaction_state(bx, R_old_arr, R_new_arr);
}

}
Expand Down
1 change: 0 additions & 1 deletion Source/sdc/Castro_sdc.H
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ void ca_sdc_compute_initial_guess(const amrex::Box& bx,
#ifdef REACTIONS
void ca_store_reaction_state(const amrex::Box& bx,
amrex::Array4<const amrex::Real> const& R_old,
amrex::Array4<const amrex::Real> const& state,
amrex::Array4<amrex::Real> const& R_store);
#endif

Expand Down
1 change: 0 additions & 1 deletion Source/sdc/sdc_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ void Castro::ca_sdc_compute_initial_guess(const Box& bx,
#ifdef REACTIONS
void Castro::ca_store_reaction_state(const Box& bx,
Array4<const Real> const& R_old,
Array4<const Real> const& state,
Array4<Real> const& R_store)
{
// copy the data from the last node's reactive source to the state data
Expand Down

0 comments on commit afcf69c

Please sign in to comment.