#include <MeshBasedTissueWithGhostNodes.hpp>
Public Member Functions | |
MeshBasedTissueWithGhostNodes (MutableMesh< DIM, DIM > &rMesh, const std::vector< TissueCell > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false) | |
MeshBasedTissueWithGhostNodes (MutableMesh< DIM, DIM > &rMesh) | |
void | UpdateNodeLocations (const std::vector< c_vector< double, DIM > > &rNodeForces, double dt) |
std::vector< bool > & | rGetGhostNodes () |
bool | IsGhostNode (unsigned index) |
std::set< unsigned > | GetGhostNodeIndices () |
void | UpdateGhostPositions (double dt) |
void | UpdateGhostNodesAfterReMesh (NodeMap &rMap) |
c_vector< double, DIM > | CalculateForceBetweenNodes (const unsigned &rNodeAGlobalIndex, const unsigned &rNodeBGlobalIndex) |
TissueCell * | AddCell (TissueCell &rNewCell, c_vector< double, DIM > newLocation, TissueCell *pParentCell=NULL) |
Private Member Functions | |
template<class Archive> | |
void | serialize (Archive &archive, const unsigned int version) |
void | SetGhostNodes (const std::set< unsigned > &ghostNodeIndices) |
void | Validate () |
Private Attributes | |
std::vector< bool > | mIsGhostNode |
Friends | |
class | TestMeshBasedTissueWithGhostNodes |
class | boost::serialization::access |
Hides the 'ghost nodes' concept from the simulation class, so the latter only ever deals with real cells.
Definition at line 44 of file MeshBasedTissueWithGhostNodes.hpp.
MeshBasedTissueWithGhostNodes< DIM >::MeshBasedTissueWithGhostNodes | ( | MutableMesh< DIM, DIM > & | rMesh, | |
const std::vector< TissueCell > & | rCells, | |||
const std::vector< unsigned > | locationIndices = std::vector<unsigned>() , |
|||
bool | deleteMesh = false | |||
) | [inline] |
Create a new tissue facade from a mesh and collection of cells.
rMesh | a mutable tetrahedral mesh | |
rCells | TissueCells corresponding to the nodes of the mesh | |
locationIndices | an optional vector of location indices that correspond to real cells | |
deleteMesh | set to true if you want the tissue to free the mesh memory on destruction |
Definition at line 32 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissue< DIM >::GetNode(), MeshBasedTissue< DIM >::GetNumNodes(), MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode, MeshBasedTissueWithGhostNodes< DIM >::SetGhostNodes(), and MeshBasedTissueWithGhostNodes< DIM >::Validate().
MeshBasedTissueWithGhostNodes< DIM >::MeshBasedTissueWithGhostNodes | ( | MutableMesh< DIM, DIM > & | rMesh | ) | [inline] |
Constructor for use by the de-serializer.
rMesh | a mutable tetrahedral mesh. |
Definition at line 70 of file MeshBasedTissueWithGhostNodes.cpp.
void MeshBasedTissueWithGhostNodes< DIM >::serialize | ( | Archive & | archive, | |
const unsigned int | version | |||
) | [inline, private] |
Serialize the facade.
Note that serialization of the mesh and cells is handled by load/save_construct_data.
Note also that member data related to writers is not saved - output must be set up again by the caller after a restart.
archive | ||
version |
Reimplemented from MeshBasedTissue< DIM >.
Definition at line 68 of file MeshBasedTissueWithGhostNodes.hpp.
void MeshBasedTissueWithGhostNodes< DIM >::SetGhostNodes | ( | const std::set< unsigned > & | ghostNodeIndices | ) | [inline, private] |
Set the ghost nodes by taking in a set of which nodes indices are ghost nodes.
ghostNodeIndices |
Definition at line 102 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode, MeshBasedTissue< DIM >::mrMesh, and MeshBasedTissueWithGhostNodes< DIM >::Validate().
Referenced by MeshBasedTissueWithGhostNodes< DIM >::MeshBasedTissueWithGhostNodes().
void MeshBasedTissueWithGhostNodes< DIM >::Validate | ( | ) | [inline, private, virtual] |
This is called after a tissue has been constructed to check the user gave consistent instructions. Check consistency of our internal data structures: Each node must have a cell associated with it OR must be a ghost node.
It is called after cells are added or removed from MeshBasedTissue as it is an overridden virtual method.
Reimplemented from MeshBasedTissue< DIM >.
Definition at line 205 of file MeshBasedTissueWithGhostNodes.cpp.
References AbstractTissue< DIM >::Begin(), AbstractTissue< DIM >::End(), MeshBasedTissue< DIM >::GetNumNodes(), AbstractTissue< DIM >::mCellLocationMap, and MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.
Referenced by MeshBasedTissueWithGhostNodes< DIM >::MeshBasedTissueWithGhostNodes(), and MeshBasedTissueWithGhostNodes< DIM >::SetGhostNodes().
void MeshBasedTissueWithGhostNodes< DIM >::UpdateNodeLocations | ( | const std::vector< c_vector< double, DIM > > & | rNodeForces, | |
double | dt | |||
) | [inline, virtual] |
Overridden UpdateNodeLocation() method.
Update the location of each node in the tissue given a vector of forces on nodes and a time step over which to integrate the equations of motion.
rNodeForces | forces on nodes | |
dt | time step |
Reimplemented from AbstractCellCentreBasedTissue< DIM >.
Definition at line 259 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions(), and AbstractCellCentreBasedTissue< DIM >::UpdateNodeLocations().
std::vector< bool > & MeshBasedTissueWithGhostNodes< DIM >::rGetGhostNodes | ( | ) | [inline] |
Definition at line 76 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.
bool MeshBasedTissueWithGhostNodes< DIM >::IsGhostNode | ( | unsigned | index | ) | [inline, virtual] |
Overridden IsGhostNode() method.
Find if a given node is a ghost node. The abstract method always returns false but is overridden in subclasses.
index | the global index of a specified node |
Reimplemented from MeshBasedTissue< DIM >.
Definition at line 82 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.
std::set< unsigned > MeshBasedTissueWithGhostNodes< DIM >::GetGhostNodeIndices | ( | ) | [inline] |
Definition at line 88 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.
void MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions | ( | double | dt | ) | [inline] |
Update the GhostNode positions using the spring force model with rest length=1. Forces are applied to ghost nodes from connected ghost and normal nodes.
dt |
Definition at line 119 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissueWithGhostNodes< DIM >::CalculateForceBetweenNodes(), CancerParameters::GetDampingConstantNormal(), MeshBasedTissue< DIM >::GetNode(), MeshBasedTissue< DIM >::GetNumNodes(), CancerParameters::Instance(), MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode, and MeshBasedTissue< DIM >::mrMesh.
Referenced by MeshBasedTissueWithGhostNodes< DIM >::UpdateNodeLocations().
void MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostNodesAfterReMesh | ( | NodeMap & | rMap | ) | [inline, virtual] |
Update mIsGhostNode if required by a remesh.
rMap | A map between node indices before and after remesh |
Reimplemented from MeshBasedTissue< DIM >.
Definition at line 238 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissue< DIM >::GetNumNodes(), and MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.
c_vector< double, DIM > MeshBasedTissueWithGhostNodes< DIM >::CalculateForceBetweenNodes | ( | const unsigned & | rNodeAGlobalIndex, | |
const unsigned & | rNodeBGlobalIndex | |||
) | [inline] |
This method is used to calculate the force between GHOST nodes.
rNodeAGlobalIndex | ||
rNodeBGlobalIndex |
Definition at line 166 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissue< DIM >::GetNode(), CancerParameters::GetSpringStiffness(), CancerParameters::Instance(), and MeshBasedTissue< DIM >::mrMesh.
Referenced by MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions().
TissueCell * MeshBasedTissueWithGhostNodes< DIM >::AddCell | ( | TissueCell & | rNewCell, | |
c_vector< double, DIM > | newLocation, | |||
TissueCell * | pParentCell = NULL | |||
) | [inline, virtual] |
Overridden AddCell() method.
Add a new cell to the tissue and update mIsGhostNode.
rNewCell | the cell to add | |
newLocation | the position in space at which to put it | |
pParentCell | pointer to a parent cell (if required) |
Reimplemented from MeshBasedTissue< DIM >.
Definition at line 186 of file MeshBasedTissueWithGhostNodes.cpp.
References MeshBasedTissue< DIM >::AddCell(), MeshBasedTissue< DIM >::GetNumNodes(), AbstractTissue< DIM >::mCellLocationMap, and MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.
friend class TestMeshBasedTissueWithGhostNodes [friend] |
Just so that the test can test the private functions
Definition at line 49 of file MeshBasedTissueWithGhostNodes.hpp.
friend class boost::serialization::access [friend] |
Needed for serialization.
Reimplemented from MeshBasedTissue< DIM >.
Definition at line 55 of file MeshBasedTissueWithGhostNodes.hpp.
std::vector<bool> MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode [private] |
Records whether a node is a ghost node or not
Definition at line 52 of file MeshBasedTissueWithGhostNodes.hpp.
Referenced by MeshBasedTissueWithGhostNodes< DIM >::AddCell(), MeshBasedTissueWithGhostNodes< DIM >::GetGhostNodeIndices(), MeshBasedTissueWithGhostNodes< DIM >::IsGhostNode(), MeshBasedTissueWithGhostNodes< DIM >::MeshBasedTissueWithGhostNodes(), MeshBasedTissueWithGhostNodes< DIM >::rGetGhostNodes(), MeshBasedTissueWithGhostNodes< 2 >::serialize(), MeshBasedTissueWithGhostNodes< DIM >::SetGhostNodes(), MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostNodesAfterReMesh(), MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions(), and MeshBasedTissueWithGhostNodes< DIM >::Validate().