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

Function ca_dertpert

Exec/reacting_tests/reacting_bubble/Problem_Derive.cpp:171–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169
170
171void ca_dertpert(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
172 const FArrayBox& datfab, const Geometry& geomdata,
173 Real /*time*/, const int* /*bcrec*/, int /*level*/)
174{
175
176 // derive the temperature perturbation
177
178 const auto dx = geomdata.CellSizeArray();
179 const auto problo = geomdata.ProbLoArray();
180
181 auto const dat = datfab.array();
182 auto const der = derfab.array();
183
184 amrex::ParallelFor(bx,
185 [=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
186 {
187
188 Real x = problo[0] + dx[0] * (static_cast<Real>(i) + 0.5_rt);
189
190 Real y = 0.0;
191#if AMREX_SPACEDIM >= 2
192 y = problo[1] + dx[1] * (static_cast<Real>(j) + 0.5_rt);
193#endif
194
195 Real z = 0.0;
196#if AMREX_SPACEDIM == 3
197 z = problo[2] + dx[2] * (static_cast<Real>(k) + 0.5_rt);
198#endif
199
200#if AMREX_SPACEDIM == 2
201 Real height = y;
202#else
203 Real height = z;
204#endif
205
206 Real temp = interpolate(height, model::itemp);
207
208 der(i,j,k,0) = dat(i,j,k,UTEMP) - temp;
209
210 });
211
212}
213

Callers

nothing calls this directly

Calls 1

interpolateFunction · 0.85

Tested by

no test coverage detected