Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
|
#include <PottsMesh.hpp>
Classes | |
class | PottsElementIterator |
Public Member Functions | |
PottsElementIterator | GetElementIteratorBegin (bool skipDeletedElements=true) |
PottsElementIterator | GetElementIteratorEnd () |
PottsMesh (std::vector< Node< DIM > * > nodes, std::vector< PottsElement< DIM > * > pottsElements, std::vector< std::set< unsigned > > vonNeumannNeighbouringNodeIndices, std::vector< std::set< unsigned > > mooreNeighbouringNodeIndices) | |
PottsMesh () | |
virtual | ~PottsMesh () |
virtual unsigned | GetNumNodes () const |
virtual unsigned | GetNumElements () const |
unsigned | GetNumAllElements () const |
PottsElement< DIM > * | GetElement (unsigned index) const |
virtual c_vector< double, DIM > | GetCentroidOfElement (unsigned index) |
void | ConstructFromMeshReader (AbstractMeshReader< DIM, DIM > &rMeshReader) |
virtual void | Clear () |
virtual double | GetVolumeOfElement (unsigned index) |
virtual double | GetSurfaceAreaOfElement (unsigned index) |
std::set< unsigned > | GetMooreNeighbouringNodeIndices (unsigned nodeIndex) |
std::set< unsigned > | GetVonNeumannNeighbouringNodeIndices (unsigned nodeIndex) |
void | DeleteNode (unsigned index) |
void | DeleteElement (unsigned index) |
void | RemoveDeletedElements () |
unsigned | DivideElement (PottsElement< DIM > *pElement, bool placeOriginalElementBelow=false) |
unsigned | AddElement (PottsElement< DIM > *pNewElement) |
std::set< unsigned > | GetNeighbouringElementIndices (unsigned elementIndex) |
Public Member Functions inherited from AbstractMesh< DIM, DIM > | |
virtual ChasteCuboid< SPACE_DIM > | CalculateBoundingBox () const |
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 |
virtual c_vector< double, SPACE_DIM > | GetVectorFromAtoB (const c_vector< double, SPACE_DIM > &rLocationA, const c_vector< double, SPACE_DIM > &rLocationB) |
double | GetDistanceBetweenNodes (unsigned indexA, unsigned indexB) |
virtual double | GetWidth (const unsigned &rDimension) 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 | Rotate (double theta) |
void | RotateX (const double theta) |
void | RotateY (const double theta) |
void | RotateZ (const double theta) |
virtual void | RefreshMesh () |
bool | IsMeshChanging () const |
unsigned | CalculateMaximumContainingElementsPerProcess () const |
void | SetMeshHasChangedSinceLoading () |
Protected Member Functions | |
unsigned | SolveNodeMapping (unsigned index) const |
unsigned | SolveElementMapping (unsigned index) const |
unsigned | SolveBoundaryElementMapping (unsigned index) const |
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< DIM, DIM > | |
virtual void | SetElementOwnerships () |
ChasteCuboid< SPACE_DIM > | CalculateBoundingBox (const std::vector< Node< SPACE_DIM > * > &rNodes) const |
Protected Attributes | |
std::vector< PottsElement< DIM > * > | mElements |
std::vector< unsigned > | mDeletedElementIndices |
std::vector< std::set< unsigned > > | mVonNeumannNeighbouringNodeIndices |
std::vector< std::set< unsigned > > | mMooreNeighbouringNodeIndices |
Protected Attributes inherited from AbstractMesh< DIM, DIM > | |
std::vector< Node< SPACE_DIM > * > | mNodes |
std::vector< Node< SPACE_DIM > * > | mBoundaryNodes |
DistributedVectorFactory * | mpDistributedVectorFactory |
std::vector< unsigned > | mNodePermutation |
std::string | mMeshFileBaseName |
bool | mMeshChangesDuringSimulation |
Friends | |
class | TestPottsMesh |
class | boost::serialization::access |
Additional Inherited Members | |
Public Types inherited from AbstractMesh< DIM, DIM > | |
typedef std::vector< Node< SPACE_DIM > * >::const_iterator | BoundaryNodeIterator |
A Potts-based mesh class, for use in Cellular Potts model simulations.
Definition at line 63 of file PottsMesh.hpp.
PottsMesh< DIM >::PottsMesh | ( | std::vector< Node< DIM > * > | nodes, |
std::vector< PottsElement< DIM > * > | pottsElements, | ||
std::vector< std::set< unsigned > > | vonNeumannNeighbouringNodeIndices, | ||
std::vector< std::set< unsigned > > | mooreNeighbouringNodeIndices | ||
) |
Default constructor.
nodes | vector of pointers to nodes |
pottsElements | vector of pointers to PottsElements |
vonNeumannNeighbouringNodeIndices | vector of set of Moore neighbours for each node |
mooreNeighbouringNodeIndices | vector of set of Von Neumann neighbours for each node |
Definition at line 41 of file PottsMesh.cpp.
References EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
PottsMesh< DIM >::PottsMesh | ( | ) |
Default constructor for use by serializer.
Definition at line 87 of file PottsMesh.cpp.
Destructor.
Definition at line 94 of file PottsMesh.cpp.
unsigned PottsMesh< DIM >::AddElement | ( | PottsElement< DIM > * | pNewElement | ) |
Add an element to the mesh.
pNewElement | the new element |
Definition at line 513 of file PottsMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), and MutableElement< ELEMENT_DIM, SPACE_DIM >::RegisterWithNodes().
Delete mNodes and mElements.
Definition at line 120 of file PottsMesh.cpp.
void PottsMesh< DIM >::ConstructFromMeshReader | ( | AbstractMeshReader< DIM, DIM > & | rMeshReader | ) |
Construct the mesh using a MeshReader.
rMeshReader | the mesh reader |
Definition at line 574 of file PottsMesh.cpp.
References ElementData::AttributeValue, 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(), AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::HasNodePermutation(), ElementData::NodeIndices, AbstractMeshReader< ELEMENT_DIM, SPACE_DIM >::Reset(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::SetAttribute().
Referenced by PottsMesh< DIM >::load().
Mark an element as deleted. Note that in a Potts mesh this does not delete the nodes so no remeshing is required.
index | the global index of a specified Potts element |
Definition at line 245 of file PottsMesh.cpp.
Mark a node as deleted. Note that in a Potts mesh this requires the elements and connectivity to be updated accordingly.
index | the global index of a specified node |
Definition at line 272 of file PottsMesh.cpp.
unsigned PottsMesh< DIM >::DivideElement | ( | PottsElement< DIM > * | pElement, |
bool | placeOriginalElementBelow = false |
||
) |
Divide an element by assigning half the nodes to each new element in numerical order. If an odd number of nodes then the existing element has one more node than the new element.
pElement | the element to divide |
placeOriginalElementBelow | whether to place the original element below (in the y direction) the new element (defaults to false) |
Not implemented in 1d
Remove the correct nodes from each element. If placeOriginalElementBelow is true, place the original element below (in the y direction or z in 3d) the new element; otherwise, place it above.
Definition at line 386 of file PottsMesh.cpp.
References MutableElement< ELEMENT_DIM, SPACE_DIM >::DeleteNode(), EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
|
virtual |
Compute the centroid of an element.
This needs to be overridden in daughter classes for non-Euclidean metrics.
index | the global index of a specified vertex element |
Definition at line 169 of file PottsMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeLocation(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
PottsElement< DIM > * PottsMesh< DIM >::GetElement | ( | unsigned | index | ) | const |
index | the global index of a specified PottsElement. |
Definition at line 162 of file PottsMesh.cpp.
|
inline |
skipDeletedElements | whether to include deleted element |
Definition at line 422 of file PottsMesh.hpp.
|
inline |
Definition at line 429 of file PottsMesh.hpp.
std::set< unsigned > PottsMesh< DIM >::GetMooreNeighbouringNodeIndices | ( | unsigned | nodeIndex | ) |
Given a node, return a set containing the indices of its Moore neighbouring nodes.
nodeIndex | global index of the node |
Definition at line 233 of file PottsMesh.cpp.
Referenced by ExclusionCaBasedDivisionRule< SPACE_DIM >::CalculateDaughterNodeIndex(), ShovingCaBasedDivisionRule< SPACE_DIM >::CalculateDaughterNodeIndex(), CaBasedCellPopulation< DIM >::GetNeighbouringLocationIndices(), ExclusionCaBasedDivisionRule< SPACE_DIM >::IsRoomToDivide(), and CaBasedCellPopulation< DIM >::UpdateCellLocations().
std::set< unsigned > PottsMesh< DIM >::GetNeighbouringElementIndices | ( | unsigned | elementIndex | ) |
Given an element, find a set containing the indices of its neighbouring elements.
elementIndex | global index of the element |
Definition at line 530 of file PottsMesh.cpp.
References Node< SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
Definition at line 156 of file PottsMesh.cpp.
Definition at line 150 of file PottsMesh.cpp.
Reimplemented from AbstractMesh< DIM, DIM >.
Definition at line 144 of file PottsMesh.cpp.
Referenced by PottsMeshWriter< SPACE_DIM >::WriteFilesUsingMesh().
Compute the surface area (or perimeter in 2D) of a PottsElement.
This needs to be overridden in daughter classes for non-Euclidean metrics.
index | the global index of a specified PottsElement |
Definition at line 198 of file PottsMesh.cpp.
Get the volume (or area in 2D, or length in 1D) of a PottsElement.
This needs to be overridden in daughter classes for non-Euclidean metrics.
index | the global index of a specified PottsElement element |
Definition at line 189 of file PottsMesh.cpp.
References AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes().
std::set< unsigned > PottsMesh< DIM >::GetVonNeumannNeighbouringNodeIndices | ( | unsigned | nodeIndex | ) |
Given a node, return a set containing the indices of its Von Neumann neighbouring nodes.
nodeIndex | global index of the node |
Definition at line 239 of file PottsMesh.cpp.
Referenced by CryptShovingCaBasedDivisionRule::CalculateDaughterNodeIndex(), and CryptShovingCaBasedDivisionRule::IsNodeOnBase().
|
inlineprotected |
Loads a mesh by using PottsMeshReader and the location in ArchiveLocationInfo.
archive | the archive |
version | the current version of this class |
Definition at line 143 of file PottsMesh.hpp.
References PottsMesh< DIM >::ConstructFromMeshReader(), ArchiveLocationInfo::GetArchiveDirectory(), ArchiveLocationInfo::GetMeshFilename(), PottsMesh< DIM >::mDeletedElementIndices, PottsMesh< DIM >::mMooreNeighbouringNodeIndices, and PottsMesh< DIM >::mVonNeumannNeighbouringNodeIndices.
Remove deleted elements and reorder them appropriately
Definition at line 253 of file PottsMesh.cpp.
|
inlineprotected |
Archive the PottsMesh and its member variables. Note that this will write out a PottsMeshWriter file to wherever ArchiveLocationInfo has specified.
archive | the archive |
version | the current version of this class |
Definition at line 121 of file PottsMesh.hpp.
References ArchiveLocationInfo::GetArchiveRelativePath(), ArchiveLocationInfo::GetMeshFilename(), PottsMesh< DIM >::mDeletedElementIndices, PottsMesh< DIM >::mMooreNeighbouringNodeIndices, PottsMesh< DIM >::mVonNeumannNeighbouringNodeIndices, and PottsMeshWriter< SPACE_DIM >::WriteFilesUsingMesh().
|
protected |
Solve boundary element mapping method. This overridden method is required as it is pure virtual in the base class.
index | the global index of the boundary element |
Definition at line 114 of file PottsMesh.cpp.
|
protected |
Solve element mapping method. This overridden method is required as it is pure virtual in the base class.
index | the global index of the element |
Definition at line 107 of file PottsMesh.cpp.
|
protectedvirtual |
Solve node mapping method. This overridden method is required as it is pure virtual in the base class.
index | the global index of the node |
Implements AbstractMesh< DIM, DIM >.
Definition at line 100 of file PottsMesh.cpp.
|
friend |
Needed for serialization.
Definition at line 111 of file PottsMesh.hpp.
|
friend |
Definition at line 65 of file PottsMesh.hpp.
Indices of elements that have been marked as deleted. These indices can be reused when adding new elements.
Definition at line 75 of file PottsMesh.hpp.
Referenced by PottsMesh< DIM >::load(), and PottsMesh< DIM >::save().
|
protected |
Vector of pointers to PottsElements.
Definition at line 69 of file PottsMesh.hpp.
|
protected |
Vector of set of Moore neighbours for each node.
Definition at line 81 of file PottsMesh.hpp.
Referenced by PottsMesh< DIM >::load(), and PottsMesh< DIM >::save().
|
protected |
Vector of set of Von Neumann neighbours for each node.
Definition at line 78 of file PottsMesh.hpp.
Referenced by PottsMesh< DIM >::load(), and PottsMesh< DIM >::save().