VertexCryptSimulation2d.hpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
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 VERTEXCRYPTSIMULATION2D_HPP_
00029 #define VERTEXCRYPTSIMULATION2D_HPP_
00030 
00031 #include "ChasteSerialization.hpp"
00032 #include <boost/serialization/base_object.hpp>
00033 
00034 #include "CellBasedSimulation.hpp"
00035 #include "VertexBasedCellPopulation.hpp"
00036 
00037 
00041 class VertexCryptSimulation2d : public CellBasedSimulation<2>
00042 {
00043     // Allow tests to access private members, in order to test computation of
00044     // private functions eg. DoCellBirth
00045     friend class TestVertexCryptSimulation2d;
00046 
00047 private:
00048 
00049     friend class boost::serialization::access;
00050     template<class Archive>
00051     void serialize(Archive & archive, const unsigned int version)
00052     {
00053         // If Archive is an output archive, then & resolves to <<
00054         // If Archive is an input archive, then & resolves to >>
00055         archive & boost::serialization::base_object<CellBasedSimulation<2> >(*this);
00056         archive & mUseJiggledBottomCells;
00057         archive & mWriteBetaCatenin;
00058     }
00059 
00061     bool mUseJiggledBottomCells;
00062 
00069     bool mWriteBetaCatenin;
00070 
00072     out_stream mVizBetaCateninResultsFile;
00073 
00084     c_vector<double, 2> CalculateCellDivisionVector(CellPtr pParentCell);
00085 
00091     void WriteVisualizerSetupFile();
00092 
00096     void SetupWriteBetaCatenin();
00097 
00103     void WriteBetaCatenin(double time);
00104 
00110     void SetupSolve();
00111 
00117     void PostSolve();
00118 
00125     void AfterSolve();
00126 
00127 public:
00128 
00136     VertexCryptSimulation2d(AbstractCellPopulation<2>& rCellPopulation,
00137                       bool deleteCellPopulationAndForceCollection=false,
00138                       bool initialiseCells=true);
00139 
00143     void UseJiggledBottomCells();
00144 
00154     void ApplyCellPopulationBoundaryConditions(const std::vector<c_vector<double,2> >& rOldLocations);
00155 
00160     void SetBottomCellAncestors();
00161 
00170     void OutputSimulationParameters(out_stream& rParamsFile);
00171 };
00172 
00173 // Declare identifier for the serializer
00174 #include "SerializationExportWrapper.hpp"
00175 CHASTE_CLASS_EXPORT(VertexCryptSimulation2d)
00176 
00177 namespace boost
00178 {
00179 namespace serialization
00180 {
00184 template<class Archive>
00185 inline void save_construct_data(
00186     Archive & ar, const VertexCryptSimulation2d * t, const BOOST_PFTO unsigned int file_version)
00187 {
00188     // Save data required to construct instance
00189     const AbstractCellPopulation<2> * p_cell_population = &(t->rGetCellPopulation());
00190     ar & p_cell_population;
00191 }
00192 
00196 template<class Archive>
00197 inline void load_construct_data(
00198     Archive & ar, VertexCryptSimulation2d * t, const unsigned int file_version)
00199 {
00200     // Retrieve data from archive required to construct new instance
00201     AbstractCellPopulation<2>* p_cell_population;
00202     ar & p_cell_population;
00203 
00204     // Invoke inplace constructor to initialise instance
00205     ::new(t)VertexCryptSimulation2d(*p_cell_population, true, false);
00206 }
00207 }
00208 } // namespace
00209 
00210 #endif /*VERTEXCRYPTSIMULATION2D_HPP_*/

Generated on Tue May 31 14:31:41 2011 for Chaste by  doxygen 1.5.5