2 inline void mohrCoulomb2(
const double&
phi,
const double&
psi,
const double&
c,
const double* stress,
3 double&
f,
double*
df,
double& g,
double*
r,
double* dr)
5 const int sXX=0,sYY=1,sZZ=2,sYZ=3,sZX=4,sXY=5;
6 const double &sigma_x(stress[sXX]),
9 &sigma_yz(stress[sYZ]),
10 &sigma_zx(stress[sZX]),
11 &sigma_xy(stress[sXY]);
12 const double eps(1.0e-8);
13 double Df_sigma_m,Df_sigma_b,Df_theta,
14 theta,Dtheta_arg,Dtheta_x,Dtheta_y,Dtheta_z,Dtheta_xy,Dtheta_yz,Dtheta_zx,
16 sigma_m,Dsigma_m_x,Dsigma_m_y,Dsigma_m_z,
17 sigma_b,sigma_b_star,Dsigma_b_x,Dsigma_b_y,Dsigma_b_z,Dsigma_b_xy,Dsigma_b_yz,Dsigma_b_zx,
18 t,t_star,Dt_x,Dt_y,Dt_z,Dt_yz,Dt_zx,Dt_xy,
19 s_x,Ds_x_x,Ds_x_y,Ds_x_z,
20 s_y,Ds_y_x,Ds_y_y,Ds_y_z,
21 s_z,Ds_z_x,Ds_z_y,Ds_z_z,
22 J_3,DJ_3_x,DJ_3_y,DJ_3_z,DJ_3_xy,DJ_3_yz,DJ_3_zx,
23 arg,arg_star,Darg_J_3,Darg_t,
24 Dg_sigma_m,Dg_sigma_b,Dg_theta;
26 sigma_m = (sigma_x + sigma_y + sigma_z)/3.0;
31 sigma_b = sqrt(pow(sigma_x - sigma_y,2) +
32 pow(sigma_y - sigma_z,2) +
33 pow(sigma_z - sigma_x,2) +
36 6.0*pow(sigma_zx,2))/ sqrt(2.0);
37 sigma_b_star = sigma_b;
42 Dsigma_b_x = (2.0*sigma_x - sigma_y - sigma_z)/(2.0*sigma_b_star);
43 Dsigma_b_y = (2.0*sigma_y - sigma_x - sigma_z)/(2.0*sigma_b_star);
44 Dsigma_b_z = (2.0*sigma_z - sigma_y - sigma_x)/(2.0*sigma_b_star);
45 Dsigma_b_xy = (3.0*sigma_xy)/sigma_b_star;
46 Dsigma_b_yz = (3.0*sigma_yz)/sigma_b_star;
47 Dsigma_b_zx = (3.0*sigma_zx)/sigma_b_star;
50 t = sigma_b*sqrt(2.0/3.0);
56 Dt_x = Dsigma_b_x*sqrt(2.0/3.0);
57 Dt_y = Dsigma_b_y*sqrt(2.0/3.0);
58 Dt_z = Dsigma_b_z*sqrt(2.0/3.0);
59 Dt_xy = Dsigma_b_xy*sqrt(2.0/3.0);
60 Dt_yz = Dsigma_b_yz*sqrt(2.0/3.0);
61 Dt_zx = Dsigma_b_zx*sqrt(2.0/3.0);
64 s_x = (2.0*sigma_x - sigma_y - sigma_z)/3.0;
68 s_y = (2.0*sigma_y - sigma_x - sigma_z)/3.0;
72 s_z = (2.0*sigma_z - sigma_y - sigma_x)/3.0;
77 J_3 = s_x*s_y*s_z - s_x*pow(sigma_yz,2) - s_y*pow(sigma_zx,2) - s_z*pow(sigma_xy,2) + 2.0*sigma_xy*sigma_yz*sigma_zx;
78 DJ_3_x = Ds_x_x*s_y*s_z + s_x*Ds_y_x*s_z + s_x*s_y*Ds_z_x
79 - Ds_x_x*pow(sigma_yz,2)
80 - Ds_y_x*pow(sigma_zx,2)
81 - Ds_z_x*pow(sigma_xy,2);
82 DJ_3_y = Ds_x_y*s_y*s_z + s_x*Ds_y_y*s_z + s_x*s_y*Ds_z_y
83 - Ds_x_y*pow(sigma_yz,2)
84 - Ds_y_y*pow(sigma_zx,2)
85 - Ds_z_y*pow(sigma_xy,2);
86 DJ_3_z = Ds_x_z*s_y*s_z + s_x*Ds_y_z*s_z + s_x*s_y*Ds_z_z
87 - Ds_x_z*pow(sigma_yz,2)
88 - Ds_y_z*pow(sigma_zx,2)
89 - Ds_z_z*pow(sigma_xy,2);
90 DJ_3_xy = - 2.0*s_z*sigma_xy + 2.0*sigma_yz*sigma_zx;
91 DJ_3_yz = - 2.0*s_x*sigma_yz + 2.0*sigma_xy*sigma_zx;
92 DJ_3_zx = - 2.0*s_y*sigma_zx + 2.0*sigma_xy*sigma_yz;
94 arg = -3.0*sqrt(6.0)*J_3/pow(t_star,3);
106 Darg_J_3 = -3.0*sqrt(6.0)/pow(t_star,3);
107 Darg_t = 9.0*sqrt(6.0)*J_3/pow(t_star,4);
109 theta = asin(arg)/3.0;
111 sin_theta = sin(theta);
112 cos_theta = cos(theta);
114 Dtheta_arg = 1.0/(3.0*sqrt(1.0-pow(arg_star,2)));
115 Dtheta_x = Dtheta_arg*(Darg_J_3*DJ_3_x + Darg_t*Dt_x);
116 Dtheta_y = Dtheta_arg*(Darg_J_3*DJ_3_y + Darg_t*Dt_y);
117 Dtheta_z = Dtheta_arg*(Darg_J_3*DJ_3_z + Darg_t*Dt_z);
118 Dtheta_xy = Dtheta_arg*(Darg_J_3*DJ_3_xy + Darg_t*Dt_xy);
119 Dtheta_yz = Dtheta_arg*(Darg_J_3*DJ_3_yz + Darg_t*Dt_yz);
120 Dtheta_zx = Dtheta_arg*(Darg_J_3*DJ_3_zx + Darg_t*Dt_zx);
124 + sigma_b*(cos_theta/sqrt(3.0) - (sin_theta*sin(
phi))/3.0)
127 Df_sigma_m = sin(
phi);
129 Df_sigma_b = (cos_theta/sqrt(3.0) - (sin_theta*sin(
phi))/3.0);
131 Df_theta = sigma_b*(-sin_theta/sqrt(3.0) - (cos_theta*sin(
phi))/3.0);
133 df[sXX] = Df_sigma_m*Dsigma_m_x +
134 Df_sigma_b*Dsigma_b_x +
136 df[sYY] = Df_sigma_m*Dsigma_m_y +
137 Df_sigma_b*Dsigma_b_y +
139 df[sZZ] = Df_sigma_m*Dsigma_m_z +
140 Df_sigma_b*Dsigma_b_z +
142 df[sXY] = Df_sigma_b*Dsigma_b_xy +
144 df[sYZ] = Df_sigma_b*Dsigma_b_yz +
146 df[sZX] = Df_sigma_b*Dsigma_b_zx +
150 + sigma_b*(cos_theta/sqrt(3.0) - (sin_theta*sin(
psi))/3.0)
153 Dg_sigma_m = sin(
psi);
155 Dg_sigma_b = (cos_theta/sqrt(3.0) - (sin_theta*sin(
psi))/3.0);
157 Dg_theta = sigma_b*(-sin_theta/sqrt(3.0) - (cos_theta*sin(
psi))/3.0);
159 r[sXX] = Dg_sigma_m*Dsigma_m_x +
160 Dg_sigma_b*Dsigma_b_x +
162 r[sYY] = Dg_sigma_m*Dsigma_m_y +
163 Dg_sigma_b*Dsigma_b_y +
165 r[sZZ] = Dg_sigma_m*Dsigma_m_z +
166 Dg_sigma_b*Dsigma_b_z +
168 r[sXY] = Dg_sigma_b*Dsigma_b_xy +
170 r[sYZ] = Dg_sigma_b*Dsigma_b_yz +
172 r[sZX] = Dg_sigma_b*Dsigma_b_zx +