00001 #ifndef _MY_VecDoubleGhost_ 00002 #define _MY_VecDoubleGhost_ 00003 #include "orthomesh.h" 00004 00005 class GhostBC 00006 { 00007 OrthoMesh &m_mesh; 00008 std::vector<int> m_vIndices; 00009 unsigned _off; 00010 unsigned _numBC; 00011 GhostBC(GhostBC &ghost); 00012 GhostBC& operator = (GhostBC &ghost); 00013 public: 00014 GhostBC(OrthoMesh &mesh) 00015 :m_mesh(mesh),m_vIndices(numGhostCells(),0); 00016 { 00017 _off = m_mesh.numCells();m_vIndices[ghostIndex-_off]; 00018 } 00019 bool isGhostIndex(Index ghostIndex); 00020 bool isMirrorBC(Index ghostIndex); 00021 Index getPrescribedBCIndex(Index ghostIndex); 00022 void setGhostCellAsMirror(unsigned ghostIndex,unsigned cellIndex); 00023 void setGhostBC(Function3D &f); 00024 void setGhostBCVector(Function3D &f,VecDouble &v); 00025 00026 00027 }; 00028 00029 00030 00031 }; 00032 00033 00034 void setGhostCellAsValue(unsigned ghostIndex) 00035 { 00036 assert(ghostIndex >= m_mesh.numCells()); 00037 unsigned index = ghostIndex-m_mesh.numCells(); 00038 m_vIndices[index]= 00039 00040 } 00041 00042 } 00047 class VecDoubleGhost 00048 { 00049 protected: 00050 std::vector<int> m_vIndices; 00051 std::vector<double> m_vFBC; 00052 VecDouble *m_vRealData; 00053 public: 00054 VecDoubleGhost(OrthoMesh &mesh) 00055 :m_mesh(mesh) 00056 { 00057 m_vRealData=new VecDouble(mesh.numCells()); 00058 } 00059 00060 VecDoubleGhost(VecDouble &v,OrthoMesh &mesh) 00061 :m_mesh(mesh) 00062 { 00063 assert(v.size() == mesh.numRawCells()); 00064 m_vRealData=&v; 00065 } 00066 00067 void setGhostCellAsMirror(unsigned ghostIndex,unsigned cellIndex) 00068 { 00069 assert(ghostIndex >= m_mesh.numCells()); 00070 assert(cellIndex < m_mesh.numCells()); 00071 unsigned index = ghostIndex-m_mesh.numCells(); 00072 assert(index < m_vIndices.size()); 00073 m_vIndices[index]=cellIndex; 00074 } 00075 00076 00077 00078 void setGhostCells(Function3D &f) 00079 { 00080 OrthoMesh::Raw_Face_It face = m_mesh.begin_raw_face(); 00081 00082 } 00083 00084 00085 00086 00087 ~VecDoubleGhost(); 00088 00089 }; 00090 00091 #endif