LinearSpringWithVariableSpringConstantsForce.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 
00029 #ifndef LINEARSPRINGWITHVARIABLESPRINGCONSTANTSFORCE_HPP
00030 #define LINEARSPRINGWITHVARIABLESPRINGCONSTANTSFORCE_HPP
00031 
00032 #include "GeneralisedLinearSpringForce.hpp"
00033 
00034 #include "ChasteSerialization.hpp"
00035 #include <boost/serialization/base_object.hpp>
00036 
00037 // Needed here to avoid serialization errors (on Boost<1.37)
00038 #include "ApcTwoHitCellMutationState.hpp"
00039 #include "BetaCateninOneHitCellMutationState.hpp"
00040 
00044 template<unsigned DIM>
00045 class LinearSpringWithVariableSpringConstantsForce : public GeneralisedLinearSpringForce<DIM>
00046 {
00047     friend class TestLinearSpringWithVariableSpringConstantsForce;
00048 
00049 private:
00050 
00052     friend class boost::serialization::access;
00059     template<class Archive>
00060     void serialize(Archive & archive, const unsigned int version)
00061     {
00062         archive & boost::serialization::base_object<GeneralisedLinearSpringForce<DIM> >(*this);
00063         archive & mUseEdgeBasedSpringConstant;
00064         archive & mUseMutantSprings;
00065         archive & mMutantMutantMultiplier;
00066         archive & mNormalMutantMultiplier;
00067         archive & mUseBCatSprings;
00068         archive & mUseApoptoticSprings;
00069         archive & mBetaCatSpringScaler;
00070         archive & mApoptoticSpringTensionStiffness;
00071         archive & mApoptoticSpringCompressionStiffness;
00072     }
00073 
00074 protected:
00075 
00077     bool mUseEdgeBasedSpringConstant;
00078 
00080     bool mUseMutantSprings;
00081 
00083     double mMutantMutantMultiplier;
00084 
00086     double mNormalMutantMultiplier;
00087 
00089     bool mUseBCatSprings;
00090 
00092     bool mUseApoptoticSprings;
00093 
00095     double mBetaCatSpringScaler;
00096 
00098     double mApoptoticSpringTensionStiffness;
00099 
00101     double mApoptoticSpringCompressionStiffness;
00102 
00103 public:
00104 
00108     LinearSpringWithVariableSpringConstantsForce();
00109 
00113     ~LinearSpringWithVariableSpringConstantsForce();
00114 
00120     void SetEdgeBasedSpringConstant(bool useEdgeBasedSpringConstant);
00121 
00130     void SetMutantSprings(bool useMutantSprings, double mutantMutantMultiplier=2, double normalMutantMultiplier=1.5);
00131 
00137     void SetBetaCateninSprings(bool useBCatSprings);
00138 
00144     void SetApoptoticSprings(bool useApoptoticSprings);
00145 
00159     double VariableSpringConstantMultiplicationFactor(unsigned nodeAGlobalIndex,
00160                                                       unsigned nodeBGlobalIndex,
00161                                                       AbstractCellPopulation<DIM>& rCellPopulation,
00162                                                       bool isCloserThanRestLength);
00163 
00170     void AddForceContribution(std::vector<c_vector<double, DIM> >& rForces,
00171                               AbstractCellPopulation<DIM>& rCellPopulation);
00172 
00176     double GetBetaCatSpringScaler();
00177 
00183     void SetBetaCatSpringScaler(double betaCatSpringScaler);
00184 
00188     double GetApoptoticSpringTensionStiffness();
00189 
00195     void SetApoptoticSpringTensionStiffness(double apoptoticSpringTensionStiffness);
00196 
00200     double GetApoptoticSpringCompressionStiffness();
00201 
00207     void SetApoptoticSpringCompressionStiffness(double apoptoticSpringCompressionStiffness);
00208 
00217     virtual void OutputForceParameters(out_stream& rParamsFile);
00218 };
00219 
00220 #include "SerializationExportWrapper.hpp"
00221 
00222 EXPORT_TEMPLATE_CLASS_SAME_DIMS(LinearSpringWithVariableSpringConstantsForce)
00223 
00224 
00225 #endif /*LINEARSPRINGWITHVARIABLESPRINGCONSTANTSFORCE_HPP*/
Generated on Thu Dec 22 13:00:05 2011 for Chaste by  doxygen 1.6.3