ABLATE Source Documentation  0.12.34
ablate::utilities::MathUtilities Class Reference

Public Types

enum class  Norm {
  L1 , L1_NORM , L2 , LINF ,
  L2_NORM
}
 

Static Public Member Functions

template<class I , class T >
static void ScaleVector (I dim, T *vec, T alpha)
 
template<class I , class T >
static void NormVector (I dim, T *vec)
 
template<class I , class T >
static bool VectorEquals (I dim, const T *test, const T *equal, T tolerance=1.0E-8)
 
template<class R , class T >
static bool Equals (R test, T equal, T tolerance=1.0E-8)
 
template<class I , class T >
static void NormVector (I dim, const T *in, T *out)
 
template<class I , class T >
static T MagVector (I dim, const T *in)
 
template<class I , class T >
static T DotVector (I dim, const T *a, const T *b)
 
template<int dim, class T >
static T DotVector (const T *a, const T *b)
 
template<class I , class T >
static T DiffDotVector (I dim, const T *aE, const T *aS, const T *b)
 
template<int dim, class T >
static T DiffDotVector (const T *aE, const T *aS, const T *b)
 
template<class I , class T >
static void CrossVector (I dim, const T *a, const T *b, T *c)
 
template<int dim, class T >
static void CrossVector ([[maybe_unused]] const T *a, [[maybe_unused]] const T *b, T *c)
 
template<class I , class T >
static void Subtract (I dim, const T *a, const T *b, T *c)
 
template<class I , class T >
static void Plus (I dim, const T *a, T *b)
 
template<class I , class T >
static void Multiply (I dim, const T a[3][3], const T *in, T *out)
 
template<class I , class T >
static void MultiplyTranspose (I dim, const T a[3][3], const T *in, T *out)
 
static void ComputeTransformationMatrix (PetscInt dim, const PetscScalar normal[3], PetscScalar transformationMatrix[3][3])
 
static PetscReal ComputeDeterminant (PetscInt dim, PetscScalar transformationMatrix[3][3])
 
static PetscErrorCode ComputeNorm (Norm normType, Vec x, Vec y, PetscReal norm[])
 

Member Enumeration Documentation

◆ Norm

Enum types for the compute norm function

Member Function Documentation

◆ ComputeDeterminant()

PetscReal ablate::utilities::MathUtilities::ComputeDeterminant ( PetscInt  dim,
PetscScalar  transformationMatrix[3][3] 
)
static

Computes the determinant of square matrix up to size 3 is always the normal direction

Parameters
dim
normal
transformationMatrix[row, col]

◆ ComputeNorm()

PetscErrorCode ablate::utilities::MathUtilities::ComputeNorm ( Norm  normType,
Vec  x,
Vec  y,
PetscReal  norm[] 
)
static

Computes the specified norm between x and y. Note that y is used for scratch space and may be override

Parameters
normType
x
y
norm,thenorm must be the same size as the block size of x/y
Returns

◆ ComputeTransformationMatrix()

void ablate::utilities::MathUtilities::ComputeTransformationMatrix ( PetscInt  dim,
const PetscScalar  normal[3],
PetscScalar  transformationMatrix[3][3] 
)
static

Computes the transformation matrix from the global Cartesian system to a normal coordinate system. The first component of the transformed system is always the normal direction

Parameters
dim
normal
transformationMatrix[row, col]

◆ CrossVector() [1/2]

template<int dim, class T >
static void ablate::utilities::MathUtilities::CrossVector ( [[maybe_unused] ] const T *  a,
[[maybe_unused] ] const T *  b,
T *  c 
)
inlinestatic

Take the cross of c = a x b for a fixed size

Template Parameters
I
T
Parameters
dim
a
b
c

◆ CrossVector() [2/2]

template<class I , class T >
static void ablate::utilities::MathUtilities::CrossVector ( dim,
const T *  a,
const T *  b,
T *  c 
)
inlinestatic

Take the cross of c = a x b

Template Parameters
I
T
Parameters
dim
a
b
c

◆ DiffDotVector() [1/2]

template<int dim, class T >
static T ablate::utilities::MathUtilities::DiffDotVector ( const T *  aE,
const T *  aS,
const T *  b 
)
inlinestatic

Compute the vector and take the resulting dot product result = (aE - aS) * b

Template Parameters
I
T
Parameters
dim
a
b
Returns

◆ DiffDotVector() [2/2]

template<class I , class T >
static T ablate::utilities::MathUtilities::DiffDotVector ( dim,
const T *  aE,
const T *  aS,
const T *  b 
)
inlinestatic

Compute the vector and take the resulting dot product result = (aE - aS) * b

Template Parameters
I
T
Parameters
dim
a
b
Returns

◆ Multiply()

template<class I , class T >
static void ablate::utilities::MathUtilities::Multiply ( dim,
const T  a[3][3],
const T *  in,
T *  out 
)
inlinestatic

matrix vector multiplication returns out = [A]*in 1st index in A is row, 2nd is col

Parameters
dim
transformationMatrix

◆ MultiplyTranspose()

template<class I , class T >
static void ablate::utilities::MathUtilities::MultiplyTranspose ( dim,
const T  a[3][3],
const T *  in,
T *  out 
)
inlinestatic

matrix transpose vector multiplication returns out = [A]^T *in 1st index in A is row, 2nd is col

Parameters
dim
transformationMatrix

◆ Plus()

template<class I , class T >
static void ablate::utilities::MathUtilities::Plus ( dim,
const T *  a,
T *  b 
)
inlinestatic

adds a to b; b = a+b

Template Parameters
I
T
Parameters
dim
a
b

◆ Subtract()

template<class I , class T >
static void ablate::utilities::MathUtilities::Subtract ( dim,
const T *  a,
const T *  b,
T *  c 
)
inlinestatic

subtract so that c = a - b

Template Parameters
I
T
Parameters
dim
a
b

The documentation for this class was generated from the following files: