MeshBasedTissueWithGhostNodes< DIM > Class Template Reference

#include <MeshBasedTissueWithGhostNodes.hpp>

Inheritance diagram for MeshBasedTissueWithGhostNodes< DIM >:

Inheritance graph
[legend]
Collaboration diagram for MeshBasedTissueWithGhostNodes< DIM >:

Collaboration graph
[legend]

List of all members.

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)
TissueCellAddCell (TissueCell &rNewCell, c_vector< double, DIM > newLocation, TissueCell *pParentCell=NULL)
virtual void GenerateCellResultsAndWriteToFiles (std::vector< unsigned > &rCellTypeCounter, std::vector< unsigned > &rCellMutationStateCounter, std::vector< unsigned > &rCellCyclePhaseCounter)

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< bool > mIsGhostNode

Friends

class TestMeshBasedTissueWithGhostNodes
class boost::serialization::access


Detailed Description

template<unsigned DIM>
class MeshBasedTissueWithGhostNodes< DIM >

A facade class encapsulating a mesh-based 'tissue' with ghost nodes.

If simulating a crypt with a mesh-based tissue, 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 MeshBasedTissueWithGhostNodes class deals with these ghost nodes, hiding the 'ghost nodes' concept from the TissueSimulation class, so the latter only ever deals with real cells.

Definition at line 49 of file MeshBasedTissueWithGhostNodes.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
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.

Parameters:
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().

template<unsigned DIM>
MeshBasedTissueWithGhostNodes< DIM >::MeshBasedTissueWithGhostNodes ( MutableMesh< DIM, DIM > &  rMesh  )  [inline]

Constructor for use by the de-serializer.

Parameters:
rMesh a mutable tetrahedral mesh.

Definition at line 70 of file MeshBasedTissueWithGhostNodes.cpp.


Member Function Documentation

template<unsigned DIM>
template<class Archive>
void MeshBasedTissueWithGhostNodes< 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:
archive the archive
version the current version of this class

Reimplemented from MeshBasedTissue< DIM >.

Definition at line 72 of file MeshBasedTissueWithGhostNodes.hpp.

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

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

Parameters:
rGhostNodeIndices set of node indices corresponding to ghost nodes

Definition at line 102 of file MeshBasedTissueWithGhostNodes.cpp.

References MutableMesh< ELEMENT_DIM, SPACE_DIM >::GetNumNodes(), MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode, MeshBasedTissue< DIM >::mrMesh, and MeshBasedTissueWithGhostNodes< DIM >::Validate().

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

template<unsigned DIM>
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 208 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().

template<unsigned DIM>
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.

Parameters:
rNodeForces forces on nodes
dt time step

Reimplemented from AbstractCellCentreBasedTissue< DIM >.

Definition at line 262 of file MeshBasedTissueWithGhostNodes.cpp.

References MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions(), and AbstractCellCentreBasedTissue< DIM >::UpdateNodeLocations().

template<unsigned DIM>
std::vector< bool > & MeshBasedTissueWithGhostNodes< DIM >::rGetGhostNodes (  )  [inline]

Returns:
mIsGhostNode.

Definition at line 76 of file MeshBasedTissueWithGhostNodes.cpp.

References MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.

template<unsigned DIM>
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.

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

Reimplemented from MeshBasedTissue< DIM >.

Definition at line 82 of file MeshBasedTissueWithGhostNodes.cpp.

References MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.

template<unsigned DIM>
std::set< unsigned > MeshBasedTissueWithGhostNodes< DIM >::GetGhostNodeIndices (  )  [inline]

Returns:
the indices of those nodes that are ghost nodes.

Definition at line 88 of file MeshBasedTissueWithGhostNodes.cpp.

References MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.

template<unsigned DIM>
void MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions ( double  dt  )  [inline]

template<unsigned DIM>
void MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostNodesAfterReMesh ( NodeMap rMap  )  [inline, virtual]

Update mIsGhostNode if required by a remesh.

Parameters:
rMap A map between node indices before and after remesh

Reimplemented from MeshBasedTissue< DIM >.

Definition at line 241 of file MeshBasedTissueWithGhostNodes.cpp.

References NodeMap::GetNewIndex(), MeshBasedTissue< DIM >::GetNumNodes(), NodeMap::IsDeleted(), MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode, and NodeMap::Size().

template<unsigned DIM>
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.

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

Definition at line 169 of file MeshBasedTissueWithGhostNodes.cpp.

References MeshBasedTissue< DIM >::GetNode(), TissueConfig::GetSpringStiffness(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetVectorFromAtoB(), TissueConfig::Instance(), and MeshBasedTissue< DIM >::mrMesh.

Referenced by MeshBasedTissueWithGhostNodes< DIM >::UpdateGhostPositions().

template<unsigned DIM>
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.

Parameters:
rNewCell the cell to add
newLocation the position in space at which to put it
pParentCell pointer to a parent cell (if required)
Returns:
address of cell as it appears in the cell list (internal of this method uses a copy constructor along the way)

Reimplemented from MeshBasedTissue< DIM >.

Definition at line 189 of file MeshBasedTissueWithGhostNodes.cpp.

References MeshBasedTissue< DIM >::AddCell(), MeshBasedTissue< DIM >::GetNumNodes(), AbstractTissue< DIM >::mCellLocationMap, and MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode.

template<unsigned DIM>
void MeshBasedTissueWithGhostNodes< DIM >::GenerateCellResultsAndWriteToFiles ( std::vector< unsigned > &  rCellTypeCounter,
std::vector< unsigned > &  rCellMutationStateCounter,
std::vector< unsigned > &  rCellCyclePhaseCounter 
) [inline, virtual]

Overridden GenerateCellResultsAndWriteToFiles() method.

Call GenerateCellResults() on each cell then call WriteCellResultsToFiles(). Also accounts for ghost nodes.

Parameters:
rCellTypeCounter cell type counter
rCellMutationStateCounter cell mutation state counter
rCellCyclePhaseCounter cell cycle phase counter

Reimplemented from AbstractTissue< DIM >.

Definition at line 272 of file MeshBasedTissueWithGhostNodes.cpp.

References AbstractTissue< DIM >::GenerateCellResults(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorBegin(), AbstractMesh< ELEMENT_DIM, SPACE_DIM >::GetNodeIteratorEnd(), MeshBasedTissue< DIM >::mrMesh, and AbstractTissue< DIM >::WriteCellResultsToFiles().


Friends And Related Function Documentation

template<unsigned DIM>
friend class TestMeshBasedTissueWithGhostNodes [friend]

Just so that the test can test the private functions

Definition at line 53 of file MeshBasedTissueWithGhostNodes.hpp.

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

Needed for serialization.

Reimplemented from MeshBasedTissue< DIM >.

Definition at line 59 of file MeshBasedTissueWithGhostNodes.hpp.


Member Data Documentation

template<unsigned DIM>
std::vector<bool> MeshBasedTissueWithGhostNodes< DIM >::mIsGhostNode [private]


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

Generated on Tue Aug 4 16:11:25 2009 for Chaste by  doxygen 1.5.5