src/Boundary/CylindricalBoundary.cc
// Specialization for fourth rank tensors.
Specialization for fourth rank tensors.
Specialization for fourth rank tensors .
void
CylindricalBoundary::
applyGhostBoundary(Field<Dim<3>, Dim<3>::FourthRankTensor>& 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);
  FourthRankTensor val;
  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());
    const Tensor T = reflectOperator(position(*controlItr), position(*ghostItr));
    val = FourthRankTensor::zero;
    const FourthRankTensor& fc = field(*controlItr);
    for (unsigned i = 0; i != Dimension::nDim; ++i) {
      for (unsigned j = 0; j != Dimension::nDim; ++j) {
        for (unsigned k = 0; k != Dimension::nDim; ++k) {
          for (unsigned l = 0; l != Dimension::nDim; ++l) {
            for (unsigned q = 0; q != Dimension::nDim; ++q) {
              for (unsigned r = 0; r != Dimension::nDim; ++r) {
                for (unsigned s = 0; s != Dimension::nDim; ++s) {
                  for (unsigned t = 0; t != Dimension::nDim; ++t) {
                    val(i,j,k,l) += T(i,q)*T(j,r)*T(k,s)*T(l,t)*fc(q,r,s,t);
                  }
                }
              }
            }
          }
        }
      }
    }
    field(*ghostItr) = val;
  }
}
void CylindricalBoundary :: applyGhostBoundary ( Field < Dim < 3 > , Dim < 3 > :: FourthRankTensor > & 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 ) ; FourthRankTensor val ; 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 ( ) ) ; const Tensor T = reflectOperator ( position ( * controlItr ) , position ( * ghostItr ) ) ; val = FourthRankTensor :: zero ; const FourthRankTensor & fc = field ( * controlItr ) ; for ( unsigned i = 0 ; i != Dimension :: nDim ; ++ i ) { for ( unsigned j = 0 ; j != Dimension :: nDim ; ++ j ) { for ( unsigned k = 0 ; k != Dimension :: nDim ; ++ k ) { for ( unsigned l = 0 ; l != Dimension :: nDim ; ++ l ) { for ( unsigned q = 0 ; q != Dimension :: nDim ; ++ q ) { for ( unsigned r = 0 ; r != Dimension :: nDim ; ++ r ) { for ( unsigned s = 0 ; s != Dimension :: nDim ; ++ s ) { for ( unsigned t = 0 ; t != Dimension :: nDim ; ++ t ) { val ( i , j , k , l ) += T ( i , q ) * T ( j , r ) * T ( k , s ) * T ( l , t ) * fc ( q , r , s , t ) ; } } } } } } } } field ( * ghostItr ) = val ; } }
Specialization for fourth rank tensors.
Specialization for fourth rank tensors .
// Apply the boundary condition to all the ghost node values.