# define DEAL_II_CUDA_HOST_DEV
#endif
+// Forward-declare the automatic differentiation types so we can add prototypes
+// for our own wrappers.
+#ifdef DEAL_II_WITH_ADOLC
+class adouble;
+namespace adtl
+{
+ class adouble;
+}
+#endif
+
DEAL_II_NAMESPACE_OPEN
namespace internal
struct EnableIfScalar;
#endif
-DEAL_II_NAMESPACE_CLOSE
-
-// Declare / Import auto-differentiable math functions in(to) standard
-// namespace before numbers::NumberTraits is defined
#ifdef DEAL_II_WITH_ADOLC
-# include <deal.II/differentiation/ad/adolc_math.h>
-
-# include <adolc/adouble.h> // Taped double
+# ifndef DOXYGEN
+// Prototype some inline functions present in adolc_math.h for use in
+// NumberTraits.
+//
+// ADOL-C uses fabs(), but for genericity we want to use abs(). Simultaneously,
+// though, we don't want to include ADOL-C headers in this header since
+// numbers.h is in everything. To get around this: use C++ rules which permit
+// the use of forward-declared classes in function prototypes to declare some
+// functions which are defined in adolc_math.h. This permits us to write "using
+// dealii::abs;" in NumberTraits which will allow us to select the correct
+// overload (the one in dealii::) when instantiating NumberTraits for ADOL-C
+// types.
+
+adouble
+abs(const adouble &x);
+
+adtl::adouble
+abs(const adtl::adouble &x);
+# endif
#endif
+DEAL_II_NAMESPACE_CLOSE
+
namespace std
{
template <typename Number, std::size_t width>
{
// Make things work with AD types
using std::abs;
+#ifdef DEAL_II_WITH_ADOLC
+ // This one is a little tricky - we have our own abs function in dealii::,
+ // prototyped with forward-declared types in this file, but it only exists
+ // if we have ADOL-C: hence we only add this using statement in that
+ // situation
+ using dealii::abs;
+#endif
return abs(x);
}
{
// Make things work with AD types
using std::abs;
+#ifdef DEAL_II_WITH_ADOLC
+ // Same comment as the non-complex case holds here
+ using dealii::abs;
+#endif
return abs(x);
}
std::array<Number, 2>
eigenvalues(const SymmetricTensor<2, 2, Number> &T)
{
+ // Make things work with AD types
+ using std::sqrt;
+
const Number upp_tri_sq = T[0][1] * T[0][1];
if (upp_tri_sq == internal::NumberType<Number>::value(0.0))
{
descrim > internal::NumberType<Number>::value(0.0),
ExcMessage(
"The roots of the characteristic polynomial are complex valued."));
- const Number sqrt_desc = std::sqrt(descrim);
+ const Number sqrt_desc = sqrt(descrim);
const std::array<Number, 2> eig_vals = {
{internal::NumberType<Number>::value(0.5 * (tr_T + sqrt_desc)),
std::array<Number, 3>
eigenvalues(const SymmetricTensor<2, 3, Number> &T)
{
+ // Make things work with AD types
+ using std::acos;
+ using std::cos;
+ using std::sqrt;
+
const Number upp_tri_sq =
T[0][1] * T[0][1] + T[0][2] * T[0][2] + T[1][2] * T[1][2];
if (upp_tri_sq == internal::NumberType<Number>::value(0.0))
const Number tmp1 = (T[0][0] - q) * (T[0][0] - q) +
(T[1][1] - q) * (T[1][1] - q) +
(T[2][2] - q) * (T[2][2] - q) + 2.0 * upp_tri_sq;
- const Number p = std::sqrt(tmp1 / 6.0);
+ const Number p = sqrt(tmp1 / 6.0);
const SymmetricTensor<2, 3, Number> B =
Number(1.0 / p) * (T - q * unit_symmetric_tensor<3, Number>());
const Number tmp_2 = determinant(B) / 2.0;
internal::NumberType<Number>::value(numbers::PI / 3.0) :
(tmp_2 >= 1.0 ?
internal::NumberType<Number>::value(0.0) :
- internal::NumberType<Number>::value(std::acos(tmp_2) / 3.0)));
+ internal::NumberType<Number>::value(acos(tmp_2) / 3.0)));
// Due to the trigonometric solution, the computed eigenvalues
// should be predictably in the order eig1 >= eig2 >= eig3...
std::array<Number, 3> eig_vals = {
- {static_cast<Number>(q + 2.0 * p * std::cos(phi)),
+ {static_cast<Number>(q + 2.0 * p * cos(phi)),
static_cast<Number>(0.0),
- static_cast<Number>(q + 2.0 * p *
- std::cos(phi + (2.0 / 3.0 * numbers::PI)))}};
+ static_cast<Number>(q +
+ 2.0 * p * cos(phi + (2.0 / 3.0 * numbers::PI)))}};
// Use the identity tr(T) = eig1 + eig2 + eig3
eig_vals[1] = tr_T - eig_vals[0] - eig_vals[2];
std::array<Number, dim> & d,
std::array<Number, dim - 1> & e)
{
+ // Make things work with AD types
+ using std::sqrt;
+
// Create some intermediate storage
Number h, g, omega_inv, K, f;
g = 0.0;
if (A[0][1] > 0.0)
- g = -std::sqrt(h);
+ g = -sqrt(h);
else
- g = std::sqrt(h);
+ g = sqrt(h);
e[0] = g;
std::array<Number, dim> u;
std::array<std::pair<Number, Tensor<1, dim, Number>>, dim>
ql_implicit_shifts(const dealii::SymmetricTensor<2, dim, Number> &A)
{
+ // Make things work with AD types
+ using std::fabs;
+ using std::sqrt;
+
static_assert(
numbers::NumberTraits<Number>::is_complex == false,
"This implementation of the QL implicit shift algorithm does "
int m = l;
for (; m <= dim - 2; ++m)
{
- g = std::abs(w[m]) + std::abs(w[m + 1]);
- if (std::abs(e[m]) + g == g)
+ g = fabs(w[m]) + fabs(w[m + 1]);
+ if (fabs(e[m]) + g == g)
break;
}
if (m == l)
// Calculate the shift..
g = (w[l + 1] - w[l]) / (e[l] + e[l]);
- r = std::sqrt(g * g + 1.0);
+ r = sqrt(g * g + 1.0);
// .. and then compute g = d_m - k_s for the
// plane rotation (Press2007a eq 11.4.22)
if (g > 0.0)
b = c * e[i];
// Branch to recover from underflow
- if (std::abs(f) > std::abs(g))
+ if (fabs(f) > fabs(g))
{
c = g / f;
- r = std::sqrt(c * c + 1.0);
+ r = sqrt(c * c + 1.0);
e[i + 1] = f * r;
c *= (s = 1.0 / r);
}
else
{
s = f / g;
- r = std::sqrt(s * s + 1.0);
+ r = sqrt(s * s + 1.0);
e[i + 1] = g * r;
s *= (c = 1.0 / r);
}
"This implementation of the Jacobi algorithm does "
"not support complex numbers");
+ // Make things work with AD types
+ using std::fabs;
+ using std::sqrt;
+
// Sums of diagonal resp. off-diagonal elements
Number sd, so;
// sin(phi), cos(phi), tan(phi) and temporary storage
so = 0.0;
for (unsigned int p = 0; p < dim; ++p)
for (int q = p + 1; q < dim; ++q)
- so += std::abs(A[p][q]);
+ so += fabs(A[p][q]);
if (so == 0.0)
break;
for (unsigned int p = 0; p < dim; ++p)
for (unsigned int q = p + 1; q < dim; ++q)
{
- g = 100.0 * std::abs(A[p][q]);
+ g = 100.0 * fabs(A[p][q]);
// After a given number of iterations the
// rotation is skipped if the off-diagonal
// element is small
- if (it > n_it_skip && std::abs(w[p]) + g == std::abs(w[p]) &&
- std::abs(w[q]) + g == std::abs(w[q]))
+ if (it > n_it_skip && fabs(w[p]) + g == fabs(w[p]) &&
+ fabs(w[q]) + g == fabs(w[q]))
{
A[p][q] = 0.0;
}
- else if (std::abs(A[p][q]) > thresh)
+ else if (fabs(A[p][q]) > thresh)
{
// Calculate Jacobi transformation
h = w[q] - w[p];
// Compute surrogate for angle theta resulting from
// angle transformation and subsequent smallest solution
// of quadratic equation
- if (std::abs(h) + g == std::abs(h))
+ if (fabs(h) + g == fabs(h))
{
// Prevent overflow for large theta^2. This computation
// is the algebraic equivalent of t = 1/(2*theta).
{
theta = 0.5 * h / A[p][q];
if (theta < 0.0)
- t = -1.0 / (std::sqrt(1.0 + theta * theta) - theta);
+ t = -1.0 / (sqrt(1.0 + theta * theta) - theta);
else
- t = 1.0 / (std::sqrt(1.0 + theta * theta) + theta);
+ t = 1.0 / (sqrt(1.0 + theta * theta) + theta);
}
// Compute trigonometric functions for rotation
// in such a way as to prevent overflow for
// large theta.
- c = 1.0 / std::sqrt(1.0 + t * t);
+ c = 1.0 / sqrt(1.0 + t * t);
s = t * c;
z = t * A[p][q];
"This implementation of the 2d Hybrid algorithm does "
"not support complex numbers");
+ // Make things work with AD types
+ using std::fabs;
+
const unsigned int dim = 2;
// Calculate eigenvalues
std::array<std::pair<Number, Tensor<1, dim, Number>>, dim> eig_vals_vecs;
Number t, u; // Intermediate storage
- t = std::abs(w[0]);
+ t = fabs(w[0]);
for (unsigned int i = 1; i < dim; ++i)
{
- u = std::abs(w[i]);
+ u = fabs(w[i]);
if (u > t)
t = u;
}
"This implementation of the 3d Hybrid algorithm does "
"not support complex numbers");
+ // Make things work with AD types
+ using std::fabs;
+ using std::sqrt;
+
const unsigned int dim = 3;
Number norm; // Squared norm or inverse norm of current eigenvector
Number t, u; // Intermediate storage
// Calculate eigenvalues
const std::array<Number, dim> w = eigenvalues(A);
- t = std::abs(w[0]);
+ t = fabs(w[0]);
for (unsigned int i = 1; i < dim; ++i)
{
- u = std::abs(w[i]);
+ u = fabs(w[i]);
if (u > t)
t = u;
}
}
else // This is the standard branch
{
- norm = std::sqrt(1.0 / norm);
+ norm = sqrt(1.0 / norm);
for (unsigned j = 0; j < dim; ++j)
Q[j][0] = Q[j][0] * norm;
}
}
else
{
- norm = std::sqrt(1.0 / norm);
+ norm = sqrt(1.0 / norm);
for (unsigned int j = 0; j < dim; ++j)
Q[j][1] = Q[j][1] * norm;
}
# ifndef DOXYGEN
+DEAL_II_NAMESPACE_OPEN
/**
- * Import ADOL-C math operations into standard namespace. This gives us the
- * ability to use them within the Tensor class, and it also allows the user
- * to write generic code and switch between AD number types.
- *
- * The math functions to be exposed come from the ADOL-C's taped
- * (anonymous) and tapeless namespaces.
+ * Implementation of the complementary error function for adol-c adouble
+ * numbers.
*/
-namespace std
+# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF
+inline adouble
+erfc(const adouble &x)
{
- /**
- * Make a unary function with one name available under a different name
- */
-# define DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION_COPY(func_to, func_from) \
- inline adouble func_to(const adouble &x) \
- { \
- return func_from(static_cast<const badouble &>(x)); \
- } \
- inline adtl::adouble func_to(const adtl::adouble &x) \
- { \
- return adtl::func_from(x); \
- }
-
- /**
- * Expose a unary function
- */
-# define DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(func) \
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION_COPY(func, func)
-
- /**
- * Make a binary function with one name available under a different name
- */
-# define DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_COPY(func_to, func_from) \
- inline adouble func_to(const adouble &x, const adouble &y) \
- { \
- return func_from(static_cast<const badouble &>(x), \
- static_cast<const badouble &>(y)); \
- } \
- inline adouble func_to(const double x, const adouble &y) \
- { \
- return func_from(x, static_cast<const badouble &>(y)); \
- } \
- inline adouble func_to(const adouble &x, const double y) \
- { \
- return func_from(static_cast<const badouble &>(x), y); \
- } \
- inline adtl::adouble func_to(const adtl::adouble &x, \
- const adtl::adouble &y) \
- { \
- return adtl::func_from(x, y); \
- } \
- inline adtl::adouble func_to(const double x, const adtl::adouble &y) \
- { \
- return adtl::func_from(x, y); \
- } \
- inline adtl::adouble func_to(const adtl::adouble &x, const double y) \
- { \
- return adtl::func_from(x, y); \
- }
-
- /**
- * Expose a binary function
- */
-# define DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION(func) \
- DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_COPY(func, func)
-
- /**
- * Expose a binary function
- */
-# define DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_2(func) \
- inline adouble func(const adouble &x, const adouble &y) \
- { \
- return func(static_cast<const badouble &>(x), \
- static_cast<const badouble &>(y)); \
- } \
- inline adtl::adouble func(const adtl::adouble &x, \
- const adtl::adouble &y) \
- { \
- return adtl::func(x, y); \
- }
-
- // See
- // https://gitlab.com/adol-c/adol-c/blob/master/ADOL-C/include/adolc/adouble.h
- // https://gitlab.com/adol-c/adol-c/blob/master/ADOL-C/include/adolc/internal/paramfunc.h
+ // Make things work with AD types
+ using std::erf;
+ return 1.0 - erf(x);
+}
- DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION(pow)
- DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION(fmax)
- DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_COPY(max, fmax)
- DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION(fmin)
- DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_COPY(min, fmin)
-
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(exp)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(log)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(log10)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(sqrt)
-# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(erf)
- inline adouble
- erfc(const adouble &x)
- {
- return 1.0 - std::erf(x);
- }
- inline adtl::adouble
- erfc(const adtl::adouble &x)
- {
- return 1.0 - std::erf(x);
- }
+/**
+ * Implementation of the complementary error function for adol-c adtl::adouble
+ * numbers.
+ */
+inline adtl::adouble
+erfc(const adtl::adouble &x)
+{
+ // Make things work with AD types
+ using std::erf;
+ return 1.0 - erf(x);
+}
# endif
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(fabs)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION_COPY(abs, fabs)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(ceil)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(floor)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(sin)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(cos)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(tan)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(asin)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(acos)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(atan)
- DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_2(atan2)
-
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(sinh)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(cosh)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(tanh)
-# ifdef DEAL_II_ADOLC_WITH_ATRIG_ERF
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(asinh)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(acosh)
- DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION(atanh)
-# endif
-
-# undef DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_2
-# undef DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION
-# undef DEAL_II_EXPOSE_ADOLC_BINARY_MATH_FUNCTION_COPY
-# undef DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION
-# undef DEAL_II_EXPOSE_ADOLC_UNARY_MATH_FUNCTION_COPY
+/**
+ * For improved genericity, implement abs() in terms of fabs() for adouble.
+ */
+inline adouble
+abs(const adouble &x)
+{
+ return fabs(static_cast<const badouble &>(x));
+}
-} // namespace std
+/**
+ * Same idea: implement abs() in terms of adtl::fabs().
+ */
+inline adtl::adouble
+abs(const adtl::adouble &x)
+{
+ return adtl::fabs(x);
+}
+DEAL_II_NAMESPACE_CLOSE
# endif // DOXYGEN
#endif // DEAL_II_WITH_ADOLC
inline Tensor<2, dim, Number>
Physics::Elasticity::Kinematics::F_iso(const Tensor<2, dim, Number> &F)
{
- return internal::NumberType<Number>::value(
- std::pow(determinant(F), -1.0 / dim)) *
+ // Make things work with AD types
+ using std::pow;
+ return internal::NumberType<Number>::value(pow(determinant(F), -1.0 / dim)) *
F;
}
inline SymmetricTensor<2, dim, Number>
Physics::Elasticity::Kinematics::F_vol(const Tensor<2, dim, Number> &F)
{
- return internal::NumberType<Number>::value(
- std::pow(determinant(F), 1.0 / dim)) *
+ // Make things work with AD types
+ using std::pow;
+ return internal::NumberType<Number>::value(pow(determinant(F), 1.0 / dim)) *
static_cast<SymmetricTensor<2, dim, Number>>(
unit_symmetric_tensor<dim>());
}
Physics::Elasticity::StandardTensors<dim>::Dev_P(
const Tensor<2, dim, Number> &F)
{
+ // Make things work with AD types
+ using std::pow;
const Number det_F = determinant(F);
Assert(numbers::value_is_greater_than(det_F, 0.0),
ExcMessage("Deformation gradient has a negative determinant."));
outer_product(C, C_inv); // Dev_P = C_x_C_inv
Dev_P /= -dim; // Dev_P = -[1/dim]C_x_C_inv
Dev_P += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_x_C_inv
- Dev_P *=
- std::pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_x_C_inv]
+ Dev_P *= pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_x_C_inv]
return Dev_P;
}
Physics::Elasticity::StandardTensors<dim>::Dev_P_T(
const Tensor<2, dim, Number> &F)
{
+ // Make things work with AD types
+ using std::pow;
const Number det_F = determinant(F);
Assert(numbers::value_is_greater_than(det_F, 0.0),
ExcMessage("Deformation gradient has a negative determinant."));
Dev_P_T /= -dim; // Dev_P = -[1/dim]C_inv_x_C
Dev_P_T += SymmetricTensor<4, dim, Number>(S); // Dev_P = S - [1/dim]C_inv_x_C
Dev_P_T *=
- std::pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_inv_x_C]
+ pow(det_F, -2.0 / dim); // Dev_P = J^{-2/dim} [S - [1/dim]C_inv_x_C]
return Dev_P_T;
}
Tensor<2, 2, Number>
Physics::Transformations::Rotations::rotation_matrix_2d(const Number &angle)
{
- const Number rotation[2][2] = {{std::cos(angle), -std::sin(angle)},
- {std::sin(angle), std::cos(angle)}};
+ // Make things work with AD types
+ using std::cos;
+ using std::sin;
+
+ const Number rotation[2][2] = {{cos(angle), -sin(angle)},
+ {sin(angle), cos(angle)}};
return Tensor<2, 2>(rotation);
}
const Tensor<1, 3, Number> &axis,
const Number & angle)
{
- Assert(std::abs(axis.norm() - 1.0) < 1e-9,
+ // Make things work with AD types
+ using std::abs;
+ using std::cos;
+ using std::sin;
+
+ Assert(abs(axis.norm() - 1.0) < 1e-9,
ExcMessage("The supplied axial vector is not a unit vector."));
- const Number c = std::cos(angle);
- const Number s = std::sin(angle);
+ const Number c = cos(angle);
+ const Number s = sin(angle);
const Number t = 1. - c;
const Number rotation[3][3] = {{t * axis[0] * axis[0] + c,
t * axis[0] * axis[1] - s * axis[2],
static NumberType
psi(const NumberType &s1, const NumberType &s2)
{
- return 2.0 * std::pow(s1, 4) * std::pow(s2, 3);
+ return 2.0 * pow(s1, 4) * pow(s2, 3);
};
static NumberType
dpsi_ds1(const NumberType &s1, const NumberType &s2)
{
- return 8.0 * std::pow(s1, 3) * std::pow(s2, 3);
+ return 8.0 * pow(s1, 3) * pow(s2, 3);
};
static NumberType
dpsi_ds2(const NumberType &s1, const NumberType &s2)
{
- return 6.0 * std::pow(s1, 4) * std::pow(s2, 2);
+ return 6.0 * pow(s1, 4) * pow(s2, 2);
};
static NumberType
d2psi_ds1_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 2) * std::pow(s2, 3);
+ return 24.0 * pow(s1, 2) * pow(s2, 3);
};
static NumberType
d2psi_ds2_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 3) * std::pow(s2, 2);
+ return 24.0 * pow(s1, 3) * pow(s2, 2);
};
static NumberType
static NumberType
d2psi_ds2_ds2(const NumberType &s1, const NumberType &s2)
{
- return 12.0 * std::pow(s1, 4) * std::pow(s2, 1);
+ return 12.0 * pow(s1, 4) * pow(s2, 1);
};
};
static NumberType
psi(const Tensor<1, dim, NumberType> &v, const NumberType &s)
{
- return (v * v) * std::pow(s, 3);
+ return (v * v) * pow(s, 3);
};
static Tensor<1, dim, NumberType>
dpsi_dv(const Tensor<1, dim, NumberType> &v, const NumberType &s)
{
- return 2.0 * v * std::pow(s, 3);
+ return 2.0 * v * pow(s, 3);
};
static NumberType
dpsi_ds(const Tensor<1, dim, NumberType> &v, const NumberType &s)
{
- return 3.0 * (v * v) * std::pow(s, 2);
+ return 3.0 * (v * v) * pow(s, 2);
};
static Tensor<2, dim, NumberType>
{
static const Tensor<2, dim, NumberType> I(
unit_symmetric_tensor<dim, NumberType>());
- return 2.0 * I * std::pow(s, 3);
+ return 2.0 * I * pow(s, 3);
};
static Tensor<1, dim, NumberType>
d2psi_ds_dv(const Tensor<1, dim, NumberType> &v, const NumberType &s)
{
- return 6.0 * v * std::pow(s, 2);
+ return 6.0 * v * pow(s, 2);
};
static Tensor<1, dim, NumberType>
static NumberType
d2psi_ds_ds(const Tensor<1, dim, NumberType> &v, const NumberType &s)
{
- return 6.0 * (v * v) * std::pow(s, 1);
+ return 6.0 * (v * v) * pow(s, 1);
};
};
static NumberType
psi(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return double_contract<0, 0, 1, 1>(t, t) * std::pow(s, 3);
+ return double_contract<0, 0, 1, 1>(t, t) * pow(s, 3);
};
static Tensor<2, dim, NumberType>
dpsi_dt(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return 2.0 * t * std::pow(s, 3);
+ return 2.0 * t * pow(s, 3);
};
static NumberType
dpsi_ds(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return 3.0 * double_contract<0, 0, 1, 1>(t, t) * std::pow(s, 2);
+ return 3.0 * double_contract<0, 0, 1, 1>(t, t) * pow(s, 2);
};
static Tensor<4, dim, NumberType>
for (unsigned int l = 0; l < dim; ++l)
II[i][j][k][l] = I[i][k] * I[j][l];
- return 2.0 * II * std::pow(s, 3);
+ return 2.0 * II * pow(s, 3);
};
static Tensor<2, dim, NumberType>
d2psi_ds_dt(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return 6.0 * t * std::pow(s, 2);
+ return 6.0 * t * pow(s, 2);
};
static Tensor<2, dim, NumberType>
static NumberType
d2psi_ds_ds(const Tensor<2, dim, NumberType> &t, const NumberType &s)
{
- return 6.0 * double_contract<0, 0, 1, 1>(t, t) * std::pow(s, 1);
+ return 6.0 * double_contract<0, 0, 1, 1>(t, t) * pow(s, 1);
};
};
psi(const Tensor<1, dim, NumberType> &v1,
const Tensor<1, dim, NumberType> &v2)
{
- return std::pow(v1 * v1, 2) * std::pow(v2 * v2, 3);
+ return pow(v1 * v1, 2) * pow(v2 * v2, 3);
};
static Tensor<1, dim, NumberType>
dpsi_dv1(const Tensor<1, dim, NumberType> &v1,
const Tensor<1, dim, NumberType> &v2)
{
- return 2.0 * std::pow(v1 * v1, 1) * 2.0 * v1 * std::pow(v2 * v2, 3);
+ return 2.0 * pow(v1 * v1, 1) * 2.0 * v1 * pow(v2 * v2, 3);
};
static Tensor<1, dim, NumberType>
dpsi_dv2(const Tensor<1, dim, NumberType> &v1,
const Tensor<1, dim, NumberType> &v2)
{
- return std::pow(v1 * v1, 2) * 3.0 * std::pow(v2 * v2, 2) * 2.0 * v2;
+ return pow(v1 * v1, 2) * 3.0 * pow(v2 * v2, 2) * 2.0 * v2;
};
static Tensor<2, dim, NumberType>
{
const Tensor<2, dim, NumberType> I(
unit_symmetric_tensor<dim, NumberType>());
- return 2.0 * 2.0 * std::pow(v2 * v2, 3) *
+ return 2.0 * 2.0 * pow(v2 * v2, 3) *
(pow(v1 * v1, 0) * 2.0 * outer_product(v1, v1) +
- std::pow(v1 * v1, 1) * I);
+ pow(v1 * v1, 1) * I);
};
static Tensor<2, dim, NumberType>
// Note: This is not symmetric, and this is why we
// don't set the return type for hessian extractor (vector,vector)
// operations as SymmetricTensor.
- return (2.0 * std::pow(v1 * v1, 1) * 2.0) *
- (3.0 * std::pow(v2 * v2, 2) * 2.0) * outer_product(v1, v2);
+ return (2.0 * pow(v1 * v1, 1) * 2.0) * (3.0 * pow(v2 * v2, 2) * 2.0) *
+ outer_product(v1, v2);
};
static Tensor<2, dim, NumberType>
d2psi_dv1_dv2(const Tensor<1, dim, NumberType> &v1,
const Tensor<1, dim, NumberType> &v2)
{
- return (2.0 * std::pow(v1 * v1, 1) * 2.0) *
- (3.0 * std::pow(v2 * v2, 2) * 2.0) * outer_product(v2, v1);
+ return (2.0 * pow(v1 * v1, 1) * 2.0) * (3.0 * pow(v2 * v2, 2) * 2.0) *
+ outer_product(v2, v1);
};
static Tensor<2, dim, NumberType>
{
const Tensor<2, dim, NumberType> I(
unit_symmetric_tensor<dim, NumberType>());
- // return std::pow(v1*v1,2)*3.0*
- // ( 2.0*std::pow(v2*v2,1)*2.0*outer_product(v2,v2) +
- // std::pow(v2*v2,2)*2.0*I);
- return std::pow(v1 * v1, 2) * 3.0 * 2.0 *
- (2.0 * std::pow(v2 * v2, 1) * 2.0 * outer_product(v2, v2) +
- std::pow(v2 * v2, 2) * I);
+ // return pow(v1*v1,2)*3.0*
+ // ( 2.0*pow(v2*v2,1)*2.0*outer_product(v2,v2) +
+ // pow(v2*v2,2)*2.0*I);
+ return pow(v1 * v1, 2) * 3.0 * 2.0 *
+ (2.0 * pow(v2 * v2, 1) * 2.0 * outer_product(v2, v2) +
+ pow(v2 * v2, 2) * I);
};
};
static NumberType
psi(const Tensor<2, dim, NumberType> &t, const Tensor<1, dim, NumberType> &v)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3);
};
static Tensor<2, dim, NumberType>
dpsi_dt(const Tensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> &v)
{
- return 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3);
+ return 2.0 * pow(det_t(t), 1) * ddet_t_dt(t) * pow(v_squ(v), 3);
};
static Tensor<1, dim, NumberType>
dpsi_dv(const Tensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> &v)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v);
};
static Tensor<4, dim, NumberType>
d2psi_dt_dt(const Tensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> &v)
{
- return 2.0 * std::pow(v_squ(v), 3) *
+ return 2.0 * pow(v_squ(v), 3) *
(pow(det_t(t), 0) * outer_product(ddet_t_dt(t), ddet_t_dt(t)) +
- std::pow(det_t(t), 1) * d2det_t_dt_dt(t));
+ pow(det_t(t), 1) * d2det_t_dt_dt(t));
};
static Tensor<3, dim, NumberType>
d2psi_dv_dt(const Tensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> &v)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(ddet_t_dt(t), dv_squ_dv(v));
};
d2psi_dt_dv(const Tensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> &v)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(dv_squ_dv(v), ddet_t_dt(t));
};
d2psi_dv_dv(const Tensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> &v)
{
- return std::pow(det_t(t), 2) * 3.0 *
- (2.0 * std::pow(v_squ(v), 1) *
- outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
- std::pow(v_squ(v), 2) * d2v_squ_dv_dv(v));
+ return pow(det_t(t), 2) * 3.0 *
+ (2.0 * pow(v_squ(v), 1) * outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
+ pow(v_squ(v), 2) * d2v_squ_dv_dv(v));
};
};
psi(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3);
};
static SymmetricTensor<2, dim, NumberType>
dpsi_dt(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return SymmetricTensor<2, dim, NumberType>(
- 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3));
+ return SymmetricTensor<2, dim, NumberType>(2.0 * pow(det_t(t), 1) *
+ ddet_t_dt(t) * pow(v_squ(v), 3));
};
static Tensor<1, dim, NumberType>
dpsi_dv(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v);
};
static SymmetricTensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> & v)
{
return SymmetricTensor<4, dim, NumberType>(
- 2.0 * std::pow(v_squ(v), 3) *
+ 2.0 * pow(v_squ(v), 3) *
(pow(det_t(t), 0) * outer_product(ddet_t_dt(t), ddet_t_dt(t)) +
- std::pow(det_t(t), 1) * d2det_t_dt_dt(t)));
+ pow(det_t(t), 1) * d2det_t_dt_dt(t)));
};
static Tensor<3, dim, NumberType>
d2psi_dv_dt(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(static_cast<Tensor<2, dim, NumberType>>(ddet_t_dt(t)),
dv_squ_dv(v));
};
d2psi_dt_dv(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(dv_squ_dv(v),
static_cast<Tensor<2, dim, NumberType>>(ddet_t_dt(t)));
};
d2psi_dv_dv(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return std::pow(det_t(t), 2) * 3.0 *
- (2.0 * std::pow(v_squ(v), 1) *
- outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
- std::pow(v_squ(v), 2) * d2v_squ_dv_dv(v));
+ return pow(det_t(t), 2) * 3.0 *
+ (2.0 * pow(v_squ(v), 1) * outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
+ pow(v_squ(v), 2) * d2v_squ_dv_dv(v));
};
};
psi(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3);
};
static SymmetricTensor<2, dim, NumberType>
dpsi_dt(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return SymmetricTensor<2, dim, NumberType>(
- 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3));
+ return SymmetricTensor<2, dim, NumberType>(2.0 * pow(det_t(t), 1) *
+ ddet_t_dt(t) * pow(v_squ(v), 3));
};
static Tensor<1, dim, NumberType>
dpsi_dv(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v);
};
static SymmetricTensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> & v)
{
return SymmetricTensor<4, dim, NumberType>(
- 2.0 * std::pow(v_squ(v), 3) *
+ 2.0 * pow(v_squ(v), 3) *
(pow(det_t(t), 0) * outer_product(ddet_t_dt(t), ddet_t_dt(t)) +
- std::pow(det_t(t), 1) * d2det_t_dt_dt(t)));
+ pow(det_t(t), 1) * d2det_t_dt_dt(t)));
};
static Tensor<3, dim, NumberType>
d2psi_dv_dt(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(static_cast<Tensor<2, dim, NumberType>>(ddet_t_dt(t)),
dv_squ_dv(v));
};
d2psi_dt_dv(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(dv_squ_dv(v),
static_cast<Tensor<2, dim, NumberType>>(ddet_t_dt(t)));
};
d2psi_dv_dv(const SymmetricTensor<2, dim, NumberType> &t,
const Tensor<1, dim, NumberType> & v)
{
- return std::pow(det_t(t), 2) * 3.0 *
- (2.0 * std::pow(v_squ(v), 1) *
- outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
- std::pow(v_squ(v), 2) * d2v_squ_dv_dv(v));
+ return pow(det_t(t), 2) * 3.0 *
+ (2.0 * pow(v_squ(v), 1) * outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
+ pow(v_squ(v), 2) * d2v_squ_dv_dv(v));
};
};
psi(const SymmetricTensor<2, dim, NumberType> &t1,
const Tensor<2, dim, NumberType> & t2)
{
- return std::pow(det_t(t1), 2) * std::pow(det_t(t2), 3);
+ return pow(det_t(t1), 2) * pow(det_t(t2), 3);
};
static SymmetricTensor<2, dim, NumberType>
const Tensor<2, dim, NumberType> & t2)
{
return SymmetricTensor<2, dim, NumberType>(
- 2.0 * std::pow(det_t(t1), 1) * ddet_t_dt(t1) * std::pow(det_t(t2), 3));
+ 2.0 * pow(det_t(t1), 1) * ddet_t_dt(t1) * pow(det_t(t2), 3));
};
static Tensor<2, dim, NumberType>
dpsi_dt2(const SymmetricTensor<2, dim, NumberType> &t1,
const Tensor<2, dim, NumberType> & t2)
{
- return std::pow(det_t(t1), 2) * 3.0 * std::pow(det_t(t2), 2) *
- ddet_t_dt(t2);
+ return pow(det_t(t1), 2) * 3.0 * pow(det_t(t2), 2) * ddet_t_dt(t2);
};
static SymmetricTensor<4, dim, NumberType>
const Tensor<2, dim, NumberType> & t2)
{
return SymmetricTensor<4, dim, NumberType>(
- 2.0 * std::pow(det_t(t2), 3) *
+ 2.0 * pow(det_t(t2), 3) *
(pow(det_t(t1), 0) * outer_product(ddet_t_dt(t1), ddet_t_dt(t1)) +
- std::pow(det_t(t1), 1) * d2det_t_dt_dt(t1)));
+ pow(det_t(t1), 1) * d2det_t_dt_dt(t1)));
};
static Tensor<4, dim, NumberType>
d2psi_dt2_dt1(const SymmetricTensor<2, dim, NumberType> &t1,
const Tensor<2, dim, NumberType> & t2)
{
- return 2.0 * std::pow(det_t(t1), 1) * 3.0 * std::pow(det_t(t2), 2) *
+ return 2.0 * pow(det_t(t1), 1) * 3.0 * pow(det_t(t2), 2) *
outer_product(static_cast<Tensor<2, dim, NumberType>>(ddet_t_dt(t1)),
ddet_t_dt(t2));
};
d2psi_dt1_dt2(const SymmetricTensor<2, dim, NumberType> &t1,
const Tensor<2, dim, NumberType> & t2)
{
- return 2.0 * std::pow(det_t(t1), 1) * 3.0 * std::pow(det_t(t2), 2) *
+ return 2.0 * pow(det_t(t1), 1) * 3.0 * pow(det_t(t2), 2) *
outer_product(ddet_t_dt(t2),
static_cast<Tensor<2, dim, NumberType>>(
ddet_t_dt(t1)));
d2psi_dt2_dt2(const SymmetricTensor<2, dim, NumberType> &t1,
const Tensor<2, dim, NumberType> & t2)
{
- return std::pow(det_t(t1), 2) * 3.0 *
- (2.0 * std::pow(det_t(t2), 1) *
+ return pow(det_t(t1), 2) * 3.0 *
+ (2.0 * pow(det_t(t2), 1) *
outer_product(ddet_t_dt(t2), ddet_t_dt(t2)) +
- std::pow(det_t(t2), 2) * d2det_t_dt_dt(t2));
+ pow(det_t(t2), 2) * d2det_t_dt_dt(t2));
};
};
psi(const SymmetricTensor<2, dim, NumberType> &t1,
const SymmetricTensor<2, dim, NumberType> &t2)
{
- return std::pow(det_t(t1), 2) * std::pow(det_t(t2), 3);
+ return pow(det_t(t1), 2) * pow(det_t(t2), 3);
};
static SymmetricTensor<2, dim, NumberType>
const SymmetricTensor<2, dim, NumberType> &t2)
{
return SymmetricTensor<2, dim, NumberType>(
- 2.0 * std::pow(det_t(t1), 1) * ddet_t_dt(t1) * std::pow(det_t(t2), 3));
+ 2.0 * pow(det_t(t1), 1) * ddet_t_dt(t1) * pow(det_t(t2), 3));
};
static SymmetricTensor<2, dim, NumberType>
const SymmetricTensor<2, dim, NumberType> &t2)
{
return SymmetricTensor<2, dim, NumberType>(
- pow(det_t(t1), 2) * 3.0 * std::pow(det_t(t2), 2) * ddet_t_dt(t2));
+ pow(det_t(t1), 2) * 3.0 * pow(det_t(t2), 2) * ddet_t_dt(t2));
};
static SymmetricTensor<4, dim, NumberType>
const SymmetricTensor<2, dim, NumberType> &t2)
{
return SymmetricTensor<4, dim, NumberType>(
- 2.0 * std::pow(det_t(t2), 3) *
+ 2.0 * pow(det_t(t2), 3) *
(pow(det_t(t1), 0) * outer_product(ddet_t_dt(t1), ddet_t_dt(t1)) +
- std::pow(det_t(t1), 1) * d2det_t_dt_dt(t1)));
+ pow(det_t(t1), 1) * d2det_t_dt_dt(t1)));
};
static SymmetricTensor<4, dim, NumberType>
const SymmetricTensor<2, dim, NumberType> &t2)
{
return SymmetricTensor<4, dim, NumberType>(
- 2.0 * std::pow(det_t(t1), 1) * 3.0 * std::pow(det_t(t2), 2) *
+ 2.0 * pow(det_t(t1), 1) * 3.0 * pow(det_t(t2), 2) *
outer_product(ddet_t_dt(t1), ddet_t_dt(t2)));
};
const SymmetricTensor<2, dim, NumberType> &t2)
{
return SymmetricTensor<4, dim, NumberType>(
- 2.0 * std::pow(det_t(t1), 1) * 3.0 * std::pow(det_t(t2), 2) *
+ 2.0 * pow(det_t(t1), 1) * 3.0 * pow(det_t(t2), 2) *
outer_product(ddet_t_dt(t2), ddet_t_dt(t1)));
};
{
return SymmetricTensor<4, dim, NumberType>(
pow(det_t(t1), 2) * 3.0 *
- (2.0 * std::pow(det_t(t2), 1) *
- outer_product(ddet_t_dt(t2), ddet_t_dt(t2)) +
- std::pow(det_t(t2), 2) * d2det_t_dt_dt(t2)));
+ (2.0 * pow(det_t(t2), 1) * outer_product(ddet_t_dt(t2), ddet_t_dt(t2)) +
+ pow(det_t(t2), 2) * d2det_t_dt_dt(t2)));
};
};
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * std::pow(s, sf);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3) *
- std::pow(s, sf);
+ return 2.0 * pow(det_t(t), 1) * ddet_t_dt(t) * pow(v_squ(v), 3) *
+ pow(s, sf);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v) *
- std::pow(s, sf);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v) *
+ pow(s, sf);
};
static NumberType
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * sf *
- std::pow(s, sf - 1.0);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3) * sf * pow(s, sf - 1.0);
};
static Tensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(v_squ(v), 3) *
+ return 2.0 * pow(v_squ(v), 3) *
(pow(det_t(t), 0) * outer_product(ddet_t_dt(t), ddet_t_dt(t)) +
- std::pow(det_t(t), 1) * d2det_t_dt_dt(t)) *
- std::pow(s, sf);
+ pow(det_t(t), 1) * d2det_t_dt_dt(t)) *
+ pow(s, sf);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
- outer_product(ddet_t_dt(t), dv_squ_dv(v)) * std::pow(s, sf);
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
+ outer_product(ddet_t_dt(t), dv_squ_dv(v)) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3) *
- sf * std::pow(s, sf - 1.0);
+ return 2.0 * pow(det_t(t), 1) * ddet_t_dt(t) * pow(v_squ(v), 3) * sf *
+ pow(s, sf - 1.0);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
- outer_product(dv_squ_dv(v), ddet_t_dt(t)) * std::pow(s, sf);
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
+ outer_product(dv_squ_dv(v), ddet_t_dt(t)) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 *
- (2.0 * std::pow(v_squ(v), 1) *
- outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
- std::pow(v_squ(v), 2) * d2v_squ_dv_dv(v)) *
- std::pow(s, sf);
+ return pow(det_t(t), 2) * 3.0 *
+ (2.0 * pow(v_squ(v), 1) * outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
+ pow(v_squ(v), 2) * d2v_squ_dv_dv(v)) *
+ pow(s, sf);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v) *
- sf * std::pow(s, sf - 1.0);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v) * sf *
+ pow(s, sf - 1.0);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3) *
- sf * std::pow(s, sf - 1.0);
+ return 2.0 * pow(det_t(t), 1) * ddet_t_dt(t) * pow(v_squ(v), 3) * sf *
+ pow(s, sf - 1.0);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v) *
- sf * std::pow(s, sf - 1.0);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v) * sf *
+ pow(s, sf - 1.0);
};
static NumberType
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * sf * (sf - 1.0) *
- std::pow(s, sf - 2.0);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3) * sf * (sf - 1.0) *
+ pow(s, sf - 2.0);
};
};
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * std::pow(s, sf);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3) *
- std::pow(s, sf);
+ return 2.0 * pow(det_t(t), 1) * ddet_t_dt(t) * pow(v_squ(v), 3) *
+ pow(s, sf);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v) *
- std::pow(s, sf);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v) *
+ pow(s, sf);
};
static NumberType
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * sf *
- std::pow(s, sf - 1.0);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3) * sf * pow(s, sf - 1.0);
};
static Tensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(v_squ(v), 3) *
+ return 2.0 * pow(v_squ(v), 3) *
(pow(det_t(t), 0) * outer_product(ddet_t_dt(t), ddet_t_dt(t)) +
- std::pow(det_t(t), 1) * d2det_t_dt_dt(t)) *
- std::pow(s, sf);
+ pow(det_t(t), 1) * d2det_t_dt_dt(t)) *
+ pow(s, sf);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
- outer_product(ddet_t_dt(t), dv_squ_dv(v)) * std::pow(s, sf);
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
+ outer_product(ddet_t_dt(t), dv_squ_dv(v)) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3) *
- sf * std::pow(s, sf - 1.0);
+ return 2.0 * pow(det_t(t), 1) * ddet_t_dt(t) * pow(v_squ(v), 3) * sf *
+ pow(s, sf - 1.0);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * 3.0 * std::pow(v_squ(v), 2) *
- outer_product(dv_squ_dv(v), ddet_t_dt(t)) * std::pow(s, sf);
+ return 2.0 * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
+ outer_product(dv_squ_dv(v), ddet_t_dt(t)) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 *
- (2.0 * std::pow(v_squ(v), 1) *
- outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
- std::pow(v_squ(v), 2) * d2v_squ_dv_dv(v)) *
- std::pow(s, sf);
+ return pow(det_t(t), 2) * 3.0 *
+ (2.0 * pow(v_squ(v), 1) * outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
+ pow(v_squ(v), 2) * d2v_squ_dv_dv(v)) *
+ pow(s, sf);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v) *
- sf * std::pow(s, sf - 1.0);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v) * sf *
+ pow(s, sf - 1.0);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 1) * ddet_t_dt(t) * std::pow(v_squ(v), 3) *
- sf * std::pow(s, sf - 1.0);
+ return 2.0 * pow(det_t(t), 1) * ddet_t_dt(t) * pow(v_squ(v), 3) * sf *
+ pow(s, sf - 1.0);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * 3.0 * std::pow(v_squ(v), 2) * dv_squ_dv(v) *
- sf * std::pow(s, sf - 1.0);
+ return pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) * dv_squ_dv(v) * sf *
+ pow(s, sf - 1.0);
};
static NumberType
const Tensor<1, dim, NumberType> &v,
const NumberType & s)
{
- return std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * sf * (sf - 1.0) *
- std::pow(s, sf - 2.0);
+ return pow(det_t(t), 2) * pow(v_squ(v), 3) * sf * (sf - 1.0) *
+ pow(s, sf - 2.0);
};
};
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return std::pow(det_t(st), 2) * std::pow(det_t(t), 2) *
- std::pow(v_squ(v), 3) * std::pow(s, sf);
+ return pow(det_t(st), 2) * pow(det_t(t), 2) * pow(v_squ(v), 3) * pow(s, sf);
};
// --------------------------------------------------------------------------
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 1) * ddet_t_dt(st) *
- std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * std::pow(s, sf);
+ return 2.0 * pow(det_t(st), 1) * ddet_t_dt(st) * pow(det_t(t), 2) *
+ pow(v_squ(v), 3) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 2) * std::pow(det_t(t), 1) * ddet_t_dt(t) *
- std::pow(v_squ(v), 3) * std::pow(s, sf);
+ return 2.0 * pow(det_t(st), 2) * pow(det_t(t), 1) * ddet_t_dt(t) *
+ pow(v_squ(v), 3) * pow(s, sf);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return std::pow(det_t(st), 2) * std::pow(det_t(t), 2) * 3.0 *
- std::pow(v_squ(v), 2) * dv_squ_dv(v) * std::pow(s, sf);
+ return pow(det_t(st), 2) * pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) *
+ dv_squ_dv(v) * pow(s, sf);
};
static NumberType
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return std::pow(det_t(st), 2) * std::pow(det_t(t), 2) *
- std::pow(v_squ(v), 3) * sf * std::pow(s, sf - 1.0);
+ return pow(det_t(st), 2) * pow(det_t(t), 2) * pow(v_squ(v), 3) * sf *
+ pow(s, sf - 1.0);
};
static SymmetricTensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) *
- (std::pow(det_t(st), 0) *
- outer_product(ddet_t_dt(st), ddet_t_dt(st)) +
- std::pow(det_t(st), 1) * d2det_t_dt_dt(st)) *
- std::pow(s, sf);
+ return 2.0 * pow(det_t(t), 2) * pow(v_squ(v), 3) *
+ (pow(det_t(st), 0) * outer_product(ddet_t_dt(st), ddet_t_dt(st)) +
+ pow(det_t(st), 1) * d2det_t_dt_dt(st)) *
+ pow(s, sf);
};
static Tensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 4.0 * std::pow(det_t(st), 1) * std::pow(det_t(t), 1) *
+ return 4.0 * pow(det_t(st), 1) * pow(det_t(t), 1) *
outer_product(Tensor<2, dim, NumberType>(ddet_t_dt(st)),
ddet_t_dt(t)) *
- std::pow(v_squ(v), 3) * std::pow(s, sf);
+ pow(v_squ(v), 3) * pow(s, sf);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 2) * std::pow(det_t(st), 1) * 3.0 *
- std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 2) * pow(det_t(st), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(Tensor<2, dim, NumberType>(ddet_t_dt(st)),
dv_squ_dv(v)) *
- std::pow(s, sf);
+ pow(s, sf);
};
static SymmetricTensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 1) * ddet_t_dt(st) *
- std::pow(det_t(t), 2) * std::pow(v_squ(v), 3) * sf *
- std::pow(s, sf - 1.0);
+ return 2.0 * pow(det_t(st), 1) * ddet_t_dt(st) * pow(det_t(t), 2) *
+ pow(v_squ(v), 3) * sf * pow(s, sf - 1.0);
};
static Tensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 4.0 * std::pow(det_t(st), 1) * std::pow(det_t(t), 1) *
+ return 4.0 * pow(det_t(st), 1) * pow(det_t(t), 1) *
outer_product(ddet_t_dt(t),
Tensor<2, dim, NumberType>(ddet_t_dt(st))) *
- std::pow(v_squ(v), 3) * std::pow(s, sf);
+ pow(v_squ(v), 3) * pow(s, sf);
};
static Tensor<4, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 2) * std::pow(v_squ(v), 3) *
+ return 2.0 * pow(det_t(st), 2) * pow(v_squ(v), 3) *
(pow(det_t(t), 0) * outer_product(ddet_t_dt(t), ddet_t_dt(t)) +
- std::pow(det_t(t), 1) * d2det_t_dt_dt(t)) *
- std::pow(s, sf);
+ pow(det_t(t), 1) * d2det_t_dt_dt(t)) *
+ pow(s, sf);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 2) * std::pow(det_t(t), 1) * 3.0 *
- std::pow(v_squ(v), 2) * outer_product(ddet_t_dt(t), dv_squ_dv(v)) *
- std::pow(s, sf);
+ return 2.0 * pow(det_t(st), 2) * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
+ outer_product(ddet_t_dt(t), dv_squ_dv(v)) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 2) * std::pow(det_t(t), 1) * ddet_t_dt(t) *
- std::pow(v_squ(v), 3) * sf * std::pow(s, sf - 1.0);
+ return 2.0 * pow(det_t(st), 2) * pow(det_t(t), 1) * ddet_t_dt(t) *
+ pow(v_squ(v), 3) * sf * pow(s, sf - 1.0);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(t), 2) * std::pow(det_t(st), 1) * 3.0 *
- std::pow(v_squ(v), 2) *
+ return 2.0 * pow(det_t(t), 2) * pow(det_t(st), 1) * 3.0 * pow(v_squ(v), 2) *
outer_product(dv_squ_dv(v),
Tensor<2, dim, NumberType>(ddet_t_dt(st))) *
- std::pow(s, sf);
+ pow(s, sf);
};
static Tensor<3, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 2) * std::pow(det_t(t), 1) * 3.0 *
- std::pow(v_squ(v), 2) * outer_product(dv_squ_dv(v), ddet_t_dt(t)) *
- std::pow(s, sf);
+ return 2.0 * pow(det_t(st), 2) * pow(det_t(t), 1) * 3.0 * pow(v_squ(v), 2) *
+ outer_product(dv_squ_dv(v), ddet_t_dt(t)) * pow(s, sf);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return std::pow(det_t(st), 2) * std::pow(det_t(t), 2) * 3.0 *
- (2.0 * std::pow(v_squ(v), 1) *
- outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
- std::pow(v_squ(v), 2) * d2v_squ_dv_dv(v)) *
- std::pow(s, sf);
+ return pow(det_t(st), 2) * pow(det_t(t), 2) * 3.0 *
+ (2.0 * pow(v_squ(v), 1) * outer_product(dv_squ_dv(v), dv_squ_dv(v)) +
+ pow(v_squ(v), 2) * d2v_squ_dv_dv(v)) *
+ pow(s, sf);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return std::pow(det_t(st), 2) * std::pow(det_t(t), 2) * 3.0 *
- std::pow(v_squ(v), 2) * dv_squ_dv(v) * sf * std::pow(s, sf - 1.0);
+ return pow(det_t(st), 2) * pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) *
+ dv_squ_dv(v) * sf * pow(s, sf - 1.0);
};
static SymmetricTensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * ddet_t_dt(st) * std::pow(det_t(t), 2) *
- std::pow(det_t(st), 1) * std::pow(v_squ(v), 3) * sf *
- std::pow(s, sf - 1.0);
+ return 2.0 * ddet_t_dt(st) * pow(det_t(t), 2) * pow(det_t(st), 1) *
+ pow(v_squ(v), 3) * sf * pow(s, sf - 1.0);
};
static Tensor<2, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return 2.0 * std::pow(det_t(st), 2) * std::pow(det_t(t), 1) * ddet_t_dt(t) *
- std::pow(v_squ(v), 3) * sf * std::pow(s, sf - 1.0);
+ return 2.0 * pow(det_t(st), 2) * pow(det_t(t), 1) * ddet_t_dt(t) *
+ pow(v_squ(v), 3) * sf * pow(s, sf - 1.0);
};
static Tensor<1, dim, NumberType>
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return std::pow(det_t(st), 2) * std::pow(det_t(t), 2) * 3.0 *
- std::pow(v_squ(v), 2) * dv_squ_dv(v) * sf * std::pow(s, sf - 1.0);
+ return pow(det_t(st), 2) * pow(det_t(t), 2) * 3.0 * pow(v_squ(v), 2) *
+ dv_squ_dv(v) * sf * pow(s, sf - 1.0);
};
static NumberType
const Tensor<1, dim, NumberType> & v,
const NumberType & s)
{
- return std::pow(det_t(st), 2) * std::pow(det_t(t), 2) *
- std::pow(v_squ(v), 3) * sf * (sf - 1.0) * std::pow(s, sf - 2.0);
+ return pow(det_t(st), 2) * pow(det_t(t), 2) * pow(v_squ(v), 3) * sf *
+ (sf - 1.0) * pow(s, sf - 2.0);
};
};
static NumberType
psi(const NumberType &s)
{
- return 4.0 * std::pow(s, 4);
+ return 4.0 * pow(s, 4);
}
static NumberType
dpsi_ds(const NumberType &s)
{
- return 16.0 * std::pow(s, 3);
+ return 16.0 * pow(s, 3);
}
static NumberType
d2psi_ds_ds(const NumberType &s)
{
- return 48.0 * std::pow(s, 2);
+ return 48.0 * pow(s, 2);
}
};
static NumberType
f0(const NumberType &s0)
{
- return 4.0 * std::pow(s0, 4);
+ return 4.0 * pow(s0, 4);
}
static NumberType
df0_ds0(const NumberType &s0)
{
- return 16.0 * std::pow(s0, 3);
+ return 16.0 * pow(s0, 3);
}
};
static NumberType
f0(const NumberType &s0)
{
- return 2.0 * std::pow(s0, 4);
+ return 2.0 * pow(s0, 4);
};
static NumberType
df0_ds0(const NumberType &s0)
{
- return 8.0 * std::pow(s0, 3);
+ return 8.0 * pow(s0, 3);
};
static NumberType
f1(const NumberType &s0)
{
- return 3.0 * std::pow(s0, 2);
+ return 3.0 * pow(s0, 2);
};
static NumberType
df1_ds0(const NumberType &s0)
{
- return 6.0 * std::pow(s0, 1);
+ return 6.0 * pow(s0, 1);
};
};
static NumberType
f0(const NumberType &s0, const NumberType &s1)
{
- return 2.0 * std::pow(s0, 4) * std::pow(s1, 3);
+ return 2.0 * pow(s0, 4) * pow(s1, 3);
};
static NumberType
df0_ds0(const NumberType &s0, const NumberType &s1)
{
- return 8.0 * std::pow(s0, 3) * std::pow(s1, 3);
+ return 8.0 * pow(s0, 3) * pow(s1, 3);
};
static NumberType
df0_ds1(const NumberType &s0, const NumberType &s1)
{
- return 6.0 * std::pow(s0, 4) * std::pow(s1, 2);
+ return 6.0 * pow(s0, 4) * pow(s1, 2);
};
};
static NumberType
f0(const NumberType &s0, const NumberType &s1)
{
- return 2.0 * std::pow(s0, 4) * std::pow(s1, 3);
+ return 2.0 * pow(s0, 4) * pow(s1, 3);
};
static NumberType
df0_ds0(const NumberType &s0, const NumberType &s1)
{
- return 8.0 * std::pow(s0, 3) * std::pow(s1, 3);
+ return 8.0 * pow(s0, 3) * pow(s1, 3);
};
static NumberType
df0_ds1(const NumberType &s0, const NumberType &s1)
{
- return 6.0 * std::pow(s0, 4) * std::pow(s1, 2);
+ return 6.0 * pow(s0, 4) * pow(s1, 2);
};
static NumberType
f1(const NumberType &s0, const NumberType &s1)
{
- return 3.0 * std::pow(s0, 2) * std::pow(s1, 4);
+ return 3.0 * pow(s0, 2) * pow(s1, 4);
};
static NumberType
df1_ds0(const NumberType &s0, const NumberType &s1)
{
- return 6.0 * std::pow(s0, 1) * std::pow(s1, 4);
+ return 6.0 * pow(s0, 1) * pow(s1, 4);
};
static NumberType
df1_ds1(const NumberType &s0, const NumberType &s1)
{
- return 12.0 * std::pow(s0, 2) * std::pow(s1, 3);
+ return 12.0 * pow(s0, 2) * pow(s1, 3);
};
};
{
const NumberType det_F = determinant(F);
SymmetricTensor<2, dim, NumberType> b_bar = symmetrize(F * transpose(F));
- b_bar *= std::pow(det_F, -2.0 / dim);
+ b_bar *= pow(det_F, -2.0 / dim);
return 2.0 * c_1 * b_bar;
}
};
const double det_F_qp = determinant(
StandardTensors<dim>::I + solution_grads_u_total[q_point]);
const double J_tilde_qp = solution_values_J_total[q_point];
- const double the_error_qp_squared =
- std::pow((det_F_qp - J_tilde_qp), 2);
- const double JxW = fe_values_ref.JxW(q_point);
+ const double the_error_qp_squared = pow((det_F_qp - J_tilde_qp), 2);
+ const double JxW = fe_values_ref.JxW(q_point);
dil_L2_error += the_error_qp_squared * JxW;
vol_current += det_F_qp * JxW;
}
const double J_tilde_in)
{
det_F = determinant(F);
- b_bar = std::pow(det_F, -2.0 / dim) * symmetrize(F * transpose(F));
+ b_bar = pow(det_F, -2.0 / dim) * symmetrize(F * transpose(F));
p_tilde = p_tilde_in;
J_tilde = J_tilde_in;
Assert(det_F > 0, ExcInternalError());
const ADNumberType det_F_AD = sqrt(determinant(C_AD));
SymmetricTensor<2, dim, ADNumberType> C_bar_AD(C_AD);
- C_bar_AD *= std::pow(det_F_AD, -2.0 / dim);
+ C_bar_AD *= pow(det_F_AD, -2.0 / dim);
ADNumberType psi_CpJ = material->get_Psi_iso(C_bar_AD);
psi_CpJ += p_tilde_AD * (det_F_AD - J_tilde_AD);
Assert(lqph.size() == n_q_points, ExcInternalError());
for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
{
- const double det_F_qp = lqph[q_point]->get_det_F();
- const double J_tilde_qp = lqph[q_point]->get_J_tilde();
- const double the_error_qp_squared =
- std::pow((det_F_qp - J_tilde_qp), 2);
- const double JxW = fe_values_ref.JxW(q_point);
+ const double det_F_qp = lqph[q_point]->get_det_F();
+ const double J_tilde_qp = lqph[q_point]->get_J_tilde();
+ const double the_error_qp_squared = pow((det_F_qp - J_tilde_qp), 2);
+ const double JxW = fe_values_ref.JxW(q_point);
dil_L2_error += the_error_qp_squared * JxW;
}
}
symmetrize(transpose(F) * F);
const NumberType det_F = determinant(F);
SymmetricTensor<2, dim, NumberType> C_bar(C);
- C_bar *= std::pow(det_F, -2.0 / dim);
+ C_bar *= pow(det_F, -2.0 / dim);
NumberType psi_CpJ = material->get_Psi_iso(C_bar);
psi_CpJ += material->get_Psi_vol(J_tilde);
const double det_F_qp = determinant(
StandardTensors<dim>::I + solution_grads_u_total[q_point]);
const double J_tilde_qp = solution_values_J_total[q_point];
- const double the_error_qp_squared =
- std::pow((det_F_qp - J_tilde_qp), 2);
- const double JxW = fe_values_ref.JxW(q_point);
+ const double the_error_qp_squared = pow((det_F_qp - J_tilde_qp), 2);
+ const double JxW = fe_values_ref.JxW(q_point);
dil_L2_error += the_error_qp_squared * JxW;
vol_current += det_F_qp * JxW;
}
{
const NumberType det_F = determinant(F);
SymmetricTensor<2, dim, NumberType> b_bar = symmetrize(F * transpose(F));
- b_bar *= std::pow(det_F, -2.0 / dim);
+ b_bar *= pow(det_F, -2.0 / dim);
return 2.0 * c_1 * b_bar;
}
};
const double det_F_qp = determinant(
StandardTensors<dim>::I + solution_grads_u_total[q_point]);
const double J_tilde_qp = solution_values_J_total[q_point];
- const double the_error_qp_squared =
- std::pow((det_F_qp - J_tilde_qp), 2);
- const double JxW = fe_values_ref.JxW(q_point);
+ const double the_error_qp_squared = pow((det_F_qp - J_tilde_qp), 2);
+ const double JxW = fe_values_ref.JxW(q_point);
dil_L2_error += the_error_qp_squared * JxW;
vol_current += det_F_qp * JxW;
}
NumberType
J(const SymmetricTensor<2, dim, NumberType> &C)
{
- return std::sqrt(determinant(C));
+ // Make things work with AD types
+ using std::sqrt;
+ return sqrt(determinant(C));
}
template <int dim, typename NumberType>
static NumberType
psi(const SymmetricTensor<2, dim, NumberType> &C)
{
- return 0.5 * mu() * (trace(C) - dim) - mu() * std::log(J(C));
+ // Make things work with AD types
+ using std::log;
+ return 0.5 * mu() * (trace(C) - dim) - mu() * log(J(C));
}
static SymmetricTensor<2, dim, NumberType>
psi(const std::array<std::pair<NumberType, Tensor<1, dim, NumberType>>, dim>
eig_C)
{
+ // Make things work with AD types
+ using std::log;
+ using std::sqrt;
NumberType psi = 0.0;
NumberType J = 1.0;
for (unsigned int d = 0; d < dim; ++d)
{
const NumberType &lambda_squared = eig_C[d].first;
psi += 0.5 * mu() * (lambda_squared - 1.0);
- J *= std::sqrt(lambda_squared);
+ J *= sqrt(lambda_squared);
}
- psi -= mu() * std::log(J);
+ psi -= mu() * log(J);
return psi;
}
NumberType
J(const SymmetricTensor<2, dim, NumberType> &C)
{
- return std::sqrt(determinant(C));
+ // Make things work with AD types
+ using std::sqrt;
+ return sqrt(determinant(C));
}
template <int dim, typename NumberType>
static NumberType
psi(const SymmetricTensor<2, dim, NumberType> &C)
{
- return 0.5 * mu() * (trace(C) - dim) - mu() * std::log(J(C));
+ // Make things work with AD types
+ using std::log;
+ return 0.5 * mu() * (trace(C) - dim) - mu() * log(J(C));
}
static SymmetricTensor<2, dim, NumberType>
static NumberType
psi(const NumberType &s1, const NumberType &s2)
{
- return 2.0 * std::pow(s1, 4) * std::pow(s2, 3);
+ return 2.0 * pow(s1, 4) * pow(s2, 3);
};
static NumberType
dpsi_ds1(const NumberType &s1, const NumberType &s2)
{
- return 8.0 * std::pow(s1, 3) * std::pow(s2, 3);
+ return 8.0 * pow(s1, 3) * pow(s2, 3);
};
static NumberType
dpsi_ds2(const NumberType &s1, const NumberType &s2)
{
- return 6.0 * std::pow(s1, 4) * std::pow(s2, 2);
+ return 6.0 * pow(s1, 4) * pow(s2, 2);
};
static NumberType
d2psi_ds1_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 2) * std::pow(s2, 3);
+ return 24.0 * pow(s1, 2) * pow(s2, 3);
};
static NumberType
d2psi_ds2_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 3) * std::pow(s2, 2);
+ return 24.0 * pow(s1, 3) * pow(s2, 2);
};
static NumberType
static NumberType
d2psi_ds2_ds2(const NumberType &s1, const NumberType &s2)
{
- return 12.0 * std::pow(s1, 4) * std::pow(s2, 1);
+ return 12.0 * pow(s1, 4) * pow(s2, 1);
};
};
static NumberType
psi(const NumberType &s1, const NumberType &s2)
{
- return 2.0 * std::pow(s1, 4) * std::pow(s2, 3);
+ return 2.0 * pow(s1, 4) * pow(s2, 3);
};
static NumberType
dpsi_ds1(const NumberType &s1, const NumberType &s2)
{
- return 8.0 * std::pow(s1, 3) * std::pow(s2, 3);
+ return 8.0 * pow(s1, 3) * pow(s2, 3);
};
static NumberType
dpsi_ds2(const NumberType &s1, const NumberType &s2)
{
- return 6.0 * std::pow(s1, 4) * std::pow(s2, 2);
+ return 6.0 * pow(s1, 4) * pow(s2, 2);
};
static NumberType
d2psi_ds1_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 2) * std::pow(s2, 3);
+ return 24.0 * pow(s1, 2) * pow(s2, 3);
};
static NumberType
d2psi_ds2_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 3) * std::pow(s2, 2);
+ return 24.0 * pow(s1, 3) * pow(s2, 2);
};
static NumberType
static NumberType
d2psi_ds2_ds2(const NumberType &s1, const NumberType &s2)
{
- return 12.0 * std::pow(s1, 4) * std::pow(s2, 1);
+ return 12.0 * pow(s1, 4) * pow(s2, 1);
};
};
static NumberType
psi(const NumberType &s1, const NumberType &s2)
{
- return 2.0 * std::pow(s1, 4) * std::pow(s2, 3);
+ return 2.0 * pow(s1, 4) * pow(s2, 3);
};
static NumberType
dpsi_ds1(const NumberType &s1, const NumberType &s2)
{
- return 8.0 * std::pow(s1, 3) * std::pow(s2, 3);
+ return 8.0 * pow(s1, 3) * pow(s2, 3);
};
static NumberType
dpsi_ds2(const NumberType &s1, const NumberType &s2)
{
- return 6.0 * std::pow(s1, 4) * std::pow(s2, 2);
+ return 6.0 * pow(s1, 4) * pow(s2, 2);
};
static NumberType
d2psi_ds1_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 2) * std::pow(s2, 3);
+ return 24.0 * pow(s1, 2) * pow(s2, 3);
};
static NumberType
d2psi_ds2_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 3) * std::pow(s2, 2);
+ return 24.0 * pow(s1, 3) * pow(s2, 2);
};
static NumberType
static NumberType
d2psi_ds2_ds2(const NumberType &s1, const NumberType &s2)
{
- return 12.0 * std::pow(s1, 4) * std::pow(s2, 1);
+ return 12.0 * pow(s1, 4) * pow(s2, 1);
};
};
static NumberType
psi(const NumberType &s1, const NumberType &s2)
{
- return 2.0 * std::pow(s1, 4) * std::pow(s2, 3);
+ return 2.0 * pow(s1, 4) * pow(s2, 3);
};
static NumberType
dpsi_ds1(const NumberType &s1, const NumberType &s2)
{
- return 8.0 * std::pow(s1, 3) * std::pow(s2, 3);
+ return 8.0 * pow(s1, 3) * pow(s2, 3);
};
static NumberType
dpsi_ds2(const NumberType &s1, const NumberType &s2)
{
- return 6.0 * std::pow(s1, 4) * std::pow(s2, 2);
+ return 6.0 * pow(s1, 4) * pow(s2, 2);
};
static NumberType
d2psi_ds1_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 2) * std::pow(s2, 3);
+ return 24.0 * pow(s1, 2) * pow(s2, 3);
};
static NumberType
d2psi_ds2_ds1(const NumberType &s1, const NumberType &s2)
{
- return 24.0 * std::pow(s1, 3) * std::pow(s2, 2);
+ return 24.0 * pow(s1, 3) * pow(s2, 2);
};
static NumberType
static NumberType
d2psi_ds2_ds2(const NumberType &s1, const NumberType &s2)
{
- return 12.0 * std::pow(s1, 4) * std::pow(s2, 1);
+ return 12.0 * pow(s1, 4) * pow(s2, 1);
};
};