src/Boundary/CylindricalBoundary.cc
//------------------------------------------------------------------------------
// Update the nodes in violation of the boundary condition, mapping their
// positions and H tensors.
//------------------------------------------------------------------------------
Update the nodes in violation of the boundary condition, mapping their
positions and H tensors.
Update the nodes in violation of the boundary condition mapping their positions and H tensors .
void
CylindricalBoundary::
updateViolationNodes(NodeList<Dim<3> >& nodeList) {
  const vector<int>& vNodes = violationNodes(nodeList);
  Field<Dim<3>, Vector>& positions = nodeList.positions();
  Field<Dim<3>, Vector>& velocity = nodeList.velocity();
  Field<Dim<3> , SymTensor>& Hfield = nodeList.Hfield();
  for (vector<int>::const_iterator itr = vNodes.begin();
       itr != vNodes.end();
       ++itr) {
    const double ri = positions(*itr).y();
    if (ri < 0.0) {
      positions(*itr).y(-ri);
      velocity(*itr).y(abs(velocity(*itr).y()));
    }
    CHECK(positions(*itr).y() >= 0.0);
    positions(*itr).z(0.0);
  }
  this->enforceBoundary(Hfield);
}
void CylindricalBoundary :: updateViolationNodes ( NodeList < Dim < 3 > > & nodeList ) { const vector < int > & vNodes = violationNodes ( nodeList ) ; Field < Dim < 3 > , Vector > & positions = nodeList . positions ( ) ; Field < Dim < 3 > , Vector > & velocity = nodeList . velocity ( ) ; Field < Dim < 3 > , SymTensor > & Hfield = nodeList . Hfield ( ) ; for ( vector < int > :: const_iterator itr = vNodes . begin ( ) ; itr != vNodes . end ( ) ; ++ itr ) { const double ri = positions ( * itr ) . y ( ) ; if ( ri < 0.0 ) { positions ( * itr ) . y ( - ri ) ; velocity ( * itr ) . y ( abs ( velocity ( * itr ) . y ( ) ) ) ; } CHECK ( positions ( * itr ) . y ( ) >= 0.0 ) ; positions ( * itr ) . z ( 0.0 ) ; } this -> enforceBoundary ( Hfield ) ; }
Update the nodes in violation of the boundary condition, mapping their
positions and H tensors.
Update the nodes in violation of the boundary condition mapping their positions and H tensors .
// Get the set of violation nodes. // State we care about. // Make sure the positions are sensible. // Has the node crossed to negative r (y)? // Make sure there is no component out of the xy plane. // The normal Field enforcement policies work H. //   // Update the neighbor information. //   nodeList.neighbor().updateNodes(); // (vNodes);