Enumerations | |
enum | ComputeType { ComputeType::value, ComputeType::derivative } |
Functions | |
Real | poly1Log (Real x, Real tol, unsigned int derivative_order) |
Real | poly2Log (Real x, Real tol, unsigned int derivative_order) |
Real | poly3Log (Real x, Real tol, unsigned int derivative_order) |
Real | poly4Log (Real x, Real tol, unsigned int derivative_order) |
Real | taylorLog (Real x) |
Point | barycentricToCartesian2D (const Point &p0, const Point &p1, const Point &p2, const Real b0, const Real b1, const Real b2) |
Evaluate Cartesian coordinates of any center point of a triangle given Barycentric coordinates of center point and Cartesian coordinates of triangle's vertices. More... | |
Point | barycentricToCartesian3D (const Point &p0, const Point &p1, const Point &p2, const Point &p3, const Real b0, const Real b1, const Real b2, const Real b3) |
Evaluate Cartesian coordinates of any center point of a tetrahedron given Barycentric coordinates of center point and Cartesian coordinates of tetrahedon's vertices. More... | |
Point | circumcenter2D (const Point &p0, const Point &p1, const Point &p2) |
Evaluate circumcenter of a triangle given three arbitrary points. More... | |
Point | circumcenter3D (const Point &p0, const Point &p1, const Point &p2, const Point &p3) |
Evaluate circumcenter of a tetrahedrom given four arbitrary points. More... | |
template<typename T > | |
T | round (T x) |
template<typename T > | |
T | sign (T x) |
template<typename T > | |
T | pow (T x, int e) |
template<typename T > | |
T | heavyside (T x) |
template<typename T > | |
T | regularizedHeavyside (T x, Real smoothing_length) |
template<typename T > | |
T | regularizedHeavysideDerivative (T x, Real smoothing_length) |
template<typename T > | |
T | positivePart (T x) |
template<typename T > | |
T | negativePart (T x) |
template<typename T , typename T2 , typename T3 , typename std::enable_if< ScalarTraits< T >::value &&ScalarTraits< T2 >::value &&ScalarTraits< T3 >::value, int >::type = 0> | |
void | addScaled (const T &a, const T2 &b, T3 &result) |
template<typename T , typename T2 , typename T3 , typename std::enable_if< ScalarTraits< T >::value, int >::type = 0> | |
void | addScaled (const T &scalar, const NumericVector< T2 > &numeric_vector, NumericVector< T3 > &result) |
template<typename T , typename T2 , template< typename > class W, template< typename > class W2, typename std::enable_if< std::is_same< typename W< T >::index_type, unsigned int >::value &&std::is_same< typename W2< T2 >::index_type, unsigned int >::value, int >::type = 0> | |
libMesh::CompareTypes< T, T2 >::supertype | dotProduct (const W< T > &a, const W2< T2 > &b) |
template<typename C , typename T , typename R = typename libMesh::CompareTypes<typename C::value_type, T>::supertype> | |
R | poly (const C &c, const T x, const bool derivative=false) |
Evaluate a polynomial with the coefficients c at x. More... | |
template<typename C , typename T , typename R = typename libMesh::CompareTypes<typename C::value_type, T>::supertype> | |
R | polynomial (const C &c, const T x) |
Evaluate a polynomial with the coefficients c at x. More... | |
template<typename C , typename T , typename R = typename libMesh::CompareTypes<typename C::value_type, T>::supertype> | |
R | polynomialDerivative (const C &c, const T x) |
Returns the derivative of polynomial(c, x) with respect to x. More... | |
template<typename T , typename T2 > | |
T | clamp (const T &x, T2 lowerlimit, T2 upperlimit) |
template<typename T , typename T2 > | |
T | smootherStep (T x, T2 start, T2 end, bool derivative=false) |
template<ComputeType compute_type, typename X , typename S , typename E > | |
auto | smootherStep (const X &x, const S &start, const E &end) |
template<typename T > | |
void | mooseSetToZero (T &v) |
Helper function templates to set a variable to zero. More... | |
template<typename T > | |
void | mooseSetToZero (T *&) |
template<> | |
void | mooseSetToZero (std::vector< Real > &vec) |
std::vector< std::vector< unsigned int > > | multiIndex (unsigned int dim, unsigned int order) |
generate a complete multi index table for given dimension and order i.e. More... | |
template<ComputeType compute_type, typename X , typename X1 , typename X2 , typename Y1 , typename Y2 > | |
auto | linearInterpolation (const X &x, const X1 &x1, const X2 &x2, const Y1 &y1, const Y2 &y2) |
template<typename T1 , typename T2 > | |
std::size_t | euclideanMod (T1 dividend, T2 divisor) |
perform modulo operator for Euclidean division that ensures a non-negative result More... | |
template<typename T > | |
T | gradName (const T &base_prop_name) |
automatic prefixing for naming material properties based on gradients of coupled variables/functors More... | |
template<typename T > | |
T | timeDerivName (const T &base_prop_name) |
automatic prefixing for naming material properties based on time derivatives of coupled variables/functors More... | |
template<> | |
void | mooseSetToZero< RankFourTensor > (RankFourTensor &v) |
Helper function template specialization to set an object to zero. More... | |
template<> | |
void | mooseSetToZero< ADRankFourTensor > (ADRankFourTensor &v) |
template<> | |
void | mooseSetToZero< RankFourTensorTempl< Real > > (RankFourTensorTempl< Real > &v) |
template<> | |
void | mooseSetToZero< RankFourTensorTempl< DualReal > > (RankFourTensorTempl< DualReal > &v) |
template<> | |
void | mooseSetToZero< RankThreeTensorTempl< Real > > (RankThreeTensorTempl< Real > &v) |
Helper function template specialization to set an object to zero. More... | |
template<> | |
void | mooseSetToZero< RankThreeTensorTempl< DualReal > > (RankThreeTensorTempl< DualReal > &v) |
template<> | |
void | mooseSetToZero< RankThreeTensor > (RankThreeTensor &v) |
template<> | |
void | mooseSetToZero< ADRankThreeTensor > (ADRankThreeTensor &v) |
template<> | |
void | mooseSetToZero< RankTwoTensor > (RankTwoTensor &v) |
Helper function template specialization to set an object to zero. More... | |
template<> | |
void | mooseSetToZero< ADRankTwoTensor > (ADRankTwoTensor &v) |
Helper function template specialization to set an object to zero. More... | |
template<> | |
void | mooseSetToZero< SymmetricRankFourTensor > (SymmetricRankFourTensor &v) |
Helper function template specialization to set an object to zero. More... | |
template<> | |
void | mooseSetToZero< ADSymmetricRankFourTensor > (ADSymmetricRankFourTensor &v) |
template<> | |
void | mooseSetToZero< SymmetricRankFourTensorTempl< Real > > (SymmetricRankFourTensorTempl< Real > &v) |
template<> | |
void | mooseSetToZero< SymmetricRankFourTensorTempl< DualReal > > (SymmetricRankFourTensorTempl< DualReal > &v) |
template<> | |
void | mooseSetToZero< SymmetricRankTwoTensor > (SymmetricRankTwoTensor &v) |
Helper function template specialization to set an object to zero. More... | |
template<> | |
void | mooseSetToZero< ADSymmetricRankTwoTensor > (ADSymmetricRankTwoTensor &v) |
Helper function template specialization to set an object to zero. More... | |
Real | plainLog (Real x, unsigned int derivative_order) |
FactorizedRankTwoTensorOperatorMapUnary (log, std::log(eigval)) | |
FactorizedRankTwoTensorOperatorMapDerivativeUnary (dlog, std::log(eigval), 1/eigval) | |
FactorizedRankTwoTensorOperatorMapUnary (exp, std::exp(eigval)) | |
FactorizedRankTwoTensorOperatorMapDerivativeUnary (dexp, std::exp(eigval), std::exp(eigval)) | |
FactorizedRankTwoTensorOperatorMapUnary (sqrt, std::sqrt(eigval)) | |
FactorizedRankTwoTensorOperatorMapDerivativeUnary (dsqrt, std::sqrt(eigval), std::pow(eigval, -1./2.)/2.) | |
FactorizedRankTwoTensorOperatorMapUnary (cbrt, std::cbrt(eigval)) | |
FactorizedRankTwoTensorOperatorMapDerivativeUnary (dcbrt, std::cbrt(eigval), std::pow(eigval, -2./3.)/3.) | |
FactorizedRankTwoTensorOperatorMapBinary (pow, std::pow(eigval, arg)) | |
FactorizedRankTwoTensorOperatorMapDerivativeBinary (dpow, std::pow(eigval, arg), arg *std::pow(eigval, arg - 1)) | |
Variables | |
static constexpr Real | sqrt2 = 1.4142135623730951 |
std::sqrt is not constexpr, so we add sqrt(2) as a constant (used in Mandel notation) More... | |
|
strong |
Enumerator | |
---|---|
value | |
derivative |
Definition at line 334 of file MathUtils.h.
void MathUtils::addScaled | ( | const T & | a, |
const T2 & | b, | ||
T3 & | result | ||
) |
Definition at line 168 of file MathUtils.h.
Referenced by NewmarkBeta::computeTimeDerivativeHelper(), and BDF2::computeTimeDerivativeHelper().
void MathUtils::addScaled | ( | const T & | scalar, |
const NumericVector< T2 > & | numeric_vector, | ||
NumericVector< T3 > & | result | ||
) |
Definition at line 178 of file MathUtils.h.
Point MathUtils::barycentricToCartesian2D | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2, | ||
const Real | b0, | ||
const Real | b1, | ||
const Real | b2 | ||
) |
Evaluate Cartesian coordinates of any center point of a triangle given Barycentric coordinates of center point and Cartesian coordinates of triangle's vertices.
p0,p1,p2 | are the three non-collinear vertices in Cartesian coordinates |
b0,b1,b2 | is the center point in barycentric coordinates with b0+b1+b2=1, e.g. (1/3,1/3,1/3) for a centroid |
Definition at line 206 of file MathUtils.C.
Referenced by circumcenter2D().
Point MathUtils::barycentricToCartesian3D | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2, | ||
const Point & | p3, | ||
const Real | b0, | ||
const Real | b1, | ||
const Real | b2, | ||
const Real | b3 | ||
) |
Evaluate Cartesian coordinates of any center point of a tetrahedron given Barycentric coordinates of center point and Cartesian coordinates of tetrahedon's vertices.
p0,p1,p2,p3 | are the three non-coplanar vertices in Cartesian coordinates |
b0,b1,b2,b3 | is the center point in barycentric coordinates with b0+b1+b2+b3=1, e.g. (1/4,1/4,1/4,1/4) for a centroid. |
Definition at line 226 of file MathUtils.C.
Referenced by circumcenter3D().
Point MathUtils::circumcenter2D | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2 | ||
) |
Evaluate circumcenter of a triangle given three arbitrary points.
p0,p1,p2 | are the three non-collinear vertices in Cartesian coordinates |
Definition at line 249 of file MathUtils.C.
Point MathUtils::circumcenter3D | ( | const Point & | p0, |
const Point & | p1, | ||
const Point & | p2, | ||
const Point & | p3 | ||
) |
Evaluate circumcenter of a tetrahedrom given four arbitrary points.
p0,p1,p2,p3 | are the four non-coplanar vertices in Cartesian coordinates |
Definition at line 278 of file MathUtils.C.
T MathUtils::clamp | ( | const T & | x, |
T2 | lowerlimit, | ||
T2 | upperlimit | ||
) |
Definition at line 305 of file MathUtils.h.
libMesh::CompareTypes< T, T2 >::supertype MathUtils::dotProduct | ( | const W< T > & | a, |
const W2< T2 > & | b | ||
) |
Definition at line 194 of file MathUtils.h.
Referenced by ADKernelGradTempl< T >::computeResidual(), and ADKernelGradTempl< T >::computeResidualsForJacobian().
std::size_t MathUtils::euclideanMod | ( | T1 | dividend, |
T2 | divisor | ||
) |
perform modulo operator for Euclidean division that ensures a non-negative result
dividend | dividend of the modulo operation |
divisor | divisor of the modulo operation |
Definition at line 430 of file MathUtils.h.
MathUtils::FactorizedRankTwoTensorOperatorMapDerivativeBinary | ( | dpow | , |
std::pow(eigval, arg) | , | ||
arg * | std::poweigval, arg - 1 | ||
) |
MathUtils::FactorizedRankTwoTensorOperatorMapDerivativeUnary | ( | dlog | , |
std::log(eigval) | , | ||
1/ | eigval | ||
) |
MathUtils::FactorizedRankTwoTensorOperatorMapDerivativeUnary | ( | dexp | , |
std::exp(eigval) | , | ||
std::exp(eigval) | |||
) |
MathUtils::FactorizedRankTwoTensorOperatorMapDerivativeUnary | ( | dsqrt | , |
std::sqrt(eigval) | , | ||
std::pow(eigval, -1./2.)/ | 2. | ||
) |
MathUtils::FactorizedRankTwoTensorOperatorMapDerivativeUnary | ( | dcbrt | , |
std::cbrt(eigval) | , | ||
std::pow(eigval, -2./3.)/ | 3. | ||
) |
MathUtils::FactorizedRankTwoTensorOperatorMapUnary | ( | log | , |
std::log(eigval) | |||
) |
MathUtils::FactorizedRankTwoTensorOperatorMapUnary | ( | exp | , |
std::exp(eigval) | |||
) |
MathUtils::FactorizedRankTwoTensorOperatorMapUnary | ( | cbrt | , |
std::cbrt(eigval) | |||
) |
T MathUtils::gradName | ( | const T & | base_prop_name | ) |
automatic prefixing for naming material properties based on gradients of coupled variables/functors
Definition at line 441 of file MathUtils.h.
Referenced by GenericFunctorMaterialTempl< is_ad >::GenericFunctorMaterialTempl().
T MathUtils::heavyside | ( | T | x | ) |
Definition at line 119 of file MathUtils.h.
auto MathUtils::linearInterpolation | ( | const X & | x, |
const X1 & | x1, | ||
const X2 & | x2, | ||
const Y1 & | y1, | ||
const Y2 & | y2 | ||
) |
Definition at line 413 of file MathUtils.h.
|
inline |
Helper function templates to set a variable to zero.
Specializations may have to be implemented (for examples see RankTwoTensor, RankFourTensor).
The default for non-pointer types is to assign zero. This should either do something sensible, or throw a compiler error. Otherwise the T type is designed badly.
Definition at line 368 of file MathUtils.h.
Referenced by MaterialBase::getGenericZeroMaterialProperty(), MaterialPropertyInterface::getGenericZeroMaterialProperty(), and MaterialBase::getGenericZeroMaterialPropertyByName().
|
inline |
Definition at line 379 of file MathUtils.h.
Definition at line 386 of file MathUtils.h.
void MathUtils::mooseSetToZero< ADRankFourTensor > | ( | ADRankFourTensor & | v | ) |
Definition at line 26 of file RankFourTensor.C.
void MathUtils::mooseSetToZero< ADRankThreeTensor > | ( | ADRankThreeTensor & | v | ) |
Definition at line 27 of file RankThreeTensor.C.
void MathUtils::mooseSetToZero< ADRankTwoTensor > | ( | ADRankTwoTensor & | v | ) |
Helper function template specialization to set an object to zero.
Needed by DerivativeMaterialInterface
Definition at line 27 of file RankTwoTensor.C.
void MathUtils::mooseSetToZero< ADSymmetricRankFourTensor > | ( | ADSymmetricRankFourTensor & | v | ) |
Definition at line 26 of file SymmetricRankFourTensor.C.
void MathUtils::mooseSetToZero< ADSymmetricRankTwoTensor > | ( | ADSymmetricRankTwoTensor & | v | ) |
Helper function template specialization to set an object to zero.
Needed by DerivativeMaterialInterface
Definition at line 27 of file SymmetricRankTwoTensor.C.
void MathUtils::mooseSetToZero< RankFourTensor > | ( | RankFourTensor & | v | ) |
Helper function template specialization to set an object to zero.
Needed by DerivativeMaterialInterface
Definition at line 20 of file RankFourTensor.C.
void MathUtils::mooseSetToZero< RankFourTensorTempl< DualReal > > | ( | RankFourTensorTempl< DualReal > & | v | ) |
void MathUtils::mooseSetToZero< RankFourTensorTempl< Real > > | ( | RankFourTensorTempl< Real > & | v | ) |
void MathUtils::mooseSetToZero< RankThreeTensor > | ( | RankThreeTensor & | v | ) |
Definition at line 20 of file RankThreeTensor.C.
void MathUtils::mooseSetToZero< RankThreeTensorTempl< DualReal > > | ( | RankThreeTensorTempl< DualReal > & | v | ) |
void MathUtils::mooseSetToZero< RankThreeTensorTempl< Real > > | ( | RankThreeTensorTempl< Real > & | v | ) |
Helper function template specialization to set an object to zero.
Needed by DerivativeMaterialInterface
void MathUtils::mooseSetToZero< RankTwoTensor > | ( | RankTwoTensor & | v | ) |
Helper function template specialization to set an object to zero.
Needed by DerivativeMaterialInterface
Definition at line 20 of file RankTwoTensor.C.
void MathUtils::mooseSetToZero< SymmetricRankFourTensor > | ( | SymmetricRankFourTensor & | v | ) |
Helper function template specialization to set an object to zero.
Needed by DerivativeMaterialInterface
Definition at line 20 of file SymmetricRankFourTensor.C.
void MathUtils::mooseSetToZero< SymmetricRankFourTensorTempl< DualReal > > | ( | SymmetricRankFourTensorTempl< DualReal > & | v | ) |
void MathUtils::mooseSetToZero< SymmetricRankFourTensorTempl< Real > > | ( | SymmetricRankFourTensorTempl< Real > & | v | ) |
void MathUtils::mooseSetToZero< SymmetricRankTwoTensor > | ( | SymmetricRankTwoTensor & | v | ) |
Helper function template specialization to set an object to zero.
Needed by DerivativeMaterialInterface
Definition at line 20 of file SymmetricRankTwoTensor.C.
std::vector< std::vector< unsigned int > > MathUtils::multiIndex | ( | unsigned int | dim, |
unsigned int | order | ||
) |
generate a complete multi index table for given dimension and order i.e.
given dim = 2, order = 2, generated table will have the following content 0 0 1 0 0 1 2 0 1 1 0 2 The first number in each entry represents the order of the first variable, i.e. x; The second number in each entry represents the order of the second variable, i.e. y. Multiplication is implied between numbers in each entry, i.e. 1 1 represents x^1 * y^1
dim | dimension of the multi-index, here dim = mesh dimension |
order | generate the multi-index up to certain order |
Definition at line 175 of file MathUtils.C.
T MathUtils::negativePart | ( | T | x | ) |
Definition at line 156 of file MathUtils.h.
Definition at line 17 of file MathUtils.C.
Referenced by poly1Log(), poly2Log(), poly3Log(), and poly4Log().
R MathUtils::poly | ( | const C & | c, |
const T | x, | ||
const bool | derivative = false |
||
) |
Evaluate a polynomial with the coefficients c at x.
Note that the Polynomial form is c[0]*x^s + c[1]*x^(s-1) + c[2]*x^(s-2) + ... + c[s-2]*x^2 + c[s-1]*x + c[s] where s = c.size()-1 , which is counter intuitive!
This function will be DEPRECATED soon (10/22/2020)
The coefficient container type can be any container that provides an index operator [] and a .size() method (e.g. std::vector, std::array). The return type is the supertype of the container value type and the argument x. The supertype is the type that can represent both number types.
Definition at line 233 of file MathUtils.h.
Referenced by MortarSegmentHelper::isDisjoint().
Definition at line 38 of file MathUtils.C.
Definition at line 65 of file MathUtils.C.
Definition at line 93 of file MathUtils.C.
Definition at line 122 of file MathUtils.C.
R MathUtils::polynomial | ( | const C & | c, |
const T | x | ||
) |
Evaluate a polynomial with the coefficients c at x.
Note that the Polynomial form is c[0] + c[1] * x + c[2] * x^2 + ... The coefficient container type can be any container that provides an index operator [] and a .size() method (e.g. std::vector, std::array). The return type is the supertype of the container value type and the argument x. The supertype is the type that can represent both number types.
Definition at line 268 of file MathUtils.h.
Referenced by NodalPatchRecovery::computePVector(), NodalPatchRecoveryBase::evaluateBasisFunctions(), and ProjectedStatefulMaterialNodalPatchRecoveryTempl< T, is_ad >::evaluateBasisFunctions().
R MathUtils::polynomialDerivative | ( | const C & | c, |
const T | x | ||
) |
Returns the derivative of polynomial(c, x) with respect to x.
Definition at line 289 of file MathUtils.h.
T MathUtils::positivePart | ( | T | x | ) |
Definition at line 149 of file MathUtils.h.
T MathUtils::pow | ( | T | x, |
int | e | ||
) |
Definition at line 90 of file MathUtils.h.
Referenced by ProjectedStatefulMaterialNodalPatchRecoveryTempl< T, is_ad >::evaluateBasisFunctions(), PolynomialFit::fillMatrix(), BicubicInterpolation::sample2ndDerivative(), BicubicInterpolation::sampleDerivative(), BicubicInterpolation::sampleInternal(), BicubicInterpolation::sampleValueAndDerivativesInternal(), and PseudoTimestep::timestepEXP().
T MathUtils::regularizedHeavyside | ( | T | x, |
Real | smoothing_length | ||
) |
Definition at line 126 of file MathUtils.h.
T MathUtils::regularizedHeavysideDerivative | ( | T | x, |
Real | smoothing_length | ||
) |
Definition at line 138 of file MathUtils.h.
T MathUtils::round | ( | T | x | ) |
Definition at line 76 of file MathUtils.h.
Referenced by GeneratedMesh::buildMesh(), GeneratedMeshGenerator::generate(), ImageSubdomainGenerator::generate(), DistributedRectilinearMeshGenerator::generate(), PointIndexedMap::getRoundedPoint(), FlagElementsThread::onElement(), and ProgressOutput::output().
T MathUtils::sign | ( | T | x | ) |
Definition at line 83 of file MathUtils.h.
Referenced by AutomaticMortarGeneration::computeNodalGeometry(), HFEMTestJump::computeQpOffDiagJacobian(), HFEMTrialJump::computeQpOffDiagJacobian(), HFEMTrialJump::computeQpResidual(), HFEMTestJump::computeQpResidual(), MooseUnits::parse(), Moose::FV::rF(), VectorFunctionReaction::validParams(), and PiecewiseConstant::value().
T MathUtils::smootherStep | ( | T | x, |
T2 | start, | ||
T2 | end, | ||
bool | derivative = false |
||
) |
Definition at line 316 of file MathUtils.h.
auto MathUtils::smootherStep | ( | const X & | x, |
const S & | start, | ||
const E & | end | ||
) |
Definition at line 342 of file MathUtils.h.
Definition at line 161 of file MathUtils.C.
T MathUtils::timeDerivName | ( | const T & | base_prop_name | ) |
automatic prefixing for naming material properties based on time derivatives of coupled variables/functors
Definition at line 452 of file MathUtils.h.
Referenced by GenericFunctorMaterialTempl< is_ad >::GenericFunctorMaterialTempl(), and GenericVectorFunctorMaterialTempl< is_ad >::GenericVectorFunctorMaterialTempl().
|
static |
std::sqrt is not constexpr, so we add sqrt(2) as a constant (used in Mandel notation)
Definition at line 24 of file MathUtils.h.
Referenced by SymmetricRankTwoTensorTempl< T >::d2thirdInvariant(), SymmetricRankTwoTensorTempl< T >::ddet(), SymmetricRankTwoTensorTempl< T >::det(), SymmetricRankTwoTensorTempl< T >::dthirdInvariant(), SymmetricRankTwoTensorTempl< T >::inverse(), SymmetricRankTwoTensorTempl< T >::mandelFactor(), SymmetricRankFourTensorTempl< T >::rotationMatrix(), SymmetricRankTwoTensorTempl< T >::thirdInvariant(), and SymmetricRankTwoTensorTempl< T >::timesTranspose().