2 #include <athena/bvals/bvals.hpp>
3 #include <athena/mesh/mesh.hpp>
11 NeighborBlock *pbot =
nullptr;
13 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
14 NeighborBlock *nb = pmb->pbval->neighbor + n;
15 if ((nb->ni.ox1 == -1) && (nb->ni.ox2 == 0) && (nb->ni.ox3 == 0)) pbot = nb;
22 NeighborBlock *ptop =
nullptr;
24 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
25 NeighborBlock *nb = pmb->pbval->neighbor + n;
26 if ((nb->ni.ox1 == 1) && (nb->ni.ox2 == 0) && (nb->ni.ox3 == 0)) ptop = nb;
33 NeighborBlock *pleft =
nullptr;
35 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
36 NeighborBlock *nb = pmb->pbval->neighbor + n;
37 if ((nb->ni.ox1 == 0) && (nb->ni.ox2 == -1) && (nb->ni.ox3 == 0))
45 NeighborBlock *pright =
nullptr;
47 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
48 NeighborBlock *nb = pmb->pbval->neighbor + n;
49 if ((nb->ni.ox1 == 1) && (nb->ni.ox2 == 1) && (nb->ni.ox3 == 0))
57 NeighborBlock *pback =
nullptr;
59 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
60 NeighborBlock *nb = pmb->pbval->neighbor + n;
61 if ((nb->ni.ox1 == 0) && (nb->ni.ox2 == 0) && (nb->ni.ox3 == -1))
69 NeighborBlock *pfront =
nullptr;
71 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
72 NeighborBlock *nb = pmb->pbval->neighbor + n;
73 if ((nb->ni.ox1 == 1) && (nb->ni.ox2 == 1) && (nb->ni.ox3 == 1))
81 NeighborBlock *bblock, NeighborBlock *tblock) {
84 bblock->snb.rank = -1;
88 tblock->snb.rank = -1;
90 for (
int n = 0; n < pmb->pbval->nneighbor; ++n) {
91 NeighborBlock &nb = pmb->pbval->neighbor[n];
93 if ((nb.ni.ox1 == -1) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 0))
95 if ((nb.ni.ox1 == 1) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 0))
97 }
else if (dir == X2DIR) {
98 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == -1) && (nb.ni.ox3 == 0))
100 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == 1) && (nb.ni.ox3 == 0))
103 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == -1))
105 if ((nb.ni.ox1 == 0) && (nb.ni.ox2 == 0) && (nb.ni.ox3 == 1))
NeighborBlock const * find_back_neighbor(MeshBlock const *pmb)
find back neighbor block
NeighborBlock const * find_left_neighbor(MeshBlock const *pmb)
find left neighbor block
NeighborBlock const * find_front_neighbor(MeshBlock const *pmb)
find front neighbor block
NeighborBlock const * find_bot_neighbor(MeshBlock const *pmb)
find bottom neighbor block
NeighborBlock const * find_top_neighbor(MeshBlock const *pmb)
find top neighbor block
NeighborBlock const * find_right_neighbor(MeshBlock const *pmb)
find right neighbor block
void find_neighbors(MeshBlock const *pmb, CoordinateDirection dir, NeighborBlock *bblock, NeighborBlock *tblock)
find neighbors in one coordinate direction