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 00029 #ifndef WNTCONCENTRATION_HPP_ 00030 #define WNTCONCENTRATION_HPP_ 00031 00032 #include "ChasteSerialization.hpp" 00033 #include "SerializableSingleton.hpp" 00034 #include <boost/serialization/base_object.hpp> 00035 00036 #include <iostream> 00037 00038 #include "AbstractCellPopulation.hpp" 00039 00046 typedef enum WntConcentrationType_ 00047 { 00048 NONE, 00049 LINEAR, 00050 RADIAL, 00051 EXPONENTIAL 00052 } WntConcentrationType; 00053 00054 00058 template<unsigned DIM> 00059 class WntConcentration : public SerializableSingleton<WntConcentration<DIM> > 00060 { 00061 private: 00062 00064 static WntConcentration* mpInstance; 00065 00069 double mCryptLength; 00070 00074 bool mLengthSet; 00075 00082 WntConcentrationType mWntType; 00083 00087 AbstractCellPopulation<DIM>* mpCellPopulation; 00088 00092 bool mTypeSet; 00093 00097 double mConstantWntValueForTesting; 00098 00103 bool mUseConstantWntValueForTesting; 00104 00114 double mWntConcentrationParameter; 00115 00121 double mCryptProjectionParameterA; 00122 00128 double mCryptProjectionParameterB; 00129 00131 friend class boost::serialization::access; 00138 template<class Archive> 00139 void serialize(Archive & archive, const unsigned int version) 00140 { 00141 bool is_set_up = IsWntSetUp(); 00142 archive & is_set_up; 00143 if (is_set_up) 00144 { 00145 archive & mCryptLength; 00146 archive & mLengthSet; 00147 archive & mWntType; 00148 archive & mpCellPopulation; 00149 archive & mTypeSet; 00150 archive & mConstantWntValueForTesting; 00151 archive & mUseConstantWntValueForTesting; 00152 archive & mWntConcentrationParameter; 00153 archive & mCryptProjectionParameterA; 00154 archive & mCryptProjectionParameterB; 00155 } 00156 } 00157 00158 protected: 00159 00163 WntConcentration(); 00164 00165 public: 00166 00173 static WntConcentration* Instance(); 00174 00178 virtual ~WntConcentration(); 00179 00184 static void Destroy(); 00185 00192 double GetWntLevel(double height); 00193 00201 double GetWntLevel(CellPtr pCell); 00202 00208 c_vector<double, DIM> GetWntGradient(c_vector<double, DIM>& rLocation); 00209 00215 c_vector<double, DIM> GetWntGradient(CellPtr pCell); 00216 00222 void SetCellPopulation(AbstractCellPopulation<DIM>& rCellPopulation); 00223 00227 AbstractCellPopulation<DIM>& rGetCellPopulation(); 00228 00232 double GetCryptLength(); 00233 00239 void SetCryptLength(double cryptLength); 00240 00244 WntConcentrationType GetType(); 00245 00251 void SetType(WntConcentrationType type); 00252 00259 void SetConstantWntValueForTesting(double value); 00260 00271 bool IsWntSetUp(); 00272 00276 double GetWntConcentrationParameter(); 00277 00283 void SetWntConcentrationParameter(double wntConcentrationParameter); 00284 00288 double GetCryptProjectionParameterA(); 00289 00293 double GetCryptProjectionParameterB(); 00294 00300 void SetCryptProjectionParameterA(double cryptProjectionParameterA); 00301 00307 void SetCryptProjectionParameterB(double cryptProjectionParameterB); 00308 }; 00309 00310 #endif /*WNTCONCENTRATION_HPP_*/