QuOc

 

Public Member Functions | Protected Attributes

qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim > Class Template Reference

#include <periodicBC.h>

Inheritance diagram for qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >:
qc::PeriodicityHandlerBase< GridType, DataType, Dim >

List of all members.

Public Member Functions

 QuocOneDirectionPeriodicityHandler (const GridType &Grid, const int dir=0)
 Construtor. direction for periodicity given by dir. dir=0 means X, dir=1 means Y, dir=2 means Z.
virtual bool isPeriodicNode (const qc::CoordType &pos) const
 check whether a node is not a DOF but a periodic copy of another DOF
virtual qc::CoordType facingPresentNode (const qc::CoordType &pos) const
 for periodic nodes, returns the position where DOF is actually stored, for all other nodes, returns the position

Protected Attributes

const int _dir

Detailed Description

template<typename GridType, typename DataType, qc::Dimension Dim>
class qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >

Periodicity in just one space direction on Quoc grids

Author:
Geihe

Definition at line 198 of file periodicBC.h.


Constructor & Destructor Documentation

template<typename GridType , typename DataType , qc::Dimension Dim>
qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >::QuocOneDirectionPeriodicityHandler ( const GridType &  Grid,
const int  dir = 0 
) [inline]

Construtor. direction for periodicity given by dir. dir=0 means X, dir=1 means Y, dir=2 means Z.

Definition at line 204 of file periodicBC.h.

References qc::QC_2D, and qc::QC_3D.

    : PeriodicityHandlerBase< GridType, DataType, Dim > ( Grid ),
      _dir ( dir )
    {
      if ( ( dir < 0 ) || ( dir > 2 ) )                   throw aol::Exception ( "QuocOneDirectionPeriodicityHandler: invalid direction", __FILE__, __LINE__ );
      if ( ( Dim == qc::QC_2D ) && ( dir == 2 ) )         throw aol::Exception ( "QuocOneDirectionPeriodicityHandler: invalid direction", __FILE__, __LINE__ );
      if ( ( Dim != qc::QC_2D ) && ( Dim != qc::QC_3D ) ) throw aol::Exception ( "QuocOneDirectionPeriodicityHandler: unsupported dimension", __FILE__, __LINE__ );
    }


Member Function Documentation

template<typename GridType , typename DataType , qc::Dimension Dim>
virtual qc::CoordType qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >::facingPresentNode ( const qc::CoordType  )  const [inline, virtual]

for periodic nodes, returns the position where DOF is actually stored, for all other nodes, returns the position

Implements qc::PeriodicityHandlerBase< GridType, DataType, Dim >.

Definition at line 224 of file periodicBC.h.

References qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >::_dir, and qc::PeriodicityHandlerBase< GridType, DataType, Dim >::_grid.

                                                                           {
      qc::CoordType ret ( pos );
      switch ( _dir ) {
        case 0: { if ( ret[0] == this->_grid.getNumX() - 1 ) ret[0] = 0; break; }
        case 1: { if ( ret[1] == this->_grid.getNumY() - 1 ) ret[1] = 0; break; }
        case 2: { if ( ret[2] == this->_grid.getNumZ() - 1 ) ret[2] = 0; break; }
      }
      return ( ret );
    }

template<typename GridType , typename DataType , qc::Dimension Dim>
virtual bool qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >::isPeriodicNode ( const qc::CoordType  )  const [inline, virtual]

check whether a node is not a DOF but a periodic copy of another DOF

Implements qc::PeriodicityHandlerBase< GridType, DataType, Dim >.

Definition at line 215 of file periodicBC.h.

References qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >::_dir, and qc::PeriodicityHandlerBase< GridType, DataType, Dim >::_grid.

                                                                 {
      switch ( _dir ) {
        case 0: return ( pos[0] == ( this->_grid.getNumX() - 1 ) );
        case 1: return ( pos[1] == ( this->_grid.getNumY() - 1 ) );
        case 2: return ( pos[2] == ( this->_grid.getNumZ() - 1 ) );
      }
      return false;
    }


Member Data Documentation

template<typename GridType , typename DataType , qc::Dimension Dim>
const int qc::QuocOneDirectionPeriodicityHandler< GridType, DataType, Dim >::_dir [protected]

The documentation for this class was generated from the following file:

Generated on Fri Sep 9 2011 21:09:56 for QuocMesh by doxygen 1.7.1