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

Method levelACoeffs

Source/radiation/RadSolve.cpp:188–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188void RadSolve::levelACoeffs(int level,
189 MultiFab& fkp, MultiFab& eta, MultiFab& etainv,
190 Real c, Real delta_t, Real theta)
191{
192 BL_PROFILE("RadSolve::levelACoeffs");
193 const BoxArray& grids = parent->boxArray(level);
194 const DistributionMapping& dmap = parent->DistributionMap(level);
195
196 auto geomdata = parent->Geom(level).data();
197
198 // Allocate space for ABecLapacian acoeffs, fill with values
199
200 int Ncomp = 1;
201 int Nghost = 0;
202
203 MultiFab acoefs(grids, dmap, Ncomp, Nghost);
204
205#ifdef _OPENMP
206#pragma omp parallel
207#endif
208 for (MFIter mfi(fkp, TilingIfNotGPU()); mfi.isValid(); ++mfi) {
209 const Box &bx = mfi.tilebox();
210
211 auto a = acoefs[mfi].array();
212 auto fkp_arr = fkp[mfi].array();
213 auto eta_arr = eta[mfi].array();
214 auto etainv_arr = etainv[mfi].array();
215
216 const Real dtm = 1.e0_rt / delta_t;
217
218 amrex::ParallelFor(bx,
219 [=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
220 {
221 Real r, s;
222 cell_center_metric(i, j, k, geomdata, r, s);
223
224 if (AMREX_SPACEDIM == 1) {
225 s = 1.e0_rt;
226 }
227
228 a(i,j,k) = r * s *
229 (fkp_arr(i,j,k) * etainv_arr(i,j,k) * c + dtm) /
230 (1.e0_rt - (1.e0_rt - theta) * eta_arr(i,j,k));
231 });
232 }
233
234 if (hd) {
235 hd->aCoefficients(acoefs);
236 }
237 else if (hm) {
238 hm->aCoefficients(level, acoefs);
239 }
240 else if (hem) {
241 hem->aCoefficients(level, acoefs);
242 }
243}
244
245void RadSolve::levelSPas(int level, Array<MultiFab, AMREX_SPACEDIM>& lambda, int igroup,

Callers 2

single_group_updateMethod · 0.80
MGFLD_implicit_updateMethod · 0.80

Calls 3

cell_center_metricFunction · 0.85
isValidMethod · 0.80
aCoefficientsMethod · 0.45

Tested by

no test coverage detected