src/bvals/bvals_cc.cpp
//----------------------------------------------------------------------------------------
//! \fn void BoundaryValues::SetCellCenteredBoundarySameLevel(AthenaArray<Real> &dst,
//                         int ns, int ne, Real *buf, const NeighborBlock& nb, bool *flip)
//  \brief Set hydro boundary received from a block on the same level
\fn void BoundaryValues::SetCellCenteredBoundarySameLevel(AthenaArray &dst,
int ns, int ne, Real *buf, const NeighborBlock& nb, bool *flip)
\brief Set hydro boundary received from a block on the same level
\ fn void BoundaryValues :: SetCellCenteredBoundarySameLevel ( AthenaArray &dst int ns int ne Real * buf const NeighborBlock& nb bool * flip ) \ brief Set hydro boundary received from a block on the same level
void BoundaryValues::SetCellCenteredBoundarySameLevel(AthenaArray<Real> &dst,
                     int ns, int ne, Real *buf, const NeighborBlock& nb, bool *flip)
{
  MeshBlock *pmb=pmy_block_;
  int si, sj, sk, ei, ej, ek;
  if(nb.ox1==0)     si=pmb->is,        ei=pmb->ie;
  else if(nb.ox1>0) si=pmb->ie+1,      ei=pmb->ie+NGHOST;
  else              si=pmb->is-NGHOST, ei=pmb->is-1;
  if(nb.ox2==0)     sj=pmb->js,        ej=pmb->je;
  else if(nb.ox2>0) sj=pmb->je+1,      ej=pmb->je+NGHOST;
  else              sj=pmb->js-NGHOST, ej=pmb->js-1;
  if(nb.ox3==0)     sk=pmb->ks,        ek=pmb->ke;
  else if(nb.ox3>0) sk=pmb->ke+1,      ek=pmb->ke+NGHOST;
  else              sk=pmb->ks-NGHOST, ek=pmb->ks-1;
  int p=0;
  if (nb.polar) {
    for (int n=ns; n<=ne; ++n) {
      Real sign = 1.0;
      if(flip!=NULL) sign =flip[n] ? -1.0 : 1.0;
      for (int k=sk; k<=ek; ++k) {
        for (int j=ej; j>=sj; --j) {
#pragma simd
          for (int i=si; i<=ei; ++i)
            dst(n,k,j,i) = sign * buf[p++];
        }
      }
    }
  }
  else
    BufferUtility::Unpack4DData(buf, dst, ns, ne, si, ei, sj, ej, sk, ek, p);
  return;
}
void BoundaryValues :: SetCellCenteredBoundarySameLevel ( AthenaArray < Real > & dst , int ns , int ne , Real * buf , const NeighborBlock & nb , bool * flip ) { MeshBlock * pmb = pmy_block_ ; int si , sj , sk , ei , ej , ek ; if ( nb . ox1 == 0 ) si = pmb -> is , ei = pmb -> ie ; else if ( nb . ox1 > 0 ) si = pmb -> ie + 1 , ei = pmb -> ie + NGHOST ; else si = pmb -> is - NGHOST , ei = pmb -> is - 1 ; if ( nb . ox2 == 0 ) sj = pmb -> js , ej = pmb -> je ; else if ( nb . ox2 > 0 ) sj = pmb -> je + 1 , ej = pmb -> je + NGHOST ; else sj = pmb -> js - NGHOST , ej = pmb -> js - 1 ; if ( nb . ox3 == 0 ) sk = pmb -> ks , ek = pmb -> ke ; else if ( nb . ox3 > 0 ) sk = pmb -> ke + 1 , ek = pmb -> ke + NGHOST ; else sk = pmb -> ks - NGHOST , ek = pmb -> ks - 1 ; int p = 0 ; if ( nb . polar ) { for ( int n = ns ; n <= ne ; ++ n ) { Real sign = 1.0 ; if ( flip != NULL ) sign = flip [ n ] ? -1.0 : 1.0 ; for ( int k = sk ; k <= ek ; ++ k ) { for ( int j = ej ; j >= sj ; -- j ) { #pragma  simd for ( int i = si ; i <= ei ; ++ i ) dst ( n , k , j , i ) = sign * buf [ p ++ ] ; } } } } else BufferUtility :: Unpack4DData ( buf , dst , ns , ne , si , ei , sj , ej , sk , ek , p ) ; return ; }
\fn void BoundaryValues::SetCellCenteredBoundarySameLevel(AthenaArray<Real> &dst,
int ns, int ne, Real *buf, const NeighborBlock& nb, bool *flip)
\brief Set hydro boundary received from a block on the same level
\ fn void BoundaryValues :: SetCellCenteredBoundarySameLevel ( AthenaArray<Real > &dst int ns int ne Real * buf const NeighborBlock& nb bool * flip ) \ brief Set hydro boundary received from a block on the same level