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

Method applyMetricTerms

Source/gravity/Gravity.cpp:2862–2891  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2860
2861#if (AMREX_SPACEDIM < 3)
2862void
2863Gravity::applyMetricTerms(int level, MultiFab& Rhs, const Vector<MultiFab*>& coeffs) const
2864{
2865 BL_PROFILE("Gravity::applyMetricTerms()");
2866
2867 const auto dx = parent->Geom(level).CellSizeArray();
2868 const auto problo = parent->Geom(level).ProbLoArray();
2869 const int coord_type = parent->Geom(level).Coord();
2870
2871#ifdef _OPENMP
2872#pragma omp parallel
2873#endif
2874 for (MFIter mfi(Rhs, TilingIfNotGPU()); mfi.isValid(); ++mfi)
2875 {
2876 const Box& bx = mfi.growntilebox(1);
2877 const Box& xbx = mfi.nodaltilebox(0);
2878#if AMREX_SPACEDIM >= 2
2879 const Box& ybx = mfi.nodaltilebox(1);
2880#endif
2881
2882 // Modify Rhs and coeffs with the appropriate metric terms.
2883 apply_metric(bx,
2884 Rhs.array(mfi), (Rhs[mfi]).box(),
2885 (*coeffs[0]).array(mfi), xbx,
2886#if AMREX_SPACEDIM >= 2
2887 (*coeffs[1]).array(mfi), ybx,
2888#endif
2889 problo, dx, coord_type);
2890 }
2891}
2892
2893#endif
2894

Callers

nothing calls this directly

Calls 2

apply_metricFunction · 0.85
isValidMethod · 0.80

Tested by

no test coverage detected