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

   Inputs:
   * a_dir is the direction of the 5-point stencil;
   * a_inBox is the cell-centered box on which we are to compute a
     stencil (2-point or 3-point or 5-point), expanded by 1 in a_dir direction,
     and not intersected with the domain;
   * a_domain is the problem domain.

   Output boxes are all cell-centered subboxes of a_inBox and
   are also contained in a_domain:
   * a_loBox is where a 2-point stencil must be used on the low side;
   * a_nextLoBox is where a 3-point stencil must be used on the low side
     with one point lower and three points higher;
   * a_hiBox is where a 2-point stencil must be used on the high side;
   * a_nextHiBox is where a 3-point stencil must be used on the high side
     with one point higher and three points lower;
   * a_centerBox is union of a_innerCenterBox, a_nextLoBox, and a_nextHiBox,
     where a 3-point stencil may be used;
   * a_innerCenterBox is where the regular 5-point stencil can be used;
     where a 5-point stencil may be used;
   * 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 cell 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 5-point stencil of
cell-centered data is being used to compute something at the
center of the central cell of the stencil.





Each of the boxes a_loBox, a_nextLoBox, a_hiBox, a_nextHiBox
will be at most 1 cell 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 5 - point stencil of cell - centered data is being used to compute something at the center of the central cell of the stencil . Each of the boxes a_loBox a_nextLoBox a_hiBox a_nextHiBox will be at most 1 cell 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 loHiCenter5(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)
{
  loHiCenter(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 loHiCenter5 ( 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 ) { loHiCenter ( 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 5-point stencil of
cell-centered data is being used to compute something at the
center of the central cell of the stencil.
This function is used when in direction a_dir a 5 - point stencil of cell - centered data is being used to compute something at the center of the central cell of the stencil .
// Remove first row of faces from a_centerBox. // Remove last row of faces from a_centerBox.