00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "PoleZeroMaterialLaw.hpp"
00037
00038 template<unsigned DIM>
00039 PoleZeroMaterialLaw<DIM>::PoleZeroMaterialLaw()
00040 {
00041 }
00042
00043 template<unsigned DIM>
00044 void PoleZeroMaterialLaw<DIM>::SetParameters(std::vector<std::vector<double> > k,
00045 std::vector<std::vector<double> > a,
00046 std::vector<std::vector<double> > b)
00047 {
00048 if (DIM!=2 && DIM !=3)
00049 {
00050 EXCEPTION("Can only have a 2 or 3d incompressible pole-zero law");
00051 }
00052
00053 assert(k.size()==DIM);
00054 assert(a.size()==DIM);
00055 assert(b.size()==DIM);
00056
00057 for (unsigned i=0; i<DIM; i++)
00058 {
00059 assert(k[i].size()==DIM);
00060 assert(a[i].size()==DIM);
00061 assert(b[i].size()==DIM);
00062
00063 for (unsigned j=0; j<DIM; j++)
00064 {
00065 assert( k[i][j] = k[j][i] );
00066 assert( a[i][j] = a[j][i] );
00067 assert( b[i][j] = b[j][i] );
00068 }
00069 }
00070
00071 mK = k;
00072 mA = a;
00073 mB = b;
00074
00075 for (unsigned M=0; M<DIM; M++)
00076 {
00077 for (unsigned N=0; N<DIM; N++)
00078 {
00079 mIdentity(M,N) = M==N ? 1.0 : 0.0;
00080 }
00081 }
00082 }
00083
00084 template<unsigned DIM>
00085 PoleZeroMaterialLaw<DIM>::PoleZeroMaterialLaw(std::vector<std::vector<double> > k,
00086 std::vector<std::vector<double> > a,
00087 std::vector<std::vector<double> > b)
00088 {
00089 SetParameters(k,a,b);
00090 }
00091
00092
00093 template<unsigned DIM>
00094 void PoleZeroMaterialLaw<DIM>::ComputeStressAndStressDerivative(c_matrix<double,DIM,DIM>& rC,
00095 c_matrix<double,DIM,DIM>& rInvC,
00096 double pressure,
00097 c_matrix<double,DIM,DIM>& rT,
00098 FourthOrderTensor<DIM,DIM,DIM,DIM>& rDTdE,
00099 bool computeDTdE)
00100 {
00101 static c_matrix<double,DIM,DIM> C_transformed;
00102 static c_matrix<double,DIM,DIM> invC_transformed;
00103
00104
00105
00106
00107
00108
00109
00110 this->ComputeTransformedDeformationTensor(rC, rInvC, C_transformed, invC_transformed);
00111
00112
00113
00114 c_matrix<double,DIM,DIM> E = 0.5*(C_transformed - mIdentity);
00115
00116 for (unsigned M=0; M<DIM; M++)
00117 {
00118 for (unsigned N=0; N<DIM; N++)
00119 {
00120 double e = E(M,N);
00121 {
00122 double b = mB[M][N];
00123 double a = mA[M][N];
00124 double k = mK[M][N];
00125
00126
00127 if (e>=a)
00128 {
00129 EXCEPTION("E_{MN} >= a_{MN} - strain unacceptably large for model");
00130 }
00131
00132 rT(M,N) = k
00133 * e
00134 * (2*(a-e) + b*e)
00135 * pow(a-e,-b-1)
00136 - pressure*invC_transformed(M,N);
00137 }
00138 }
00139 }
00140
00141 if (computeDTdE)
00142 {
00143 for (unsigned M=0; M<DIM; M++)
00144 {
00145 for (unsigned N=0; N<DIM; N++)
00146 {
00147 for (unsigned P=0; P<DIM; P++)
00148 {
00149 for (unsigned Q=0; Q<DIM; Q++)
00150 {
00151 rDTdE(M,N,P,Q) = 2 * pressure * invC_transformed(M,P) * invC_transformed(Q,N);
00152 }
00153 }
00154
00155 double e = E(M,N);
00156
00157 double b = mB[M][N];
00158 double a = mA[M][N];
00159 double k = mK[M][N];
00160
00161 rDTdE(M,N,M,N) += k
00162 * pow(a-e, -b-2)
00163 * (
00164 2*(a-e)*(a-e)
00165 + 4*b*e*(a-e)
00166 + b*(b+1)*e*e
00167 );
00168 }
00169 }
00170 }
00171
00172
00173 this->TransformStressAndStressDerivative(rT, rDTdE, computeDTdE);
00174 }
00175
00176 template<unsigned DIM>
00177 double PoleZeroMaterialLaw<DIM>::GetZeroStrainPressure()
00178 {
00179 return 0.0;
00180 }
00181
00182 template<unsigned DIM>
00183 void PoleZeroMaterialLaw<DIM>::ScaleMaterialParameters(double scaleFactor)
00184 {
00185 assert(scaleFactor > 0.0);
00186 for (unsigned i=0; i<mK.size(); i++)
00187 {
00188 for (unsigned j=0; j<mK[i].size(); j++)
00189 {
00190 mK[i][j] /= scaleFactor;
00191 }
00192 }
00193 }
00194
00196
00198
00199 template class PoleZeroMaterialLaw<2>;
00200 template class PoleZeroMaterialLaw<3>;