lib/src/BoxTools/LoHiCenter.cpp
///
/**
   This function is used when in direction a_dir a 4-point stencil of
   cell-centered data is being used to compute something at the
   face between cells of the stencil.

   Inputs:
   * a_dir is the direction of the 4-point stencil;
   * a_inBox is the cell-centered box on which we have data;
   * a_domain is the problem domain.

   Output boxes are all face-centered subboxes of the faces of a_inBox
   in direction a_dir, and are also contained in the faces of a_domain:
   * a_loBox is where a stencil must be used on the low side
     with all four points higher;
   * a_nextLoBox is where a stencil must be used on the low side
     with one point lower and three points higher;
   * a_centerBox is where the regular 4-point stencil can be used;
   * a_hiBox is where a stencil must be used on the high side
     with all four points lower;
   * a_nextHiBox is where a stencil must be used on the high side
     with one point higher and three points lower;
   * a_entireBox is the union of a_(lo|nextLo|center|hi|nextHi)Box.

   Each of the boxes a_loBox, a_nextLoBox, a_hiBox, a_nextHiBox
   will be at most 1 face wide.

   a_loBox and a_nextLoBox will both be defined or both be undefined.
   a_hiBox and a_nextHiBox will both be defined or both be undefined.

   Output flags:
   * a_hasLo:  1 or 0, according to whether a_loBox and a_nextLoBox
     are defined or not;
   * a_hasHi:  1 or 0, according to whether a_hiBox and a_nextHiBox
     are defined or not.
 */
This function is used when in direction a_dir a 4-point stencil of
cell-centered data is being used to compute something at the
face between cells of the stencil.

a_dir is the direction of the 4-point stencil;
a_inBox is the cell-centered box on which we have data;
a_domain is the problem domain.

Output boxes are all face-centered subboxes of the faces of a_inBox
in direction a_dir, and are also contained in the faces of a_domain:
a_loBox is where a stencil must be used on the low side
with all four points higher;
a_nextLoBox is where a stencil must be used on the low side
with one point lower and three points higher;
a_centerBox is where the regular 4-point stencil can be used;
a_hiBox is where a stencil must be used on the high side
with all four points lower;
a_nextHiBox is where a stencil must be used on the high side
with one point higher and three points lower;
a_entireBox is the union of a_(lo|nextLo|center|hi|nextHi)Box.

Each of the boxes a_loBox, a_nextLoBox, a_hiBox, a_nextHiBox
will be at most 1 face wide.

a_loBox and a_nextLoBox will both be defined or both be undefined.
a_hiBox and a_nextHiBox will both be defined or both be undefined.

Output flags:
a_hasLo:  1 or 0, according to whether a_loBox and a_nextLoBox
are defined or not;
a_hasHi:  1 or 0, according to whether a_hiBox and a_nextHiBox
are defined or not.
This function is used when in direction a_dir a 4 - point stencil of cell - centered data is being used to compute something at the face between cells of the stencil . a_dir is the direction of the 4 - point stencil ; a_inBox is the cell - centered box on which we have data ; a_domain is the problem domain . Output boxes are all face - centered subboxes of the faces of a_inBox in direction a_dir and are also contained in the faces of a_domain : a_loBox is where a stencil must be used on the low side with all four points higher ; a_nextLoBox is where a stencil must be used on the low side with one point lower and three points higher ; a_centerBox is where the regular 4 - point stencil can be used ; a_hiBox is where a stencil must be used on the high side with all four points lower ; a_nextHiBox is where a stencil must be used on the high side with one point higher and three points lower ; a_entireBox is the union of a_ ( lo|nextLo|center|hi|nextHi ) Box . Each of the boxes a_loBox a_nextLoBox a_hiBox a_nextHiBox will be at most 1 face wide . a_loBox and a_nextLoBox will both be defined or both be undefined . a_hiBox and a_nextHiBox will both be defined or both be undefined . Output flags : a_hasLo : 1 or 0 according to whether a_loBox and a_nextLoBox are defined or not ; a_hasHi : 1 or 0 according to whether a_hiBox and a_nextHiBox are defined or not .
void loHiCenterFace4(Box&                 a_loBox,
                     Box&                 a_nextLoBox,
                     int&                 a_hasLo,
                     Box&                 a_hiBox,
                     Box&                 a_nextHiBox,
                     int&                 a_hasHi,
                     Box&                 a_centerBox,
                     Box&                 a_innerCenterBox,
                     Box&                 a_entireBox,
                     const Box&           a_inBox,
                     const ProblemDomain& a_domain,
                     const int&           a_dir)
{
  loHiCenterFace(a_loBox, a_hasLo, a_hiBox, a_hasHi,
                 a_centerBox, a_entireBox, a_inBox, a_domain, a_dir);
  a_innerCenterBox = a_centerBox;
  if (a_hasLo)
    {
      a_nextLoBox = a_loBox;
      a_nextLoBox.shift(a_dir, 1);
      int centerMin = a_centerBox.smallEnd(a_dir);
      a_innerCenterBox.setSmall(a_dir, centerMin + 1);
    }
  if (a_hasHi)
    {
      a_nextHiBox = a_hiBox;
      a_nextHiBox.shift(a_dir, -1);
      int centerMax = a_centerBox.bigEnd(a_dir);
      a_innerCenterBox.setBig(a_dir, centerMax - 1);
    }
}
void loHiCenterFace4 ( Box & a_loBox , Box & a_nextLoBox , int & a_hasLo , Box & a_hiBox , Box & a_nextHiBox , int & a_hasHi , Box & a_centerBox , Box & a_innerCenterBox , Box & a_entireBox , const Box & a_inBox , const ProblemDomain & a_domain , const int & a_dir ) { loHiCenterFace ( a_loBox , a_hasLo , a_hiBox , a_hasHi , a_centerBox , a_entireBox , a_inBox , a_domain , a_dir ) ; a_innerCenterBox = a_centerBox ; if ( a_hasLo ) { a_nextLoBox = a_loBox ; a_nextLoBox . shift ( a_dir , 1 ) ; int centerMin = a_centerBox . smallEnd ( a_dir ) ; a_innerCenterBox . setSmall ( a_dir , centerMin + 1 ) ; } if ( a_hasHi ) { a_nextHiBox = a_hiBox ; a_nextHiBox . shift ( a_dir , -1 ) ; int centerMax = a_centerBox . bigEnd ( a_dir ) ; a_innerCenterBox . setBig ( a_dir , centerMax - 1 ) ; } }
This function is used when in direction a_dir a 4-point stencil of
cell-centered data is being used to compute something at the
face between cells of the stencil.
This function is used when in direction a_dir a 4 - point stencil of cell - centered data is being used to compute something at the face between cells of the stencil .
// Remove first row of faces from a_centerBox. // Remove last row of faces from a_centerBox.