1 #include "../coordinates/coordinates.hpp"
2 #include "../hydro/hydro.hpp"
3 #include "../hydro/srcterms/hydro_srcterms.hpp"
4 #include "../reconstruct/interpolation.hpp"
13 grav_ = pmb->phydro->hsrc.GetG1();
18 int is = pmb->is, js = pmb->js, ks = pmb->ks;
19 int ie = pmb->ie, je = pmb->je, ke = pmb->ke;
21 for (
int k = ks; k <= ke; ++k)
22 for (
int j = js;
j <= je; ++
j)
23 for (
int i = is; i <= ie + 1; ++i) {
26 pf_(k,
j, i) = sqrt(w(IPR, k,
j, i - 1) * w(IPR, k,
j, i));
30 for (
int k = ks; k <= ke; ++k)
31 for (
int j = js;
j <= je; ++
j)
32 for (
int i = is; i <= ie; ++i) {
33 Real dx = pmb->pcoord->dx1f(i);
35 (
pf_(k,
j, i) -
pf_(k,
j, i + 1)) / (dx * w(IDN, k,
j, i)) +
grav_;
39 bool has_top_neighbor =
false;
40 bool has_bot_neighbor =
false;
41 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
42 NeighborBlock& nb = pmb->pbval->neighbor[n];
43 if ((nb.ni.ox1 == -1) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 0))
44 has_bot_neighbor =
true;
45 if ((nb.ni.ox1 == 1) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 0))
46 has_top_neighbor =
true;
49 if (!has_bot_neighbor) {
50 for (
int k = ks; k <= ke; ++k)
51 for (
int j = js;
j <= je; ++
j)
data(k,
j, is) =
data(k,
j, is + 1);
54 if (!has_top_neighbor) {
55 for (
int k = ks; k <= ke; ++k)
56 for (
int j = js;
j <= je; ++
j)
data(k,
j, ie) =
data(k,
j, ie - 1);
void Finalize(AthenaArray< Real > const &w)