Chaste Release::3.1
MeshBasedCellPopulationWithGhostNodes< DIM > Class Template Reference

#include <MeshBasedCellPopulationWithGhostNodes.hpp>

Inheritance diagram for MeshBasedCellPopulationWithGhostNodes< DIM >:
Collaboration diagram for MeshBasedCellPopulationWithGhostNodes< DIM >:

List of all members.

Public Member Functions

 MeshBasedCellPopulationWithGhostNodes (MutableMesh< DIM, DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false, double ghostSpringStiffness=15.0)
 MeshBasedCellPopulationWithGhostNodes (MutableMesh< DIM, DIM > &rMesh, double ghostSpringStiffness=15.0)
void UpdateNodeLocations (const std::vector< c_vector< double, DIM > > &rNodeForces, double dt)
std::vector< bool > & rGetGhostNodes ()
bool IsGhostNode (unsigned index)
std::set< unsignedGetGhostNodeIndices ()
void UpdateGhostPositions (double dt)
void UpdateGhostNodesAfterReMesh (NodeMap &rMap)
c_vector< double, DIM > CalculateForceBetweenGhostNodes (const unsigned &rNodeAGlobalIndex, const unsigned &rNodeBGlobalIndex)
CellPtr AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell)
void WriteVtkResultsToFile ()
void OutputCellPopulationParameters (out_stream &rParamsFile)

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
void SetGhostNodes (const std::set< unsigned > &rGhostNodeIndices)
void Validate ()

Private Attributes

std::vector< boolmIsGhostNode
double mGhostSpringStiffness

Friends

class TestMeshBasedCellPopulationWithGhostNodes
class boost::serialization::access

Detailed Description

template<unsigned DIM>
class MeshBasedCellPopulationWithGhostNodes< DIM >

A facade class encapsulating a mesh-based cell population with ghost nodes.

If simulating a crypt with a mesh-based cell population, the mesh should be surrounded by at least one layer of ghost nodes. These are nodes which do not correspond to a cell, but are necessary for remeshing (because the remesher tries to create a convex hull of the set of nodes) and visualization purposes. The MeshBasedCellPopulationWithGhostNodes class deals with these ghost nodes, hiding the 'ghost nodes' concept from the OffLatticeSimulation class, so the latter only ever deals with real cells.

Definition at line 57 of file MeshBasedCellPopulationWithGhostNodes.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
MeshBasedCellPopulationWithGhostNodes< DIM >::MeshBasedCellPopulationWithGhostNodes ( MutableMesh< DIM, DIM > &  rMesh,
std::vector< CellPtr > &  rCells,
const std::vector< unsigned locationIndices = std::vector<unsigned>(),
bool  deleteMesh = false,
double  ghostSpringStiffness = 15.0 
)

Create a new cell population from a mesh and collection of cells.

Parameters:
rMesha mutable tetrahedral mesh
rCellscells corresponding to the nodes of the mesh
locationIndicesan optional vector of location indices that correspond to real cells
deleteMeshset to true if you want the cell population to free the mesh memory on destruction
ghostSpringStiffnessspring stiffness used to move the ghost nodes defaults to 15.0.

Definition at line 39 of file MeshBasedCellPopulationWithGhostNodes.cpp.

References MeshBasedCellPopulation< DIM >::GetNode(), MeshBasedCellPopulation< DIM >::GetNumNodes(), MeshBasedCellPopulationWithGhostNodes< DIM >::mIsGhostNode, MeshBasedCellPopulationWithGhostNodes< DIM >::SetGhostNodes(), and MeshBasedCellPopulationWithGhostNodes< DIM >::Validate().

template<unsigned DIM>
MeshBasedCellPopulationWithGhostNodes< DIM >::MeshBasedCellPopulationWithGhostNodes ( MutableMesh< DIM, DIM > &  rMesh,
double  ghostSpringStiffness = 15.0 
)

Constructor for use by the de-serializer.

Parameters:
rMesha mutable tetrahedral mesh.
ghostSpringStiffnessspring stiffness used to move the ghost nodes defaults to 15.0.

Definition at line 79 of file MeshBasedCellPopulationWithGhostNodes.cpp.


Member Function Documentation

template<unsigned DIM>
CellPtr MeshBasedCellPopulationWithGhostNodes< DIM >::AddCell ( CellPtr  pNewCell,
const c_vector< double, DIM > &  rCellDivisionVector,
CellPtr  pParentCell 
)

Overridden AddCell() method.

Add a new cell to the cell population and update mIsGhostNode.

Parameters:
pNewCellthe cell to add
rCellDivisionVectorthe position in space at which to put it
pParentCellpointer to a parent cell - this is required for mesh-based cell populations
Returns:
address of cell as it appears in the cell list (internal of this method uses a copy constructor along the way)

Definition at line 198 of file MeshBasedCellPopulationWithGhostNodes.cpp.

References MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::AddCell().

template<unsigned DIM>
c_vector< double, DIM > MeshBasedCellPopulationWithGhostNodes< DIM >::CalculateForceBetweenGhostNodes ( const unsigned rNodeAGlobalIndex,
const unsigned rNodeBGlobalIndex 
)

This method is used to calculate the force between GHOST nodes.

Parameters:
rNodeAGlobalIndex
rNodeBGlobalIndex
Returns:
The force exerted on Node A by Node B.

Definition at line 178 of file MeshBasedCellPopulationWithGhostNodes.cpp.

template<unsigned DIM>
std::set< unsigned > MeshBasedCellPopulationWithGhostNodes< DIM >::GetGhostNodeIndices ( )
Returns:
the indices of those nodes that are ghost nodes.

Definition at line 99 of file MeshBasedCellPopulationWithGhostNodes.cpp.

template<unsigned DIM>
bool MeshBasedCellPopulationWithGhostNodes< DIM >::IsGhostNode ( unsigned  index) [virtual]

Overridden IsGhostNode() method.

Find if a given node is a ghost node. The abstract method always returns false but is overridden in subclasses.

Parameters:
indexthe global index of a specified node
Returns:
whether the node is a ghost node

Reimplemented from AbstractCentreBasedCellPopulation< ELEMENT_DIM, ELEMENT_DIM >.

Definition at line 93 of file MeshBasedCellPopulationWithGhostNodes.cpp.

template<unsigned DIM>
void MeshBasedCellPopulationWithGhostNodes< DIM >::OutputCellPopulationParameters ( out_stream &  rParamsFile) [virtual]

Outputs CellPopulation parameters to file

As this method is pure virtual, it must be overridden in subclasses.

Parameters:
rParamsFilethe file stream to which the parameters are output

Reimplemented from MeshBasedCellPopulation< DIM >.

Definition at line 441 of file MeshBasedCellPopulationWithGhostNodes.cpp.

References MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::OutputCellPopulationParameters().

template<unsigned DIM>
std::vector< bool > & MeshBasedCellPopulationWithGhostNodes< DIM >::rGetGhostNodes ( )
Returns:
mIsGhostNode.

Definition at line 87 of file MeshBasedCellPopulationWithGhostNodes.cpp.

template<unsigned DIM>
template<class Archive >
void MeshBasedCellPopulationWithGhostNodes< DIM >::serialize ( Archive &  archive,
const unsigned int  version 
) [inline, private]

Serialize the object and its member variables.

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.

Parameters:
archivethe archive
versionthe current version of this class

Reimplemented from MeshBasedCellPopulation< DIM >.

Definition at line 86 of file MeshBasedCellPopulationWithGhostNodes.hpp.

References MeshBasedCellPopulationWithGhostNodes< DIM >::mGhostSpringStiffness, and MeshBasedCellPopulationWithGhostNodes< DIM >::mIsGhostNode.

template<unsigned DIM>
void MeshBasedCellPopulationWithGhostNodes< DIM >::SetGhostNodes ( const std::set< unsigned > &  rGhostNodeIndices) [private]

Set the ghost nodes by taking in a set of which nodes indices are ghost nodes.

Parameters:
rGhostNodeIndicesset of node indices corresponding to ghost nodes

Definition at line 113 of file MeshBasedCellPopulationWithGhostNodes.cpp.

Referenced by MeshBasedCellPopulationWithGhostNodes< DIM >::MeshBasedCellPopulationWithGhostNodes().

template<unsigned DIM>
void MeshBasedCellPopulationWithGhostNodes< DIM >::UpdateGhostNodesAfterReMesh ( NodeMap rMap) [virtual]

Update mIsGhostNode if required by a remesh.

Parameters:
rMapA map between node indices before and after remesh

Reimplemented from MeshBasedCellPopulation< DIM >.

Definition at line 247 of file MeshBasedCellPopulationWithGhostNodes.cpp.

References NodeMap::GetNewIndex(), NodeMap::IsDeleted(), and NodeMap::Size().

template<unsigned DIM>
void MeshBasedCellPopulationWithGhostNodes< DIM >::UpdateGhostPositions ( double  dt)

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.

Parameters:
dt

Definition at line 128 of file MeshBasedCellPopulationWithGhostNodes.cpp.

References TetrahedralMesh< ELEMENT_DIM, SPACE_DIM >::EdgesEnd(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), and MutableMesh< ELEMENT_DIM, SPACE_DIM >::SetNode().

template<unsigned DIM>
void MeshBasedCellPopulationWithGhostNodes< DIM >::UpdateNodeLocations ( const std::vector< c_vector< double, DIM > > &  rNodeForces,
double  dt 
)

Overridden UpdateNodeLocation() method.

Update the location of each node in the cell population given a vector of forces on nodes and a time step over which to integrate the equations of motion.

Parameters:
rNodeForcesforces on nodes
dttime step

Definition at line 268 of file MeshBasedCellPopulationWithGhostNodes.cpp.

References AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::UpdateNodeLocations().

template<unsigned DIM>
void MeshBasedCellPopulationWithGhostNodes< DIM >::Validate ( ) [private, virtual]

This is called after a cell population 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 MeshBasedCellPopulation as it is an overridden virtual method.

Reimplemented from MeshBasedCellPopulation< DIM >.

Definition at line 218 of file MeshBasedCellPopulationWithGhostNodes.cpp.

References EXCEPTION.

Referenced by MeshBasedCellPopulationWithGhostNodes< DIM >::MeshBasedCellPopulationWithGhostNodes().


Friends And Related Function Documentation

template<unsigned DIM>
friend class boost::serialization::access [friend]

Needed for serialization.

Reimplemented from MeshBasedCellPopulation< DIM >.

Definition at line 73 of file MeshBasedCellPopulationWithGhostNodes.hpp.

template<unsigned DIM>
friend class TestMeshBasedCellPopulationWithGhostNodes [friend]

Just so that the test can test the private functions

Definition at line 62 of file MeshBasedCellPopulationWithGhostNodes.hpp.


Member Data Documentation

template<unsigned DIM>
double MeshBasedCellPopulationWithGhostNodes< DIM >::mGhostSpringStiffness [private]

Spring stiffness for springs between ghost nodes.

Definition at line 70 of file MeshBasedCellPopulationWithGhostNodes.hpp.

Referenced by MeshBasedCellPopulationWithGhostNodes< DIM >::serialize().


The documentation for this class was generated from the following files: