CryptSimulation2d.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
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     // Allow tests to access private members, in order to test computation of
00045     // private functions eg. DoCellBirth
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         // If Archive is an output archive, then & resolves to <<
00062         // If Archive is an input archive, then & resolves to >>
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 // Declare identifier for the serializer
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     // Save data required to construct instance
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     // Retrieve data from archive required to construct new instance
00201     AbstractTissue<2>*p_tissue;
00202     ar >> p_tissue;
00203     std::vector<AbstractForce<2>*> force_collection;
00204     ar >> force_collection;
00205 
00206     // Invoke inplace constructor to initialise instance
00207     ::new(t)CryptSimulation2d(*p_tissue, force_collection, true, false);
00208 }
00209 }
00210 } // namespace
00211 
00212 #endif /*CRYPTSIMULATION2D_HPP_*/
00213 

Generated by  doxygen 1.6.2