NodeLocationWriter.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 "NodeLocationWriter.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 NodeLocationWriter<ELEMENT_DIM, SPACE_DIM>::NodeLocationWriter()
00046 : AbstractCellPopulationWriter<ELEMENT_DIM, SPACE_DIM>("results.viznodes")
00047 {
00048 }
00049
00050 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00051 void NodeLocationWriter<ELEMENT_DIM, SPACE_DIM>::VisitAnyPopulation(AbstractCellPopulation<SPACE_DIM, SPACE_DIM>* pCellPopulation)
00052 {
00053 for (typename AbstractMesh<SPACE_DIM, SPACE_DIM>::NodeIterator node_iter = pCellPopulation->rGetMesh().GetNodeIteratorBegin();
00054 node_iter != pCellPopulation->rGetMesh().GetNodeIteratorEnd();
00055 ++node_iter)
00056 {
00057 if (!node_iter->IsDeleted())
00058 {
00059 const c_vector<double,SPACE_DIM>& position = node_iter->rGetLocation();
00060
00061 for (unsigned i=0; i<SPACE_DIM; i++)
00062 {
00063 *this->mpOutStream << position[i] << " ";
00064 }
00065 }
00066 }
00067 }
00068
00069 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00070 void NodeLocationWriter<ELEMENT_DIM, SPACE_DIM>::Visit(MeshBasedCellPopulation<ELEMENT_DIM, SPACE_DIM>* pCellPopulation)
00071 {
00072 for (typename AbstractMesh<ELEMENT_DIM, SPACE_DIM>::NodeIterator node_iter = pCellPopulation->rGetMesh().GetNodeIteratorBegin();
00073 node_iter != pCellPopulation->rGetMesh().GetNodeIteratorEnd();
00074 ++node_iter)
00075 {
00076 if (!node_iter->IsDeleted())
00077 {
00078 const c_vector<double,SPACE_DIM>& position = node_iter->rGetLocation();
00079
00080 for (unsigned i=0; i<SPACE_DIM; i++)
00081 {
00082 *this->mpOutStream << position[i] << " ";
00083 }
00084 }
00085 }
00086 }
00087
00088 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00089 void NodeLocationWriter<ELEMENT_DIM, SPACE_DIM>::Visit(CaBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00090 {
00091 VisitAnyPopulation(pCellPopulation);
00092 }
00093
00094 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00095 void NodeLocationWriter<ELEMENT_DIM, SPACE_DIM>::Visit(NodeBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00096 {
00097 VisitAnyPopulation(pCellPopulation);
00098 }
00099
00100 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00101 void NodeLocationWriter<ELEMENT_DIM, SPACE_DIM>::Visit(PottsBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00102 {
00103 VisitAnyPopulation(pCellPopulation);
00104 }
00105
00106 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00107 void NodeLocationWriter<ELEMENT_DIM, SPACE_DIM>::Visit(VertexBasedCellPopulation<SPACE_DIM>* pCellPopulation)
00108 {
00109 VisitAnyPopulation(pCellPopulation);
00110 }
00111
00112
00113 template class NodeLocationWriter<1,1>;
00114 template class NodeLocationWriter<1,2>;
00115 template class NodeLocationWriter<2,2>;
00116 template class NodeLocationWriter<1,3>;
00117 template class NodeLocationWriter<2,3>;
00118 template class NodeLocationWriter<3,3>;
00119
00120 #include "SerializationExportWrapperForCpp.hpp"
00121
00122 EXPORT_TEMPLATE_CLASS_ALL_DIMS(NodeLocationWriter)