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 #include "AbstractWntOdeBasedCellCycleModel.hpp" 00029 #include "PetscTools.hpp" 00030 00031 AbstractWntOdeBasedCellCycleModel::AbstractWntOdeBasedCellCycleModel(boost::shared_ptr<AbstractCellCycleModelOdeSolver> pOdeSolver) 00032 : AbstractOdeBasedCellCycleModel(SimulationTime::Instance()->GetTime(), pOdeSolver) 00033 { 00034 } 00035 00036 AbstractWntOdeBasedCellCycleModel::~AbstractWntOdeBasedCellCycleModel() 00037 { 00038 } 00039 00040 double AbstractWntOdeBasedCellCycleModel::GetWntLevel() 00041 { 00042 assert(mpCell != NULL); 00043 double level = 0; 00044 00045 switch (mDimension) 00046 { 00047 case 1: 00048 { 00049 const unsigned DIM = 1; 00050 level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell); 00051 break; 00052 } 00053 case 2: 00054 { 00055 const unsigned DIM = 2; 00056 level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell); 00057 break; 00058 } 00059 case 3: 00060 { 00061 const unsigned DIM = 3; 00062 level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell); 00063 break; 00064 } 00065 default: 00066 NEVER_REACHED; 00067 } 00068 00069 return level; 00070 } 00071 00072 void AbstractWntOdeBasedCellCycleModel::ResetForDivision() 00073 { 00074 AbstractOdeBasedCellCycleModel::ResetForDivision(); 00075 00076 assert(mpOdeSystem != NULL); 00077 00078 // This model needs the protein concentrations and phase resetting to G0/G1. 00079 // Keep the Wnt pathway in the same state but reset the cell cycle part 00080 // Cell cycle is proteins 0 to 4 (first 5 ODEs) 00081 std::vector<double> init_conds = mpOdeSystem->GetInitialConditions(); 00082 for (unsigned i=0; i<5; i++) 00083 { 00084 mpOdeSystem->rGetStateVariables()[i] = init_conds[i]; 00085 } 00086 } 00087 00088 void AbstractWntOdeBasedCellCycleModel::UpdateCellCyclePhase() 00089 { 00090 AbstractOdeBasedCellCycleModel::UpdateCellCyclePhase(); 00091 if (SimulationTime::Instance()->GetTime() == mLastTime 00092 || GetOdeStopTime() == mLastTime) 00093 { 00094 // Should only be called if we're still running ODEs 00095 UpdateCellProliferativeType(); 00096 } 00097 } 00098 00099 void AbstractWntOdeBasedCellCycleModel::UpdateCellProliferativeType() 00100 { 00101 assert(mpOdeSystem != NULL); 00102 assert(mpCell != NULL); 00103 ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel(); 00104 } 00105 00106 double AbstractWntOdeBasedCellCycleModel::GetAverageTransitCellCycleTime() 00107 { 00108 return 16.0; 00109 } 00110 00111 double AbstractWntOdeBasedCellCycleModel::GetAverageStemCellCycleTime() 00112 { 00113 return 16.0; 00114 } 00115 00116 bool AbstractWntOdeBasedCellCycleModel::CanCellTerminallyDifferentiate() 00117 { 00118 return false; 00119 } 00120 00121 void AbstractWntOdeBasedCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile) 00122 { 00123 // No new parameters to output 00124 00125 // Call method on direct parent class 00126 AbstractOdeBasedCellCycleModel::OutputCellCycleModelParameters(rParamsFile); 00127 } 00128