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 #ifndef CRYPTSIMULATION2D_HPP_
00029 #define CRYPTSIMULATION2D_HPP_
00030
00031 #include <boost/serialization/access.hpp>
00032 #include <boost/serialization/base_object.hpp>
00033
00034 #include "TissueSimulation.hpp"
00035 #include "SimpleDataWriter.hpp"
00036 #include "MeshBasedTissueWithGhostNodes.hpp"
00037
00038
00039 #include <boost/serialization/export.hpp>
00040
00041
00046 class CryptSimulation2d : public TissueSimulation<2>
00047 {
00048
00049
00050 friend class TestCryptSimulation2d;
00051
00052 private :
00053
00055 friend class boost::serialization::access;
00062 template<class Archive>
00063 void serialize(Archive & archive, const unsigned int version)
00064 {
00065
00066
00067 archive & boost::serialization::base_object<TissueSimulation<2> >(*this);
00068 archive & mUseJiggledBottomCells;
00069 }
00070
00072 bool mUseJiggledBottomCells;
00073
00075 out_stream mBetaCatResultsFile;
00076
00078 MeshBasedTissueWithGhostNodes<2>* mpStaticCastTissue;
00079
00090 c_vector<double, 2> CalculateDividingCellCentreLocations(TissueCell* pParentCell);
00091
00097 void WriteVisualizerSetupFile();
00098
00102 void SetupWriteBetaCatenin();
00103
00109 void WriteBetaCatenin(double time);
00110
00116 void SetupSolve();
00117
00123 void PostSolve();
00124
00131 void AfterSolve();
00132
00133 public :
00134
00143 CryptSimulation2d(AbstractTissue<2>& rTissue,
00144 std::vector<AbstractForce<2>*> forceCollection,
00145 bool deleteTissueAndForceCollection=false,
00146 bool initialiseCells=true);
00147
00149 void UseJiggledBottomCells();
00150
00160 void ApplyTissueBoundaryConditions(const std::vector<c_vector<double,2> >& rOldLocations);
00161
00162 };
00163
00164
00165
00166 BOOST_CLASS_EXPORT(CryptSimulation2d)
00167
00168 namespace boost
00169 {
00170 namespace serialization
00171 {
00175 template<class Archive>
00176 inline void save_construct_data(
00177 Archive & ar, const CryptSimulation2d * t, const BOOST_PFTO unsigned int file_version)
00178 {
00179
00180 const AbstractTissue<2> * p_tissue = &(t->rGetTissue());
00181 ar & p_tissue;
00182 const std::vector<AbstractForce<2>*> force_collection = t->rGetForceCollection();
00183 ar & force_collection;
00184 }
00185
00189 template<class Archive>
00190 inline void load_construct_data(
00191 Archive & ar, CryptSimulation2d * t, const unsigned int file_version)
00192 {
00193
00194 AbstractTissue<2>* p_tissue;
00195 ar >> p_tissue;
00196 std::vector<AbstractForce<2>*> force_collection;
00197 ar >> force_collection;
00198
00199
00200 ::new(t)CryptSimulation2d(*p_tissue, force_collection, true, false);
00201 }
00202 }
00203 }
00204
00205 #endif
00206