src/bvals/bvals_cc.cpp
//----------------------------------------------------------------------------------------
//! \fn int BoundaryValues::LoadCellCenteredBoundaryBufferToCoarser(AthenaArray<Real> &src,
//          int ns, int ne, AthenaArray<Real> &cbuf, Real *buf, const NeighborBlock& nb)
//  \brief Set hydro boundary buffers for sending to a block on the coarser level
\fn int BoundaryValues::LoadCellCenteredBoundaryBufferToCoarser(AthenaArray &src,
int ns, int ne, AthenaArray &cbuf, Real *buf, const NeighborBlock& nb)
\brief Set hydro boundary buffers for sending to a block on the coarser level
\ fn int BoundaryValues :: LoadCellCenteredBoundaryBufferToCoarser ( AthenaArray &src int ns int ne AthenaArray &cbuf Real * buf const NeighborBlock& nb ) \ brief Set hydro boundary buffers for sending to a block on the coarser level
int BoundaryValues::LoadCellCenteredBoundaryBufferToCoarser(AthenaArray<Real> &src,
    int ns, int ne, Real *buf, AthenaArray<Real> &cbuf, const NeighborBlock& nb)
{
  MeshBlock *pmb=pmy_block_;
  MeshRefinement *pmr=pmb->pmr;
  int si, sj, sk, ei, ej, ek;
  int cn=pmb->cnghost-1;
  si=(nb.ox1>0)?(pmb->cie-cn):pmb->cis;
  ei=(nb.ox1<0)?(pmb->cis+cn):pmb->cie;
  sj=(nb.ox2>0)?(pmb->cje-cn):pmb->cjs;
  ej=(nb.ox2<0)?(pmb->cjs+cn):pmb->cje;
  sk=(nb.ox3>0)?(pmb->cke-cn):pmb->cks;
  ek=(nb.ox3<0)?(pmb->cks+cn):pmb->cke;
  int p=0;
  pmr->RestrictCellCenteredValues(src, cbuf, ns, ne,
                                  si, ei, sj, ej, sk, ek);
  BufferUtility::Pack4DData(cbuf, buf, ns, ne,
                            si, ei, sj, ej, sk, ek, p);
  return p;
}
int BoundaryValues :: LoadCellCenteredBoundaryBufferToCoarser ( AthenaArray < Real > & src , int ns , int ne , Real * buf , AthenaArray < Real > & cbuf , const NeighborBlock & nb ) { MeshBlock * pmb = pmy_block_ ; MeshRefinement * pmr = pmb -> pmr ; int si , sj , sk , ei , ej , ek ; int cn = pmb -> cnghost - 1 ; si = ( nb . ox1 > 0 ) ? ( pmb -> cie - cn ) : pmb -> cis ; ei = ( nb . ox1 < 0 ) ? ( pmb -> cis + cn ) : pmb -> cie ; sj = ( nb . ox2 > 0 ) ? ( pmb -> cje - cn ) : pmb -> cjs ; ej = ( nb . ox2 < 0 ) ? ( pmb -> cjs + cn ) : pmb -> cje ; sk = ( nb . ox3 > 0 ) ? ( pmb -> cke - cn ) : pmb -> cks ; ek = ( nb . ox3 < 0 ) ? ( pmb -> cks + cn ) : pmb -> cke ; int p = 0 ; pmr -> RestrictCellCenteredValues ( src , cbuf , ns , ne , si , ei , sj , ej , sk , ek ) ; BufferUtility :: Pack4DData ( cbuf , buf , ns , ne , si , ei , sj , ej , sk , ek , p ) ; return p ; }
\fn int BoundaryValues::LoadCellCenteredBoundaryBufferToCoarser(AthenaArray<Real> &src,
int ns, int ne, AthenaArray<Real> &cbuf, Real *buf, const NeighborBlock& nb)
\brief Set hydro boundary buffers for sending to a block on the coarser level
\ fn int BoundaryValues :: LoadCellCenteredBoundaryBufferToCoarser ( AthenaArray<Real > &src int ns int ne AthenaArray<Real > &cbuf Real * buf const NeighborBlock& nb ) \ brief Set hydro boundary buffers for sending to a block on the coarser level