Chaste Release::3.1
|
00001 /* 00002 00003 Copyright (c) 2005-2012, University of Oxford. 00004 All rights reserved. 00005 00006 University of Oxford means the Chancellor, Masters and Scholars of the 00007 University of Oxford, having an administrative office at Wellington 00008 Square, Oxford OX1 2JD, UK. 00009 00010 This file is part of Chaste. 00011 00012 Redistribution and use in source and binary forms, with or without 00013 modification, are permitted provided that the following conditions are met: 00014 * Redistributions of source code must retain the above copyright notice, 00015 this list of conditions and the following disclaimer. 00016 * Redistributions in binary form must reproduce the above copyright notice, 00017 this list of conditions and the following disclaimer in the documentation 00018 and/or other materials provided with the distribution. 00019 * Neither the name of the University of Oxford nor the names of its 00020 contributors may be used to endorse or promote products derived from this 00021 software without specific prior written permission. 00022 00023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00024 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00025 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00026 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 00027 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00028 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 00029 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00030 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00031 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 00032 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 00034 */ 00035 00036 #ifndef ELECTROMECHANICSPROBLEMDEFINITION_HPP_ 00037 #define ELECTROMECHANICSPROBLEMDEFINITION_HPP_ 00038 00039 #include "SolidMechanicsProblemDefinition.hpp" 00040 #include "ContractionModelName.hpp" 00041 #include "NashHunterPoleZeroLaw.hpp" 00042 #include "CompressibleExponentialLaw.hpp" 00043 #include "FileFinder.hpp" 00044 00049 template<unsigned DIM> 00050 class ElectroMechanicsProblemDefinition : public SolidMechanicsProblemDefinition<DIM> 00051 { 00052 private: 00057 ContractionModelName mContractionModel; 00058 00060 double mContractionModelOdeTimeStep; 00061 00063 double mMechanicsSolveTimestep; 00064 00069 bool mDeformationAffectsConductivity; 00070 00075 bool mDeformationAffectsCellModels; 00076 00080 AbstractMaterialLaw<DIM>* mpDefaultMaterialLaw; 00081 00082 00084 bool mReadFibreSheetInformationFromFile; 00085 00090 FileFinder mFibreSheetDirectionsFile; 00091 00096 bool mFibreSheetDirectionsDefinedPerQuadraturePoint; 00097 00103 unsigned mNumIncrementsForInitialDeformation; 00104 00108 bool mApplyCrossFibreTension; 00109 00111 double mCrossFibreTensionFraction; 00112 00113 public: 00118 ElectroMechanicsProblemDefinition(QuadraticMesh<DIM>& rMesh); 00119 00121 ~ElectroMechanicsProblemDefinition(); 00122 00133 void SetContractionModel(ContractionModelName contractionModel, double timestep); 00134 00140 void SetUseDefaultCardiacMaterialLaw(CompressibilityType compressibilityType); 00141 00164 void SetDeformationAffectsElectrophysiology(bool deformationAffectsConductivity, bool deformationAffectsCellModels); 00165 00170 void SetMechanicsSolveTimestep(double timestep); 00171 00172 00187 void SetVariableFibreSheetDirectionsFile(const FileFinder& rFibreSheetDirectionsFile, bool definedPerQuadPoint); 00188 00189 00200 void SetApplyCrossFibreTension(bool applyCrossFibreTension, double crossFibreTensionFraction); 00201 00202 00206 ContractionModelName GetContractionModel() 00207 { 00208 assert(mContractionModelOdeTimeStep>0.0); // if this fails SetContractionModel() probably hasn't been called - call Validate() to check 00209 return mContractionModel; 00210 } 00211 00215 double GetContractionModelOdeTimestep() 00216 { 00217 assert(mContractionModelOdeTimeStep>0.0); // if this fails SetContractionModel() probably hasn't been called - call Validate() to check 00218 return mContractionModelOdeTimeStep; 00219 } 00220 00224 double GetMechanicsSolveTimestep() 00225 { 00226 assert(mMechanicsSolveTimestep>0.0); // if this fails SetMechanicsSolveTimestep() probably hasn't been called - call Validate() to check 00227 return mMechanicsSolveTimestep; 00228 } 00229 00234 bool GetDeformationAffectsConductivity() 00235 { 00236 return mDeformationAffectsConductivity; 00237 } 00238 00243 bool GetDeformationAffectsCellModels() 00244 { 00245 return mDeformationAffectsCellModels; 00246 } 00247 00251 bool ReadFibreSheetDirectionsFromFile() 00252 { 00253 return mReadFibreSheetInformationFromFile; 00254 } 00255 00259 FileFinder GetFibreSheetDirectionsFile() 00260 { 00261 assert(mReadFibreSheetInformationFromFile); 00262 assert(mFibreSheetDirectionsFile.GetAbsolutePath()!=""); 00263 return mFibreSheetDirectionsFile; 00264 } 00265 00271 bool GetFibreSheetDirectionsDefinedPerQuadraturePoint() 00272 { 00273 assert(mReadFibreSheetInformationFromFile); 00274 return mFibreSheetDirectionsDefinedPerQuadraturePoint; 00275 } 00276 00283 void SetNumIncrementsForInitialDeformation(unsigned numIncrements) 00284 { 00285 if(numIncrements==0) 00286 { 00287 EXCEPTION("Number of increments for initial deformation must be 1 or more"); 00288 } 00289 mNumIncrementsForInitialDeformation = numIncrements; 00290 } 00291 00296 unsigned GetNumIncrementsForInitialDeformation() 00297 { 00298 return mNumIncrementsForInitialDeformation; 00299 } 00300 00304 double GetApplyCrossFibreTension() 00305 { 00306 return mApplyCrossFibreTension; 00307 } 00308 00312 double GetCrossFibreTensionFraction() 00313 { 00314 return mCrossFibreTensionFraction; 00315 } 00316 00317 00322 virtual void Validate(); 00323 }; 00324 00325 #endif // ELECTROMECHANICSPROBLEMDEFINITION_HPP_