Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
MathUtils.h File Reference

Various mathematical functions. More...

#include "arcane/utils/Math.h"
#include "arcane/utils/ArrayView.h"
#include "arcane/utils/NumericTypes.h"
#include "arcane/utils/Real2x2.h"
#include "arcane/utils/Real3.h"
#include "arcane/utils/Real2.h"
#include "arcane/core/Algorithm.h"
Include dependency graph for MathUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  Arcane
 -- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
namespace  Arcane::math
 Namespace for mathematical functions.

Functions

__host__ __device__ Real3 Arcane::math::vecMul (Real3 u, Real3 v)
 Vector cross product of u by v in \(R^3\).
__host__ __device__ Real Arcane::math::vecMul2D (Real3 u, Real3 v)
 Vector cross product of u by v in \(R^2\).
__host__ __device__ Real Arcane::math::cross2D (Real3 u, Real3 v)
 Vector cross product of u by v in \(R^2\).
__host__ __device__ Real Arcane::math::dot (Real2 u, Real2 v)
 Dot product of u by v in \(R^2\).
__host__ __device__ Real Arcane::math::scaMul (Real2 u, Real2 v)
 Dot product of u by v in \(R^2\).
__host__ __device__ Real Arcane::math::dot (Real3 u, Real3 v)
 Dot product of u by v.
__host__ __device__ Real Arcane::math::scaMul (Real3 u, Real3 v)
 Dot product of u by v.
__host__ __device__ Real Arcane::math::mixteMul (Real3 u, Real3 v, Real3 w)
 Mixed product of u, v and w.
__host__ __device__ Real Arcane::math::matDet (Real3 u, Real3 v, Real3 w)
 Determinant of the matrix u,v,w.
Real3x3 Arcane::math::prodTens (Real3 u, Real3 v)
 Tensor product of two Real3 vectors.
__host__ __device__ Real3 Arcane::math::prodTensVec (Real3x3 t, Real3 v)
 Matrix-vector product between a tensor and a vector.
__host__ __device__ Real2 Arcane::math::prodTensVec (Real2x2 t, Real2 v)
__host__ __device__ Real3 Arcane::math::prodVecTens (Real3 v, Real3x3 t)
 Transposed(vector) matrix product between the transpose of a vector and a matrix.
__host__ __device__ Real3x3 Arcane::math::matrixProduct (const Real3x3 &t, const Real3x3 &v)
 Matrix-matrix product between two tensors.
__host__ __device__ Real3x3 Arcane::math::transpose (const Real3x3 &t)
 Transpose the matrix.
__host__ __device__ Real3x3 Arcane::math::matrixTranspose (const Real3x3 &t)
 Transpose the matrix.
__host__ __device__ Real Arcane::math::doubleContraction (const Real3x3 &u, const Real3x3 &v)
__host__ __device__ Real Arcane::math::doubleContraction (const Real2x2 &u, const Real2x2 &v)
__host__ __device__ Real2 Arcane::math::min (Real2 a, Real2 b)
 Returns the minimum of two Real2.
__host__ __device__ Real3 Arcane::math::min (Real3 a, Real3 b)
 Returns the minimum of two Real3s.
__host__ __device__ Real2x2 Arcane::math::min (const Real2x2 &a, const Real2x2 &b)
 Returns the minimum of two Real2x2s.
__host__ __device__ Real3x3 Arcane::math::min (const Real3x3 &a, const Real3x3 &b)
 Returns the minimum of two Real3x3s.
template<class T>
Arcane::math::min (const T &a, const T &b, const T &c)
 Returns the minimum of three elements.
template<class T>
Arcane::math::max (const T &a, const T &b, const T &c)
 Returns the maximum of three elements.
__host__ __device__ Real2 Arcane::math::max (Real2 a, Real2 b)
 Returns the maximum of two Real2s.
__host__ __device__ Real3 Arcane::math::max (Real3 a, Real3 b)
 Returns the maximum of two Real3s.
__host__ __device__ Real2x2 Arcane::math::max (const Real2x2 &a, const Real2x2 &b)
 Returns the maximum of two Real2x2s.
__host__ __device__ Real3x3 Arcane::math::max (const Real3x3 &a, const Real3x3 &b)
 Returns the maximum of two Real3x3s.
__host__ __device__ Real Arcane::math::min4Real (Real a, Real b, Real c, Real d)
 Returns the minimum of four Reals.
__host__ __device__ Real Arcane::math::max4Real (Real a, Real b, Real c, Real d)
 Returns the maximum of four Reals.
__host__ __device__ Real Arcane::math::min8Real (const Real a[8])
 Returns the minimum of eight Reals.
Real Arcane::math::max8Real (const Real a[8])
 Returns the maximum of eight Reals.
__host__ __device__ Real Arcane::math::minMod (Real a, Real b, Real c, Real d)
 Returns the Min mod of four Reals.
__host__ __device__ Real Arcane::math::minMod2 (Real a, Real b)
 Returns the Min mod of two Reals.
__host__ __device__ Real Arcane::math::maxMod2 (Real a, Real b)
 Returns the Max mod of two Reals.
Real Arcane::math::relativeError (Real a, Real b)
 Returns the relative error between two scalars a and b.
Real Arcane::math::relativeError (const Real3x3 &T1, const Real3x3 &T2)
 Returns the relative error between two tensors T1 and T2.
Real Arcane::math::relativeError2 (Real a, Real b)
 Returns the relative error between two scalars a and b relative to b.
Real Arcane::math::relativeError1 (Real a, Real b)
 Returns the relative error between two scalars a and b relative to a.
bool Arcane::math::searchExtrema (ConstArrayView< Real2 > array, Real &xmin, Real &xmax, Real &ymin, Real &ymax, bool need_init)
 Searches for the extreme values of an array of pairs (x,y).
__host__ __device__ Real Arcane::math::matrixDeterminant (Real3x3 m)
 Calculates the determinant of a 3x3 matrix.
Real Arcane::math::normeR3 (Real3 v1)
 Norm of a vector.
__host__ __device__ Real3x3 Arcane::math::matrix3x3Id ()
 Identity matrix.
__host__ __device__ Real3x3 Arcane::math::inverseMatrix (const Real3x3 &m, Real d)
 Calculates the inverse of a matrix m assuming its determinant d is known.
__host__ __device__ Real3x3 Arcane::math::inverseMatrix (const Real3x3 &m)
 Calculates the inverse of a matrix m.
Real3 Arcane::math::crossProduct3 (Real3 v1, Real3 v2)
 Cross product of two 3-component vectors.
__host__ __device__ Real3 Arcane::math::cross (Real3 v1, Real3 v2)
 Cross product of two 3-component vectors.
__host__ __device__ Real3 Arcane::math::normalizeReal3 (Real3 v)
 Normalization of a Real3.
Real3 Arcane::math::normalizedCrossProduct3 (Real3 v1, Real3 v2)
 Normalized cross product.
Real3x3 Arcane::math::matrix3x3Transp (Real3x3 m)
Real3x3 Arcane::math::matrix3x3Prod (Real3x3 m1, Real3x3 m2)
 Multiplication of 2 3x3 matrices.
__host__ __device__ Real3 Arcane::math::multiply (const Real3x3 &m, Real3 v)
 3x3 matrix multiplied by a vector.
bool Arcane::math::isNearlyId (Real3x3 m, Real epsilon=1.e-10)
 Checks if a matrix is the identity matrix.
Real3 Arcane::math::planarSymmetric (Real3 u, Real3 n)
 Symmetry of a vector u with respect to a normal plane n.
Real3 Arcane::math::axisSymmetric (Real3 u, Real3 a)
 Symmetry of a vector u with respect to an axis defined by direction vector a.
template<typename T>
void Arcane::math::add (ArrayView< T > lhs, ConstArrayView< T > copy_array)
 Adds the array copy_array to the instance.
template<typename T>
void Arcane::math::add (ArrayView< T > lhs, ArrayView< T > copy_array)
 Adds the array copy_array to the instance.
template<typename T>
void Arcane::math::sub (ArrayView< T > lhs, ConstArrayView< T > copy_array)
 Subtracts the array copy_array from the instance.
template<typename T>
void Arcane::math::sub (ArrayView< T > lhs, ArrayView< T > copy_array)
 Subtracts the array copy_array from the instance.
template<typename T>
void Arcane::math::mult (ArrayView< T > lhs, ConstArrayView< T > copy_array)
 Multiplies the elements of the instance term-by-term by the elements of the array copy_array.
template<typename T>
void Arcane::math::mult (ArrayView< T > lhs, ArrayView< T > copy_array)
 Multiplies the elements of the instance term-by-term by the elements of the array copy_array.
template<typename T>
void Arcane::math::mult (ArrayView< T > lhs, T o)
 Multiplies all elements of the array by the real number o.
template<typename T>
void Arcane::math::power (ArrayView< T > lhs, T o)
 Raises all elements of the array to the power o.

Detailed Description

Various mathematical functions.

Definition in file MathUtils.h.