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