Cylindrical2dNodesOnlyMesh.hpp
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 #ifndef CYLINDRICAL2DNODESONLYMESH_HPP_
00037 #define CYLINDRICAL2DNODESONLYMESH_HPP_
00038
00039 #include "ChasteSerialization.hpp"
00040 #include <boost/serialization/base_object.hpp>
00041
00042 #include "NodesOnlyMesh.hpp"
00043
00052 class Cylindrical2dNodesOnlyMesh: public NodesOnlyMesh<2>
00053 {
00054 private:
00058 double mWidth;
00059
00060 friend class TestCylindrical2dNodesOnlyMesh;
00061
00063 friend class boost::serialization::access;
00075 template<class Archive>
00076 void serialize(Archive & archive, const unsigned int version)
00077 {
00078 archive & boost::serialization::base_object<NodesOnlyMesh<2> >(*this);
00079 archive & mWidth;
00080 }
00081
00082 public:
00083
00089 Cylindrical2dNodesOnlyMesh(double width);
00090
00099 virtual void SetUpBoxCollection(double cutOffLength, c_vector<double, 2*2> domainSize, int numLocalRows = PETSC_DECIDE, bool isPeriodic = true);
00100
00111 c_vector<double, 2> GetVectorFromAtoB(const c_vector<double, 2>& rLocation1, const c_vector<double, 2>& rLocation2);
00112
00122 double GetWidth(const unsigned& rDimension) const;
00123
00134 void SetNode(unsigned nodeIndex, ChastePoint<2> point, bool concreteMove = false);
00135
00142 unsigned AddNode(Node<2>* pNewNode);
00143 };
00144
00145 namespace boost
00146 {
00147 namespace serialization
00148 {
00152 template<class Archive>
00153 inline void save_construct_data(
00154 Archive & ar, const Cylindrical2dNodesOnlyMesh * t, const BOOST_PFTO unsigned int file_version)
00155 {
00156
00157 const double width = t->GetWidth(0);
00158 ar & width;
00159 }
00160
00164 template<class Archive>
00165 inline void load_construct_data(
00166 Archive & ar, Cylindrical2dNodesOnlyMesh * t, const unsigned int file_version)
00167 {
00168
00169 double width;
00170 ar & width;
00171
00172
00173 ::new(t)Cylindrical2dNodesOnlyMesh(width);
00174 }
00175 }
00176 }
00177
00178 #include "SerializationExportWrapper.hpp"
00179 CHASTE_CLASS_EXPORT(Cylindrical2dNodesOnlyMesh)
00180
00181 #endif