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 "AbstractIsotropicCompressibleMaterialLaw.hpp"
00030
00031 template<unsigned DIM>
00032 AbstractIsotropicCompressibleMaterialLaw<DIM>::~AbstractIsotropicCompressibleMaterialLaw()
00033 {
00034 }
00035
00036 template<unsigned DIM>
00037 void AbstractIsotropicCompressibleMaterialLaw<DIM>::ComputeStressAndStressDerivative(
00038 c_matrix<double,DIM,DIM>& rC,
00039 c_matrix<double,DIM,DIM>& rInvC,
00040 double pressure,
00041 c_matrix<double,DIM,DIM>& rT,
00042 FourthOrderTensor<DIM,DIM,DIM,DIM>& rDTdE,
00043 bool computeDTdE)
00044 {
00045
00046
00047 #define COVERAGE_IGNORE
00048 assert((DIM==2) || (DIM==3));
00049 #undef COVERAGE_IGNORE
00050
00051 assert(pressure==0.0);
00052
00053 static c_matrix<double,DIM,DIM> identity = identity_matrix<double>(DIM);
00054
00055 double I1 = Trace(rC);
00056 double I2 = SecondInvariant(rC);
00057 double I3 = Determinant(rC);
00058
00059 static c_matrix<double,DIM,DIM> dI2dC = I1*identity - rC;
00060
00061 double w1 = Get_dW_dI1(I1,I2,I3);
00062 double w2 = Get_dW_dI2(I1,I2,I3);
00063 double w3 = Get_dW_dI3(I1,I2,I3);
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 rT = 2*w1*identity + 2*w3*rInvC;
00076 if (DIM==3)
00077 {
00078 rT += 2*w2*dI2dC;
00079 }
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 if (computeDTdE)
00097 {
00098 double w11 = Get_d2W_dI1(I1,I2,I3);
00099 double w22 = Get_d2W_dI2(I1,I2,I3);
00100 double w33 = Get_d2W_dI3(I1,I2,I3);
00101
00102 double w23 = Get_d2W_dI2I3(I1,I2,I3);
00103 double w13 = Get_d2W_dI1I3(I1,I2,I3);
00104 double w12 = Get_d2W_dI1I2(I1,I2,I3);
00105
00106 for (unsigned M=0; M<DIM; M++)
00107 {
00108 for (unsigned N=0; N<DIM; N++)
00109 {
00110 for (unsigned P=0; P<DIM; P++)
00111 {
00112 for (unsigned Q=0; Q<DIM; Q++)
00113 {
00114 rDTdE(M,N,P,Q) = 4 * w11 * (M==N) * (P==Q)
00115 + 4 * w13 * ( (M==N) * rInvC(P,Q) + rInvC(M,N)*(P==Q) )
00116 + 4 * w33 * rInvC(M,N) * rInvC(P,Q)
00117 - 4 * w3 * rInvC(M,P) * rInvC(Q,N);
00118
00119 if (DIM==3)
00120 {
00121 rDTdE(M,N,P,Q) += 4 * w22 * dI2dC(M,N) * dI2dC(P,Q)
00122 + 4 * w12 * ((M==N)*dI2dC(P,Q) + (P==Q)*dI2dC(M,N))
00123 + 4 * w23 * ( dI2dC(M,N)*rInvC(P,Q) + rInvC(M,N)*dI2dC(P,Q))
00124 + 4 * w2 * ((M==N)*(P==Q) - (M==P)*(N==Q));
00125 }
00126 }
00127 }
00128 }
00129 }
00130 }
00131 }
00132
00133
00134
00136
00138
00139
00140
00141 template class AbstractIsotropicCompressibleMaterialLaw<2>;
00142 template class AbstractIsotropicCompressibleMaterialLaw<3>;