Chaste  Release::2017.1
CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM > Class Template Reference

#include <CellPopulationAdjacencyMatrixWriter.hpp>

+ Inheritance diagram for CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >:
+ Collaboration diagram for CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >:

Public Member Functions

 CellPopulationAdjacencyMatrixWriter ()
 
void VisitAnyPopulation (AbstractCellPopulation< SPACE_DIM, SPACE_DIM > *pCellPopulation)
 
virtual void Visit (MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation)
 
virtual void Visit (CaBasedCellPopulation< SPACE_DIM > *pCellPopulation)
 
virtual void Visit (NodeBasedCellPopulation< SPACE_DIM > *pCellPopulation)
 
virtual void Visit (PottsBasedCellPopulation< SPACE_DIM > *pCellPopulation)
 
virtual void Visit (VertexBasedCellPopulation< SPACE_DIM > *pCellPopulation)
 
- Public Member Functions inherited from AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM >
 AbstractCellPopulationWriter (const std::string &rFileName)
 
virtual void WriteHeader (AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM > *pCellPopulation)
 
- Public Member Functions inherited from AbstractCellBasedWriter< ELEMENT_DIM, SPACE_DIM >
 AbstractCellBasedWriter (const std::string &rFileName)
 
virtual ~AbstractCellBasedWriter ()
 
void CloseFile ()
 
virtual void OpenOutputFile (OutputFileHandler &rOutputFileHandler)
 
void OpenOutputFileForAppend (OutputFileHandler &rOutputFileHandler)
 
virtual void WriteTimeStamp ()
 
virtual void WriteNewline ()
 
void SetFileName (std::string fileName)
 
std::string GetFileName ()
 
- Public Member Functions inherited from Identifiable
virtual ~Identifiable ()
 
std::string GetIdentifier () const
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Protected Attributes inherited from AbstractCellBasedWriter< ELEMENT_DIM, SPACE_DIM >
std::string mFileName
 
out_stream mpOutStream
 

Detailed Description

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
class CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >

A class written using the visitor pattern for writing the cell population adjacency (i.e. connectivity) matrix to file.

The output file is called cellpopulationadjacency.dat by default.

Definition at line 50 of file CellPopulationAdjacencyMatrixWriter.hpp.

Constructor & Destructor Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::CellPopulationAdjacencyMatrixWriter ( )

Member Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
template<class Archive >
void CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate
template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::Visit ( MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM > *  pCellPopulation)
virtual

Visit the population and write the adjacency matrix (as a long vector).

Outputs a line of tab-separated values of the form: [number of cells] [adjacency 1 1] [adjacency 1 2] [adjacency 1 3]...

where, in the case of N cells, the (i,j)th entry of the adjacency matrix corresponds to the (1 + i + N*j)th entry in the line (the additional 1 is for the initial entry, which gives N).

This line is appended to the output written by AbstractCellBasedWriter, which is a single value [present simulation time], followed by a tab.

If cells i and j are adjacent and neither are labelled (as determined by the CellLabel property), then we have [adjacency i j] = 1; if they are adjacent and both are labelled, then we have [adjacency i j] = 2; if they are adjacent and exactly one is labelled, then we have [adjacency i j] = 3; otherwise, if they are no adjacent, then we have [adjacency i i] = 0.

By default we have [adjacency i i] = 0, i.e. cells are not considered to be adjacent to themselves.

Parameters
pCellPopulationa pointer to the MeshBasedCellPopulation to visit.
Todo:
#2645 - if efficiency is an issue, check if this is really needed

Implements AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 138 of file CellPopulationAdjacencyMatrixWriter.cpp.

References AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::Begin(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::End(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetCellUsingLocationIndex(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetLocationIndexUsingCell(), AbstractCentreBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetNeighbouringLocationIndices(), AbstractCellPopulation< ELEMENT_DIM, SPACE_DIM >::GetNumRealCells(), AbstractCellBasedWriter< ELEMENT_DIM, SPACE_DIM >::mpOutStream, and MeshBasedCellPopulation< ELEMENT_DIM, SPACE_DIM >::Update().

Referenced by CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::serialize().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::Visit ( CaBasedCellPopulation< SPACE_DIM > *  pCellPopulation)
virtual

Visit the population and write the adjacency matrix (as a long vector).

Outputs a line of tab-separated values of the form: [number of cells] [adjacency 1 1] [adjacency 1 2] [adjacency 1 3]...

where, in the case of N cells, the (i,j)th entry of the adjacency matrix corresponds to the (1 + i + N*j)th entry in the line (the additional 1 is for the initial entry, which gives N).

This line is appended to the output written by AbstractCellBasedWriter, which is a single value [present simulation time], followed by a tab.

If cells i and j are adjacent and neither are labelled (as determined by the CellLabel property), then we have [adjacency i j] = 1; if they are adjacent and both are labelled, then we have [adjacency i j] = 2; if they are adjacent and exactly one is labelled, then we have [adjacency i j] = 3; otherwise, if they are no adjacent, then we have [adjacency i i] = 0.

By default we have [adjacency i i] = 0, i.e. cells are not considered to be adjacent to themselves.

Parameters
pCellPopulationa pointer to the CaBasedCellPopulation to visit.

Implements AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 222 of file CellPopulationAdjacencyMatrixWriter.cpp.

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::Visit ( NodeBasedCellPopulation< SPACE_DIM > *  pCellPopulation)
virtual

Visit the population and write the adjacency matrix (as a long vector).

Outputs a line of tab-separated values of the form: [number of cells] [adjacency 1 1] [adjacency 1 2] [adjacency 1 3]...

where, in the case of N cells, the (i,j)th entry of the adjacency matrix corresponds to the (1 + i + N*j)th entry in the line (the additional 1 is for the initial entry, which gives N).

This line is appended to the output written by AbstractCellBasedWriter, which is a single value [present simulation time], followed by a tab.

If cells i and j are adjacent and neither are labelled (as determined by the CellLabel property), then we have [adjacency i j] = 1; if they are adjacent and both are labelled, then we have [adjacency i j] = 2; if they are adjacent and exactly one is labelled, then we have [adjacency i j] = 3; otherwise, if they are no adjacent, then we have [adjacency i i] = 0.

By default we have [adjacency i i] = 0, i.e. cells are not considered to be adjacent to themselves.

Parameters
pCellPopulationa pointer to the NodeBasedCellPopulation to visit.

Implements AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 227 of file CellPopulationAdjacencyMatrixWriter.cpp.

References CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::VisitAnyPopulation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::Visit ( PottsBasedCellPopulation< SPACE_DIM > *  pCellPopulation)
virtual

Visit the population and write the adjacency matrix (as a long vector).

Outputs a line of tab-separated values of the form: [number of cells] [adjacency 1 1] [adjacency 1 2] [adjacency 1 3]...

where, in the case of N cells, the (i,j)th entry of the adjacency matrix corresponds to the (1 + i + N*j)th entry in the line (the additional 1 is for the initial entry, which gives N).

This line is appended to the output written by AbstractCellBasedWriter, which is a single value [present simulation time], followed by a tab.

If cells i and j are adjacent and neither are labelled (as determined by the CellLabel property), then we have [adjacency i j] = 1; if they are adjacent and both are labelled, then we have [adjacency i j] = 2; if they are adjacent and exactly one is labelled, then we have [adjacency i j] = 3; otherwise, if they are no adjacent, then we have [adjacency i i] = 0.

By default we have [adjacency i i] = 0, i.e. cells are not considered to be adjacent to themselves.

Parameters
pCellPopulationa pointer to the PottsBasedCellPopulation to visit.

Implements AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 233 of file CellPopulationAdjacencyMatrixWriter.cpp.

References CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::VisitAnyPopulation().

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
void CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::Visit ( VertexBasedCellPopulation< SPACE_DIM > *  pCellPopulation)
virtual

Visit the population and write the adjacency matrix (as a long vector).

Outputs a line of tab-separated values of the form: [number of cells] [adjacency 1 1] [adjacency 1 2] [adjacency 1 3]...

where, in the case of N cells, the (i,j)th entry of the adjacency matrix corresponds to the (1 + i + N*j)th entry in the line (the additional 1 is for the initial entry, which gives N).

This line is appended to the output written by AbstractCellBasedWriter, which is a single value [present simulation time], followed by a tab.

If cells i and j are adjacent and neither are labelled (as determined by the CellLabel property), then we have [adjacency i j] = 1; if they are adjacent and both are labelled, then we have [adjacency i j] = 2; if they are adjacent and exactly one is labelled, then we have [adjacency i j] = 3; otherwise, if they are no adjacent, then we have [adjacency i i] = 0.

By default we have [adjacency i i] = 0, i.e. cells are not considered to be adjacent to themselves.

Parameters
pCellPopulationa pointer to the VertexBasedCellPopulation to visit.

Implements AbstractCellPopulationWriter< ELEMENT_DIM, SPACE_DIM >.

Definition at line 239 of file CellPopulationAdjacencyMatrixWriter.cpp.

References EXPORT_TEMPLATE_CLASS_ALL_DIMS, and CellPopulationAdjacencyMatrixWriter< ELEMENT_DIM, SPACE_DIM >::VisitAnyPopulation().

Friends And Related Function Documentation

template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 54 of file CellPopulationAdjacencyMatrixWriter.hpp.


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