#include <orthocellaccessorwithholes.h>
Definition at line 9 of file orthocellaccessorwithholes.h.
OrthoCellAccessorWithHoles::OrthoCellAccessorWithHoles | ( | const OrthoMesh & | mesh, | |
unsigned | rawIndex | |||
) | [protected] |
Definition at line 4 of file orthocellaccessorwithholes.cpp.
00005 :OrthoCellAccessor(mesh,rawIndex) 00006 { 00007 _delIt = mesh._delCellLst.findLUEntry(rawIndex); 00008 _delItFcX=mesh._delFaceLst.begin(); 00009 _delItFcY=_delItFcX; 00010 _delItFcZ=_delItFcX; 00011 _delItVert=mesh._delVertLst.begin(); 00012 _newIndex = mesh._delCellLst.adjustI(_index,_delIt); 00013 }
OrthoCellAccessorWithHoles::~OrthoCellAccessorWithHoles | ( | ) | [inline] |
Definition at line 23 of file orthocellaccessorwithholes.h.
unsigned OrthoCellAccessorWithHoles::advance | ( | CellDirection3D | dir, | |
unsigned | stps | |||
) |
Advance the cell stps time in the dir direction.It the cell accessor reaches the end of the domain, the method finish in the boundary of the cell
stps | ||
dir |
Reimplemented from OrthoCellAccessor.
Definition at line 170 of file orthocellaccessorwithholes.cpp.
00171 { 00172 unsigned i; 00173 for (i=0;i<stps;i++) 00174 { 00175 if (!this->advance(dir)) 00176 { 00177 return i; 00178 } 00179 } 00180 return i; 00181 }
bool OrthoCellAccessorWithHoles::advance | ( | CellDirection3D | dir | ) |
Reimplemented from OrthoCellAccessor.
Definition at line 132 of file orthocellaccessorwithholes.cpp.
00133 { 00134 OrthoCellAccessorWithHoles backTrack = *this; 00135 if (OrthoCellAccessor::advance(dir)) 00136 { 00137 //We advance the cell as there was no holes. 00138 //Now calculate the index in the mesh with holes 00139 _newIndex=_pMesh->_delCellLst.adjustI(raw_index(),_delIt); 00140 00141 //If _newIndex is invalid it means the neighbor cell is not a valid 00142 //cell because it is inside the well. So backtrack and return false 00143 if (_newIndex == OrthoMesh::INVALID_INDEX) 00144 { 00145 *this=backTrack; 00146 return false; 00147 } 00148 else 00149 return true; 00150 } 00151 else //Neighbor is out of the domain 00152 { 00153 return false; 00154 } 00155 }
bool OrthoCellAccessorWithHoles::at_boundary | ( | ) |
Use this function with caution. It is very expensive
Definition at line 99 of file orthocellaccessorwithholes.cpp.
00100 { 00101 00102 return (neighbor_index(LEFT_CELL ) == OrthoMesh::invalidIndex() || 00103 neighbor_index(RIGHT_CELL ) == OrthoMesh::invalidIndex() || 00104 neighbor_index(UP_CELL ) == OrthoMesh::invalidIndex() || 00105 neighbor_index(BOTTOM_CELL) == OrthoMesh::invalidIndex() || 00106 neighbor_index(FRONT_CELL ) == OrthoMesh::invalidIndex() || 00107 neighbor_index(BACK_CELL ) == OrthoMesh::invalidIndex() ); 00108 }
OrthoMesh::Face_It OrthoCellAccessorWithHoles::face | ( | FaceDirection3D | dir | ) |
Reimplemented from OrthoCellAccessor.
Definition at line 115 of file orthocellaccessorwithholes.cpp.
00116 { 00117 OrthoFaceAccessorWithHoles faceAcc(*this,dir); 00118 return OrthoMesh::Face_It(faceAcc); 00119 }
unsigned OrthoCellAccessorWithHoles::face_index | ( | FaceDirection3D | dir | ) |
Index of the face in the direction dir from the cell
Definition at line 59 of file orthocellaccessorwithholes.cpp.
unsigned OrthoCellAccessorWithHoles::face_index_back | ( | ) |
Index of the face in the direction back from the cell
Definition at line 90 of file orthocellaccessorwithholes.cpp.
00091 { 00092 return _pMesh->_delFaceLst.adjust(_i + (_j+1)*_pMesh->_fyYStride + _k*_pMesh->_fyZStride + _pMesh->_fyOff,_delItFcY); 00093 }
unsigned OrthoCellAccessorWithHoles::face_index_down | ( | ) |
Index of the face in the direction down from the cell
Definition at line 69 of file orthocellaccessorwithholes.cpp.
00070 { 00071 return _pMesh->_delFaceLst.adjust(_i + _j*_pMesh->_fzYStride + _k*_pMesh->_fzZStride + _pMesh->_fzOff,_delItFcZ); 00072 }
unsigned OrthoCellAccessorWithHoles::face_index_front | ( | ) |
Index of the face in the direction front from the cell
Definition at line 84 of file orthocellaccessorwithholes.cpp.
00085 { 00086 return _pMesh->_delFaceLst.adjust(_i + _j*_pMesh->_fyYStride + _k*_pMesh->_fyZStride + _pMesh->_fyOff,_delItFcY); 00087 00088 }
unsigned OrthoCellAccessorWithHoles::face_index_left | ( | ) |
Index of the face in the direction left from the cell
Definition at line 74 of file orthocellaccessorwithholes.cpp.
00075 { 00076 return _pMesh->_delFaceLst.adjust(_i+_j*_pMesh->_fxYStride + _k*_pMesh->_fxZStride,_delItFcX); 00077 }
unsigned OrthoCellAccessorWithHoles::face_index_right | ( | ) |
Index of the face in the direction right from the cell
Definition at line 79 of file orthocellaccessorwithholes.cpp.
00080 { 00081 return _pMesh->_delFaceLst.adjust(_i + 1 + _j*_pMesh->_fxYStride + _k*_pMesh->_fxZStride,_delItFcX); 00082 }
unsigned OrthoCellAccessorWithHoles::face_index_up | ( | ) |
Index of the face in the direction up from the cell
Definition at line 64 of file orthocellaccessorwithholes.cpp.
00065 { 00066 return _pMesh->_delFaceLst.adjust(_i + _j*_pMesh->_fzYStride + (_k +1)*_pMesh->_fzZStride + _pMesh->_fzOff,_delItFcZ); 00067 }
unsigned OrthoCellAccessorWithHoles::face_raw_index | ( | FaceDirection3D | dir | ) | [inline] |
Definition at line 34 of file orthocellaccessorwithholes.h.
00034 {return OrthoCellAccessor::face_index(dir);}
unsigned OrthoCellAccessorWithHoles::index | ( | ) | const [inline] |
Index of the cell
Reimplemented from OrthoCellAccessor.
Definition at line 37 of file orthocellaccessorwithholes.h.
unsigned OrthoCellAccessorWithHoles::index_back | ( | ) |
Index of the cell in the direction back from the cell
Definition at line 238 of file orthocellaccessorwithholes.cpp.
unsigned OrthoCellAccessorWithHoles::index_down | ( | ) |
Index of the cell in the direction down from the cell
Definition at line 195 of file orthocellaccessorwithholes.cpp.
00196 { 00197 assert(this->isValid()); 00198 if (_k == 0) 00199 return OrthoMesh::INVALID_INDEX; 00200 else 00201 return _pMesh->_delCellLst.adjustI(_index-_pMesh->_ZStride,_delIt); 00202 00203 }
unsigned OrthoCellAccessorWithHoles::index_front | ( | ) |
Index of the cell in the direction front from the cell
Definition at line 226 of file orthocellaccessorwithholes.cpp.
00227 { 00228 assert(this->isValid()); 00229 if (_j == 0) 00230 return OrthoMesh::INVALID_INDEX; 00231 else 00232 return _pMesh->_delCellLst.adjustI(_index-_pMesh->_YStride,_delIt); 00233 }
unsigned OrthoCellAccessorWithHoles::index_left | ( | ) |
Index of the cell in the direction left from the cell
Definition at line 205 of file orthocellaccessorwithholes.cpp.
00206 { 00207 assert(this->isValid()); 00208 if (_i == 0) 00209 return OrthoMesh::INVALID_INDEX; 00210 else 00211 return _pMesh->_delCellLst.adjustI(_index-1,_delIt); 00212 }
unsigned OrthoCellAccessorWithHoles::index_right | ( | ) |
Index of the cell in the direction right from the cell
Definition at line 214 of file orthocellaccessorwithholes.cpp.
00215 { 00216 assert(this->isValid()); 00217 if (_i == _pMesh->_LastI) 00218 return OrthoMesh::INVALID_INDEX; 00219 else 00220 return _pMesh->_delCellLst.adjustI(_index+1,_delIt); 00221 00222 }
unsigned OrthoCellAccessorWithHoles::index_up | ( | ) |
Index of the cell in the direction up from the cell
Definition at line 184 of file orthocellaccessorwithholes.cpp.
OrthoMesh::Cell_It OrthoCellAccessorWithHoles::neighbor | ( | CellDirection3D | dir | ) |
Reimplemented from OrthoCellAccessor.
Definition at line 122 of file orthocellaccessorwithholes.cpp.
00123 { 00124 OrthoCellAccessorWithHoles cell = *this; 00125 if (cell.advance(dir)) 00126 return OrthoMesh::Cell_It(cell); 00127 else 00128 return _pMesh->end_cell(); 00129 }
unsigned OrthoCellAccessorWithHoles::neighbor_index | ( | unsigned int | dir | ) | const |
Reimplemented from OrthoCellAccessor.
Definition at line 48 of file orthocellaccessorwithholes.cpp.
00049 { 00050 unsigned i=OrthoCellAccessor::neighbor_index(dir); 00051 if (i != OrthoMesh::invalidIndex()) 00052 return _pMesh->_delCellLst.adjustI(OrthoCellAccessor::neighbor_index(dir),_delIt); 00053 else 00054 return OrthoMesh::invalidIndex(); 00055 }
void OrthoCellAccessorWithHoles::operator++ | ( | int | ) | [protected] |
Reimplemented from OrthoCellAccessor.
Definition at line 15 of file orthocellaccessorwithholes.cpp.
00016 { 00017 OrthoCellAccessor &rawCell = *this; 00018 assert(rawCell.index() < _delIt->index()); 00019 OrthoCellAccessor::operator++(0); 00020 00021 00022 if (rawCell.index() < _delIt->index()) 00023 { 00024 _newIndex = _delIt->adjust(rawCell.index()); 00025 return; 00026 } 00027 else //we know that delIt->index() == rawCell.index() 00028 { 00029 do { 00030 OrthoCellAccessor::operator++(0); 00031 _delIt++; 00032 } while(rawCell.index() == _delIt->index()); 00033 _newIndex = _delIt->adjust(rawCell.index()); 00034 } 00035 }
unsigned OrthoCellAccessorWithHoles::raw_index | ( | ) | [inline] |
Index of the cell
Definition at line 38 of file orthocellaccessorwithholes.h.
unsigned OrthoCellAccessorWithHoles::vertex_index | ( | VertexDirection3D | dir | ) |
return the index of the vertice given the relative position of the vertex within the cell
Definition at line 42 of file orthocellaccessorwithholes.cpp.
00043 { 00044 return getMesh()._delVertLst.adjust(OrthoCellAccessor::vertex_index(dir),_delItVert); 00045 }
friend class IteratorAccessor< OrthoCellAccessorWithHoles > [friend] |
Definition at line 13 of file orthocellaccessorwithholes.h.
friend class OrthoMesh [friend] |
Reimplemented from OrthoCellAccessor.
Definition at line 12 of file orthocellaccessorwithholes.h.
Definition at line 15 of file orthocellaccessorwithholes.h.
Definition at line 15 of file orthocellaccessorwithholes.h.
Definition at line 15 of file orthocellaccessorwithholes.h.
Definition at line 15 of file orthocellaccessorwithholes.h.
Definition at line 15 of file orthocellaccessorwithholes.h.
Index OrthoCellAccessorWithHoles::_newIndex [private] |
Definition at line 16 of file orthocellaccessorwithholes.h.