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

Function hse_fill

Source/problems/hse_fill.cpp:13–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11
12
13void
14hse_fill(const Box& bx, Array4<Real> const& adv,
15 Geometry const& geom, const Vector<BCRec>& bcr,
16 const Real time)
17{
18
19 amrex::ignore_unused(time);
20
21 auto domlo = geom.Domain().loVect3d();
22 auto domhi = geom.Domain().hiVect3d();
23
24 const auto *lo = bx.loVect();
25 const auto *hi = bx.hiVect();
26
27 auto adv_bx = Box(adv);
28 auto adv_lo = adv_bx.loVect3d();
29 auto adv_hi = adv_bx.hiVect3d();
30
31 auto dx = geom.CellSizeArray();
32
33 //
34 // x boundaries
35 //
36
37 // XLO
38
39 if (bcr[URHO].lo(0) == amrex::BCType::ext_dir && lo[0] < domlo[0]) {
40
41 if (xl_ext_bc_type == EXT_HSE) {
42
43 // we need to integrate in the i direction from adv_lo[0]
44 // to domlo[0]-1, but we want that to be handled by a
45 // single thread on the GPU
46
47 Box gbx(IntVect(AMREX_D_DECL(domlo[0]-1, lo[1], lo[2])),
48 IntVect(AMREX_D_DECL(domlo[0]-1, hi[1], hi[2])));
49
50 amrex::ParallelFor(gbx,
51 [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
52 {
53
54 amrex::ignore_unused(i);
55
56 Real dens_above = adv(domlo[0],j,k,URHO);
57 Real temp_above = adv(domlo[0],j,k,UTEMP);
58 Real X_zone[NumSpec];
59 for (int n = 0; n < NumSpec; n++) {
60 X_zone[n] = adv(domlo[0],j,k,UFS+n) / dens_above;
61 }
62#if NAUX_NET > 0
63 Real aux_zone[NumAux];
64 for (int n = 0; n < NumAux; n++) {
65 aux_zone[n] = adv(domlo[0],j,k,UFX+n) / dens_above;
66 }
67#endif
68
69 // keep track of the density at the base of the domain
70

Callers 1

ca_statefillFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected