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 "AbstractMaterialLaw.hpp"
00030
00031 template<unsigned DIM>
00032 AbstractMaterialLaw<DIM>::~AbstractMaterialLaw()
00033 {
00034 }
00035
00036 template<unsigned DIM>
00037 void AbstractMaterialLaw<DIM>::ComputeCauchyStress(c_matrix<double,DIM,DIM>& rF,
00038 double pressure,
00039 c_matrix<double,DIM,DIM>& rSigma)
00040 {
00041 double detF = Determinant(rF);
00042
00043 c_matrix<double,DIM,DIM> C = prod(trans(rF), rF);
00044 c_matrix<double,DIM,DIM> invC = Inverse(C);
00045
00046 c_matrix<double,DIM,DIM> T;
00047
00048 static FourthOrderTensor<DIM,DIM,DIM,DIM> dTdE;
00049
00050 ComputeStressAndStressDerivative(C, invC, pressure, T, dTdE, false);
00051
00052
00053
00054
00055 for (unsigned i=0; i<DIM; i++)
00056 {
00057 for (unsigned j=0; j<DIM; j++)
00058 {
00059 rSigma(i,j) = 0.0;
00060 for (unsigned M=0; M<DIM; M++)
00061 {
00062 for (unsigned N=0; N<DIM; N++)
00063 {
00064 rSigma(i,j) += rF(i,M)*T(M,N)*rF(j,N);
00065 }
00066 }
00067 rSigma(i,j) /= detF;
00068 }
00069 }
00070 }
00071
00072 template<unsigned DIM>
00073 void AbstractMaterialLaw<DIM>::Compute1stPiolaKirchoffStress(c_matrix<double,DIM,DIM>& rF,
00074 double pressure,
00075 c_matrix<double,DIM,DIM>& rS)
00076 {
00077 c_matrix<double,DIM,DIM> C = prod(trans(rF), rF);
00078 c_matrix<double,DIM,DIM> invC = Inverse(C);
00079
00080 c_matrix<double,DIM,DIM> T;
00081
00082 static FourthOrderTensor<DIM,DIM,DIM,DIM> dTdE;
00083
00084 ComputeStressAndStressDerivative(C, invC, pressure, T, dTdE, false);
00085
00086 rS = prod(T, trans(rF));
00087 }
00088
00089 template<unsigned DIM>
00090 void AbstractMaterialLaw<DIM>::Compute2ndPiolaKirchoffStress(c_matrix<double,DIM,DIM>& rC,
00091 double pressure,
00092 c_matrix<double,DIM,DIM>& rT)
00093 {
00094 c_matrix<double,DIM,DIM> invC = Inverse(rC);
00095
00096 static FourthOrderTensor<DIM,DIM,DIM,DIM> dTdE;
00097
00098 ComputeStressAndStressDerivative(rC, invC, pressure, rT, dTdE, false);
00099 }
00100
00101 template<unsigned DIM>
00102 void AbstractMaterialLaw<DIM>::ScaleMaterialParameters(double scaleFactor)
00103 {
00104 #define COVERAGE_IGNORE
00105 EXCEPTION("[the material law you are using]::ScaleMaterialParameters() has not been implemented\n");
00106 #undef COVERAGE_IGNORE
00107 }
00108
00109
00111
00113
00114
00115 template class AbstractMaterialLaw<2>;
00116 template class AbstractMaterialLaw<3>;