#include <VoronoiTessellation.hpp>
Public Member Functions | |
VoronoiTessellation (TetrahedralMesh< DIM, DIM > &rMesh, const std::vector< unsigned > locationIndices=std::vector< unsigned >()) | |
~VoronoiTessellation () | |
const VoronoiCell & | rGetCell (unsigned index) const |
const Face< DIM > & | rGetFace (unsigned index) const |
unsigned | GetNumFaces () const |
double | GetFaceArea (unsigned index) const |
double | GetFacePerimeter (unsigned index) const |
double | GetEdgeLength (unsigned nodeIndex1, unsigned nodeIndex2) const |
unsigned | GetNumVertices () const |
c_vector< double, DIM > * | GetVertex (unsigned index) |
unsigned | GetNumCells () |
template<> | |
void | Initialise (TetrahedralMesh< 1, 1 > &rMesh) |
template<> | |
void | Initialise (TetrahedralMesh< 2, 2 > &rMesh) |
template<> | |
void | Initialise (TetrahedralMesh< 3, 3 > &rMesh) |
Private Member Functions | |
void | GenerateVerticesFromElementCircumcentres () |
void | Initialise (TetrahedralMesh< DIM, DIM > &rMesh) |
Private Attributes | |
TetrahedralMesh< DIM, DIM > & | mrMesh |
std::vector< c_vector< double, DIM > * > | mVertices |
std::vector< Face< DIM > * > | mFaces |
std::vector< VoronoiCell > | mVoronoiCells |
std::set< unsigned > | mLocationIndices |
Friends | |
class | TestVoronoiTessellation |
class | InventorVoronoiWriter |
Voronoi tessellation class. For use in certain mesh-based tissue simulations.
Definition at line 42 of file VoronoiTessellation.hpp.
VoronoiTessellation< DIM >::VoronoiTessellation | ( | TetrahedralMesh< DIM, DIM > & | rMesh, | |
const std::vector< unsigned > | locationIndices = std::vector<unsigned>() | |||
) | [inline] |
Constructor. Create a tessellation of the given mesh which must be Delaunay (see TetrahedralMesh::CheckIsVoronoi).
rMesh | a tetrahedral mesh | |
locationIndices | an optional vector of location indices that correspond to non-ghost nodes |
Definition at line 48 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::Initialise(), and VoronoiTessellation< DIM >::mLocationIndices.
VoronoiTessellation< DIM >::~VoronoiTessellation | ( | ) | [inline] |
Destructor.
Definition at line 253 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::mFaces, and VoronoiTessellation< DIM >::mVertices.
void VoronoiTessellation< DIM >::GenerateVerticesFromElementCircumcentres | ( | ) | [inline, private] |
Generate the vertices of the tessellation using the circumcentres of the mesh elements.
Definition at line 272 of file VoronoiTessellation.cpp.
References AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetInverseJacobianForElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), VoronoiTessellation< DIM >::mrMesh, and VoronoiTessellation< DIM >::mVertices.
Referenced by VoronoiTessellation< DIM >::Initialise().
double VoronoiTessellation< DIM >::GetEdgeLength | ( | unsigned | nodeIndex1, | |
unsigned | nodeIndex2 | |||
) | const [inline] |
Get the length of the tessellation edge between two given nodes.
nodeIndex1 | ||
nodeIndex2 |
Definition at line 320 of file VoronoiTessellation.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), VoronoiTessellation< DIM >::mFaces, VoronoiTessellation< DIM >::mLocationIndices, and VoronoiTessellation< DIM >::mrMesh.
Referenced by LinearSpringWithVariableSpringConstantsForce< DIM >::VariableSpringConstantMultiplicationFactor().
double VoronoiTessellation< DIM >::GetFaceArea | ( | unsigned | index | ) | const [inline] |
Get the area of the face with a given index.
index |
Definition at line 382 of file VoronoiTessellation.cpp.
References Face< DIM >::GetNumVertices(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), VoronoiTessellation< DIM >::mFaces, VoronoiTessellation< DIM >::mLocationIndices, VoronoiTessellation< DIM >::mrMesh, and Face< DIM >::rGetVertex().
Referenced by MeshBasedTissue< DIM >::GetDampingConstant().
double VoronoiTessellation< DIM >::GetFacePerimeter | ( | unsigned | index | ) | const [inline] |
Get the perimeter of the face with a given index.
index |
Definition at line 432 of file VoronoiTessellation.cpp.
References Face< DIM >::GetNumVertices(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), VoronoiTessellation< DIM >::mFaces, VoronoiTessellation< DIM >::mLocationIndices, VoronoiTessellation< DIM >::mrMesh, and Face< DIM >::rGetVertex().
Referenced by LinearSpringWithVariableSpringConstantsForce< DIM >::VariableSpringConstantMultiplicationFactor().
unsigned VoronoiTessellation< DIM >::GetNumCells | ( | ) | [inline] |
Get the number of VoronoiCells in the tessellation.
Definition at line 491 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::mVoronoiCells.
unsigned VoronoiTessellation< DIM >::GetNumFaces | ( | ) | const [inline] |
Get the number of faces in the tessellation.
Definition at line 484 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::mFaces.
Referenced by InventorVoronoiWriter::Write().
unsigned VoronoiTessellation< DIM >::GetNumVertices | ( | ) | const [inline] |
Get the number of vertices in the tessellation.
Definition at line 478 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::mVertices.
Referenced by InventorVoronoiWriter::Write().
c_vector< double, DIM > * VoronoiTessellation< DIM >::GetVertex | ( | unsigned | index | ) | [inline] |
Get the vertex with a given index.
index |
Definition at line 498 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::mVertices.
void VoronoiTessellation< 3 >::Initialise | ( | TetrahedralMesh< 3, 3 > & | rMesh | ) | [inline] |
3D version of Initialise method.
rMesh | a tetrahedral mesh |
Definition at line 154 of file VoronoiTessellation.cpp.
References Face< DIM >::AddVertex(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::EdgesBegin(), TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::EdgesEnd(), VoronoiTessellation< DIM >::GenerateVerticesFromElementCircumcentres(), Node< SPACE_DIM >::GetIndex(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), Node< SPACE_DIM >::IsBoundaryNode(), VoronoiTessellation< DIM >::mFaces, VoronoiTessellation< DIM >::mrMesh, VoronoiTessellation< DIM >::mVertices, VoronoiTessellation< DIM >::mVoronoiCells, Node< SPACE_DIM >::rGetContainingElementIndices(), and Node< SPACE_DIM >::rGetLocation().
void VoronoiTessellation< 2 >::Initialise | ( | TetrahedralMesh< 2, 2 > & | rMesh | ) | [inline] |
2D version of Initialise method.
rMesh | a tetrahedral mesh |
Definition at line 84 of file VoronoiTessellation.cpp.
References Face< DIM >::AddVertex(), VoronoiTessellation< DIM >::GenerateVerticesFromElementCircumcentres(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), VoronoiTessellation< DIM >::mFaces, VoronoiTessellation< DIM >::mLocationIndices, VoronoiTessellation< DIM >::mrMesh, and VoronoiTessellation< DIM >::mVertices.
void VoronoiTessellation< 1 >::Initialise | ( | TetrahedralMesh< 1, 1 > & | rMesh | ) | [inline] |
1D version of Initialise method (not implemented).
rMesh | a tetrahedral mesh |
Definition at line 72 of file VoronoiTessellation.cpp.
void VoronoiTessellation< DIM >::Initialise | ( | TetrahedralMesh< DIM, DIM > & | rMesh | ) | [private] |
Use a tetrahedral mesh to initialise the faces and vertices of the tessellation.
rMesh | the mesh |
Referenced by VoronoiTessellation< DIM >::VoronoiTessellation().
const VoronoiCell & VoronoiTessellation< DIM >::rGetCell | ( | unsigned | index | ) | const [inline] |
Get a VoronoiCell.
index | The index of the cell is the index of the corresponding node in the original mesh. If the corresponding node was on the boundary, this will return a cell with no faces. |
Definition at line 292 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::mVoronoiCells.
Referenced by InventorVoronoiWriter::ScaleAndWrite().
const Face< DIM > & VoronoiTessellation< DIM >::rGetFace | ( | unsigned | index | ) | const [inline] |
Get the face of the VoronoiCell with a given index.
index | The index of the cell is the index of the corresponding node in the original mesh. |
Definition at line 302 of file VoronoiTessellation.cpp.
References VoronoiTessellation< DIM >::mFaces, and VoronoiTessellation< DIM >::mLocationIndices.
std::vector< Face<DIM>* > VoronoiTessellation< DIM >::mFaces [private] |
Faces corespond to edges of the mesh.
Definition at line 56 of file VoronoiTessellation.hpp.
Referenced by VoronoiTessellation< DIM >::GetEdgeLength(), VoronoiTessellation< DIM >::GetFaceArea(), VoronoiTessellation< DIM >::GetFacePerimeter(), VoronoiTessellation< DIM >::GetNumFaces(), VoronoiTessellation< DIM >::Initialise(), VoronoiTessellation< DIM >::rGetFace(), InventorVoronoiWriter::Write(), and VoronoiTessellation< DIM >::~VoronoiTessellation().
std::set<unsigned> VoronoiTessellation< DIM >::mLocationIndices [private] |
Set of node indices corresponding to non-ghost nodes.
Definition at line 62 of file VoronoiTessellation.hpp.
Referenced by VoronoiTessellation< DIM >::GetEdgeLength(), VoronoiTessellation< DIM >::GetFaceArea(), VoronoiTessellation< DIM >::GetFacePerimeter(), VoronoiTessellation< DIM >::Initialise(), VoronoiTessellation< DIM >::rGetFace(), and VoronoiTessellation< DIM >::VoronoiTessellation().
TetrahedralMesh<DIM,DIM>& VoronoiTessellation< DIM >::mrMesh [private] |
A tetrahedral mesh.
Definition at line 50 of file VoronoiTessellation.hpp.
Referenced by VoronoiTessellation< DIM >::GenerateVerticesFromElementCircumcentres(), VoronoiTessellation< DIM >::GetEdgeLength(), VoronoiTessellation< DIM >::GetFaceArea(), VoronoiTessellation< DIM >::GetFacePerimeter(), and VoronoiTessellation< DIM >::Initialise().
std::vector< c_vector<double,DIM>* > VoronoiTessellation< DIM >::mVertices [private] |
Vertices correspond to elements of the mesh.
Definition at line 53 of file VoronoiTessellation.hpp.
Referenced by VoronoiTessellation< DIM >::GenerateVerticesFromElementCircumcentres(), VoronoiTessellation< DIM >::GetNumVertices(), VoronoiTessellation< DIM >::GetVertex(), VoronoiTessellation< DIM >::Initialise(), InventorVoronoiWriter::Write(), and VoronoiTessellation< DIM >::~VoronoiTessellation().
std::vector< VoronoiCell > VoronoiTessellation< DIM >::mVoronoiCells [private] |
Cells correspond to nodes of the mesh.
Definition at line 59 of file VoronoiTessellation.hpp.
Referenced by VoronoiTessellation< DIM >::GetNumCells(), VoronoiTessellation< DIM >::Initialise(), VoronoiTessellation< DIM >::rGetCell(), and InventorVoronoiWriter::ScaleAndWrite().