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