Chaste Release::3.1
|
#include <MutableMesh.hpp>
Public Member Functions | |
MutableMesh () | |
MutableMesh (std::vector< Node< SPACE_DIM > * > nodes) | |
virtual | ~MutableMesh () |
void | Clear () |
unsigned | GetNumNodes () const |
unsigned | GetNumElements () const |
unsigned | GetNumBoundaryElements () const |
void | RescaleMeshFromBoundaryNode (ChastePoint< 1 > updatedPoint, unsigned boundaryNodeIndex) |
virtual unsigned | AddNode (Node< SPACE_DIM > *pNewNode) |
virtual void | SetNode (unsigned index, ChastePoint< SPACE_DIM > point, bool concreteMove=true) |
void | MoveMergeNode (unsigned index, unsigned targetIndex, bool concreteMove=true) |
virtual void | DeleteNode (unsigned index) |
void | DeleteNodePriorToReMesh (unsigned index) |
unsigned | RefineElement (Element< ELEMENT_DIM, SPACE_DIM > *pElement, ChastePoint< SPACE_DIM > point) |
void | DeleteBoundaryNodeAt (unsigned index) |
void | ReIndex (NodeMap &map) |
virtual void | ReMesh (NodeMap &map) |
void | ReMesh () |
bool | CheckIsVoronoi (double maxPenetration=0.0) |
template<> | |
void | RescaleMeshFromBoundaryNode (ChastePoint< 1 > updatedPoint, unsigned boundaryNodeIndex) |
Protected Attributes | |
std::vector< unsigned > | mDeletedElementIndices |
std::vector< unsigned > | mDeletedBoundaryElementIndices |
std::vector< unsigned > | mDeletedNodeIndices |
bool | mAddedNodes |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
bool | CheckIsVoronoi (Element< ELEMENT_DIM, SPACE_DIM > *pElement, double maxPenetration) |
Friends | |
class | boost::serialization::access |
A concrete mutable mesh class.
Definition at line 49 of file MutableMesh.hpp.
MutableMesh< ELEMENT_DIM, SPACE_DIM >::MutableMesh | ( | ) |
Constructor.
Definition at line 53 of file MutableMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mMeshChangesDuringSimulation.
MutableMesh< ELEMENT_DIM, SPACE_DIM >::MutableMesh | ( | std::vector< Node< SPACE_DIM > * > | nodes | ) |
Constructor which takes in a vector of nodes.
nodes | a vector of nodes |
Definition at line 60 of file MutableMesh.cpp.
MutableMesh< ELEMENT_DIM, SPACE_DIM >::~MutableMesh | ( | ) | [virtual] |
Destructor.
Definition at line 75 of file MutableMesh.cpp.
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::AddNode | ( | Node< SPACE_DIM > * | pNewNode | ) | [virtual] |
Add a node to the mesh.
NB. After calling this one or more times, you must then call ReMesh
pNewNode | pointer to the new node |
Reimplemented in NodesOnlyMesh< SPACE_DIM >, and NodesOnlyMesh< DIM >.
Definition at line 81 of file MutableMesh.cpp.
References Node< SPACE_DIM >::GetIndex(), and Node< SPACE_DIM >::SetIndex().
Referenced by NodesOnlyMesh< SPACE_DIM >::AddNode().
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckIsVoronoi | ( | Element< ELEMENT_DIM, SPACE_DIM > * | pElement, |
double | maxPenetration | ||
) | [private] |
Check whether any neighbouring node is inside the circumsphere of this element.
pElement | pointer to an element |
maxPenetration | is the maximum distance a node is allowed to be inside the circumsphere of the element, as a proportion of the circumsphere radius. |
Definition at line 760 of file MutableMesh.cpp.
References Element< ELEMENT_DIM, SPACE_DIM >::CalculateCircumsphere(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), and Node< SPACE_DIM >::rGetContainingElementIndices().
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::CheckIsVoronoi | ( | double | maxPenetration = 0.0 | ) |
Checks the entire mesh element by element and checks whether any neighbouring node is inside the circumsphere of this element.
maxPenetration | is the maximum distance a node is allowed to be inside the circumsphere of an element that it is not a member of, as a proportion of the circumsphere radius. |
Definition at line 844 of file MutableMesh.cpp.
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::Clear | ( | ) | [virtual] |
Clear all the data in the mesh.
Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in NodesOnlyMesh< SPACE_DIM >, and NodesOnlyMesh< DIM >.
Definition at line 101 of file MutableMesh.cpp.
References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::Clear().
Referenced by NodesOnlyMesh< SPACE_DIM >::Clear().
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteBoundaryNodeAt | ( | unsigned | index | ) |
Remove a boundary node, and update all the appropriate data structures.
The deleted node is not removed from the list, merely marked as deleted, and can be reused when a new node is added to the mesh.
Any elements or boundary elements containing this node will be removed. The boundary nodes information will be updated with new boundary node(s). NB: New boundary elements WILL NOT be added.
index | The index of the node to remove. |
Definition at line 461 of file MutableMesh.cpp.
References EXCEPTION, AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetIndex(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), Node< SPACE_DIM >::IsDeleted(), Element< ELEMENT_DIM, SPACE_DIM >::MarkAsDeleted(), and Node< SPACE_DIM >::SetAsBoundaryNode().
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNode | ( | unsigned | index | ) | [virtual] |
Delete a node from the mesh by finding an appropriate neighbour node to merge it with.
index | is the index of the node to be deleted |
Reimplemented in NodesOnlyMesh< SPACE_DIM >, and NodesOnlyMesh< DIM >.
Definition at line 208 of file MutableMesh.cpp.
References EXCEPTION, and AbstractElement< ELEMENT_DIM, SPACE_DIM >::GetNodeGlobalIndex().
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::DeleteNodePriorToReMesh | ( | unsigned | index | ) |
Mark a node as deleted. Note that this method DOES NOT deal with the associated elements and therefore should only be called immediately prior to a ReMesh() being called. (Thus saves work compared to DeleteNode() function and does not MoveMerge the node and elements).
index | The index of the node to delete |
Definition at line 244 of file MutableMesh.cpp.
Referenced by HoneycombMeshGenerator::GetCircularMesh(), and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::RemoveDeadCells().
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumBoundaryElements | ( | ) | const [virtual] |
Get the number of boundary elements that are actually in use.
Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 112 of file MutableMesh.cpp.
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumElements | ( | ) | const [virtual] |
Get the number of elements that are actually in use.
Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 118 of file MutableMesh.cpp.
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes | ( | ) | const [virtual] |
Get the number of nodes that are actually in use.
Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 124 of file MutableMesh.cpp.
Referenced by HoneycombMeshGenerator::GetCellLocationIndices(), HoneycombMeshGenerator::GetCircularMesh(), and MutableMesh< SPACE_DIM, SPACE_DIM >::serialize().
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::MoveMergeNode | ( | unsigned | index, |
unsigned | targetIndex, | ||
bool | concreteMove = true |
||
) |
Move one node to another (i.e. merges the nodes), refreshing/deleting elements as appropriate.
index | is the index of the node to be moved |
targetIndex | is the index of the node to move to |
concreteMove | can be set to false if you just want to check whether this will work (defaults to true). Set it to true if you're doing the merger for real, in order to do all the bookkeeping. |
Definition at line 251 of file MutableMesh.cpp.
References EXCEPTION.
unsigned MutableMesh< ELEMENT_DIM, SPACE_DIM >::RefineElement | ( | Element< ELEMENT_DIM, SPACE_DIM > * | pElement, |
ChastePoint< SPACE_DIM > | point | ||
) |
Refine an element at a given point.
pElement | pointer to the element |
point | a point located in the element |
Definition at line 405 of file MutableMesh.cpp.
References EXCEPTION, Element< ELEMENT_DIM, SPACE_DIM >::IncludesPoint(), ChastePoint< DIM >::rGetLocation(), and Element< ELEMENT_DIM, SPACE_DIM >::UpdateNode().
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReIndex | ( | NodeMap & | map | ) |
Re-index a mesh so that it has no deleted elements or nodes.
map | is a NodeMap which associates the indices of nodes in the old mesh with indices of nodes in the new mesh. This should be created with the correct size (NumAllNodes) |
Definition at line 510 of file MutableMesh.cpp.
References NodeMap::Resize(), NodeMap::SetDeleted(), AbstractElement< ELEMENT_DIM, SPACE_DIM >::SetIndex(), and NodeMap::SetNewIndex().
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh | ( | ) |
Alternative version of remesh which takes no parameters does not require a NodeMap. Note: inherited classes should overload ReMesh(NodeMap&)
Definition at line 753 of file MutableMesh.cpp.
Referenced by MutableMesh< SPACE_DIM, SPACE_DIM >::serialize().
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::ReMesh | ( | NodeMap & | map | ) | [virtual] |
Re-mesh a mesh using triangle (via library calls) or tetgen
map | is a NodeMap which associates the indices of nodes in the old mesh with indices of nodes in the new mesh. This should be created with the correct size (NumAllNodes) |
Reimplemented in Cylindrical2dMesh, NodesOnlyMesh< SPACE_DIM >, and NodesOnlyMesh< DIM >.
Definition at line 620 of file MutableMesh.cpp.
References EXCEPTION, Node< SPACE_DIM >::GetIndex(), NodeMap::Resize(), NodeMap::SetDeleted(), and NodeMap::SetNewIndex().
Referenced by CylindricalHoneycombMeshGenerator::CylindricalHoneycombMeshGenerator(), HoneycombMeshGenerator::GetCircularMesh(), and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::Update().
void MutableMesh< 1, 1 >::RescaleMeshFromBoundaryNode | ( | ChastePoint< 1 > | updatedPoint, |
unsigned | boundaryNodeIndex | ||
) |
The RescaleMeshFromBoundaryNode method is only defined for 1D meshes.
updatedPoint | point determining the scale factor |
boundaryNodeIndex | index of the boundary node |
Definition at line 136 of file MutableMesh.cpp.
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::RescaleMeshFromBoundaryNode | ( | ChastePoint< 1 > | updatedPoint, |
unsigned | boundaryNodeIndex | ||
) |
Rescale the mesh from a boundary node.
updatedPoint | point determining the scale factor |
boundaryNodeIndex | index of the boundary node |
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::serialize | ( | Archive & | archive, |
const unsigned int | version | ||
) | [inline, private] |
Serialize the mesh.
Note that if you are calling this method (from subclasses) you should archive your member variables FIRST. So that this method can call a ReMesh (to convert from TrianglesMeshReader input format into your native format).
archive | the archive |
version | the current version of this class |
Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in Cylindrical2dMesh, NodesOnlyMesh< SPACE_DIM >, and NodesOnlyMesh< DIM >.
Definition at line 65 of file MutableMesh.hpp.
void MutableMesh< ELEMENT_DIM, SPACE_DIM >::SetNode | ( | unsigned | index, |
ChastePoint< SPACE_DIM > | point, | ||
bool | concreteMove = true |
||
) | [virtual] |
Move the node with a particular index to a new point in space and verifies that the signed areas of the supporting Elements are positive.
index | is the index of the node to be moved |
point | is the new target location of the node |
concreteMove | is set to false if we want to skip the signed area tests (defaults to true) |
Definition at line 151 of file MutableMesh.cpp.
References EXCEPTION.
Referenced by MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::SetNode(), MeshBasedCellPopulationWithGhostNodes< DIM >::UpdateGhostPositions(), and NodeBasedCellPopulationWithParticles< DIM >::UpdateParticlePositions().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in Cylindrical2dMesh, NodesOnlyMesh< SPACE_DIM >, and NodesOnlyMesh< DIM >.
Definition at line 52 of file MutableMesh.hpp.
bool MutableMesh< ELEMENT_DIM, SPACE_DIM >::mAddedNodes [protected] |
Whether any nodes have been added to the mesh.
Definition at line 98 of file MutableMesh.hpp.
std::vector<unsigned> MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedBoundaryElementIndices [protected] |
Indices of boundary elements that have been marked as deleted. These indices can be reused when adding new boundary elements.
Definition at line 89 of file MutableMesh.hpp.
std::vector<unsigned> MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedElementIndices [protected] |
Indices of elements that have been marked as deleted. These indices can be reused when adding new elements.
Definition at line 83 of file MutableMesh.hpp.
std::vector<unsigned> MutableMesh< ELEMENT_DIM, SPACE_DIM >::mDeletedNodeIndices [protected] |
Indices of nodes that have been marked as deleted. These indices can be reused when adding new nodes.
Definition at line 95 of file MutableMesh.hpp.