MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / construct_new_sponge_source

Method construct_new_sponge_source

Source/sources/Castro_sponge.cpp:25–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25void
26Castro::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
68void
69Castro::apply_sponge(const Box& bx,

Callers

nothing calls this directly

Calls 1

isValidMethod · 0.80

Tested by

no test coverage detected