| 23 | } |
| 24 | |
| 25 | void |
| 26 | Castro::construct_new_sponge_source(MultiFab& source, const MultiFab& state_old, MultiFab& state_new, |
| 27 | Real time, Real dt) |
| 28 | { |
| 29 | |
| 30 | amrex::ignore_unused(state_old); |
| 31 | amrex::ignore_unused(time); |
| 32 | |
| 33 | const Real strt_time = ParallelDescriptor::second(); |
| 34 | |
| 35 | if (!do_sponge) { |
| 36 | return; |
| 37 | } |
| 38 | |
| 39 | #ifdef _OPENMP |
| 40 | #pragma omp parallel |
| 41 | #endif |
| 42 | for (MFIter mfi(state_new, TilingIfNotGPU()); mfi.isValid(); ++mfi) |
| 43 | { |
| 44 | const Box& bx = mfi.tilebox(); |
| 45 | |
| 46 | apply_sponge(bx, state_new.array(mfi), source.array(mfi), dt); |
| 47 | } |
| 48 | |
| 49 | if (verbose > 1) |
| 50 | { |
| 51 | const int IOProc = ParallelDescriptor::IOProcessorNumber(); |
| 52 | Real run_time = ParallelDescriptor::second() - strt_time; |
| 53 | |
| 54 | #ifdef BL_LAZY |
| 55 | Lazy::QueueReduction( [=] () mutable { |
| 56 | #endif |
| 57 | ParallelDescriptor::ReduceRealMax(run_time,IOProc); |
| 58 | |
| 59 | if (ParallelDescriptor::IOProcessor()) { |
| 60 | std::cout << "Castro::construct_new_sponge_source() time = " << run_time << "\n" << "\n"; |
| 61 | } |
| 62 | #ifdef BL_LAZY |
| 63 | }); |
| 64 | #endif |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | void |
| 69 | Castro::apply_sponge(const Box& bx, |