| 114 | |
| 115 | |
| 116 | advance_status |
| 117 | Castro::initialize_do_advance (Real time, Real dt) |
| 118 | { |
| 119 | amrex::ignore_unused(time); |
| 120 | |
| 121 | BL_PROFILE("Castro::initialize_do_advance()"); |
| 122 | |
| 123 | advance_status status {}; |
| 124 | |
| 125 | #ifdef RADIATION |
| 126 | // make sure these are filled to avoid check/plot file errors: |
| 127 | if (do_radiation) { |
| 128 | get_old_data(Rad_Type).setBndry(0.0); |
| 129 | get_new_data(Rad_Type).setBndry(0.0); |
| 130 | } |
| 131 | else { |
| 132 | get_old_data(Rad_Type).setVal(0.0); |
| 133 | get_new_data(Rad_Type).setVal(0.0); |
| 134 | } |
| 135 | #endif |
| 136 | |
| 137 | #ifdef GRAVITY |
| 138 | if (moving_center == 1) { |
| 139 | define_new_center(get_old_data(State_Type), time); |
| 140 | } |
| 141 | #endif |
| 142 | |
| 143 | // For the hydrodynamics update we need to have NUM_GROW ghost |
| 144 | // zones available, but the state data does not carry ghost |
| 145 | // zones. So we use a FillPatch using the state data to give us |
| 146 | // Sborder, which does have ghost zones. |
| 147 | |
| 148 | if (time_integration_method == CornerTransportUpwind || time_integration_method == SimplifiedSpectralDeferredCorrections) { |
| 149 | #ifdef MHD |
| 150 | MultiFab& Bx_old = get_old_data(Mag_Type_x); |
| 151 | MultiFab& By_old = get_old_data(Mag_Type_y); |
| 152 | MultiFab& Bz_old = get_old_data(Mag_Type_z); |
| 153 | |
| 154 | Bx_old_tmp.define(Bx_old.boxArray(), Bx_old.DistributionMap(), 1, NUM_GROW); |
| 155 | By_old_tmp.define(By_old.boxArray(), By_old.DistributionMap(), 1, NUM_GROW); |
| 156 | Bz_old_tmp.define(Bz_old.boxArray(), Bz_old.DistributionMap(), 1, NUM_GROW); |
| 157 | |
| 158 | FillPatch(*this, Bx_old_tmp, NUM_GROW, time, Mag_Type_x, 0, 1); |
| 159 | FillPatch(*this, By_old_tmp, NUM_GROW, time, Mag_Type_y, 0, 1); |
| 160 | FillPatch(*this, Bz_old_tmp, NUM_GROW, time, Mag_Type_z, 0, 1); |
| 161 | #endif |
| 162 | // for the CTU unsplit method, we always start with the old |
| 163 | // state note: although clean_state has already been done on |
| 164 | // the old state in initialize_advance, we still need to do |
| 165 | // another here to ensure the ghost zones are thermodynamically |
| 166 | // consistent |
| 167 | Sborder.define(grids, dmap, NUM_STATE, NUM_GROW, MFInfo().SetTag("Sborder")); |
| 168 | const Real prev_time = state[State_Type].prevTime(); |
| 169 | expand_state(Sborder, prev_time, NUM_GROW); |
| 170 | clean_state( |
| 171 | #ifdef MHD |
| 172 | Bx_old_tmp, By_old_tmp, Bz_old_tmp, |
| 173 | #endif |
no test coverage detected