VertexT2SwapLocationsWriter.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 "VertexT2SwapLocationsWriter.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 #include "UblasIncludes.hpp"
00044
00045 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00046 VertexT2SwapLocationsWriter<ELEMENT_DIM, SPACE_DIM>::VertexT2SwapLocationsWriter()
00047 : AbstractCellPopulationWriter<ELEMENT_DIM, SPACE_DIM>("T2SwapLocations.dat")
00048 {
00049 }
00050
00051 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00052 void VertexT2SwapLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit(MeshBasedCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation)
00053 {
00054 }
00055
00056 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00057 void VertexT2SwapLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit(CaBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00058 {
00059 }
00060
00061 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00062 void VertexT2SwapLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit(NodeBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00063 {
00064 }
00065
00066 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00067 void VertexT2SwapLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit(PottsBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00068 {
00069 }
00070
00071 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00072 void VertexT2SwapLocationsWriter<ELEMENT_DIM, SPACE_DIM>::Visit(VertexBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00073 {
00074 std::vector< c_vector<double, SPACE_DIM> > t2_swap_locations = pCellPopulation->GetLocationsOfT2Swaps();
00075 std::vector< unsigned > t2_swap_ids = pCellPopulation->GetCellIdsOfT2Swaps();
00076
00077 *this->mpOutStream << t2_swap_locations.size() << "\t";
00078 assert( t2_swap_locations.size() == t2_swap_ids.size());
00079
00080 for (unsigned index = 0; index < t2_swap_locations.size(); index++)
00081 {
00082 *this->mpOutStream << t2_swap_ids[index] << "\t";
00083 for (unsigned i=0; i<SPACE_DIM; i++)
00084 {
00085 *this->mpOutStream << t2_swap_locations[index][i] << "\t";
00086 }
00087 }
00088
00089 pCellPopulation->ClearLocationsAndCellIdsOfT2Swaps();
00090 }
00091
00092
00093 template class VertexT2SwapLocationsWriter<1,1>;
00094 template class VertexT2SwapLocationsWriter<1,2>;
00095 template class VertexT2SwapLocationsWriter<2,2>;
00096 template class VertexT2SwapLocationsWriter<1,3>;
00097 template class VertexT2SwapLocationsWriter<2,3>;
00098 template class VertexT2SwapLocationsWriter<3,3>;
00099
00100 #include "SerializationExportWrapperForCpp.hpp"
00101
00102 EXPORT_TEMPLATE_CLASS_ALL_DIMS(VertexT2SwapLocationsWriter)