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

#include <NodeBasedCellPopulationWithParticles.hpp>

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

List of all members.

Public Member Functions

 NodeBasedCellPopulationWithParticles (NodesOnlyMesh< DIM > &rMesh, std::vector< CellPtr > &rCells, const std::vector< unsigned > locationIndices=std::vector< unsigned >(), bool deleteMesh=false)
 NodeBasedCellPopulationWithParticles (NodesOnlyMesh< DIM > &rMesh)
void UpdateParticlePositions (const std::vector< c_vector< double, DIM > > &rNodeForces, double dt)
void UpdateParticlesAfterReMesh (NodeMap &rMap)
void UpdateNodeLocations (const std::vector< c_vector< double, DIM > > &rNodeForces, double dt)
std::vector< bool > & rGetParticles ()
bool IsParticle (unsigned index)
std::set< unsignedGetParticleIndices ()
CellPtr AddCell (CellPtr pNewCell, const c_vector< double, DIM > &rCellDivisionVector, CellPtr pParentCell)
void WriteVtkResultsToFile ()
void OutputCellPopulationParameters (out_stream &rParamsFile)

Protected Member Functions

void Validate ()

Private Member Functions

void SetParticles (const std::set< unsigned > &rParticleIndices)
template<class Archive >
void serialize (Archive &archive, const unsigned int version)

Private Attributes

std::vector< boolmIsParticle

Friends

class TestNodeBasedCellPopulationWithParticles
class boost::serialization::access

Detailed Description

template<unsigned DIM>
class NodeBasedCellPopulationWithParticles< DIM >

A NodeBasedCellPopulationWithParticles is a NodeBasedCellPopulation with cells interacting with particles, such as ECM or fluid particles.

Definition at line 50 of file NodeBasedCellPopulationWithParticles.hpp.


Constructor & Destructor Documentation

template<unsigned DIM>
NodeBasedCellPopulationWithParticles< DIM >::NodeBasedCellPopulationWithParticles ( NodesOnlyMesh< DIM > &  rMesh,
std::vector< CellPtr > &  rCells,
const std::vector< unsigned locationIndices = std::vector<unsigned>(),
bool  deleteMesh = false 
)

Default constructor.

Note that the cell population will take responsibility for freeing the memory used by the nodes.

Parameters:
rMesha mutable nodes-only mesh
rCellsa vector of cells
locationIndicesan optional vector of location indices that correspond to real cells
deleteMeshwhether to delete nodes-only mesh in destructor

Definition at line 40 of file NodeBasedCellPopulationWithParticles.cpp.

References NodeBasedCellPopulation< DIM >::GetNode(), NodeBasedCellPopulation< DIM >::GetNumNodes(), NodeBasedCellPopulationWithParticles< DIM >::mIsParticle, NodeBasedCellPopulationWithParticles< DIM >::SetParticles(), and NodeBasedCellPopulationWithParticles< DIM >::Validate().

Constructor for use by the de-serializer.

Parameters:
rMesha mutable nodes-only mesh

Definition at line 77 of file NodeBasedCellPopulationWithParticles.cpp.


Member Function Documentation

template<unsigned DIM>
CellPtr NodeBasedCellPopulationWithParticles< DIM >::AddCell ( CellPtr  pNewCell,
const c_vector< double, DIM > &  rCellDivisionVector,
CellPtr  pParentCell 
) [virtual]

Overridden AddCell() method.

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

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)

Reimplemented from NodeBasedCellPopulation< DIM >.

Definition at line 177 of file NodeBasedCellPopulationWithParticles.cpp.

References AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::AddCell(), and NodesOnlyMesh< SPACE_DIM >::SetCellRadius().

template<unsigned DIM>
std::set< unsigned > NodeBasedCellPopulationWithParticles< DIM >::GetParticleIndices ( )
Returns:
the indices of those nodes that are particles.

Definition at line 96 of file NodeBasedCellPopulationWithParticles.cpp.

template<unsigned DIM>
bool NodeBasedCellPopulationWithParticles< DIM >::IsParticle ( unsigned  index) [virtual]

IsParticle() method.

Find if a given node is a particle

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

Reimplemented from AbstractCentreBasedCellPopulation< DIM >.

Definition at line 90 of file NodeBasedCellPopulationWithParticles.cpp.

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

Definition at line 387 of file NodeBasedCellPopulationWithParticles.cpp.

References NodeBasedCellPopulation< DIM >::OutputCellPopulationParameters().

template<unsigned DIM>
std::vector< bool > & NodeBasedCellPopulationWithParticles< DIM >::rGetParticles ( )
Returns:
mIsParticle, a vector that stores which nodes are particles.

Definition at line 84 of file NodeBasedCellPopulationWithParticles.cpp.

template<unsigned DIM>
template<class Archive >
void NodeBasedCellPopulationWithParticles< 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.

Parameters:
archivethe archive
versionthe current version of this class

Reimplemented from NodeBasedCellPopulation< DIM >.

Definition at line 84 of file NodeBasedCellPopulationWithParticles.hpp.

References NodeBasedCellPopulationWithParticles< DIM >::mIsParticle.

template<unsigned DIM>
void NodeBasedCellPopulationWithParticles< DIM >::SetParticles ( const std::set< unsigned > &  rParticleIndices) [private]

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

Parameters:
rParticleIndicesset of node indices corresponding to particles

Definition at line 110 of file NodeBasedCellPopulationWithParticles.cpp.

References NodeBasedCellPopulationWithParticles< DIM >::Validate().

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

template<unsigned DIM>
void NodeBasedCellPopulationWithParticles< 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 two vectors of forces on cells and particles and a time step over which to integrate the equations of motion.

Parameters:
rNodeForcesforces on cells
dttime step

Definition at line 231 of file NodeBasedCellPopulationWithParticles.cpp.

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

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

Update particle positions.

Parameters:
rNodeForces
dt

Definition at line 125 of file NodeBasedCellPopulationWithParticles.cpp.

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

template<unsigned DIM>
void NodeBasedCellPopulationWithParticles< DIM >::UpdateParticlesAfterReMesh ( NodeMap rMap) [virtual]

Update mIsParticle if required by a remesh.

Parameters:
rMapA map between node indices before and after remesh

Reimplemented from NodeBasedCellPopulation< DIM >.

Definition at line 156 of file NodeBasedCellPopulationWithParticles.cpp.

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

template<unsigned DIM>
void NodeBasedCellPopulationWithParticles< DIM >::Validate ( ) [protected, virtual]

Friends And Related Function Documentation

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

Needed for serialization.

Reimplemented from NodeBasedCellPopulation< DIM >.

Definition at line 73 of file NodeBasedCellPopulationWithParticles.hpp.


Member Data Documentation


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