2 #include <athena/coordinates/coordinates.hpp>
3 #include <athena/hydro/hydro.hpp>
4 #include <athena/mesh/mesh.hpp>
13 Real grav = -pmb->phydro->hsrc.GetG1();
14 int is = pmb->is, ie = pmb->ie;
16 if (pmb->pbval->block_bcs[inner_x1] == BoundaryFlag::reflect) {
17 for (
int k = kl; k <= ku; ++k)
18 for (
int j = jl;
j <= ju; ++
j)
19 for (
int i = 1; i <= NGHOST; ++i) {
20 psf(k,
j, is - i) = psf(k,
j, is + i);
21 w(IPR, k,
j, is - i) = w(IPR, k,
j, is + i - 1);
22 w(IDN, k,
j, is - i) = -w(IDN, k,
j, is + i - 1);
24 }
else if (pmb->pbval->block_bcs[inner_x1] == BoundaryFlag::outflow) {
25 for (
int k = kl; k <= ku; ++k)
26 for (
int j = jl;
j <= ju; ++
j)
27 for (
int i = 1; i <= NGHOST; ++i) {
28 psf(k,
j, is - i) = psf(k,
j, is - i + 1) +
29 grav * w(IDN, k,
j, is - i) * pco->dx1f(is - i);
30 w(IPR, k,
j, is - i) = w(IPR, k,
j, is);
31 w(IDN, k,
j, is - i) = 0.;
35 if (pmb->pbval->block_bcs[outer_x1] == BoundaryFlag::reflect) {
36 for (
int k = kl; k <= ku; ++k)
37 for (
int j = jl;
j <= ju; ++
j)
38 for (
int i = 1; i <= NGHOST; ++i) {
39 psf(k,
j, ie + i + 1) = psf(k,
j, ie - i);
40 w(IPR, k,
j, ie + i) = w(IPR, k,
j, ie - i + 1);
41 w(IDN, k,
j, ie + i) = -w(IDN, k,
j, ie - i + 1);
43 }
else if (pmb->pbval->block_bcs[outer_x1] == BoundaryFlag::outflow) {
44 for (
int k = kl; k <= ku; ++k)
45 for (
int j = jl;
j <= ju; ++
j)
46 for (
int i = 1; i <= NGHOST; ++i) {
47 psf(k,
j, ie + i + 1) = psf(k,
j, ie + i) - grav *
48 w(IDN, k,
j, ie + i) *
50 w(IPR, k,
j, ie + i) = w(IPR, k,
j, ie);
51 w(IDN, k,
j, ie + i) = 0.;
void ApplyHydroBoundary(AthenaArray< Real > &w, AthenaArray< Real > &psf, int kl, int ku, int jl, int ju)