Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
Cylindrical2dVertexMesh Class Reference

#include <Cylindrical2dVertexMesh.hpp>

+ Inheritance diagram for Cylindrical2dVertexMesh:
+ Collaboration diagram for Cylindrical2dVertexMesh:

Public Member Functions

 Cylindrical2dVertexMesh (double width, std::vector< Node< 2 > * > nodes, std::vector< VertexElement< 2, 2 > * > vertexElements, double cellRearrangementThreshold=0.01, double t2Threshold=0.001)
 
 Cylindrical2dVertexMesh (Cylindrical2dMesh &rMesh, bool isBounded=false)
 
 ~Cylindrical2dVertexMesh ()
 
c_vector< double, 2 > GetVectorFromAtoB (const c_vector< double, 2 > &rLocation1, const c_vector< double, 2 > &rLocation2)
 
void SetNode (unsigned nodeIndex, ChastePoint< 2 > point)
 
double GetWidth (const unsigned &rDimension) const
 
unsigned AddNode (Node< 2 > *pNewNode)
 
void CheckNodeLocation (Node< 2 > *pNode)
 
void Scale (const double xScale=1.0, const double yScale=1.0, const double zScale=1.0)
 
VertexMesh< 2, 2 > * GetMeshForVtk ()
 
- Public Member Functions inherited from MutableVertexMesh< 2, 2 >
void PerformNodeMerge (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
 MutableVertexMesh (std::vector< Node< SPACE_DIM > * > nodes, std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > vertexElements, double cellRearrangementThreshold=0.01, double t2Threshold=0.001, double cellRearrangementRatio=1.5, double protorosetteFormationProbability=0.0, double protorosetteResolutionProbabilityPerTimestep=0.0, double rosetteResolutionProbabilityPerTimestep=0.0)
 
 MutableVertexMesh ()
 
virtual ~MutableVertexMesh ()
 
void SetCellRearrangementThreshold (double cellRearrangementThreshold)
 
void SetT2Threshold (double t2Threshold)
 
void SetCellRearrangementRatio (double cellRearrangementRatio)
 
void SetProtorosetteFormationProbability (double protorosetteFormationProbability)
 
void SetProtorosetteResolutionProbabilityPerTimestep (double protorosetteResolutionProbabilityPerTimestep)
 
void SetRosetteResolutionProbabilityPerTimestep (double rosetteResolutionProbabilityPerTimestep)
 
virtual void SetNode (unsigned nodeIndex, ChastePoint< SPACE_DIM > point)
 
void SetCheckForInternalIntersections (bool checkForInternalIntersections)
 
void SetCheckForT3Swaps (bool checkForT3Swaps)
 
double GetCellRearrangementThreshold () const
 
double GetT2Threshold () const
 
double GetCellRearrangementRatio () const
 
double GetProtorosetteFormationProbability () const
 
double GetProtorosetteResolutionProbabilityPerTimestep () const
 
double GetRosetteResolutionProbabilityPerTimestep () const
 
void SetDistanceForT3SwapChecking (double distanceForT3SwapChecking)
 
double GetDistanceForT3SwapChecking () const
 
unsigned GetNumNodes () const
 
unsigned GetNumElements () const
 
bool GetCheckForInternalIntersections () const
 
bool GetCheckForT3Swaps () const
 
std::vector< c_vector< double, SPACE_DIM > > GetLocationsOfT1Swaps ()
 
c_vector< double, SPACE_DIM > GetLastT2SwapLocation ()
 
std::vector< c_vector< double, SPACE_DIM > > GetLocationsOfT3Swaps ()
 
std::vector< c_vector< double, SPACE_DIM > > GetLocationsOfIntersectionSwaps ()
 
void ClearLocationsOfT1Swaps ()
 
void ClearLocationsOfT3Swaps ()
 
void ClearLocationsOfIntersectionSwaps ()
 
unsigned AddNode (Node< SPACE_DIM > *pNewNode)
 
void DeleteElementPriorToReMesh (unsigned index)
 
void DeleteNodePriorToReMesh (unsigned index)
 
unsigned DivideElementAlongShortAxis (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, bool placeOriginalElementBelow=false)
 
unsigned DivideElementAlongGivenAxis (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, c_vector< double, SPACE_DIM > axisOfDivision, bool placeOriginalElementBelow=false)
 
unsigned AddElement (VertexElement< ELEMENT_DIM, SPACE_DIM > *pNewElement)
 
bool CheckForT2Swaps (VertexElementMap &rElementMap)
 
void Clear ()
 
void DivideEdge (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
void RemoveDeletedNodesAndElements (VertexElementMap &rElementMap)
 
void RemoveDeletedNodes ()
 
virtual void ReMesh (VertexElementMap &rElementMap)
 
void ReMesh ()
 
void SetMeshOperationTracking (const bool track)
 
VertexMeshOperationRecorder< ELEMENT_DIM, SPACE_DIM > * GetOperationRecorder ()
 
- Public Member Functions inherited from VertexMesh< ELEMENT_DIM, SPACE_DIM >
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, bool isPeriodic=false, bool isBounded=false, bool scaleBoundByEdgeLength=true, double maxDelaunayEdgeLength=DBL_MAX, bool offsetNewBoundaryNodes=false)
 Alternative 2D 'Voronoi' constructor.
 
 VertexMesh (TetrahedralMesh< 3, 3 > &rMesh)
 
 VertexMesh ()
 
virtual ~VertexMesh ()
 
unsigned GetNumEdges () const
 
Edge< SPACE_DIM > * GetEdge (unsigned index) const
 
const EdgeHelper< SPACE_DIM > & rGetEdgeHelper () 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)
 
unsigned GetDelaunayNodeIndexCorrespondingToVoronoiElementIndex (unsigned elementIndex)
 
unsigned GetVoronoiElementIndexCorrespondingToDelaunayNodeIndex (unsigned nodeIndex)
 
unsigned GetRosetteRankOfElement (unsigned index)
 
virtual c_vector< double, SPACE_DIM > GetVectorFromAtoB (const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB)
 
virtual double GetVolumeOfElement (unsigned index)
 
virtual double GetSurfaceAreaOfElement (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)
 
double GetElongationShapeFactorOfElement (unsigned elementIndex)
 
double CalculateUnitNormalToFaceWithArea (VertexElement< ELEMENT_DIM - 1, SPACE_DIM > *pFace, c_vector< double, SPACE_DIM > &rNormal)
 
virtual double CalculateAreaOfFace (VertexElement< ELEMENT_DIM - 1, SPACE_DIM > *pFace)
 
c_vector< double, SPACE_DIM > GetShortAxisOfElement (unsigned index)
 
std::set< unsignedGetNeighbouringNodeIndices (unsigned nodeIndex)
 
std::set< unsignedGetNeighbouringNodeNotAlsoInElement (unsigned nodeIndex, unsigned elemIndex)
 
std::set< unsignedGetNeighbouringElementIndices (unsigned elementIndex)
 
bool IsNearExistingNodes (c_vector< double, SPACE_DIM > newNodeLocation, std::vector< Node< SPACE_DIM > * > nodesToCheck, double minClearance)
 
- Public Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
NodeIterator GetNodeIteratorBegin (bool skipDeletedNodes=true)
 
NodeIterator GetNodeIteratorEnd ()
 
 AbstractMesh ()
 
virtual ~AbstractMesh ()
 
unsigned GetNumBoundaryNodes () const
 
virtual unsigned GetNumAllNodes () const
 
unsigned GetNumNodeAttributes () const
 
Node< SPACE_DIM > * GetNode (unsigned index) const
 
virtual Node< SPACE_DIM > * GetNodeOrHaloNode (unsigned index) const
 
Node< SPACE_DIM > * GetNodeFromPrePermutationIndex (unsigned index) const
 
virtual void ReadNodesPerProcessorFile (const std::string &rNodesPerProcessorFile)
 
virtual DistributedVectorFactoryGetDistributedVectorFactory ()
 
virtual void SetDistributedVectorFactory (DistributedVectorFactory *pFactory)
 
virtual void PermuteNodes ()
 
BoundaryNodeIterator GetBoundaryNodeIteratorBegin () const
 
BoundaryNodeIterator GetBoundaryNodeIteratorEnd () const
 
std::string GetMeshFileBaseName () const
 
bool IsMeshOnDisk () const
 
const std::vector< unsigned > & rGetNodePermutation () const
 
double GetDistanceBetweenNodes (unsigned indexA, unsigned indexB)
 
virtual ChasteCuboid< SPACE_DIM > CalculateBoundingBox () const
 
virtual unsigned GetNearestNodeIndex (const ChastePoint< SPACE_DIM > &rTestPoint)
 
virtual void Translate (const c_vector< double, SPACE_DIM > &rDisplacement)
 
void Translate (const double xMovement=0.0, const double yMovement=0.0, const double zMovement=0.0)
 
virtual void Rotate (c_matrix< double, SPACE_DIM, SPACE_DIM > rotationMatrix)
 
void Rotate (c_vector< double, 3 > axis, double angle)
 
void RotateX (const double theta)
 
void RotateY (const double theta)
 
void RotateZ (const double theta)
 
void Rotate (double theta)
 
virtual void RefreshMesh ()
 
bool IsMeshChanging () const
 
unsigned CalculateMaximumContainingElementsPerProcess () const
 
void SetMeshHasChangedSinceLoading ()
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 
 Cylindrical2dVertexMesh ()
 

Private Attributes

double mWidth
 
VertexMesh< 2, 2 > * mpMeshForVtk
 

Friends

class TestCylindrical2dVertexMesh
 
class boost::serialization::access
 

Additional Inherited Members

- Public Types inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
typedef std::vector< Node< SPACE_DIM > * >::const_iterator BoundaryNodeIterator
 
- Protected Member Functions inherited from MutableVertexMesh< 2, 2 >
unsigned DivideElement (VertexElement< ELEMENT_DIM, SPACE_DIM > *pElement, unsigned nodeAIndex, unsigned nodeBIndex, bool placeOriginalElementBelow=false)
 
virtual bool CheckForSwapsFromShortEdges ()
 
bool CheckForIntersections ()
 
virtual void IdentifySwapType (Node< SPACE_DIM > *pNodeA, Node< SPACE_DIM > *pNodeB)
 
- Protected Member Functions inherited from VertexMesh< ELEMENT_DIM, SPACE_DIM >
unsigned SolveNodeMapping (unsigned index) const
 
unsigned SolveElementMapping (unsigned index) const
 
unsigned SolveBoundaryElementMapping (unsigned index) const
 
void GenerateEdgesFromElements (std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > &rElements)
 
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 Member Functions inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
virtual void SetElementOwnerships ()
 
ChasteCuboid< SPACE_DIM > CalculateBoundingBox (const std::vector< Node< SPACE_DIM > * > &rNodes) const
 
- Protected Attributes inherited from MutableVertexMesh< 2, 2 >
bool mTrackMeshOperations
 
VertexMeshOperationRecorder< ELEMENT_DIM, SPACE_DIM > mOperationRecorder
 
double mCellRearrangementThreshold
 
double mCellRearrangementRatio
 
double mT2Threshold
 
double mProtorosetteFormationProbability
 
double mProtorosetteResolutionProbabilityPerTimestep
 
double mRosetteResolutionProbabilityPerTimestep
 
bool mCheckForInternalIntersections
 
bool mCheckForT3Swaps
 
std::vector< unsignedmDeletedNodeIndices
 
std::vector< unsignedmDeletedElementIndices
 
double mDistanceForT3SwapChecking
 
c_vector< double, SPACE_DIM > mLastT2SwapLocation
 
std::vector< c_vector< double, SPACE_DIM > > mLocationsOfIntersectionSwaps
 
- Protected Attributes inherited from VertexMesh< ELEMENT_DIM, SPACE_DIM >
std::vector< VertexElement< ELEMENT_DIM, SPACE_DIM > * > mElements
 
std::vector< VertexElement< ELEMENT_DIM - 1, SPACE_DIM > * > mFaces
 
EdgeHelper< SPACE_DIM > mEdgeHelper
 
std::map< unsigned, unsignedmVoronoiElementIndexMap
 
TetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpDelaunayMesh
 
- Protected Attributes inherited from AbstractMesh< ELEMENT_DIM, SPACE_DIM >
std::vector< Node< SPACE_DIM > * > mNodes
 
std::vector< Node< SPACE_DIM > * > mBoundaryNodes
 
DistributedVectorFactorympDistributedVectorFactory
 
std::vector< unsignedmNodePermutation
 
std::string mMeshFileBaseName
 
bool mMeshChangesDuringSimulation
 

Detailed Description

A subclass of MutableVertexMesh<2,2> for a rectangular mesh with periodic left and right boundaries, representing a cylindrical geometry.

The class works by overriding calls such as ReMesh() and GetVectorFromAtoB() so that simulation classes can treat this class in exactly the same way as a MutableMesh<2,2>.

Definition at line 53 of file Cylindrical2dVertexMesh.hpp.

Constructor & Destructor Documentation

◆ Cylindrical2dVertexMesh() [1/3]

Cylindrical2dVertexMesh::Cylindrical2dVertexMesh ( )
private

Constructor - used for serialization only.

Definition at line 334 of file Cylindrical2dVertexMesh.cpp.

◆ Cylindrical2dVertexMesh() [2/3]

Cylindrical2dVertexMesh::Cylindrical2dVertexMesh ( double  width,
std::vector< Node< 2 > * >  nodes,
std::vector< VertexElement< 2, 2 > * >  vertexElements,
double  cellRearrangementThreshold = 0.01,
double  t2Threshold = 0.001 
)

Default constructor.

Parameters
widththe width (circumference) of the mesh
nodesvector of pointers to nodes
vertexElementsvector of pointers to VertexElements
cellRearrangementThresholdthe minimum threshold distance for element rearrangement (defaults to 0.01)
t2Thresholdthe maximum threshold distance for Type 2 swaps (defaults to 0.001)

Definition at line 39 of file Cylindrical2dVertexMesh.cpp.

References MutableVertexMesh< 2, 2 >::ReMesh().

◆ Cylindrical2dVertexMesh() [3/3]

Cylindrical2dVertexMesh::Cylindrical2dVertexMesh ( Cylindrical2dMesh rMesh,
bool  isBounded = false 
)

◆ ~Cylindrical2dVertexMesh()

Cylindrical2dVertexMesh::~Cylindrical2dVertexMesh ( )

Destructor.

Definition at line 339 of file Cylindrical2dVertexMesh.cpp.

References mpMeshForVtk.

Member Function Documentation

◆ AddNode()

unsigned Cylindrical2dVertexMesh::AddNode ( Node< 2 > *  pNewNode)

Overridden AddNode() method.

Parameters
pNewNodethe node to be added to the mesh
Returns
the global index of the new node

Definition at line 401 of file Cylindrical2dVertexMesh.cpp.

References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), and CheckNodeLocation().

◆ CheckNodeLocation()

void Cylindrical2dVertexMesh::CheckNodeLocation ( Node< 2 > *  pNode)

Helper method to check if a node is within, x in [0,mWidth) and move back into the domain if needed.

Parameters
pNodethe node to be checked

Definition at line 410 of file Cylindrical2dVertexMesh.cpp.

References mWidth, Node< SPACE_DIM >::rGetLocation(), and Node< SPACE_DIM >::rGetModifiableLocation().

Referenced by Cylindrical2dVertexMesh(), and AddNode().

◆ GetMeshForVtk()

◆ GetVectorFromAtoB()

c_vector< double, 2 > Cylindrical2dVertexMesh::GetVectorFromAtoB ( const c_vector< double, 2 > &  rLocation1,
const c_vector< double, 2 > &  rLocation2 
)

Overridden GetVectorFromAtoB() method. This method evaluates the (surface) distance between two points in a 2D cylindrical geometry.

Parameters
rLocation1the x and y co-ordinates of point 1
rLocation2the x and y co-ordinates of point 2
Returns
the vector from location1 to location2

Definition at line 347 of file Cylindrical2dVertexMesh.cpp.

References mWidth.

◆ GetWidth()

double Cylindrical2dVertexMesh::GetWidth ( const unsigned rDimension) const
virtual

Overridden GetWidth() method.

Calculate the 'width' of any dimension of the mesh, taking periodicity into account.

Parameters
rDimensiona dimension (0 or 1)
Returns
The maximum distance between any nodes in this dimension.

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 386 of file Cylindrical2dVertexMesh.cpp.

References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetWidth(), and mWidth.

◆ Scale()

void Cylindrical2dVertexMesh::Scale ( const double  xScale = 1.0,
const double  yScale = 1.0,
const double  zScale = 1.0 
)
virtual

Overridden Scale method to also scale the width (mWidth) of the mesh

Parameters
xScaleis the scale in the x-direction (defaults to 1.0)
yScaleis the scale in the y-direction (defaults to 1.0)
zScaleis the scale in the z-direction (defaults to 1.0) note this has to be 1.0 as only a 2d Mesh

Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.

Definition at line 423 of file Cylindrical2dVertexMesh.cpp.

References mWidth, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::Scale().

◆ serialize()

template<class Archive >
void Cylindrical2dVertexMesh::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archives the member variables of the object which have to be preserved during its lifetime.

The remaining member variables are re-initialised before being used by each ReMesh() call so they do not need to be archived.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 81 of file Cylindrical2dVertexMesh.hpp.

References mWidth.

◆ SetNode()

void Cylindrical2dVertexMesh::SetNode ( unsigned  nodeIndex,
ChastePoint< 2 >  point 
)

Overridden SetNode() method.

If the location should be set outside a cylindrical boundary move it back onto the cylinder.

Parameters
nodeIndexis the index of the node to be moved
pointis the new target location of the node

Definition at line 366 of file Cylindrical2dVertexMesh.cpp.

References mWidth, ChastePoint< DIM >::rGetLocation(), ChastePoint< DIM >::SetCoordinate(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetNode().

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 69 of file Cylindrical2dVertexMesh.hpp.

◆ TestCylindrical2dVertexMesh

friend class TestCylindrical2dVertexMesh
friend

Definition at line 55 of file Cylindrical2dVertexMesh.hpp.

Member Data Documentation

◆ mpMeshForVtk

VertexMesh<2,2>* Cylindrical2dVertexMesh::mpMeshForVtk
private

Auxiliary mesh pointer, created/updated when GetMeshForVtk() is called and stored so that it may be deleted by the destructor.

Definition at line 66 of file Cylindrical2dVertexMesh.hpp.

Referenced by ~Cylindrical2dVertexMesh(), and GetMeshForVtk().

◆ mWidth

double Cylindrical2dVertexMesh::mWidth
private

The circumference of the cylinder.

Definition at line 60 of file Cylindrical2dVertexMesh.hpp.

Referenced by CheckNodeLocation(), GetMeshForVtk(), GetVectorFromAtoB(), GetWidth(), Scale(), serialize(), and SetNode().


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