VanLeeuwen2009WntSwatCellCycleModelHypothesisOne.cpp

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 
00029 #include "VanLeeuwen2009WntSwatCellCycleModelHypothesisOne.hpp"
00030 
00031 VanLeeuwen2009WntSwatCellCycleModelHypothesisOne::VanLeeuwen2009WntSwatCellCycleModelHypothesisOne(boost::shared_ptr<AbstractCellCycleModelOdeSolver> pOdeSolver)
00032     : AbstractVanLeeuwen2009WntSwatCellCycleModel(pOdeSolver)
00033 {
00034     if (mpOdeSolver == boost::shared_ptr<AbstractCellCycleModelOdeSolver>())
00035     {
00036 #ifdef CHASTE_CVODE
00037         mpOdeSolver = CellCycleModelOdeSolver<VanLeeuwen2009WntSwatCellCycleModelHypothesisOne, CvodeAdaptor>::Instance();
00038         mpOdeSolver->Initialise();
00039         // Chaste solvers always check for stopping events, CVODE needs to be instructed to do so
00040         mpOdeSolver->CheckForStoppingEvents();
00041         mpOdeSolver->SetMaxSteps(10000);
00042 #else
00043         mpOdeSolver = CellCycleModelOdeSolver<VanLeeuwen2009WntSwatCellCycleModelHypothesisOne, RungeKutta4IvpOdeSolver>::Instance();
00044         mpOdeSolver->Initialise();
00045         SetDt(0.00005);
00046 #endif //CHASTE_CVODE
00047     }
00048 }
00049 
00050 void VanLeeuwen2009WntSwatCellCycleModelHypothesisOne::InitialiseOdeSystem(double wntConcentration, boost::shared_ptr<AbstractCellMutationState> pMutationState)
00051 {
00052     mpOdeSystem = new VanLeeuwen2009WntSwatCellCycleOdeSystem(1, wntConcentration,  pMutationState);
00053 }
00054 
00055 AbstractCellCycleModel* VanLeeuwen2009WntSwatCellCycleModelHypothesisOne::CreateCellCycleModel()
00056 {
00057     // Create a new cell cycle model
00058     VanLeeuwen2009WntSwatCellCycleModelHypothesisOne* p_model = new VanLeeuwen2009WntSwatCellCycleModelHypothesisOne(mpOdeSolver);
00059 
00060     // Create the new cell cycle model's ODE system
00061     double wnt_level = GetWntLevel();
00062     p_model->InitialiseOdeSystem(wnt_level, mpCell->GetMutationState());
00063 
00064     // Use the current values of the state variables in mpOdeSystem as an initial condition for the new cell cycle model's ODE system
00065     assert(mpOdeSystem);
00066     p_model->SetStateVariables(mpOdeSystem->rGetStateVariables());
00067 
00068     // Set the values of the new cell cycle model's member variables
00069     p_model->SetBirthTime(mBirthTime);
00070     p_model->SetLastTime(mLastTime);
00071     p_model->SetDivideTime(mDivideTime);
00072     p_model->SetFinishedRunningOdes(mFinishedRunningOdes);
00073     p_model->SetG2PhaseStartTime(mG2PhaseStartTime);
00074     p_model->SetDimension(mDimension);
00075     p_model->SetCellProliferativeType(mCellProliferativeType);
00076 
00077     return p_model;
00078 }
00079 
00080 // Declare identifier for the serializer
00081 #include "SerializationExportWrapperForCpp.hpp"
00082 CHASTE_CLASS_EXPORT(VanLeeuwen2009WntSwatCellCycleModelHypothesisOne)
00083 #include "CellCycleModelOdeSolverExportWrapper.hpp"
00084 EXPORT_CELL_CYCLE_MODEL_ODE_SOLVER(VanLeeuwen2009WntSwatCellCycleModelHypothesisOne)

Generated on Mon Nov 1 12:35:16 2010 for Chaste by  doxygen 1.5.5