OrthoVerticeAccessor Class Reference

#include <orthoverticeaccessor.h>

Inheritance diagram for OrthoVerticeAccessor:
Inheritance graph
[legend]
Collaboration diagram for OrthoVerticeAccessor:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 OrthoVerticeAccessor (const OrthoMesh &mesh, unsigned index)
void operator++ (int)
bool operator!= (OrthoVerticeAccessor &vert) const
Point3D getPoint ()
bool isValid ()
 ~OrthoVerticeAccessor ()
unsigned index ()
unsigned index_left () const
unsigned index_right () const
unsigned index_up () const
unsigned index_bottom () const
unsigned index_front () const
unsigned index_back () const
bool at_boundary () const

Protected Attributes

const OrthoMeshm_mesh
unsigned m_i
unsigned m_j
unsigned m_k
unsigned m_index

Detailed Description

OrthoVerticeAccessor

Definition at line 9 of file orthoverticeaccessor.h.


Constructor & Destructor Documentation

OrthoVerticeAccessor::OrthoVerticeAccessor ( const OrthoMesh mesh,
unsigned  index 
)

Definition at line 4 of file orthoverticeaccessor.cpp.

00005    :m_mesh(&mesh)
00006  {
00007   assert(index < mesh.numRawVertices());
00008   m_index=index;
00009   m_mesh->getVerticePositionFromIndex(index,m_i,m_j,m_k);
00010 }

OrthoVerticeAccessor::~OrthoVerticeAccessor (  )  [inline]

Definition at line 24 of file orthoverticeaccessor.h.

00024 {}


Member Function Documentation

bool OrthoVerticeAccessor::at_boundary (  )  const

Definition at line 120 of file orthoverticeaccessor.cpp.

00121 {
00122   if (m_i ==0 || m_j==0 || m_k==0 || m_i == m_mesh->_nElemX || m_j == m_mesh->_nElemY || m_k == m_mesh->_nElemZ )
00123     return 1;
00124   else
00125     return 0;
00126 }

Point3D OrthoVerticeAccessor::getPoint (  ) 

Definition at line 35 of file orthoverticeaccessor.cpp.

00036 {
00037   assert(isValid());
00038   Point3D p = m_mesh->getP();
00039   p[0]+=m_i*m_mesh->getDX()[0];
00040   p[1]+=m_j*m_mesh->getDX()[1];
00041   p[2]+=m_k*m_mesh->getDX()[2];
00042 
00043   return p;
00044                  
00045 }

unsigned OrthoVerticeAccessor::index (  )  [inline]

Reimplemented in OrthoVerticeAccessorWithHoles.

Definition at line 25 of file orthoverticeaccessor.h.

00025 {return m_index;}

unsigned OrthoVerticeAccessor::index_back (  )  const

Definition at line 110 of file orthoverticeaccessor.cpp.

00111 {
00112 
00113   if (m_j==m_mesh->_nElemY)
00114     return -1;
00115   else
00116     return m_index+m_mesh->_YVStride;
00117 }

unsigned OrthoVerticeAccessor::index_bottom (  )  const

Definition at line 82 of file orthoverticeaccessor.cpp.

00083 {
00084   if (m_k==0 )
00085     return -1;
00086   else
00087     return m_index-(m_mesh->_ZVStride);
00088 }

unsigned OrthoVerticeAccessor::index_front (  )  const

Definition at line 99 of file orthoverticeaccessor.cpp.

00100 {
00101   if (m_j==0)
00102   {
00103     return -1;
00104   }
00105     else
00106       return m_index-m_mesh->_YVStride;
00107       
00108 }

unsigned OrthoVerticeAccessor::index_left (  )  const

Definition at line 64 of file orthoverticeaccessor.cpp.

00065 {
00066   if (m_i==0 )
00067     return -1;
00068   else
00069   return m_index-1;
00070 }

unsigned OrthoVerticeAccessor::index_right (  )  const

Definition at line 74 of file orthoverticeaccessor.cpp.

00075 {
00076   if (m_i==m_mesh->_nElemX )
00077     return -1;
00078   else
00079   return m_index+1;
00080 }

unsigned OrthoVerticeAccessor::index_up (  )  const

Definition at line 90 of file orthoverticeaccessor.cpp.

00091 {
00092  
00093   if (m_k==m_mesh->_nElemZ )
00094     return -1;
00095   else
00096     return m_index+m_mesh->_ZVStride;
00097 }

bool OrthoVerticeAccessor::isValid (  ) 

Definition at line 48 of file orthoverticeaccessor.cpp.

00049 {
00050   if (m_index >= m_mesh->numRawVertices())
00051     return false;
00052   if (m_i > m_mesh->_nElemX)
00053     return false;
00054   if (m_j > m_mesh->_nElemY)
00055     return false;
00056   if (m_k > m_mesh->_nElemZ)
00057     return false;
00058   return true;
00059 }

bool OrthoVerticeAccessor::operator!= ( OrthoVerticeAccessor vert  )  const [inline]

Definition at line 20 of file orthoverticeaccessor.h.

00020 {return m_index != vert.m_index;}

void OrthoVerticeAccessor::operator++ ( int   ) 

Reimplemented in OrthoVerticeAccessorWithHoles.

Definition at line 14 of file orthoverticeaccessor.cpp.

00015 {
00016   assert(this->isValid());
00017   assert(m_index < m_mesh->numRawVertices());
00018   m_index++;
00019   if (m_i == m_mesh->_nElemX)
00020   {
00021     m_i=0;
00022     if (m_j == m_mesh->_nElemY)
00023     {
00024       m_j=0;
00025       m_k++;
00026     }
00027     else
00028       m_j++;
00029   }
00030   else
00031     m_i++;
00032   
00033 }


Member Data Documentation

unsigned OrthoVerticeAccessor::m_i [protected]

Definition at line 15 of file orthoverticeaccessor.h.

unsigned OrthoVerticeAccessor::m_index [protected]

Definition at line 15 of file orthoverticeaccessor.h.

unsigned OrthoVerticeAccessor::m_j [protected]

Definition at line 15 of file orthoverticeaccessor.h.

unsigned OrthoVerticeAccessor::m_k [protected]

Definition at line 15 of file orthoverticeaccessor.h.

Definition at line 14 of file orthoverticeaccessor.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Sun Apr 8 23:13:26 2012 for CO2INJECTION by  doxygen 1.6.3