Commit fe8f3129 authored by Thomas Nagel's avatar Thomas Nagel Committed by Dmitry Yu. Naumov
Browse files

Clang format

parent b1c9417d
......@@ -15,11 +15,10 @@
@Algorithm NewtonRaphson;
@MaximumNumberOfIterations 200;
@Description{
@Description
{
Non-associated Mohr-Coulomb with C2 continuity following
Abbo et al., Int J Solids Struct 48, 2011.
}
// @Algorithm LevenbergMarquardt;
......@@ -118,19 +117,20 @@ a.setEntryName("TensionCutOffParameter");
{
const auto sign = min(
max(lode_el / max(abs(lode_el), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * arg + C * arg*arg;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT - C * sin_3_lodeT * sin_3_lodeT +
cos_lodeT;
K = A + B * arg + C * arg * arg;
}
const auto sMC =
I1_el / 3 * sin_phi + sqrt(J2_el * K * K + a * a * sin_phi * sin_phi);
......@@ -173,18 +173,20 @@ a.setEntryName("TensionCutOffParameter");
{
const auto sign =
min(max(lode / max(abs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode*sin_3_lode;
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dK_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
}
auto KG = 0.0; // move into a function to avoid code duplication
......@@ -200,17 +202,19 @@ a.setEntryName("TensionCutOffParameter");
{
const auto sign =
min(max(lode / max(fabs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_psi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_psi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
KG = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dKG_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
dKG_ddlode = -9. * B * sin_3_lode + 18. * C * cos_6_lode;
......
......@@ -132,19 +132,20 @@ cs.setEntryName("ShearFactor");
{
const auto sign = min(
max(lode_el / max(abs(lode_el), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * arg + C * arg*arg;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT - C * sin_3_lodeT * sin_3_lodeT +
cos_lodeT;
K = A + B * arg + C * arg * arg;
}
const auto sMC =
I1_el / 3 * sin_phi + sqrt(J2_el * K * K + a * a * sin_phi * sin_phi);
......@@ -196,18 +197,20 @@ cs.setEntryName("ShearFactor");
{
const auto sign =
min(max(lode / max(abs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode*sin_3_lode;
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dK_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
}
auto KG = 0.0; // move into a function to avoid code duplication
......@@ -223,17 +226,19 @@ cs.setEntryName("ShearFactor");
{
const auto sign =
min(max(lode / max(fabs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_psi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_psi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
KG = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dKG_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
dKG_ddlode = -9. * B * sin_3_lode + 18. * C * cos_6_lode;
......
......@@ -15,11 +15,10 @@
@Algorithm NewtonRaphson;
@MaximumNumberOfIterations 200;
@Description{
@Description
{
Non-associated Mohr-Coulomb with C2 continuity following
Abbo et al., Int J Solids Struct 48, 2011.
}
// @Algorithm LevenbergMarquardt;
......@@ -117,19 +116,20 @@ a.setEntryName("TensionCutOffParameter");
{
const auto sign = min(
max(lode_el / max(abs(lode_el), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * arg + C * arg*arg;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT - C * sin_3_lodeT * sin_3_lodeT +
cos_lodeT;
K = A + B * arg + C * arg * arg;
}
const auto sMC =
I1_el / 3 * sin_phi + sqrt(J2_el * K * K + a * a * sin_phi * sin_phi);
......@@ -172,18 +172,20 @@ a.setEntryName("TensionCutOffParameter");
{
const auto sign =
min(max(lode / max(abs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode*sin_3_lode;
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dK_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
}
auto KG = 0.0; // move into a function to avoid code duplication
......@@ -199,17 +201,19 @@ a.setEntryName("TensionCutOffParameter");
{
const auto sign =
min(max(lode / max(fabs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_psi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_psi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
KG = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dKG_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
dKG_ddlode = -9. * B * sin_3_lode + 18. * C * cos_6_lode;
......
......@@ -11,7 +11,8 @@
@Behaviour MohrCoulombAbboSloanUBI;
@Author Thomas Nagel;
@Date 21 / 03 / 2020;
@Description{
@Description
{
Ubiquitous joint model where the matrix fails according to a Mohr-Coulomb
criterion(with tension-cutoff) and the embedded weakness planes follow
a Coulomb behaviour(so far without tension cut-off). Both models are
......@@ -126,19 +127,20 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
{
const auto sign = min(
max(lode_el / max(abs(lode_el), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * arg + C * arg*arg;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT - C * sin_3_lodeT * sin_3_lodeT +
cos_lodeT;
K = A + B * arg + C * arg * arg;
}
const auto sMC =
I1_el / 3. * sin_phi + sqrt(J2_el * K * K + a * a * sin_phi * sin_phi);
......@@ -240,8 +242,8 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
const auto cos_lode = cos(lode);
const auto sin_lode = sin(lode);
const auto cos_3_lode = cos(3. * lode);
const auto sin_6_lode = sin(6. * lode);
const auto cos_6_lode = cos(6. * lode);
const auto sin_6_lode = sin(6. * lode);
const auto cos_6_lode = cos(6. * lode);
const auto sin_3_lode = arg;
const auto tan_3_lode = tan(3. * lode);
auto K = 0.;
......@@ -253,21 +255,26 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
}
else
{
const auto sign =
min(max(lode / max(abs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode*sin_3_lode;
dK_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
const auto sign = min(
max(lode / max(abs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 =
sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 =
18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) /
term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dK_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
}
auto KG = 0.0; // move into a function to avoid code duplication
auto dKG_dlode = 1.;
......@@ -280,22 +287,27 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
}
else
{
const auto sign =
min(max(lode / max(fabs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_psi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
KG = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dKG_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
dKG_ddlode = -9. * B * sin_3_lode + 18. * C * cos_6_lode;
const auto sign = min(
max(lode / max(fabs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 =
sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 =
18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) /
term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_psi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
KG = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dKG_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
dKG_ddlode = -9. * B * sin_3_lode + 18. * C * cos_6_lode;
}
// flow direction
......
......@@ -128,19 +128,20 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
{
const auto sign = min(
max(lode_el / max(abs(lode_el), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * arg + C * arg*arg;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) / term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT - C * sin_3_lodeT * sin_3_lodeT +
cos_lodeT;
K = A + B * arg + C * arg * arg;
}
const auto sMC =
I1_el / 3. * sin_phi + sqrt(J2_el * K * K + a * a * sin_phi * sin_phi);
......@@ -242,8 +243,8 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
const auto cos_lode = cos(lode);
const auto sin_lode = sin(lode);
const auto cos_3_lode = cos(3. * lode);
const auto sin_6_lode = sin(6. * lode);
const auto cos_6_lode = cos(6. * lode);
const auto sin_6_lode = sin(6. * lode);
const auto cos_6_lode = cos(6. * lode);
const auto sin_3_lode = arg;
const auto tan_3_lode = tan(3. * lode);
auto K = 0.;
......@@ -255,21 +256,26 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
}
else
{
const auto sign =
min(max(lode / max(abs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_phi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode*sin_3_lode;
dK_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
const auto sign = min(
max(lode / max(abs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_phi * sin_lodeT;
const auto term2 =
sign * sin_lodeT + isqrt3 * sin_phi * cos_lodeT;
const auto term3 =
18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) /
term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_phi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
K = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dK_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
}
auto KG = 0.0; // move into a function to avoid code duplication
auto dKG_dlode = 1.;
......@@ -282,22 +288,27 @@ lam.setEntryName("EquivalentPlasticStrainMatrix");
}
else
{
const auto sign =
min(max(lode / max(fabs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 = sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 = 18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B = ( sign * sin_6_lodeT * term1 -
6. * cos_6_lodeT * term2 ) / term3;
const auto C = (- cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) / term3;
const auto A =
-isqrt3 * sin_psi * sign * sin_lodeT - B * sign * sin_3_lodeT -
C * sin_3_lodeT*sin_3_lodeT + cos_lodeT;
KG = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dKG_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
dKG_ddlode = -9. * B * sin_3_lode + 18. * C * cos_6_lode;
const auto sign = min(
max(lode / max(fabs(lode), local_zero_tolerance), -1.), 1.);
const auto term1 = cos_lodeT - isqrt3 * sin_psi * sin_lodeT;
const auto term2 =
sign * sin_lodeT + isqrt3 * sin_psi * cos_lodeT;
const auto term3 =
18. * cos_3_lodeT * cos_3_lodeT * cos_3_lodeT;
const auto B =
(sign * sin_6_lodeT * term1 - 6. * cos_6_lodeT * term2) /
term3;
const auto C =
(-cos_3_lodeT * term1 - 3. * sign * sin_3_lodeT * term2) /
term3;
const auto A = -isqrt3 * sin_psi * sign * sin_lodeT -
B * sign * sin_3_lodeT -
C * sin_3_lodeT * sin_3_lodeT + cos_lodeT;
KG = A + B * sin_3_lode + C * sin_3_lode * sin_3_lode;
dKG_dlode = 3. * B * cos_3_lode + 3. * C * sin_6_lode;
dKG_ddlode = -9. * B * sin_3_lode + 18. * C * cos_6_lode;
}
// flow direction
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment