GhostBC Class Reference

#include <vecdoubleghost.h>

Collaboration diagram for GhostBC:
Collaboration graph
[legend]

List of all members.

Public Member Functions

bool isGhostIndex (Index ghostIndex)
bool isMirrorBC (Index ghostIndex)
Index getPrescribedBCIndex (Index ghostIndex)
void setGhostCellAsMirror (unsigned ghostIndex, unsigned cellIndex)
void setGhostBC (Function3D &f)
void setGhostBCVector (Function3D &f, VecDouble &v)

Public Attributes

GhostBC(OrthoMesh &mesh) _off = m_mesh.numCells()
 m_vIndices [ghostIndex-_off]

Private Member Functions

 GhostBC (GhostBC &ghost)
GhostBCoperator= (GhostBC &ghost)

Private Attributes

OrthoMeshm_mesh
std::vector< int > m_vIndices
unsigned _off
unsigned _numBC

Detailed Description

Definition at line 5 of file vecdoubleghost.h.


Constructor & Destructor Documentation

GhostBC::GhostBC ( GhostBC ghost  )  [private]

Member Function Documentation

Index GhostBC::getPrescribedBCIndex ( Index  ghostIndex  ) 

Definition at line 84 of file vecdoubleghost.cpp.

00085 {
00086   assert(!isMirrorBC(ghostIndex));
00087   return m_vIndices[ghostIndex-_off]-_off;
00088 }

bool GhostBC::isGhostIndex ( Index  ghostIndex  ) 

Definition at line 91 of file vecdoubleghost.cpp.

00092 {
00093   return ghostIndex >= _off; 
00094 }

bool GhostBC::isMirrorBC ( Index  ghostIndex  ) 

Definition at line 78 of file vecdoubleghost.cpp.

00079 {
00080   assert(ghostIndex >= _off);
00081   return m_vIndices[ghostIndex-_off] < _off;
00082 }

GhostBC& GhostBC::operator= ( GhostBC ghost  )  [private]
void GhostBC::setGhostBC ( Function3D f  ) 

Definition at line 17 of file vecdoubleghost.cpp.

00018 {
00019     unsigned _numBC=0;
00020     OrthoMesh::Face_It face = mesh.begin();
00021     OrthoMesh::Face_It endf = mesh.end();
00022 
00023     for(;face!=endf;face++)
00024     {
00025       if (face->at_boundary())
00026       {
00027         Point3D p;
00028         face->barycenter(p);
00029         face->ghostAdjCellIndices(cell1,cell2);
00030         if (isGhostIndex(cell1))
00031         {
00032           ghostIndex=cell1;
00033           cellIndex=cell2;
00034         }
00035         else
00036         {
00037           assert(isGhostIndex(cell2));
00038           ghostIndex=cell2;
00039           cellIndex=cell1;
00040         }
00041         if (f.isInDomain(p))
00042           m_vIndices[ghostIndex-off]=_off+_numBC++; 
00043         else
00044           setGhostCellAsMirror(ghostIndex,cellIndex);
00045       }
00046     }
00047 
00048 }

void GhostBC::setGhostBCVector ( Function3D f,
VecDouble v 
)

Definition at line 50 of file vecdoubleghost.cpp.

00051 {
00052   v.reinit(_numBC);
00053   OrthoMesh::Face_It face = mesh.begin();
00054   OrthoMesh::Face_It endf = mesh.end();
00055 
00056   for(;face!=endf;face++)
00057   {
00058     if (face->at_boundary())
00059     {
00060       Point3D p;
00061       face->barycenter(p);
00062       face->ghostAdjCellIndices(cell1,cell2);
00063       ghostIndex=isGhostIndex(cell1) ? cell1 : cell2;
00064       if (f.isInDomain(p))
00065       {
00066         assert(!isMirrorBC(ghostIndex));
00067         v(getPrescribedBCIndex(ghostIndex))=f.value(p);
00068       }
00069       else
00070       {
00071         assert(isMirrorBC(ghostIndex));
00072       }
00073     }
00074   }
00075 }

void GhostBC::setGhostCellAsMirror ( unsigned  ghostIndex,
unsigned  cellIndex 
)

Definition at line 6 of file vecdoubleghost.cpp.

00007   {
00008     assert(ghostIndex >= m_mesh.numCells());
00009     assert(cellIndex <  m_mesh.numCells());
00010     unsigned index = ghostIndex-m_mesh.numCells();
00011     assert(index < m_vIndices.size());
00012     m_vIndices[index]=cellIndex;
00013   }


Member Data Documentation

unsigned GhostBC::_numBC [private]

Definition at line 10 of file vecdoubleghost.h.

GhostBC (OrthoMesh &mesh) GhostBC::_off = m_mesh.numCells()

Definition at line 17 of file vecdoubleghost.h.

unsigned GhostBC::_off [private]

Definition at line 9 of file vecdoubleghost.h.

Definition at line 7 of file vecdoubleghost.h.

Definition at line 17 of file vecdoubleghost.h.

std::vector<int> GhostBC::m_vIndices [private]

Definition at line 8 of file vecdoubleghost.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:11 2012 for CO2INJECTION by  doxygen 1.6.3