CellProliferativeTypesCountWriter.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "CellProliferativeTypesCountWriter.hpp"
00037 #include "AbstractCellPopulation.hpp"
00038 #include "MeshBasedCellPopulation.hpp"
00039 #include "CaBasedCellPopulation.hpp"
00040 #include "NodeBasedCellPopulation.hpp"
00041 #include "PottsBasedCellPopulation.hpp"
00042 #include "VertexBasedCellPopulation.hpp"
00043
00044 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00045 CellProliferativeTypesCountWriter<ELEMENT_DIM, SPACE_DIM>::CellProliferativeTypesCountWriter()
00046 : AbstractCellPopulationCountWriter<ELEMENT_DIM, SPACE_DIM>("celltypes.dat")
00047 {
00048 }
00049
00050 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00051 void CellProliferativeTypesCountWriter<ELEMENT_DIM, SPACE_DIM>::VisitAnyPopulation(AbstractCellPopulation<SPACE_DIM, SPACE_DIM>* pCellPopulation)
00052 {
00053 std::vector<unsigned> proliferative_type_count = pCellPopulation->GetCellProliferativeTypeCount();
00054
00055 if (PetscTools::AmMaster())
00056 {
00057 for (unsigned i=0; i<proliferative_type_count.size(); i++)
00058 {
00059 *this->mpOutStream << proliferative_type_count[i] << "\t";
00060 }
00061 }
00062 }
00063
00064 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00065 void CellProliferativeTypesCountWriter<ELEMENT_DIM, SPACE_DIM>::Visit(MeshBasedCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation)
00066 {
00067 std::vector<unsigned> proliferative_type_count = pCellPopulation->GetCellProliferativeTypeCount();
00068 if (PetscTools::AmMaster())
00069 {
00070 for (unsigned i=0; i<proliferative_type_count.size(); i++)
00071 {
00072 *this->mpOutStream << proliferative_type_count[i] << "\t";
00073 }
00074 }
00075 }
00076
00077 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00078 void CellProliferativeTypesCountWriter<ELEMENT_DIM, SPACE_DIM>::Visit(CaBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00079 {
00080 VisitAnyPopulation(pCellPopulation);
00081 }
00082
00083 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00084 void CellProliferativeTypesCountWriter<ELEMENT_DIM, SPACE_DIM>::Visit(NodeBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00085 {
00086 VisitAnyPopulation(pCellPopulation);
00087 }
00088
00089 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00090 void CellProliferativeTypesCountWriter<ELEMENT_DIM, SPACE_DIM>::Visit(PottsBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00091 {
00092 VisitAnyPopulation(pCellPopulation);
00093 }
00094
00095 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00096 void CellProliferativeTypesCountWriter<ELEMENT_DIM, SPACE_DIM>::Visit(VertexBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00097 {
00098 VisitAnyPopulation(pCellPopulation);
00099 }
00100
00101
00102 template class CellProliferativeTypesCountWriter<1,1>;
00103 template class CellProliferativeTypesCountWriter<1,2>;
00104 template class CellProliferativeTypesCountWriter<2,2>;
00105 template class CellProliferativeTypesCountWriter<1,3>;
00106 template class CellProliferativeTypesCountWriter<2,3>;
00107 template class CellProliferativeTypesCountWriter<3,3>;
00108
00109 #include "SerializationExportWrapperForCpp.hpp"
00110
00111 EXPORT_TEMPLATE_CLASS_ALL_DIMS(CellProliferativeTypesCountWriter)