src/Boundary/CylindricalBoundary.cc
//------------------------------------------------------------------------------
// Apply the ghost boundary condition to fields of different DataTypes.
//------------------------------------------------------------------------------
// Specialization for Vector fields.
Apply the ghost boundary condition to fields of different DataTypes.
Specialization for Vector fields.
Apply the ghost boundary condition to fields of different DataTypes . Specialization for Vector fields .
void
CylindricalBoundary::
applyGhostBoundary(Field<Dim<3>, Dim<3>::Vector>& field) const {
  const NodeList<Dimension>& nodeList = field.nodeList();
  const Field<Dimension, Vector>& position = nodeList.positions();
  CHECK(controlNodes(nodeList).size() == ghostNodes(nodeList).size());
  vector<int>::const_iterator controlItr = controlBegin(nodeList);
  vector<int>::const_iterator ghostItr = ghostBegin(nodeList);
  for (; controlItr < controlEnd(nodeList); ++controlItr, ++ghostItr) {
    CHECK(ghostItr < ghostEnd(nodeList));
    CHECK(*controlItr >= 0 && *controlItr < (int)nodeList.numNodes());
    CHECK(*ghostItr >= (int)nodeList.firstGhostNode() && *ghostItr < (int)nodeList.numNodes());
    field(*ghostItr) = reflectOperator(position(*controlItr),
                                       position(*ghostItr))*field(*controlItr);
  }
}
void CylindricalBoundary :: applyGhostBoundary ( Field < Dim < 3 > , Dim < 3 > :: Vector > & field ) const { const NodeList < Dimension > & nodeList = field . nodeList ( ) ; const Field < Dimension , Vector > & position = nodeList . positions ( ) ; CHECK ( controlNodes ( nodeList ) . size ( ) == ghostNodes ( nodeList ) . size ( ) ) ; vector < int > :: const_iterator controlItr = controlBegin ( nodeList ) ; vector < int > :: const_iterator ghostItr = ghostBegin ( nodeList ) ; for ( ; controlItr < controlEnd ( nodeList ) ; ++ controlItr , ++ ghostItr ) { CHECK ( ghostItr < ghostEnd ( nodeList ) ) ; CHECK ( * controlItr >= 0 && * controlItr < ( int ) nodeList . numNodes ( ) ) ; CHECK ( * ghostItr >= ( int ) nodeList . firstGhostNode ( ) && * ghostItr < ( int ) nodeList . numNodes ( ) ) ; field ( * ghostItr ) = reflectOperator ( position ( * controlItr ) , position ( * ghostItr ) ) * field ( * controlItr ) ; } }
Apply the ghost boundary condition to fields of different DataTypes.
Apply the ghost boundary condition to fields of different DataTypes .
// Apply the boundary condition to all the ghost node values.