#include <NodeBasedTissue.hpp>
Inherits AbstractCellCentreBasedTissue< DIM >.
Public Member Functions | |
NodeBasedTissue (const std::vector< Node< DIM > * > nodes, std::vector< TissueCell > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteNodes=true) | |
NodeBasedTissue (const std::vector< Node< DIM > * > nodes, bool deleteNodes=true) | |
NodeBasedTissue (const AbstractMesh< DIM, DIM > &rMesh, std::vector< TissueCell > &rCells) | |
~NodeBasedTissue () | |
unsigned | GetNumNodes () |
Node< DIM > * | GetNode (unsigned index) |
unsigned | RemoveDeadCells () |
void | Clear () |
void | Update (bool hasHadBirthsOrDeaths=true) |
std::vector< Node< DIM > * > & | rGetNodes () |
const std::vector< Node< DIM > * > & | rGetNodes () const |
BoxCollection< DIM > * | GetBoxCollection () |
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & | rGetNodePairs () |
Protected Attributes | |
std::vector< Node< DIM > * > | mNodes |
std::vector< unsigned > | mDeletedNodeIndices |
bool | mAddedNodes |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &archive, const unsigned int version) |
unsigned | AddNode (Node< DIM > *pNewNode) |
void | SetNode (unsigned nodeIndex, ChastePoint< DIM > &rNewLocation) |
void | Validate () |
void | SplitUpIntoBoxes (double cutOffLength, c_vector< double, 2 *DIM > domainSize) |
void | FindMaxAndMin () |
Private Attributes | |
BoxCollection< DIM > * | mpBoxCollection |
c_vector< double, DIM > | mMinSpatialPositions |
c_vector< double, DIM > | mMaxSpatialPositions |
std::set< std::pair< Node< DIM > *, Node< DIM > * > > | mNodePairs |
bool | mDeleteNodes |
Friends | |
class | TestNodeBasedTissue |
class | TestBoxCollection |
class | boost::serialization::access |
A NodeBasedTissue is a Tissue consisting of only nodes in space with associated cells. There are no elements and no mesh.
Definition at line 45 of file NodeBasedTissue.hpp.
NodeBasedTissue< DIM >::NodeBasedTissue | ( | const std::vector< Node< DIM > * > | nodes, | |
std::vector< TissueCell > & | rCells, | |||
const std::vector< unsigned > | locationIndices = std::vector<unsigned>() , |
|||
bool | deleteNodes = true | |||
) | [inline] |
Default constructor.
Note that the tissue will take responsibility for freeing the memory used by the nodes.
nodes | a vector of Nodes | |
rCells | a vector of TissueCells | |
locationIndices | an optional vector of location indices that correspond to real cells | |
deleteNodes | whether to delete nodes in destructor |
Definition at line 32 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::Validate().
NodeBasedTissue< DIM >::NodeBasedTissue | ( | const std::vector< Node< DIM > * > | nodes, | |
bool | deleteNodes = true | |||
) | [inline] |
Constructor for use by the archiving - doesn't take in cells, since these are dealt with by the serialize method of our base class.
Note that the tissue will take responsibility for freeing the memory used by the nodes.
nodes | a vector of Nodes | |
deleteNodes | whether to delete nodes in destructor |
Definition at line 47 of file NodeBasedTissue.cpp.
NodeBasedTissue< DIM >::NodeBasedTissue | ( | const AbstractMesh< DIM, DIM > & | rMesh, | |
std::vector< TissueCell > & | rCells | |||
) | [inline] |
Constructor which takes in a mesh and takes a copy of its nodes. The mesh is not changed and no references to any of its data are created.
This constructor is a helper constructor: it is generally easier for the user to create a mesh than a set of nodes.
rMesh | any mesh. | |
rCells | a vector of TissueCells. |
Definition at line 59 of file NodeBasedTissue.cpp.
References AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNode(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), NodeBasedTissue< DIM >::mAddedNodes, NodeBasedTissue< DIM >::mNodes, and NodeBasedTissue< DIM >::Validate().
NodeBasedTissue< DIM >::~NodeBasedTissue | ( | ) | [inline] |
Destructor.
Frees all our node memory.
Definition at line 78 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::mDeleteNodes, and NodeBasedTissue< DIM >::mNodes.
unsigned NodeBasedTissue< DIM >::AddNode | ( | Node< DIM > * | pNewNode | ) | [inline, private, virtual] |
Overridden AddNode() method.
Add a new node to the tissue.
pNewNode | pointer to the new node |
Implements AbstractTissue< DIM >.
Definition at line 319 of file NodeBasedTissue.cpp.
References Node< SPACE_DIM >::GetIndex(), NodeBasedTissue< DIM >::mAddedNodes, NodeBasedTissue< DIM >::mDeletedNodeIndices, NodeBasedTissue< DIM >::mNodes, and Node< SPACE_DIM >::SetIndex().
void NodeBasedTissue< DIM >::Clear | ( | ) | [inline] |
Reset the member variables mDeletedNodeIndices, mAddedNodes, mNodePairs, and mpBoxCollection.
Definition at line 94 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mAddedNodes, NodeBasedTissue< DIM >::mDeletedNodeIndices, NodeBasedTissue< DIM >::mNodePairs, and NodeBasedTissue< DIM >::mpBoxCollection.
Referenced by NodeBasedTissue< DIM >::Update(), and NodeBasedTissue< DIM >::~NodeBasedTissue().
void NodeBasedTissue< DIM >::FindMaxAndMin | ( | ) | [inline, private] |
Loops over nodes and sets mMinSpatialPositions and mMaxSpatialPositions
Definition at line 160 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::GetNode(), NodeBasedTissue< DIM >::mMaxSpatialPositions, NodeBasedTissue< DIM >::mMinSpatialPositions, and NodeBasedTissue< DIM >::mNodes.
Referenced by NodeBasedTissue< DIM >::Update().
BoxCollection< DIM > * NodeBasedTissue< DIM >::GetBoxCollection | ( | ) | [inline] |
Definition at line 347 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mpBoxCollection.
Node< DIM > * NodeBasedTissue< DIM >::GetNode | ( | unsigned | index | ) | [inline, virtual] |
Overridden GetNode() method.
index | global index of the specified node |
Implements AbstractTissue< DIM >.
Definition at line 197 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mNodes.
Referenced by NodeBasedTissue< DIM >::FindMaxAndMin().
unsigned NodeBasedTissue< DIM >::GetNumNodes | ( | ) | [inline, virtual] |
Implements AbstractTissue< DIM >.
Definition at line 340 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mDeletedNodeIndices, and NodeBasedTissue< DIM >::mNodes.
Referenced by NodeBasedTissue< DIM >::Validate().
unsigned NodeBasedTissue< DIM >::RemoveDeadCells | ( | ) | [inline, virtual] |
Remove all cells labelled as dead.
Note that after calling this method the tissue will be in an inconsistent state until the equivalent of a 'remesh' is performed! So don't try iterating over cells or anything like that.
Implements AbstractTissue< DIM >.
Definition at line 296 of file NodeBasedTissue.cpp.
References AbstractCellCentreBasedTissue< DIM >::GetNodeCorrespondingToCell(), AbstractTissue< DIM >::mCellLocationMap, AbstractTissue< DIM >::mCells, and NodeBasedTissue< DIM >::mDeletedNodeIndices.
std::set< std::pair< Node< DIM > *, Node< DIM > * > > & NodeBasedTissue< DIM >::rGetNodePairs | ( | ) | [inline] |
Definition at line 354 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mNodePairs.
const std::vector< Node< DIM > * > & NodeBasedTissue< DIM >::rGetNodes | ( | ) | const [inline] |
Method for getting all nodes in the tissue (for archiving).
Definition at line 139 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mNodes.
std::vector< Node< DIM > * > & NodeBasedTissue< DIM >::rGetNodes | ( | ) | [inline] |
Method for getting all nodes in the tissue.
Definition at line 132 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mNodes.
void NodeBasedTissue< DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Serialize the object and its member variables.
Note that serialization of the nodes is handled by load/save_construct_data, so we don't actually have to do anything here except delegate to the base class.
archive | the archive | |
version | the current version of this class |
Reimplemented from AbstractCellCentreBasedTissue< DIM >.
Definition at line 92 of file NodeBasedTissue.hpp.
References NodeBasedTissue< DIM >::Validate().
void NodeBasedTissue< DIM >::SetNode | ( | unsigned | nodeIndex, | |
ChastePoint< DIM > & | rNewLocation | |||
) | [inline, private, virtual] |
Move the node with a given index to a new point in space.
nodeIndex | the index of the node to be moved | |
rNewLocation | the new target location of the node |
Implements AbstractTissue< DIM >.
Definition at line 204 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mNodes.
void NodeBasedTissue< DIM >::SplitUpIntoBoxes | ( | double | cutOffLength, | |
c_vector< double, 2 *DIM > | domainSize | |||
) | [inline, private] |
Method for Initially Splitting up tissue into neighbouring boxes, to decrease runtime.
cutOffLength | length of spring cut off between nodes | |
domainSize | c_vector of size 2*dimension reads minX, maxX, minY, maxY, etc |
Definition at line 146 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::mNodes, and NodeBasedTissue< DIM >::mpBoxCollection.
Referenced by NodeBasedTissue< DIM >::Update().
void NodeBasedTissue< DIM >::Update | ( | bool | hasHadBirthsOrDeaths = true |
) | [inline, virtual] |
Remove nodes that have been marked as deleted and update the node cell map.
hasHadBirthsOrDeaths | whether tissue has had Births Or Deaths |
Implements AbstractTissue< DIM >.
Definition at line 211 of file NodeBasedTissue.cpp.
References NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::FindMaxAndMin(), TissueConfig::GetMechanicsCutOffLength(), TissueConfig::Instance(), AbstractTissue< DIM >::mCellLocationMap, AbstractTissue< DIM >::mLocationCellMap, NodeBasedTissue< DIM >::mMaxSpatialPositions, NodeBasedTissue< DIM >::mMinSpatialPositions, NodeBasedTissue< DIM >::mNodePairs, NodeBasedTissue< DIM >::mNodes, NodeBasedTissue< DIM >::mpBoxCollection, NodeBasedTissue< DIM >::SplitUpIntoBoxes(), and NodeBasedTissue< DIM >::Validate().
void NodeBasedTissue< DIM >::Validate | ( | ) | [inline, private, virtual] |
Check consistency of our internal data structures.
Implements AbstractTissue< DIM >.
Definition at line 105 of file NodeBasedTissue.cpp.
References AbstractTissue< DIM >::Begin(), AbstractTissue< DIM >::End(), NodeBasedTissue< DIM >::GetNumNodes(), and AbstractTissue< DIM >::mCellLocationMap.
Referenced by NodeBasedTissue< DIM >::NodeBasedTissue(), NodeBasedTissue< DIM >::serialize(), and NodeBasedTissue< DIM >::Update().
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from AbstractCellCentreBasedTissue< DIM >.
Definition at line 81 of file NodeBasedTissue.hpp.
bool NodeBasedTissue< DIM >::mAddedNodes [protected] |
Whether nodes have been added to the tissue.
Definition at line 59 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::AddNode(), NodeBasedTissue< DIM >::Clear(), and NodeBasedTissue< DIM >::NodeBasedTissue().
std::vector<unsigned> NodeBasedTissue< DIM >::mDeletedNodeIndices [protected] |
Indices of nodes that have been deleted, to be reused when adding new nodes.
Definition at line 56 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::AddNode(), NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::GetNumNodes(), and NodeBasedTissue< DIM >::RemoveDeadCells().
bool NodeBasedTissue< DIM >::mDeleteNodes [private] |
Whether to delete the nodes (taken in one of the constructors, defaults to true)
Definition at line 78 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::~NodeBasedTissue().
c_vector<double, DIM> NodeBasedTissue< DIM >::mMaxSpatialPositions [private] |
Vector of maximal spatial positions in each dimension
Definition at line 70 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::FindMaxAndMin(), and NodeBasedTissue< DIM >::Update().
c_vector<double, DIM> NodeBasedTissue< DIM >::mMinSpatialPositions [private] |
Vector of minimal spatial positions in each dimension
Definition at line 67 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::FindMaxAndMin(), and NodeBasedTissue< DIM >::Update().
std::set< std::pair<Node<DIM>*, Node<DIM>* > > NodeBasedTissue< DIM >::mNodePairs [private] |
Node pairs for force calculations
Definition at line 73 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::rGetNodePairs(), and NodeBasedTissue< DIM >::Update().
std::vector<Node<DIM>* > NodeBasedTissue< DIM >::mNodes [protected] |
List of nodes.
Definition at line 53 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::AddNode(), NodeBasedTissue< DIM >::FindMaxAndMin(), NodeBasedTissue< DIM >::GetNode(), NodeBasedTissue< DIM >::GetNumNodes(), NodeBasedTissue< DIM >::NodeBasedTissue(), NodeBasedTissue< DIM >::rGetNodes(), NodeBasedTissue< DIM >::SetNode(), NodeBasedTissue< DIM >::SplitUpIntoBoxes(), NodeBasedTissue< DIM >::Update(), and NodeBasedTissue< DIM >::~NodeBasedTissue().
BoxCollection<DIM>* NodeBasedTissue< DIM >::mpBoxCollection [private] |
Pointer to a Node box collection
Definition at line 64 of file NodeBasedTissue.hpp.
Referenced by NodeBasedTissue< DIM >::Clear(), NodeBasedTissue< DIM >::GetBoxCollection(), NodeBasedTissue< DIM >::SplitUpIntoBoxes(), and NodeBasedTissue< DIM >::Update().