CellIdWriter.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 "CellIdWriter.hpp"
00037 #include "AbstractCellPopulation.hpp"
00038
00039 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00040 CellIdWriter<ELEMENT_DIM, SPACE_DIM>::CellIdWriter()
00041 : AbstractCellWriter<ELEMENT_DIM, SPACE_DIM>("loggedcell.dat")
00042 {
00043 this->mVtkCellDataName = "Cell IDs";
00044 }
00045
00046 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00047 double CellIdWriter<ELEMENT_DIM, SPACE_DIM>::GetCellDataForVtkOutput(CellPtr pCell, AbstractCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation)
00048 {
00049 double cell_id = pCell->GetCellId();
00050 return cell_id;
00051 }
00052
00053 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00054 void CellIdWriter<ELEMENT_DIM, SPACE_DIM>::VisitCell(CellPtr pCell, AbstractCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation)
00055 {
00056 unsigned cell_id = pCell->GetCellId();
00057 unsigned location_index = pCellPopulation->GetLocationIndexUsingCell(pCell);
00058 *this->mpOutStream << " " << cell_id << " " << location_index;
00059
00060 c_vector<double, SPACE_DIM> coords = pCellPopulation->GetLocationOfCellCentre(pCell);
00061 for (unsigned i=0; i<SPACE_DIM; i++)
00062 {
00063 *this->mpOutStream << " " << coords[i];
00064 }
00065 }
00066
00067
00068 template class CellIdWriter<1,1>;
00069 template class CellIdWriter<1,2>;
00070 template class CellIdWriter<2,2>;
00071 template class CellIdWriter<1,3>;
00072 template class CellIdWriter<2,3>;
00073 template class CellIdWriter<3,3>;
00074
00075 #include "SerializationExportWrapperForCpp.hpp"
00076
00077 EXPORT_TEMPLATE_CLASS_ALL_DIMS(CellIdWriter)