SchmidCostaExponentialLaw2d.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2009
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 "SchmidCostaExponentialLaw2d.hpp"
00030 
00031 SchmidCostaExponentialLaw2d::SchmidCostaExponentialLaw2d()
00032 {
00033     mA = 0.221;    // kiloPascals, presumably, althought the paper doesn't say.
00034                    // gives results matching Pole-zero anyway.
00035 
00036     double bff = 42.5; // dimensionless
00037     double bfs = 11.0; // dimensionless
00038     double bss = 18.6; // dimensionless
00039 
00040     mB.resize(2);
00041     mB[0].resize(2);
00042     mB[1].resize(2);
00043 
00044     mB[0][0] = bff;
00045     mB[0][1] = bfs;
00046     mB[1][0] = bfs;
00047     mB[1][1] = bss;
00048 
00049     for(unsigned M=0; M<2; M++)
00050     {
00051         for(unsigned N=0; N<2; N++)
00052         {
00053             mIdentity(M,N) = M==N ? 1.0 : 0.0;
00054         }
00055     }
00056 }
00057 
00058 void SchmidCostaExponentialLaw2d::ComputeStressAndStressDerivative(c_matrix<double,2,2>&  C,
00059                                           c_matrix<double,2,2>&  invC,
00060                                           double                 pressure,
00061                                           c_matrix<double,2,2>&  T,
00062                                           FourthOrderTensor2<2>& dTdE,
00063                                           bool                   computeDTdE)
00064 {
00065     c_matrix<double,2,2> E = 0.5*(C-mIdentity);
00066 
00067     double Q = 0;
00068     for(unsigned M=0; M<2; M++)
00069     {
00070         for(unsigned N=0; N<2; N++)
00071         {
00072             Q += mB[M][N]*E(M,N)*E(M,N);
00073         }
00074     }
00075 
00076     double multiplier = mA*exp(Q-1);
00077     dTdE.Zero();
00078 
00079     for(unsigned M=0; M<2; M++)
00080     {
00081         for(unsigned N=0; N<2; N++)
00082         {
00083             T(M,N) = multiplier*mB[M][N]*E(M,N) - pressure*invC(M,N);
00084 
00085             if(computeDTdE)
00086             {
00087                 //dTdE(M,N,M,N) = multiplier * mB[M][N];
00088                 for(unsigned P=0; P<2; P++)
00089                 {
00090                     for(unsigned Q=0; Q<2; Q++)
00091                     {
00092                         dTdE(M,N,P,Q) =    multiplier * mB[M][N] * (M==P)*(N==Q)
00093                                         +  2*multiplier*mB[M][N]*mB[P][Q]*E(M,N)*E(P,Q)
00094                                         +  2*pressure*invC(M,P)*invC(Q,N);
00095                     }
00096                 }
00097             }
00098         }
00099     }
00100 }
00101 
00102 double SchmidCostaExponentialLaw2d::GetA()
00103 {
00104     return mA;
00105 }
00106 
00107 std::vector<std::vector<double> > SchmidCostaExponentialLaw2d::GetB()
00108 {
00109     return mB;
00110 }
00111 
00112 double SchmidCostaExponentialLaw2d::GetZeroStrainPressure()
00113 {
00114     return 0.0;
00115 }

Generated on Wed Mar 18 12:51:56 2009 for Chaste by  doxygen 1.5.5