CryptSimulation2d.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 #ifndef CRYPTSIMULATION2D_HPP_
00029 #define CRYPTSIMULATION2D_HPP_
00030
00031 #include "ChasteSerialization.hpp"
00032 #include <boost/serialization/base_object.hpp>
00033
00034 #include "TissueSimulation.hpp"
00035 #include "SimpleDataWriter.hpp"
00036 #include "MeshBasedTissueWithGhostNodes.hpp"
00037
00042 class CryptSimulation2d : public TissueSimulation<2>
00043 {
00044
00045
00046 friend class TestCryptSimulation2d;
00047
00048 protected:
00049
00051 friend class boost::serialization::access;
00058 template<class Archive>
00059 void serialize(Archive & archive, const unsigned int version)
00060 {
00061
00062
00063 archive & boost::serialization::base_object<TissueSimulation<2> >(*this);
00064 archive & mUseJiggledBottomCells;
00065 }
00066
00068 bool mUseJiggledBottomCells;
00069
00071 out_stream mBetaCatResultsFile;
00072
00074 MeshBasedTissueWithGhostNodes<2>* mpStaticCastTissue;
00075
00086 c_vector<double, 2> CalculateCellDivisionVector(TissueCell& rParentCell);
00087
00093 void WriteVisualizerSetupFile();
00094
00098 void SetupWriteBetaCatenin();
00099
00105 void WriteBetaCatenin(double time);
00106
00112 void SetupSolve();
00113
00117 void OutputParameters();
00118
00124 void PostSolve();
00125
00132 void AfterSolve();
00133
00134 public :
00135
00144 CryptSimulation2d(AbstractTissue<2>& rTissue,
00145 std::vector<AbstractForce<2>*> forceCollection,
00146 bool deleteTissueAndForceCollection=false,
00147 bool initialiseCells=true);
00148
00150 void UseJiggledBottomCells();
00151
00161 void ApplyTissueBoundaryConditions(const std::vector<c_vector<double,2> >& rOldLocations);
00162
00167 void SetBottomCellAncestors();
00168 };
00169
00170
00171 #include "SerializationExportWrapper.hpp"
00172
00173 CHASTE_CLASS_EXPORT(CryptSimulation2d)
00174
00175 namespace boost
00176 {
00177 namespace serialization
00178 {
00182 template<class Archive>
00183 inline void save_construct_data(
00184 Archive & ar, const CryptSimulation2d * t, const BOOST_PFTO unsigned int file_version)
00185 {
00186
00187 const AbstractTissue<2>* p_tissue = &(t->rGetTissue());
00188 ar & p_tissue;
00189 const std::vector<AbstractForce<2>*> force_collection = t->rGetForceCollection();
00190 ar & force_collection;
00191 }
00192
00196 template<class Archive>
00197 inline void load_construct_data(
00198 Archive & ar, CryptSimulation2d * t, const unsigned int file_version)
00199 {
00200
00201 AbstractTissue<2>*p_tissue;
00202 ar >> p_tissue;
00203 std::vector<AbstractForce<2>*> force_collection;
00204 ar >> force_collection;
00205
00206
00207 ::new(t)CryptSimulation2d(*p_tissue, force_collection, true, false);
00208 }
00209 }
00210 }
00211
00212 #endif
00213