36 #include "PoleZeroMaterialLaw.hpp"
38 template<
unsigned DIM>
43 template<
unsigned DIM>
45 std::vector<std::vector<double> > a,
46 std::vector<std::vector<double> > b)
48 if (DIM!=2 && DIM !=3)
50 EXCEPTION(
"Can only have a 2 or 3d incompressible pole-zero law");
53 assert(k.size()==DIM);
54 assert(a.size()==DIM);
55 assert(b.size()==DIM);
57 for (
unsigned i=0; i<DIM; i++)
59 assert(k[i].size()==DIM);
60 assert(a[i].size()==DIM);
61 assert(b[i].size()==DIM);
63 for (
unsigned j=0; j<DIM; j++)
65 assert( k[i][j] = k[j][i] );
66 assert( a[i][j] = a[j][i] );
67 assert( b[i][j] = b[j][i] );
75 for (
unsigned M=0; M<DIM; M++)
77 for (
unsigned N=0; N<DIM; N++)
79 mIdentity(M,N) = M==N ? 1.0 : 0.0;
84 template<
unsigned DIM>
86 std::vector<std::vector<double> > a,
87 std::vector<std::vector<double> > b)
93 template<
unsigned DIM>
95 c_matrix<double,DIM,DIM>& rInvC,
97 c_matrix<double,DIM,DIM>& rT,
101 static c_matrix<double,DIM,DIM> C_transformed;
102 static c_matrix<double,DIM,DIM> invC_transformed;
110 this->ComputeTransformedDeformationTensor(rC, rInvC, C_transformed, invC_transformed);
114 c_matrix<double,DIM,DIM> E = 0.5*(C_transformed - mIdentity);
116 for (
unsigned M=0; M<DIM; M++)
118 for (
unsigned N=0; N<DIM; N++)
129 EXCEPTION(
"E_{MN} >= a_{MN} - strain unacceptably large for model");
136 - pressure*invC_transformed(M,N);
143 for (
unsigned M=0; M<DIM; M++)
145 for (
unsigned N=0; N<DIM; N++)
147 for (
unsigned P=0; P<DIM; P++)
149 for (
unsigned Q=0; Q<DIM; Q++)
151 rDTdE(M,N,P,Q) = 2 * pressure * invC_transformed(M,P) * invC_transformed(Q,N);
173 this->TransformStressAndStressDerivative(rT, rDTdE, computeDTdE);
176 template<
unsigned DIM>
182 template<
unsigned DIM>
185 assert(scaleFactor > 0.0);
186 for (
unsigned i=0; i<mK.size(); i++)
188 for (
unsigned j=0; j<mK[i].size(); j++)
190 mK[i][j] /= scaleFactor;
void SetParameters(std::vector< std::vector< double > > k, std::vector< std::vector< double > > a, std::vector< std::vector< double > > b)
void ScaleMaterialParameters(double scaleFactor)
#define EXCEPTION(message)
void ComputeStressAndStressDerivative(c_matrix< double, DIM, DIM > &rC, c_matrix< double, DIM, DIM > &rInvC, double pressure, c_matrix< double, DIM, DIM > &rT, FourthOrderTensor< DIM, DIM, DIM, DIM > &rDTdE, bool computeDTdE)
double GetZeroStrainPressure()