Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
|
#include <Toroidal2dVertexMesh.hpp>
Public Member Functions | |
Toroidal2dVertexMesh (double width, double height, std::vector< Node< 2 > * > nodes, std::vector< VertexElement< 2, 2 > * > vertexElements, double cellRearrangementThreshold=0.01, double t2Threshold=0.001) | |
Toroidal2dVertexMesh () | |
Toroidal2dVertexMesh (Toroidal2dMesh &rMesh, bool isBounded=false) | |
~Toroidal2dVertexMesh () | |
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 |
void | SetHeight (double height) |
void | SetWidth (double width) |
unsigned | AddNode (Node< 2 > *pNewNode) |
void | CheckNodeLocation (Node< 2 > *pNode) |
VertexMesh< 2, 2 > * | GetMeshForVtk () |
void | ConstructFromMeshReader (AbstractMeshReader< 2, 2 > &rMeshReader, double width, double height) |
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< unsigned > | GetNeighbouringNodeIndices (unsigned nodeIndex) |
std::set< unsigned > | GetNeighbouringNodeNotAlsoInElement (unsigned nodeIndex, unsigned elemIndex) |
std::set< unsigned > | GetNeighbouringElementIndices (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 DistributedVectorFactory * | GetDistributedVectorFactory () |
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 | Scale (const double xFactor=1.0, const double yFactor=1.0, const double zFactor=1.0) |
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) |
Private Attributes | |
double | mWidth |
double | mHeight |
VertexMesh< 2, 2 > * | mpMeshForVtk |
Friends | |
class | TestToroidal2dVertexMesh |
class | boost::serialization::access |
A subclass of MutableVertexMesh<2,2> for a rectangular mesh with periodic left and right boundaries and top and bottom boundaries, representing a toroidal 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 54 of file Toroidal2dVertexMesh.hpp.
Toroidal2dVertexMesh::Toroidal2dVertexMesh | ( | double | width, |
double | height, | ||
std::vector< Node< 2 > * > | nodes, | ||
std::vector< VertexElement< 2, 2 > * > | vertexElements, | ||
double | cellRearrangementThreshold = 0.01 , |
||
double | t2Threshold = 0.001 |
||
) |
Default constructor.
width | the width of the mesh |
height | the height of the mesh |
nodes | vector of pointers to nodes |
vertexElements | vector of pointers to VertexElements |
cellRearrangementThreshold | the minimum threshold distance for element rearrangement (defaults to 0.01) |
t2Threshold | the maximum threshold distance for Type 2 swaps (defaults to 0.001) |
Definition at line 39 of file Toroidal2dVertexMesh.cpp.
References MutableVertexMesh< 2, 2 >::ReMesh().
Toroidal2dVertexMesh::Toroidal2dVertexMesh | ( | ) |
Constructor.
Definition at line 280 of file Toroidal2dVertexMesh.cpp.
Toroidal2dVertexMesh::Toroidal2dVertexMesh | ( | Toroidal2dMesh & | rMesh, |
bool | isBounded = false |
||
) |
Alternative constructor. Creates a Voronoi tessellation of a given Toroidal2dMesh, which must be Delaunay (see TetrahedralMesh::CheckIsVoronoi).
rMesh | a Toroidal2dMesh |
isBounded | a boolean to indicate whether to bound the voronoi tesselation. Defaults to false. |
Create a std::vector of pairs, where each pair comprises the angle between the centre of the Voronoi element and each node with that node's global index in the Voronoi mesh.
Definition at line 54 of file Toroidal2dVertexMesh.cpp.
References MutableElement< ELEMENT_DIM, SPACE_DIM >::AddNode(), CheckNodeLocation(), MutableVertexMesh< 2, 2 >::Clear(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GenerateVerticesFromElementCircumcentres(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetElement(), AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::GetNumAllElements(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::IsNearExistingNodes(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mMeshChangesDuringSimulation, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, VertexMesh< ELEMENT_DIM, SPACE_DIM >::mpDelaunayMesh, and Node< SPACE_DIM >::rGetLocation().
Toroidal2dVertexMesh::~Toroidal2dVertexMesh | ( | ) |
Overridden AddNode() method.
pNewNode | the node to be added to the mesh |
Definition at line 380 of file Toroidal2dVertexMesh.cpp.
References MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::AddNode(), and CheckNodeLocation().
void Toroidal2dVertexMesh::CheckNodeLocation | ( | Node< 2 > * | pNode | ) |
Helper method to check if a node is within [0,mWidth]x[0,mHeight] and move back into the domain if needed.
pNode | the node to be checked |
Definition at line 390 of file Toroidal2dVertexMesh.cpp.
References mHeight, mWidth, Node< SPACE_DIM >::rGetLocation(), and Node< SPACE_DIM >::rGetModifiableLocation().
Referenced by Toroidal2dVertexMesh(), and AddNode().
void Toroidal2dVertexMesh::ConstructFromMeshReader | ( | AbstractMeshReader< 2, 2 > & | rMeshReader, |
double | width, | ||
double | height | ||
) |
Construct the mesh using a MeshReader.
rMeshReader | the mesh reader |
width | the mesh width |
height | the mesh height |
Definition at line 742 of file Toroidal2dVertexMesh.cpp.
References ElementData::AttributeValue, EXCEPTION, AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextElementData(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNextNode(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElementAttributes(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumElements(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetVolumeOfElement(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::HasNodePermutation(), MutableVertexMesh< 2, 2 >::mCellRearrangementRatio, MutableVertexMesh< 2, 2 >::mCellRearrangementThreshold, VertexMesh< ELEMENT_DIM, SPACE_DIM >::mElements, mHeight, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mMeshChangesDuringSimulation, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, mpMeshForVtk, MutableVertexMesh< 2, 2 >::mT2Threshold, mWidth, ElementData::NodeIndices, AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::SetAttribute().
|
virtual |
Overridden GetMeshForVtk() method.
Return a pointer to an extended mesh that is a 'non-periodic' version of our mesh. This can then be used when writing to VTK.
Reimplemented from VertexMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 412 of file Toroidal2dVertexMesh.cpp.
References VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetDelaunayNodeIndexCorrespondingToVoronoiElementIndex(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorBegin(), VertexMesh< ELEMENT_DIM, SPACE_DIM >::GetElementIteratorEnd(), Node< SPACE_DIM >::GetIndex(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), MutableVertexMesh< 2, 2 >::GetNumNodes(), mHeight, VertexMesh< ELEMENT_DIM, SPACE_DIM >::mpDelaunayMesh, mpMeshForVtk, and mWidth.
c_vector< double, 2 > Toroidal2dVertexMesh::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 toroidal geometry.
rLocation1 | the x and y co-ordinates of point 1 |
rLocation2 | the x and y co-ordinates of point 2 |
Definition at line 293 of file Toroidal2dVertexMesh.cpp.
Overridden GetWidth() method.
Calculate the 'width' of any dimension of the mesh, taking periodicity into account.
rDimension | a dimension (0 or 1) |
Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 355 of file Toroidal2dVertexMesh.cpp.
|
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.
archive | the archive |
version | the current version of this class |
Definition at line 85 of file Toroidal2dVertexMesh.hpp.
References mHeight, mpMeshForVtk, and mWidth.
void Toroidal2dVertexMesh::SetHeight | ( | double | height | ) |
Set mHeight.
height | the new value of mHeight |
Definition at line 368 of file Toroidal2dVertexMesh.cpp.
References mHeight.
void Toroidal2dVertexMesh::SetNode | ( | unsigned | nodeIndex, |
ChastePoint< 2 > | point | ||
) |
Overridden SetNode() method.
If the location should be set outside a toroidal boundary move it back onto the cylinder.
nodeIndex | is the index of the node to be moved |
point | is the new target location of the node |
Definition at line 324 of file Toroidal2dVertexMesh.cpp.
References mHeight, mWidth, ChastePoint< DIM >::rGetLocation(), ChastePoint< DIM >::SetCoordinate(), and MutableVertexMesh< ELEMENT_DIM, SPACE_DIM >::SetNode().
void Toroidal2dVertexMesh::SetWidth | ( | double | width | ) |
Set mWidth.
width | the new value of mWidth |
Definition at line 374 of file Toroidal2dVertexMesh.cpp.
References mWidth.
|
friend |
Needed for serialization.
Definition at line 73 of file Toroidal2dVertexMesh.hpp.
|
friend |
Definition at line 56 of file Toroidal2dVertexMesh.hpp.
|
private |
The height of the mesh, taking account of top-bottom periodicity.
Definition at line 64 of file Toroidal2dVertexMesh.hpp.
Referenced by CheckNodeLocation(), ConstructFromMeshReader(), GetMeshForVtk(), GetVectorFromAtoB(), GetWidth(), serialize(), SetHeight(), and SetNode().
|
private |
Auxiliary mesh pointer, created/updated when GetMeshForVtk() is called and stored so that it may be deleted by the destructor.
Definition at line 70 of file Toroidal2dVertexMesh.hpp.
Referenced by ~Toroidal2dVertexMesh(), ConstructFromMeshReader(), GetMeshForVtk(), and serialize().
|
private |
The width of the mesh, taking account of left-right periodicity.
Definition at line 61 of file Toroidal2dVertexMesh.hpp.
Referenced by CheckNodeLocation(), ConstructFromMeshReader(), GetMeshForVtk(), GetVectorFromAtoB(), GetWidth(), serialize(), SetNode(), and SetWidth().