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
00030
00031
00032
00033
00034
00035
00036 #ifndef CRYPTSIMULATION2D_HPP_
00037 #define CRYPTSIMULATION2D_HPP_
00038
00039 #include "ChasteSerialization.hpp"
00040 #include <boost/serialization/base_object.hpp>
00041
00042 #include "WntConcentration.hpp"
00043 #include "OffLatticeSimulation.hpp"
00044 #include "VertexBasedCellPopulation.hpp"
00045 #include "CryptSimulationBoundaryCondition.hpp"
00046
00052 class CryptSimulation2d : public OffLatticeSimulation<2>
00053 {
00054
00055 friend class TestCryptSimulation2dWithMeshBasedCellPopulation;
00056 friend class TestCryptSimulation2dWithVertexBasedCellPopulation;
00057
00058 protected:
00059
00061 friend class boost::serialization::access;
00068 template<class Archive>
00069 void serialize(Archive & archive, const unsigned int version)
00070 {
00071 archive & boost::serialization::base_object<OffLatticeSimulation<2> >(*this);
00072
00073 SerializableSingleton<WntConcentration<2> >* p_wnt_wrapper = WntConcentration<2>::Instance()->GetSerializationWrapper();
00074 archive & p_wnt_wrapper;
00075 }
00076
00081 bool mUsingMeshBasedCellPopulation;
00082
00101 c_vector<double, 2> CalculateCellDivisionVector(CellPtr pParentCell);
00102
00108 void SetupSolve();
00109
00110 public:
00111
00120 CryptSimulation2d(AbstractCellPopulation<2>& rCellPopulation,
00121 bool deleteCellPopulationInDestructor=false,
00122 bool initialiseCells=true);
00123
00129 virtual ~CryptSimulation2d();
00130
00134 void UseJiggledBottomCells();
00135
00140 void SetBottomCellAncestors();
00141
00150 void OutputSimulationParameters(out_stream& rParamsFile);
00151 };
00152
00153
00154 #include "SerializationExportWrapper.hpp"
00155 CHASTE_CLASS_EXPORT(CryptSimulation2d)
00156
00157 namespace boost
00158 {
00159 namespace serialization
00160 {
00164 template<class Archive>
00165 inline void save_construct_data(
00166 Archive & ar, const CryptSimulation2d * t, const BOOST_PFTO unsigned int file_version)
00167 {
00168
00169 const AbstractCellPopulation<2>* p_cell_population = &(t->rGetCellPopulation());
00170 ar & p_cell_population;
00171 }
00172
00176 template<class Archive>
00177 inline void load_construct_data(
00178 Archive & ar, CryptSimulation2d * t, const unsigned int file_version)
00179 {
00180
00181 AbstractCellPopulation<2>* p_cell_population;
00182 ar & p_cell_population;
00183
00184
00185 ::new(t)CryptSimulation2d(*p_cell_population, true, false);
00186 }
00187 }
00188 }
00189
00190 #endif