#include <NodesOnlyMesh.hpp>
Inherits MutableMesh< SPACE_DIM, SPACE_DIM >.
Public Member Functions | |
NodesOnlyMesh () | |
virtual | ~NodesOnlyMesh () |
void | ConstructNodesWithoutMesh (const std::vector< Node< SPACE_DIM > * > &rNodes, double maxInteractionDistance) |
void | ConstructNodesWithoutMesh (const AbstractMesh< SPACE_DIM, SPACE_DIM > &rGeneratingMesh, double maxInteractionDistance) |
std::vector< bool > & | rGetInitiallyOwnedNodes () |
void | Clear () |
unsigned | SolveNodeMapping (unsigned index) const |
Node< SPACE_DIM > * | GetNodeOrHaloNode (unsigned index) const |
bool | IsOwned (c_vector< double, SPACE_DIM > &location) |
unsigned | GetNumNodes () const |
virtual unsigned | GetMaximumNodeIndex () |
void | SetMaximumInteractionDistance (double maxDistance) |
double | GetMaximumInteractionDistance () |
double | GetWidth (const unsigned &rDimension) const |
void | SetCalculateNodeNeighbours (bool calculateNodeNeighbours) |
void | CalculateInteriorNodePairs (std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs, std::map< unsigned, std::set< unsigned > > &rNodeNeighbours) |
void | CalculateBoundaryNodePairs (std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > &rNodePairs, std::map< unsigned, std::set< unsigned > > &rNodeNeighbours) |
void | ReMesh (NodeMap &rMap) |
void | SetInitialBoxCollection (const c_vector< double, 2 *SPACE_DIM > domainSize, double maxInteractionDistance) |
void | UpdateBoxCollection () |
void | ResizeBoxCollection () |
void | AddNodesToBoxes () |
void | AddHaloNodesToBoxes () |
void | CalculateNodesOutsideLocalDomain () |
std::vector< unsigned > & | rGetNodesToSendLeft () |
std::vector< unsigned > & | rGetNodesToSendRight () |
std::vector< unsigned > & | rGetHaloNodesToSendRight () |
std::vector< unsigned > & | rGetHaloNodesToSendLeft () |
void | AddHaloNode (boost::shared_ptr< Node< SPACE_DIM > > pNewNode) |
void | ClearHaloNodes () |
unsigned | AddNode (Node< SPACE_DIM > *pNewNode) |
void | AddMovedNode (boost::shared_ptr< Node< SPACE_DIM > > pMovedNode) |
void | DeleteNode (unsigned index) |
void | DeleteMovedNode (unsigned index) |
void | SetMinimumNodeDomainBoundarySeparation (double separation) |
void | LoadBalanceMesh () |
void | ConstructFromMeshReader (AbstractMeshReader< SPACE_DIM, SPACE_DIM > &rMeshReader) |
Protected Member Functions | |
void | ClearBoxCollection () |
virtual void | SetUpBoxCollection (double cutOffLength, c_vector< double, 2 *SPACE_DIM > domainSize, int numLocalRows=PETSC_DECIDE, bool isPeriodic=false) |
DistributedBoxCollection < SPACE_DIM > * | GetBoxCollection () |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
unsigned | GetNextAvailableIndex () |
void | EnlargeBoxCollection () |
bool | IsANodeCloseToDomainBoundary () |
void | SetUpBoxCollection (const std::vector< Node< SPACE_DIM > * > &rNodes) |
void | RemoveDeletedNodes (NodeMap &map) |
void | UpdateNodeIndices () |
void | AddNodeWithFixedIndex (Node< SPACE_DIM > *pNewNode) |
Private Attributes | |
std::vector< boost::shared_ptr < Node< SPACE_DIM > > > | mHaloNodes |
double | mMaximumInteractionDistance |
std::map< unsigned, unsigned > | mNodesMapping |
std::map< unsigned, unsigned > | mHaloNodesMapping |
unsigned | mIndexCounter |
double | mMinimumNodeDomainBoundarySeparation |
std::vector< unsigned > | mDeletedGlobalNodeIndices |
std::vector< unsigned > | mNodesToSendRight |
std::vector< unsigned > | mNodesToSendLeft |
std::vector< bool > | mLocalInitialNodes |
unsigned | mMaxAddedNodeIndex |
DistributedBoxCollection < SPACE_DIM > * | mpBoxCollection |
bool | mCalculateNodeNeighbours |
Friends | |
class | TestNodesOnlyMesh |
class | boost::serialization::access |
Mesh class for storing lists of nodes (no elements). This inherits from MutableMesh because we want to be able to add and delete nodes.
Definition at line 52 of file NodesOnlyMesh.hpp.
NodesOnlyMesh< SPACE_DIM >::NodesOnlyMesh | ( | ) | [inline] |
Default constructor to initialise BoxCollection to NULL.
Definition at line 41 of file NodesOnlyMesh.cpp.
NodesOnlyMesh< SPACE_DIM >::~NodesOnlyMesh | ( | ) | [inline, virtual] |
Over-written destructor to delete pointer to BoxCollection.
Definition at line 53 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::Clear(), and NodesOnlyMesh< SPACE_DIM >::ClearBoxCollection().
void NodesOnlyMesh< SPACE_DIM >::AddHaloNode | ( | boost::shared_ptr< Node< SPACE_DIM > > | pNewNode | ) | [inline] |
Add a temporary halo node on this process.
pNewNode | a shared pointer to the new node to add. |
Definition at line 349 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mHaloNodes, and NodesOnlyMesh< SPACE_DIM >::mHaloNodesMapping.
Referenced by NodeBasedCellPopulation< DIM >::AddHaloCell().
void NodesOnlyMesh< SPACE_DIM >::AddHaloNodesToBoxes | ( | ) | [inline] |
Iterate through each halo node and add it to its appropriate box.
Definition at line 572 of file NodesOnlyMesh.cpp.
References DistributedBoxCollection< DIM >::CalculateContainingBox(), NodesOnlyMesh< SPACE_DIM >::mHaloNodes, NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, and DistributedBoxCollection< DIM >::rGetHaloBox().
Referenced by NodeBasedCellPopulation< DIM >::AddReceivedHaloCells().
void NodesOnlyMesh< SPACE_DIM >::AddMovedNode | ( | boost::shared_ptr< Node< SPACE_DIM > > | pMovedNode | ) | [inline] |
Add a node to this process that has moved from another process.
pMovedNode | the node to add to this mesh. |
Definition at line 375 of file NodesOnlyMesh.cpp.
References Node< SPACE_DIM >::AddNodeAttribute(), NodesOnlyMesh< SPACE_DIM >::AddNodeWithFixedIndex(), Node< SPACE_DIM >::SetIsParticle(), Node< SPACE_DIM >::SetRadius(), and Node< SPACE_DIM >::SetRegion().
Referenced by NodeBasedCellPopulation< DIM >::AddMovedCell().
unsigned NodesOnlyMesh< SPACE_DIM >::AddNode | ( | Node< SPACE_DIM > * | pNewNode | ) | [inline, virtual] |
Overridden AddNode() method.
pNewNode | pointer to the new node. |
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 364 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::AddNodeWithFixedIndex(), NodesOnlyMesh< SPACE_DIM >::GetNextAvailableIndex(), and Node< SPACE_DIM >::SetIndex().
Referenced by NodeBasedCellPopulation< DIM >::AddNode(), and ParallelCellsGenerator< CELL_CYCLE_MODEL, DIM >::GenerateParallelCells().
void NodesOnlyMesh< SPACE_DIM >::AddNodesToBoxes | ( | ) | [inline] |
Iterate through each node and add it to its appropriate box.
Definition at line 559 of file NodesOnlyMesh.cpp.
References DistributedBoxCollection< DIM >::CalculateContainingBox(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd(), NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, and DistributedBoxCollection< DIM >::rGetBox().
Referenced by NodesOnlyMesh< SPACE_DIM >::UpdateBoxCollection().
void NodesOnlyMesh< SPACE_DIM >::AddNodeWithFixedIndex | ( | Node< SPACE_DIM > * | pNewNode | ) | [inline, private] |
Add pNewNode to the mesh, maintaining its current global index. Called by AddNode and AddMovedNode.
pNewNode | the new node to add to this mesh. |
Definition at line 320 of file NodesOnlyMesh.cpp.
References Node< SPACE_DIM >::GetIndex(), MutableMesh< SPACE_DIM, SPACE_DIM >::mAddedNodes, MutableMesh< SPACE_DIM, SPACE_DIM >::mDeletedNodeIndices, NodesOnlyMesh< SPACE_DIM >::mMaxAddedNodeIndex, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, NodesOnlyMesh< SPACE_DIM >::mNodesMapping, and Node< SPACE_DIM >::SetRadius().
Referenced by NodesOnlyMesh< SPACE_DIM >::AddMovedNode(), and NodesOnlyMesh< SPACE_DIM >::AddNode().
void NodesOnlyMesh< SPACE_DIM >::CalculateBoundaryNodePairs | ( | std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > & | rNodePairs, | |
std::map< unsigned, std::set< unsigned > > & | rNodeNeighbours | |||
) | [inline] |
Calculate pairs of nodes from boxes on the process boundary using the BoxCollection
rNodePairs | reference to the set of node pairs to populate. | |
rNodeNeighbours | reference to the list of neighbouring nodes for each node. |
Definition at line 213 of file NodesOnlyMesh.cpp.
References DistributedBoxCollection< DIM >::CalculateBoundaryNodePairs(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and NodesOnlyMesh< SPACE_DIM >::mpBoxCollection.
Referenced by NodeBasedCellPopulation< DIM >::Update().
void NodesOnlyMesh< SPACE_DIM >::CalculateInteriorNodePairs | ( | std::vector< std::pair< Node< SPACE_DIM > *, Node< SPACE_DIM > * > > & | rNodePairs, | |
std::map< unsigned, std::set< unsigned > > & | rNodeNeighbours | |||
) | [inline] |
Calculate pairs of nodes from interior boxes using the BoxCollection.
rNodePairs | reference to the set of node pairs to populate. | |
rNodeNeighbours | reference to the list of neighbouring nodes for each node. |
Definition at line 205 of file NodesOnlyMesh.cpp.
References DistributedBoxCollection< DIM >::CalculateInteriorNodePairs(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and NodesOnlyMesh< SPACE_DIM >::mpBoxCollection.
Referenced by NodeBasedCellPopulation< DIM >::Update().
void NodesOnlyMesh< SPACE_DIM >::CalculateNodesOutsideLocalDomain | ( | ) | [inline] |
Work out which nodes lie outside the local domain and add their indices to the vectors mNodesToSendLeft and mNodesToSendRight.
Definition at line 270 of file NodesOnlyMesh.cpp.
References PetscTools::GetMyRank(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd(), DistributedBoxCollection< DIM >::GetProcessOwningNode(), NodesOnlyMesh< SPACE_DIM >::mNodesToSendLeft, NodesOnlyMesh< SPACE_DIM >::mNodesToSendRight, and NodesOnlyMesh< SPACE_DIM >::mpBoxCollection.
Referenced by NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation().
void NodesOnlyMesh< SPACE_DIM >::Clear | ( | ) | [inline, virtual] |
Overridden Clear() method for NodesOnlyMesh.
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 119 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mIndexCounter, and NodesOnlyMesh< SPACE_DIM >::mNodesMapping.
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), and NodesOnlyMesh< SPACE_DIM >::~NodesOnlyMesh().
void NodesOnlyMesh< SPACE_DIM >::ClearBoxCollection | ( | ) | [inline, protected] |
Clear the BoxCollection
Definition at line 515 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mpBoxCollection.
Referenced by NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection(), and NodesOnlyMesh< SPACE_DIM >::~NodesOnlyMesh().
void NodesOnlyMesh< SPACE_DIM >::ClearHaloNodes | ( | ) | [inline] |
Delete all the halo nodes on this process.
Definition at line 356 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mHaloNodes, and NodesOnlyMesh< SPACE_DIM >::mHaloNodesMapping.
Referenced by NodeBasedCellPopulation< DIM >::RefreshHaloCells().
void NodesOnlyMesh< SPACE_DIM >::ConstructFromMeshReader | ( | AbstractMeshReader< SPACE_DIM, SPACE_DIM > & | rMeshReader | ) | [inline] |
Overridden ConstructFromMeshReader to correctly assign global node indices on load.
rMeshReader | the mesh reader for input. |
Definition at line 631 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::GetNextAvailableIndex(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
void NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh | ( | const AbstractMesh< SPACE_DIM, SPACE_DIM > & | rGeneratingMesh, | |
double | maxInteractionDistance | |||
) | [inline] |
A Helper method to enable you to construct a nodes-only mesh by stripping the nodes TetrahedralMesh, this calls the ConstructNodesWithoutMesh method with the nodes
rGeneratingMesh | any mesh with nodes, used to generate the NodesOnlyMesh. | |
maxInteractionDistance | the distance that defines node neighbours in CalculateNodePairs. |
Definition at line 94 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
void NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh | ( | const std::vector< Node< SPACE_DIM > * > & | rNodes, | |
double | maxInteractionDistance | |||
) | [inline] |
Construct the mesh using only nodes. No mesh is created, but the nodes are stored. The original vector of nodes is deep-copied: new node objects are made with are independent of the pointers in the input so that they can be safely deleted.
If this is the only way of constructing a mesh of this type, then we can be certain that elements and boundary elements are always unused.
rNodes | a vector of pointers to nodes. | |
maxInteractionDistance | the distance that defines node neighbours in CalculateNodePairs. |
Definition at line 60 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::Clear(), Node< SPACE_DIM >::GetIndex(), NodesOnlyMesh< SPACE_DIM >::GetNextAvailableIndex(), DistributedBoxCollection< DIM >::IsOwned(), NodesOnlyMesh< SPACE_DIM >::mLocalInitialNodes, NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance, NodesOnlyMesh< SPACE_DIM >::mMinimumNodeDomainBoundarySeparation, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, NodesOnlyMesh< SPACE_DIM >::mNodesMapping, NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, Node< SPACE_DIM >::SetRadius(), and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), PottsBasedCellPopulation< DIM >::WriteVtkResultsToFile(), MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::WriteVtkResultsToFile(), and CaBasedCellPopulation< DIM >::WriteVtkResultsToFile().
void NodesOnlyMesh< SPACE_DIM >::DeleteMovedNode | ( | unsigned | index | ) | [inline] |
Make a clean delete of a node that has moved off this process.
index | the global index of the node moving off this process. |
Definition at line 420 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::DeleteNode(), and NodesOnlyMesh< SPACE_DIM >::mDeletedGlobalNodeIndices.
Referenced by NodeBasedCellPopulation< DIM >::DeleteMovedCell().
void NodesOnlyMesh< SPACE_DIM >::DeleteNode | ( | unsigned | index | ) | [inline, virtual] |
Overridden DeleteNode() method.
index | of the node to be deleted |
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 405 of file NodesOnlyMesh.cpp.
References EXCEPTION, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), NodesOnlyMesh< SPACE_DIM >::mDeletedGlobalNodeIndices, MutableMesh< SPACE_DIM, SPACE_DIM >::mDeletedNodeIndices, AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and NodesOnlyMesh< SPACE_DIM >::SolveNodeMapping().
Referenced by NodesOnlyMesh< SPACE_DIM >::DeleteMovedNode().
void NodesOnlyMesh< SPACE_DIM >::EnlargeBoxCollection | ( | ) | [inline, private] |
Increase box collection size by adding an extra row/face to each edge.
Definition at line 457 of file NodesOnlyMesh.cpp.
References PetscTools::AmMaster(), PetscTools::AmTopMost(), DistributedBoxCollection< DIM >::GetNumLocalRows(), NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance, NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, DistributedBoxCollection< DIM >::rGetDomainSize(), and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
Referenced by NodesOnlyMesh< SPACE_DIM >::ResizeBoxCollection().
DistributedBoxCollection< SPACE_DIM > * NodesOnlyMesh< SPACE_DIM >::GetBoxCollection | ( | ) | [inline, protected] |
Definition at line 131 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mpBoxCollection.
double NodesOnlyMesh< SPACE_DIM >::GetMaximumInteractionDistance | ( | ) | [inline] |
Definition at line 182 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance.
Referenced by ParallelCellsGenerator< CELL_CYCLE_MODEL, DIM >::GenerateParallelCells(), NodeBasedCellPopulation< DIM >::GetMechanicsCutOffLength(), NodeBasedCellPopulation< DIM >::GetNeighbouringNodeIndices(), and NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters().
unsigned NodesOnlyMesh< SPACE_DIM >::GetMaximumNodeIndex | ( | ) | [inline, virtual] |
Get the largest node global index on this process.
Reimplemented from AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 170 of file NodesOnlyMesh.cpp.
References PetscTools::GetMyRank(), PetscTools::GetNumProcs(), NodesOnlyMesh< SPACE_DIM >::mIndexCounter, and NodesOnlyMesh< SPACE_DIM >::mMaxAddedNodeIndex.
Referenced by ParallelCellsGenerator< CELL_CYCLE_MODEL, DIM >::GenerateParallelCells(), NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation(), NodeBasedCellPopulationWithParticles< DIM >::WriteVtkResultsToFile(), and NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile().
unsigned NodesOnlyMesh< SPACE_DIM >::GetNextAvailableIndex | ( | ) | [inline, private] |
Calculate the next unique global index available on this process. Uses a hashing function to ensure that a unique index is given to every node.
For example for 3 process they will have access to the following integers:
Proc 0: 0 3 6 9 12 ...
Proc 1: 1 4 7 10 13 ...
Proc 2: 2 5 8 11 14 ...
Deleted node indices can be locally re-used.
Deleted node indices of nodes that have *moved* process cannot be re-used.
Definition at line 437 of file NodesOnlyMesh.cpp.
References PetscTools::GetMyRank(), PetscTools::GetNumProcs(), NodesOnlyMesh< SPACE_DIM >::mDeletedGlobalNodeIndices, and NodesOnlyMesh< SPACE_DIM >::mIndexCounter.
Referenced by NodesOnlyMesh< SPACE_DIM >::AddNode(), NodesOnlyMesh< SPACE_DIM >::ConstructFromMeshReader(), and NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh().
Node< SPACE_DIM > * NodesOnlyMesh< SPACE_DIM >::GetNodeOrHaloNode | ( | unsigned | index | ) | const [inline, virtual] |
Overridden method to get node or halo node from the mesh.
index | the global index of the node. |
Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 137 of file NodesOnlyMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), NodesOnlyMesh< SPACE_DIM >::mHaloNodes, and NodesOnlyMesh< SPACE_DIM >::mHaloNodesMapping.
Referenced by NodeBasedCellPopulation< DIM >::GetNode().
unsigned NodesOnlyMesh< SPACE_DIM >::GetNumNodes | ( | ) | const [inline, virtual] |
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 164 of file NodesOnlyMesh.cpp.
References MutableMesh< SPACE_DIM, SPACE_DIM >::mDeletedNodeIndices, and AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes.
Referenced by NodeBasedCellPopulation< DIM >::GetNumNodes().
double NodesOnlyMesh< SPACE_DIM >::GetWidth | ( | const unsigned & | rDimension | ) | const [inline, virtual] |
Overridden GetWidth method to work in parallel.
rDimension | the dimension along which to get the width. |
Reimplemented from AbstractMesh< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in Cylindrical2dNodesOnlyMesh.
Definition at line 188 of file NodesOnlyMesh.cpp.
References PetscTools::GetWorld().
Referenced by NodeBasedCellPopulation< DIM >::GetWidth().
bool NodesOnlyMesh< SPACE_DIM >::IsANodeCloseToDomainBoundary | ( | ) | [inline, private] |
Definition at line 478 of file NodesOnlyMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd(), PetscTools::GetWorld(), NodesOnlyMesh< SPACE_DIM >::mMinimumNodeDomainBoundarySeparation, NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, and DistributedBoxCollection< DIM >::rGetDomainSize().
Referenced by NodesOnlyMesh< SPACE_DIM >::ResizeBoxCollection().
bool NodesOnlyMesh< SPACE_DIM >::IsOwned | ( | c_vector< double, SPACE_DIM > & | location | ) | [inline] |
A method to identify whether a location is owned in the parallel space decomposition.
location | the location to test |
Definition at line 158 of file NodesOnlyMesh.cpp.
References DistributedBoxCollection< DIM >::IsOwned(), and NodesOnlyMesh< SPACE_DIM >::mpBoxCollection.
Referenced by ParallelCellsGenerator< CELL_CYCLE_MODEL, DIM >::GenerateParallelCells().
void NodesOnlyMesh< SPACE_DIM >::LoadBalanceMesh | ( | ) | [inline] |
Re-allocate the underlaying BoxCollection rows based on the load-balance algorithm implemented in the box collection.
Definition at line 612 of file NodesOnlyMesh.cpp.
References DistributedBoxCollection< DIM >::CalculateNumberOfNodesInEachStrip(), DistributedBoxCollection< DIM >::LoadBalance(), NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance, NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, DistributedBoxCollection< DIM >::rGetDomainSize(), and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
Referenced by NodeBasedCellPopulation< DIM >::Update().
void NodesOnlyMesh< SPACE_DIM >::ReMesh | ( | NodeMap & | rMap | ) | [inline, virtual] |
Overridden ReMesh() method. Since only Nodes are stored, this method cleans up mNodes by removing nodes marked as deleted and reallocating mNodes to 'fill the gaps'.
rMap | a reference to a NodeMap which associates the indices of the old mesh with the new mesh. It should be large enough to contain all node indices. |
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Definition at line 221 of file NodesOnlyMesh.cpp.
References MutableMesh< SPACE_DIM, SPACE_DIM >::mAddedNodes, MutableMesh< SPACE_DIM, SPACE_DIM >::mDeletedNodeIndices, NodesOnlyMesh< SPACE_DIM >::RemoveDeletedNodes(), NodeMap::ResetToIdentity(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::SetMeshHasChangedSinceLoading(), and NodesOnlyMesh< SPACE_DIM >::UpdateNodeIndices().
Referenced by ParallelCellsGenerator< CELL_CYCLE_MODEL, DIM >::GenerateParallelCells(), NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation(), NodeBasedCellPopulationWithParticles< DIM >::WriteVtkResultsToFile(), and NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile().
void NodesOnlyMesh< SPACE_DIM >::RemoveDeletedNodes | ( | NodeMap & | map | ) | [inline, private] |
Remove all nodes that return mIsDeleted as true.
map | the NodeMap to record which nodes have been removed. |
Definition at line 236 of file NodesOnlyMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, NodesOnlyMesh< SPACE_DIM >::mNodesMapping, and NodeMap::SetDeleted().
Referenced by NodesOnlyMesh< SPACE_DIM >::ReMesh().
void NodesOnlyMesh< SPACE_DIM >::ResizeBoxCollection | ( | ) | [inline] |
Check whether any nodes are close to the edge of the box collection and increase the size of it if necessary.
Definition at line 598 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::EnlargeBoxCollection(), NodesOnlyMesh< SPACE_DIM >::IsANodeCloseToDomainBoundary(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
Referenced by NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation().
std::vector< unsigned > & NodesOnlyMesh< SPACE_DIM >::rGetHaloNodesToSendLeft | ( | ) | [inline] |
Definition at line 314 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, and DistributedBoxCollection< DIM >::rGetHaloNodesLeft().
Referenced by NodeBasedCellPopulation< DIM >::RefreshHaloCells().
std::vector< unsigned > & NodesOnlyMesh< SPACE_DIM >::rGetHaloNodesToSendRight | ( | ) | [inline] |
Definition at line 308 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, and DistributedBoxCollection< DIM >::rGetHaloNodesRight().
Referenced by NodeBasedCellPopulation< DIM >::RefreshHaloCells().
std::vector< bool > & NodesOnlyMesh< SPACE_DIM >::rGetInitiallyOwnedNodes | ( | ) | [inline] |
Definition at line 100 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mLocalInitialNodes.
std::vector< unsigned > & NodesOnlyMesh< SPACE_DIM >::rGetNodesToSendLeft | ( | ) | [inline] |
Definition at line 296 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mNodesToSendLeft.
Referenced by NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation().
std::vector< unsigned > & NodesOnlyMesh< SPACE_DIM >::rGetNodesToSendRight | ( | ) | [inline] |
Definition at line 302 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mNodesToSendRight.
Referenced by NodeBasedCellPopulation< DIM >::UpdateCellProcessLocation().
void NodesOnlyMesh< SPACE_DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Archives the member variables of the object which have to be preserved during its lifetime.
Note that we must archive any member variables FIRST so that this method can call a ReMesh (to convert from TrianglesMeshReader input format into our native format).
archive | the archive | |
version | the current version of this class |
Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Reimplemented in Cylindrical2dNodesOnlyMesh.
Definition at line 73 of file NodesOnlyMesh.hpp.
void NodesOnlyMesh< SPACE_DIM >::SetCalculateNodeNeighbours | ( | bool | calculateNodeNeighbours | ) | [inline] |
Set whether to calculate node neighbours for the rNodeNeigbours set in CalculateNodePairs. Switch off for efficiency
calculateNodeNeighbours | whether to store the neighbours. |
Definition at line 199 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mCalculateNodeNeighbours.
void NodesOnlyMesh< SPACE_DIM >::SetInitialBoxCollection | ( | const c_vector< double, 2 *SPACE_DIM > | domainSize, | |
double | maxInteractionDistance | |||
) | [inline] |
Set the initial box collection without passing nodes to the mesh. Used for memory efficient construction in parallel.
domainSize | the initial domain size of the mesh. | |
maxInteractionDistance | the max interaction distance between nodes. |
Definition at line 525 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
Referenced by ParallelCellsGenerator< CELL_CYCLE_MODEL, DIM >::GenerateParallelCells().
void NodesOnlyMesh< SPACE_DIM >::SetMaximumInteractionDistance | ( | double | maxDistance | ) | [inline] |
Set the maximum node interaction distance.
maxDistance | the new maximum distance. |
Definition at line 176 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance.
void NodesOnlyMesh< SPACE_DIM >::SetMinimumNodeDomainBoundarySeparation | ( | double | separation | ) | [inline] |
Set the value of mMinimumNodeDomainBoundarySeparation.
separation | the new value for the separation. |
Definition at line 429 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::mMinimumNodeDomainBoundarySeparation.
void NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection | ( | double | cutOffLength, | |
c_vector< double, 2 *SPACE_DIM > | domainSize, | |||
int | numLocalRows = PETSC_DECIDE , |
|||
bool | isPeriodic = false | |||
) | [inline, protected, virtual] |
Set up the box collection. Overridden in subclasses to implement periodicity.
cutOffLength | the cut off length for node neighbours. | |
domainSize | the size of the domain containing the nodes. | |
numLocalRows | the number of rows that should be owned by this process. | |
isPeriodic | whether the DistributedBoxCollection should be periodic. |
Definition at line 548 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::ClearBoxCollection(), NodesOnlyMesh< SPACE_DIM >::mCalculateNodeNeighbours, NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, DistributedBoxCollection< DIM >::SetCalculateNodeNeighbours(), DistributedBoxCollection< DIM >::SetupHaloBoxes(), and DistributedBoxCollection< DIM >::SetupLocalBoxesHalfOnly().
void NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection | ( | const std::vector< Node< SPACE_DIM > * > & | rNodes | ) | [inline, private] |
Set up a DistributedBoxCollection by calculating the correct domain size from the node locations.
rNodes | the nodes that will be contained in the box collection. |
Definition at line 531 of file NodesOnlyMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::CalculateBoundingBox(), NodesOnlyMesh< SPACE_DIM >::ClearBoxCollection(), NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance, ChasteCuboid< SPACE_DIM >::rGetLowerCorner(), and ChasteCuboid< SPACE_DIM >::rGetUpperCorner().
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), NodesOnlyMesh< SPACE_DIM >::EnlargeBoxCollection(), NodesOnlyMesh< SPACE_DIM >::LoadBalanceMesh(), NodesOnlyMesh< SPACE_DIM >::ResizeBoxCollection(), and NodesOnlyMesh< SPACE_DIM >::SetInitialBoxCollection().
unsigned NodesOnlyMesh< SPACE_DIM >::SolveNodeMapping | ( | unsigned | index | ) | const [inline, virtual] |
Overridden solve node mapping method
index | the global index of the node. |
Reimplemented from TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >.
Definition at line 106 of file NodesOnlyMesh.cpp.
References EXCEPTION, PetscTools::GetMyRank(), and NodesOnlyMesh< SPACE_DIM >::mNodesMapping.
Referenced by NodesOnlyMesh< SPACE_DIM >::DeleteNode(), NodeBasedCellPopulation< DIM >::RemoveDeadCells(), NodeBasedCellPopulationWithBuskeUpdate< DIM >::UpdateNodeLocations(), NodeBasedCellPopulationWithParticles< DIM >::WriteVtkResultsToFile(), and NodeBasedCellPopulation< DIM >::WriteVtkResultsToFile().
void NodesOnlyMesh< SPACE_DIM >::UpdateBoxCollection | ( | ) | [inline] |
Clear the old box collection and set up a new one if necessary.
Definition at line 585 of file NodesOnlyMesh.cpp.
References NodesOnlyMesh< SPACE_DIM >::AddNodesToBoxes(), DistributedBoxCollection< DIM >::EmptyBoxes(), NodesOnlyMesh< SPACE_DIM >::mpBoxCollection, and DistributedBoxCollection< DIM >::UpdateHaloBoxes().
Referenced by NodeBasedCellPopulation< DIM >::Update().
void NodesOnlyMesh< SPACE_DIM >::UpdateNodeIndices | ( | ) | [inline, private] |
Make sure that node indices match their location, and update mNodesMapping.
Definition at line 259 of file NodesOnlyMesh.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::mNodes, and NodesOnlyMesh< SPACE_DIM >::mNodesMapping.
Referenced by NodesOnlyMesh< SPACE_DIM >::ReMesh().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from MutableMesh< SPACE_DIM, SPACE_DIM >.
Reimplemented in Cylindrical2dNodesOnlyMesh.
Definition at line 59 of file NodesOnlyMesh.hpp.
bool NodesOnlyMesh< SPACE_DIM >::mCalculateNodeNeighbours [private] |
Whether to calculate node neighbours in the box collection. Switch off for efficiency
Definition at line 119 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::SetCalculateNodeNeighbours(), and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
std::vector<unsigned> NodesOnlyMesh< SPACE_DIM >::mDeletedGlobalNodeIndices [private] |
A list of the global indices of nodes that have been deleted from this process and can be reused.
Definition at line 99 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::DeleteMovedNode(), NodesOnlyMesh< SPACE_DIM >::DeleteNode(), and NodesOnlyMesh< SPACE_DIM >::GetNextAvailableIndex().
std::vector<boost::shared_ptr<Node<SPACE_DIM> > > NodesOnlyMesh< SPACE_DIM >::mHaloNodes [private] |
Vector of shared-pointers to halo nodes used by this process.
Definition at line 81 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::AddHaloNode(), NodesOnlyMesh< SPACE_DIM >::AddHaloNodesToBoxes(), NodesOnlyMesh< SPACE_DIM >::ClearHaloNodes(), and NodesOnlyMesh< SPACE_DIM >::GetNodeOrHaloNode().
std::map<unsigned, unsigned> NodesOnlyMesh< SPACE_DIM >::mHaloNodesMapping [private] |
A map from halo node global index to local index in mHaloNodes.
Definition at line 90 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::AddHaloNode(), NodesOnlyMesh< SPACE_DIM >::ClearHaloNodes(), and NodesOnlyMesh< SPACE_DIM >::GetNodeOrHaloNode().
unsigned NodesOnlyMesh< SPACE_DIM >::mIndexCounter [private] |
A counter of the number of fresh node indices used on this process. Ensures unique indices in parallel.
Definition at line 93 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::Clear(), NodesOnlyMesh< SPACE_DIM >::GetMaximumNodeIndex(), and NodesOnlyMesh< SPACE_DIM >::GetNextAvailableIndex().
std::vector<bool> NodesOnlyMesh< SPACE_DIM >::mLocalInitialNodes [private] |
A list of flags showing which initial nodes passed to ConstructNodesWithoutMesh were created on this process.
Definition at line 109 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), and NodesOnlyMesh< SPACE_DIM >::rGetInitiallyOwnedNodes().
unsigned NodesOnlyMesh< SPACE_DIM >::mMaxAddedNodeIndex [private] |
A variable to keep track of added node indices so we know the largest on this process. Used to create a large enough NodeMap when remeshing.
Definition at line 113 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::AddNodeWithFixedIndex(), and NodesOnlyMesh< SPACE_DIM >::GetMaximumNodeIndex().
double NodesOnlyMesh< SPACE_DIM >::mMaximumInteractionDistance [private] |
Nodes separated by a distance less than mMaximumInteractionDistance are neighbours.
Definition at line 84 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), NodesOnlyMesh< SPACE_DIM >::EnlargeBoxCollection(), NodesOnlyMesh< SPACE_DIM >::GetMaximumInteractionDistance(), NodesOnlyMesh< SPACE_DIM >::LoadBalanceMesh(), NodesOnlyMesh< 2 >::serialize(), NodesOnlyMesh< SPACE_DIM >::SetMaximumInteractionDistance(), and NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection().
double NodesOnlyMesh< SPACE_DIM >::mMinimumNodeDomainBoundarySeparation [private] |
A minimum separation to maintain between nodes and the boundary of mpBoxCollection, which grows with the mesh.
Definition at line 96 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), NodesOnlyMesh< SPACE_DIM >::IsANodeCloseToDomainBoundary(), NodesOnlyMesh< 2 >::serialize(), and NodesOnlyMesh< SPACE_DIM >::SetMinimumNodeDomainBoundarySeparation().
std::map<unsigned, unsigned> NodesOnlyMesh< SPACE_DIM >::mNodesMapping [private] |
A map from node global index to local index in mNodes.
Definition at line 87 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::AddNodeWithFixedIndex(), NodesOnlyMesh< SPACE_DIM >::Clear(), NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), NodesOnlyMesh< SPACE_DIM >::RemoveDeletedNodes(), NodesOnlyMesh< SPACE_DIM >::SolveNodeMapping(), and NodesOnlyMesh< SPACE_DIM >::UpdateNodeIndices().
std::vector<unsigned> NodesOnlyMesh< SPACE_DIM >::mNodesToSendLeft [private] |
A list of global indices of nodes that need to be moved to the left hand process.
Definition at line 105 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::CalculateNodesOutsideLocalDomain(), and NodesOnlyMesh< SPACE_DIM >::rGetNodesToSendLeft().
std::vector<unsigned> NodesOnlyMesh< SPACE_DIM >::mNodesToSendRight [private] |
A list of global indices of nodes that need to be moved to the right hand process.
Definition at line 102 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::CalculateNodesOutsideLocalDomain(), and NodesOnlyMesh< SPACE_DIM >::rGetNodesToSendRight().
DistributedBoxCollection<SPACE_DIM>* NodesOnlyMesh< SPACE_DIM >::mpBoxCollection [private] |
A pointer to the DistributedBoxCollection.
Definition at line 116 of file NodesOnlyMesh.hpp.
Referenced by NodesOnlyMesh< SPACE_DIM >::AddHaloNodesToBoxes(), NodesOnlyMesh< SPACE_DIM >::AddNodesToBoxes(), NodesOnlyMesh< SPACE_DIM >::CalculateBoundaryNodePairs(), NodesOnlyMesh< SPACE_DIM >::CalculateInteriorNodePairs(), NodesOnlyMesh< SPACE_DIM >::CalculateNodesOutsideLocalDomain(), NodesOnlyMesh< SPACE_DIM >::ClearBoxCollection(), NodesOnlyMesh< SPACE_DIM >::ConstructNodesWithoutMesh(), NodesOnlyMesh< SPACE_DIM >::EnlargeBoxCollection(), NodesOnlyMesh< SPACE_DIM >::GetBoxCollection(), NodesOnlyMesh< SPACE_DIM >::IsANodeCloseToDomainBoundary(), NodesOnlyMesh< SPACE_DIM >::IsOwned(), NodesOnlyMesh< SPACE_DIM >::LoadBalanceMesh(), NodesOnlyMesh< SPACE_DIM >::ResizeBoxCollection(), NodesOnlyMesh< SPACE_DIM >::rGetHaloNodesToSendLeft(), NodesOnlyMesh< SPACE_DIM >::rGetHaloNodesToSendRight(), NodesOnlyMesh< SPACE_DIM >::SetUpBoxCollection(), and NodesOnlyMesh< SPACE_DIM >::UpdateBoxCollection().