VertexMesh< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <VertexMesh.hpp>

Inherits AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Collaboration diagram for VertexMesh< ELEMENT_DIM, SPACE_DIM >:
Collaboration graph
[legend]

List of all members.

Classes

class  VertexElementIterator

Public Member Functions

VertexElementIterator GetElementIteratorBegin (bool skipDeletedElements=true)
VertexElementIterator GetElementIteratorEnd ()
 VertexMesh (std::vector< Node< SPACE_DIM > * > nodes, std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > vertexElements)
 VertexMesh (std::vector< Node< SPACE_DIM > * > nodes, std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * > faces, std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > vertexElements)
 VertexMesh (TetrahedralMesh< 2, 2 > &rMesh, const std::vector< unsigned > locationIndices=std::vector< unsigned >())
 VertexMesh (TetrahedralMesh< 3, 3 > &rMesh, const std::vector< unsigned > locationIndices=std::vector< unsigned >())
 VertexMesh ()
virtual ~VertexMesh ()
virtual unsigned GetNumNodes () const
virtual unsigned GetNumElements () const
unsigned GetNumAllElements () const
virtual unsigned GetNumFaces () const
VertexElement< ELEMENT_DIM,
SPACE_DIM > * 
GetElement (unsigned index) const
VertexElement< ELEMENT_DIM-1,
SPACE_DIM > * 
GetFace (unsigned index) const
virtual c_vector< double,
SPACE_DIM > 
GetCentroidOfElement (unsigned index)
void ConstructFromMeshReader (AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &rMeshReader)
virtual void Clear ()
void Translate (c_vector< double, SPACE_DIM > &rDisplacement)
void Translate (const double xMovement=0.0, const double yMovement=0.0, const double zMovement=0.0)
virtual double GetAreaOfElement (unsigned index)
double GetPerimeterOfElement (unsigned index)
c_vector< double, SPACE_DIM > GetAreaGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
c_vector< double, SPACE_DIM > GetPreviousEdgeGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
c_vector< double, SPACE_DIM > GetNextEdgeGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
c_vector< double, SPACE_DIM > GetPerimeterGradientOfElementAtNode (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned localIndex)
virtual c_vector< double, 3 > CalculateMomentsOfElement (unsigned index)
double GetEdgeLength (unsigned elementIndex1, unsigned elementIndex2)
c_vector< double, SPACE_DIM > GetUnitNormalToFace (VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace)
virtual double GetAreaOfFace (VertexElement< ELEMENT_DIM-1, SPACE_DIM > *pFace)
virtual double GetVolumeOfElement (unsigned index)
virtual double GetSurfaceAreaOfElement (unsigned index)
c_vector< double, SPACE_DIM > GetShortAxisOfElement (unsigned index)
std::set< unsignedGetNeighbouringNodeIndices (unsigned nodeIndex)
std::set< unsignedGetNeighbouringNodeNotAlsoInElement (unsigned nodeIndex, unsigned elemIndex)
template<>
 VertexMesh (TetrahedralMesh< 3, 3 > &rMesh, const std::vector< unsigned > locationIndices)

Protected Member Functions

unsigned SolveNodeMapping (unsigned index) const
unsigned SolveElementMapping (unsigned index) const
unsigned SolveBoundaryElementMapping (unsigned index) const
void GenerateVerticesFromElementCircumcentres (TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &rMesh)
bool ElementIncludesPoint (const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
unsigned GetLocalIndexForElementEdgeClosestToPoint (const c_vector< double, SPACE_DIM > &rTestPoint, unsigned elementIndex)
template<class Archive >
void save (Archive &archive, const unsigned int version) const
template<class Archive >
void load (Archive &archive, const unsigned int version)

Protected Attributes

std::vector< VertexElement
< ELEMENT_DIM, SPACE_DIM > * > 
mElements
std::vector< VertexElement
< ELEMENT_DIM-1, SPACE_DIM > * > 
mFaces

Friends

class TestVertexMesh
class boost::serialization::access

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class VertexMesh< ELEMENT_DIM, SPACE_DIM >

A vertex-based mesh class, for use in vertex-based tissue simulations.

Definition at line 57 of file VertexMesh.hpp.


Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh ( std::vector< Node< SPACE_DIM > * >  nodes,
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >  vertexElements 
) [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh ( std::vector< Node< SPACE_DIM > * >  nodes,
std::vector< VertexElement< ELEMENT_DIM-1, SPACE_DIM > * >  faces,
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * >  vertexElements 
) [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh ( TetrahedralMesh< 2, 2 > &  rMesh,
const std::vector< unsigned locationIndices = std::vector< unsigned >() 
)

Alternative 2D 'Voronoi' constructor. Creates a Voronoi tessellation of a given tetrahedral mesh, which must be Delaunay (see TetrahedralMesh::CheckIsVoronoi).

Parameters:
rMesh a tetrahedral mesh
locationIndices an optional vector of location indices that correspond to non-ghost nodes
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh ( TetrahedralMesh< 3, 3 > &  rMesh,
const std::vector< unsigned locationIndices = std::vector< unsigned >() 
)

Alternative 3D 'Voronoi' constructor. Creates a Voronoi tessellation of a given tetrahedral mesh, which must be Delaunay (see TetrahedralMesh::CheckIsVoronoi).

Parameters:
rMesh a tetrahedral mesh
locationIndices an optional vector of location indices that correspond to non-ghost nodes
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexMesh (  )  [inline]

Default constructor for use by serializer.

Definition at line 504 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::Clear(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mMeshChangesDuringSimulation.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::~VertexMesh (  )  [inline, virtual]

Destructor.

Definition at line 512 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::Clear().

template<>
VertexMesh< 3, 3 >::VertexMesh ( TetrahedralMesh< 3, 3 > &  rMesh,
const std::vector< unsigned locationIndices 
) [inline]

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, 3 > VertexMesh< ELEMENT_DIM, SPACE_DIM >::CalculateMomentsOfElement ( unsigned  index  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMesh< ELEMENT_DIM, SPACE_DIM >::Clear (  )  [inline, virtual]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMesh< ELEMENT_DIM, SPACE_DIM >::ConstructFromMeshReader ( AbstractMeshReader< ELEMENT_DIM, SPACE_DIM > &  rMeshReader  )  [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
bool VertexMesh< ELEMENT_DIM, SPACE_DIM >::ElementIncludesPoint ( const c_vector< double, SPACE_DIM > &  rTestPoint,
unsigned  elementIndex 
) [inline, protected]

Test whether a given point lies inside a given element.

We use a ray-casting algorithm, which relies on the following result: if the point in question is not on the boundary of the element, then the number of intersections is an even number if the point is outside, and it is odd if inside.

Currently the method is coded 'strictly', such that points lying on an edge or at a vertex are considered to lie outside the element.

Parameters:
rTestPoint the point to test
elementIndex global index of the element in the mesh
Returns:
if the point is included in the element.

Definition at line 828 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMesh< ELEMENT_DIM, SPACE_DIM >::GenerateVerticesFromElementCircumcentres ( TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > &  rMesh  )  [inline, protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetAreaGradientOfElementAtNode ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pElement,
unsigned  localIndex 
) [inline]

Compute the area gradient of a 2D element at one of its nodes.

N.B. This calls GetVectorFromAtoB(), which can be overridden in daughter classes for non-Euclidean metrics.

Parameters:
pElement pointer to a specified vertex element
localIndex local index of a node in this element
Returns:
the gradient of the area of the element, evaluated at this node.

Definition at line 1042 of file VertexMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetAreaOfElement ( unsigned  index  )  [inline, virtual]

Compute the area of a 2D element.

This needs to be overridden in daughter classes for non-Euclidean metrics.

Parameters:
index the global index of a specified vertex element
Returns:
the area of the element

Definition at line 1127 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetCentroidOfElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetAreaOfFace ( VertexElement< ELEMENT_DIM-1, SPACE_DIM > *  pFace  )  [inline, virtual]

Get the area of a given face in 3D. This is achieved by projecting the face onto a 2D plane. To avoid degeneracy and optimize robustness, we choose to ignore the dimension of the component of the unit normal to the plane with the greatest absolute value.

This needs to be overridden in daughter classes for non-Euclidean metrics.

Parameters:
pFace a face in the mesh
Returns:
the area

Todo:
reduce code duplication with GetAreaOfElement() method (see #1283 and #1276)

Definition at line 1216 of file VertexMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetUnitNormalToFace().

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetSurfaceAreaOfElement(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetCentroidOfElement ( unsigned  index  )  [inline, virtual]

Compute the centroid of an element.

This needs to be overridden in daughter classes for non-Euclidean metrics.

Parameters:
index the global index of a specified vertex element
Returns:
(centroid_x,centroid_y).

Todo:
Why isn't this just the centre of mass? (#1075)

Definition at line 614 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetAreaOfElement(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::CalculateMomentsOfElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetEdgeLength ( unsigned  elementIndex1,
unsigned  elementIndex2 
) [inline]

Get the length of the edge separating two given elements in 2D.

Parameters:
elementIndex1 index of an element in the mesh
elementIndex2 index of an element in the mesh

Todo:
Move this bit of code into LinearSpringWithVariableSpringConstantsForce::VariableSpringConstantMultiplicationFactor() and make use of IsGhostNode() (#1075)

Definition at line 458 of file VertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistanceBetweenNodes(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM, SPACE_DIM > * VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement ( unsigned  index  )  const [inline]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin ( bool  skipDeletedElements = true  )  [inline]

Get an iterator to the first element in the mesh.

Parameters:
skipDeletedElements whether to include deleted element

Definition at line 582 of file VertexMesh.hpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

Referenced by VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexMesh< ELEMENT_DIM, SPACE_DIM >::VertexElementIterator VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd (  )  [inline]

Get an iterator to one past the last element in the mesh.

Definition at line 589 of file VertexMesh.hpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

Referenced by VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
VertexElement< ELEMENT_DIM-1, SPACE_DIM > * VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetFace ( unsigned  index  )  const [inline]
Parameters:
index the global index of a specified face.
Returns:
a pointer to the face

Definition at line 606 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::mFaces.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetLocalIndexForElementEdgeClosestToPoint ( const c_vector< double, SPACE_DIM > &  rTestPoint,
unsigned  elementIndex 
) [inline, protected]

Get the local index of a given element which is the start vertex of the edge of the element that the overlapping point rTestPoint is closest to.

Parameters:
rTestPoint the point to test
elementIndex global index of the element in the mesh
Returns:
the local index

Definition at line 896 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::set< unsigned > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNeighbouringNodeIndices ( unsigned  nodeIndex  )  [inline]

Given a node, find a set containing the indices of its neighbouring nodes.

Parameters:
nodeIndex global index of the node
Returns:
its neighbouring node indices

Definition at line 670 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode().

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNeighbouringNodeNotAlsoInElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::set< unsigned > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNeighbouringNodeNotAlsoInElement ( unsigned  nodeIndex,
unsigned  elemIndex 
) [inline]

Given a node and one of its containing elements, find a set containing the indices of those neighbouring node(s) that are NOT also in the element.

Note that we allow for more than one such index, since there is no reason a priori to assume that each node is contained by exactly three elements.

Parameters:
nodeIndex global index of the node
elemIndex global index of the element
Returns:
its neighbouring nodes that are not in the element

Todo:
We should probably assert here that the node is in fact contained in the element (#1305)

Definition at line 701 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNeighbouringNodeIndices().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNextEdgeGradientOfElementAtNode ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pElement,
unsigned  localIndex 
) [inline]

Compute the gradient of the edge of a 2D element starting at its nodes.

N.B. This calls GetVectorFromAtoB(), which can be overridden in daughter classes for non-Euclidean metrics.

Parameters:
pElement pointer to a specified vertex element
localIndex local index of a node in this element
Returns:
the gradient of the edge of the element that starts at this node.

Definition at line 1092 of file VertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistanceBetweenNodes(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB().

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetPerimeterGradientOfElementAtNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllElements (  )  const [inline]
Returns:
the number of VertexElements in the mesh, including those marked as deleted.

Definition at line 584 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements (  )  const [inline, virtual]
Returns:
the number of VertexElements in the mesh.

Definition at line 577 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumFaces (  )  const [inline, virtual]
Returns:
the number of Faces in the mesh.

Definition at line 591 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::mFaces.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes (  )  const [inline, virtual]
Returns:
the number of Nodes in the mesh.

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 570 of file VertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by VertexMeshWriter< ELEMENT_DIM, SPACE_DIM >::WriteVtkUsingMesh().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetPerimeterGradientOfElementAtNode ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pElement,
unsigned  localIndex 
) [inline]

Compute the gradient of the perimeter of a 2D element at its nodes. This returns the sum of GetPreviousEdgeGradientAtNode() and GetNextEdgeGradientAtNode().

Parameters:
pElement pointer to a specified vertex element
localIndex local index of a node in this element
Returns:
the gradient of the perimeter of the element, evaluated at this node.

Definition at line 1113 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetNextEdgeGradientOfElementAtNode(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetPreviousEdgeGradientOfElementAtNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetPerimeterOfElement ( unsigned  index  )  [inline]

Compute the perimeter of a 2D element.

N.B. This calls GetVectorFromAtoB(), which can be overridden in daughter classes for non-Euclidean metrics.

Parameters:
index the global index of a specified vertex element
Returns:
the perimeter of the element

Definition at line 1156 of file VertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistanceBetweenNodes(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetPreviousEdgeGradientOfElementAtNode ( VertexElement< ELEMENT_DIM, SPACE_DIM > *  pElement,
unsigned  localIndex 
) [inline]

Compute the gradient of the edge of a 2D element ending at its nodes.

N.B. This calls GetVectorFromAtoB(), which can be overridden in daughter classes for non-Euclidean metrics.

Parameters:
pElement pointer to a specified vertex element
localIndex local index of a node in this element
Returns:
the gradient of the edge of the element that ends at this node.

Definition at line 1068 of file VertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetDistanceBetweenNodes(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB().

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetPerimeterGradientOfElementAtNode().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetShortAxisOfElement ( unsigned  index  )  [inline]

Calculate the vector of the shortest axis of a given 2D element. This is the eigenvector associated with the largest eigenvalue of the inertial tensor. If the polygon is regular then the eigenvalues are the same, so we return a random unit vector.

Todo:
This method is only called inside DivideElementAlongShortAxis() - get rid of it and move the code into that method? (#1276)
Parameters:
index the global index of a specified vertex element
Returns:
(short_axis_x, short_axis_y).

Definition at line 999 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::CalculateMomentsOfElement(), RandomNumberGenerator::Instance(), and RandomNumberGenerator::ranf().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetSurfaceAreaOfElement ( unsigned  index  )  [inline, virtual]

Compute the surface area of a 3D element.

This needs to be overridden in daughter classes for non-Euclidean metrics.

Parameters:
index the global index of a specified vertex element
Returns:
the surfacearea of the element

Definition at line 1322 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetAreaOfFace(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetFace(), and VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNumFaces().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
c_vector< double, SPACE_DIM > VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetUnitNormalToFace ( VertexElement< ELEMENT_DIM-1, SPACE_DIM > *  pFace  )  [inline]

Compute the unit normal vector to a given face in 3D. This is achieved from a triangle of vertices of the face. Note: this may return the outward or inward normal, depending on your point of view.

Parameters:
pFace a face in the mesh
Returns:
the unit normal

Definition at line 1189 of file VertexMesh.cpp.

References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB().

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetAreaOfFace(), and VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
double VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement ( unsigned  index  )  [inline, virtual]

Compute the volume of a 3D element.

This needs to be overridden in daughter classes for non-Euclidean metrics.

Parameters:
index the global index of a specified vertex element
Returns:
the volume of the element

Definition at line 1289 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetAreaOfFace(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetFace(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), VertexElement< ELEMENT_DIM, SPACE_DIM >::GetNumFaces(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetUnitNormalToFace(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void VertexMesh< ELEMENT_DIM, SPACE_DIM >::load ( Archive &  archive,
const unsigned int  version 
) [inline, protected]

Loads a mesh by using VertexMeshReader and the location in ArchiveLocationInfo.

Parameters:
archive the archive
version the current version of this class

Definition at line 164 of file VertexMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void VertexMesh< ELEMENT_DIM, SPACE_DIM >::save ( Archive &  archive,
const unsigned int  version 
) const [inline, protected]

Archive the VertexMesh and its member variables. Note that this will write out a VertexMeshWriter file to wherever ArchiveLocationInfo has specified.

Parameters:
archive the archive
version the current version of this class

Definition at line 146 of file VertexMesh.hpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::SolveBoundaryElementMapping ( unsigned  index  )  const [inline, protected]

Solve boundary element mapping method. This overridden method is required as it is pure virtual in the base class.

Parameters:
index the global index of the boundary element

Todo:
sort out boundary elements in a vertex mesh (#943)

Definition at line 535 of file VertexMesh.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::SolveElementMapping ( unsigned  index  )  const [inline, protected]

Solve element mapping method. This overridden method is required as it is pure virtual in the base class.

Parameters:
index the global index of the element

Definition at line 527 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
unsigned VertexMesh< ELEMENT_DIM, SPACE_DIM >::SolveNodeMapping ( unsigned  index  )  const [inline, protected, virtual]

Solve node mapping method. This overridden method is required as it is pure virtual in the base class.

Parameters:
index the global index of the node

Implements AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 519 of file VertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMesh< ELEMENT_DIM, SPACE_DIM >::Translate ( const double  xMovement = 0.0,
const double  yMovement = 0.0,
const double  zMovement = 0.0 
) [inline]

Translate the mesh given the coordinate displacements separately.

Parameters:
xMovement is the x-displacement (defaults to 0.0)
yMovement is the y-displacement (defaults to 0.0)
zMovement is the z-displacement (defaults to 0.0)

Definition at line 788 of file VertexMesh.cpp.

References VertexMesh< ELEMENT_DIM, SPACE_DIM >::Translate().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void VertexMesh< ELEMENT_DIM, SPACE_DIM >::Translate ( c_vector< double, SPACE_DIM > &  rDisplacement  )  [inline]

Translate the mesh given the displacement vector. This is the translation method that actually does the work.

Parameters:
rDisplacement is a translation vector of the correct size

Definition at line 810 of file VertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllNodes(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.

Referenced by VertexMesh< ELEMENT_DIM, SPACE_DIM >::Translate().


Friends And Related Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 136 of file VertexMesh.hpp.


Member Data Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<VertexElement<ELEMENT_DIM, SPACE_DIM>*> VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements [protected]
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
std::vector<VertexElement<ELEMENT_DIM-1, SPACE_DIM>*> VertexMesh< ELEMENT_DIM, SPACE_DIM >::mFaces [protected]

The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.2