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
00029 #ifndef CRYPTSIMULATION2D_HPP_
00030 #define CRYPTSIMULATION2D_HPP_
00031
00032 #include "ChasteSerialization.hpp"
00033 #include <boost/serialization/base_object.hpp>
00034
00035 #include "WntConcentration.hpp"
00036 #include "OffLatticeSimulation.hpp"
00037 #include "MeshBasedCellPopulationWithGhostNodes.hpp"
00038 #include "VertexBasedCellPopulation.hpp"
00039 #include "CryptSimulationBoundaryCondition.hpp"
00040
00046 class CryptSimulation2d : public OffLatticeSimulation<2>
00047 {
00048
00049 friend class TestCryptSimulation2dWithMeshBasedCellPopulation;
00050 friend class TestCryptSimulation2dWithVertexBasedCellPopulation;
00051
00052 protected:
00053
00055 friend class boost::serialization::access;
00062 template<class Archive>
00063 void serialize(Archive & archive, const unsigned int version)
00064 {
00065 archive & boost::serialization::base_object<OffLatticeSimulation<2> >(*this);
00066
00067 SerializableSingleton<WntConcentration<2> >* p_wnt_wrapper = WntConcentration<2>::Instance()->GetSerializationWrapper();
00068 archive & p_wnt_wrapper;
00069
00070 archive & mWriteBetaCatenin;
00071 }
00072
00079 bool mWriteBetaCatenin;
00080
00082 out_stream mVizBetaCateninResultsFile;
00083
00088 bool mUsingMeshBasedCellPopulation;
00089
00108 c_vector<double, 2> CalculateCellDivisionVector(CellPtr pParentCell);
00109
00113 void SetupWriteBetaCatenin();
00114
00120 virtual void WriteBetaCatenin(double time);
00121
00127 void SetupSolve();
00128
00134 void PostSolve();
00135
00142 void AfterSolve();
00143
00144 public:
00145
00154 CryptSimulation2d(AbstractCellPopulation<2>& rCellPopulation,
00155 bool deleteCellPopulationInDestructor=false,
00156 bool initialiseCells=true);
00157
00163 virtual ~CryptSimulation2d();
00164
00168 void UseJiggledBottomCells();
00169
00174 void SetBottomCellAncestors();
00175
00184 void OutputSimulationParameters(out_stream& rParamsFile);
00185 };
00186
00187
00188 #include "SerializationExportWrapper.hpp"
00189 CHASTE_CLASS_EXPORT(CryptSimulation2d)
00190
00191 namespace boost
00192 {
00193 namespace serialization
00194 {
00198 template<class Archive>
00199 inline void save_construct_data(
00200 Archive & ar, const CryptSimulation2d * t, const BOOST_PFTO unsigned int file_version)
00201 {
00202
00203 const AbstractCellPopulation<2>* p_cell_population = &(t->rGetCellPopulation());
00204 ar & p_cell_population;
00205 }
00206
00210 template<class Archive>
00211 inline void load_construct_data(
00212 Archive & ar, CryptSimulation2d * t, const unsigned int file_version)
00213 {
00214
00215 AbstractCellPopulation<2>* p_cell_population;
00216 ar & p_cell_population;
00217
00218
00219 ::new(t)CryptSimulation2d(*p_cell_population, true, false);
00220 }
00221 }
00222 }
00223
00224 #endif