MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
maiamath.h File Reference

Go to the source code of this file.

Namespaces

namespace  maia
 Namespace for auxiliary functions/classes.
 
namespace  maia::math
 

Functions

void maia::math::quickSortImpl (MInt *a, MInt start, MInt end)
 
void maia::math::quickSort (MInt *a, MInt start, MInt end)
 
template<MInt nDim, typename T , typename U >
T * maia::math::vecAdd (T *const result, const U *const a)
 Linear Algebra. More...
 
template<MInt nDim, typename T , typename U , typename... Ts>
T * maia::math::vecAdd (T *const result, const U *const a, const Ts... b)
 
template<MInt nDim, typename T , typename... Ts>
void maia::math::vecAvg (T *const M, const Ts *const ... args)
 Computes the arithmetic mean of an arbritary number of vectors of dimension nDim and returns it in M. More...
 
template<typename T >
void maia::math::cross (const T *const u, const T *const v, T *const c)
 
template<typename T >
std::array< T, 3 > maia::math::cross (const std::array< T, 3 > &u, const std::array< T, 3 > &v)
 
template<typename T >
maia::math::cross (const std::array< T, 2 > &u, const std::array< T, 2 > &v)
 
template<typename T >
T * maia::math::cross (const T(&u)[3], const T(&v)[3])
 
template<typename T >
maia::math::cross (const T(&u)[2], const T(&v)[2])
 
template<typename T , std::size_t N>
MFloat maia::math::norm (const std::array< T, N > &u)
 
template<typename T >
MFloat maia::math::norm (const T *const u, const MInt N)
 
template<typename T , std::size_t N>
void maia::math::normalize (std::array< T, N > &u)
 
template<typename T >
void maia::math::normalize (T *const u, const MInt N)
 
template<typename T , std::size_t N>
std::array< T, N > maia::math::normalized (const std::array< T, N > &u)
 
template<MInt nDim>
MFloat maia::math::distance (const MFloat *a, const MFloat *b)
 
MFloat maia::math::distance (const std::array< MFloat, 2 > a, const std::array< MFloat, 2 > b)
 
MFloat maia::math::distance (const std::array< MFloat, 3 > a, const std::array< MFloat, 3 > b)
 
MFloat maia::math::distance (const MFloat *const a, const std::array< MFloat, 2 > b)
 
MFloat maia::math::distance (const MFloat *const a, const std::array< MFloat, 3 > b)
 
MFloat maia::math::distance (const std::array< MFloat, 2 > a, const MFloat *const b)
 
MFloat maia::math::distance (std::array< MFloat, 3 > a, const MFloat *const b)
 
void maia::math::multiplyMatricesSq (MFloatScratchSpace &m1, MFloatScratchSpace &m2, MFloatScratchSpace &result, MInt dim)
 
void maia::math::multiplyMatrices (MFloatScratchSpace &m1, MFloatScratchSpace &m2, MFloatScratchSpace &result, MInt m1_n, MInt m1_m, MInt m2_n, MInt m2_m)
 
void maia::math::addMatrices (MFloatScratchSpace &m1, MFloatScratchSpace &m2, MFloatScratchSpace &result, MInt dim1, MInt dim2)
 
MFloat maia::math::frobeniusMatrixNormSquared (MFloatScratchSpace &m, MInt dim1, MInt dim2)
 
MFloat maia::math::frobeniusMatrixNorm (MFloatScratchSpace &m, MInt dim1, MInt dim2)
 
MFloat maia::math::besselJ0 (MFloat x)
 
MFloat maia::math::besselJ1 (MFloat x)
 
MFloat maia::math::besselJi (MInt order, MFloat x)
 
MFloat maia::math::lincos (MFloat arg)
 
void maia::math::sortEigenVectors (MFloat A[3][3], MFloat w[3])
 Sorts the eigenvalues and the associated eigenvectors from large to small. More...
 
void maia::math::quatMult (const MFloat *const qA, const MFloat *const qB, MFloat *const qC)
 
template<typename T >
MInt maia::math::sgn (T val)
 
MFloat maia::math::crankAngle (const MFloat time, const MFloat Strouhal, const MFloat offset, const MInt mode)
 help-function for engine calculations which returns the crank-angle for a given time, Strouhals-number and crank-angle offset mode = 0: return CAD in range of (0-720) mode = 1: return accumulated crankAnge in radian More...
 
void maia::math::computeRotationMatrix (MFloatScratchSpace &R, MFloat *q)
 rotation matrix co-rotating(~inertial) frame -> body-fixed frame More...
 
void maia::math::rotation2quaternion (MFloat *rotation, MFloat *quaternion)
 
void maia::math::matrixVectorProduct (MFloat *c, MFloatScratchSpace &A, MFloat *b)
 c=A*b More...
 
void maia::math::matrixVectorProductTranspose (MFloat *c, MFloatScratchSpace &A, MFloat *b)
 c=A^t*b More...
 
MInt maia::math::inverse (MFloat **a, MFloat **ainv, MInt n, const MFloat epsilon)
 
MInt maia::math::quickSortPartition (MInt *a, MInt start, MInt end)
 
MInt maia::math::removeDoubleEntries (MInt *a, MInt size)
 
void maia::math::calculateLegendrePolyAndDeriv (MInt Nmax, MFloat x, MFloat *polynomial, MFloat *derivative)
 Evaluates the Legendre polynomial and its derivative of degree Nmax at point x. More...
 
void maia::math::calculateLegendreGaussNodesAndWeights (MInt Nmax, MFloat *nodes, MFloat *wInt)
 Calculate the Gauss integration nodes and weight for the Legendre polynomials on the interval [-1,1]. More...
 
MFloat maia::math::RBF (const MFloat R, const MFloat R0)
 radial base function More...
 
MFloat maia::math::deltaFun (const MFloat r, const MFloat r0, const MFloat r1)
 
std::vector< MFloatmaia::math::linSpace (const MFloat start, const MFloat end, const MInt num)
 
MFloat maia::math::getSector (MFloat y, MFloat z, MFloat azimuthalAngle)
 
MFloat maia::math::getAngle (MFloat y, MFloat z)
 
template<typename T , std::size_t N>
MFloat maia::math::determinant (std::array< T, N > &m)
 
template<typename T , std::size_t N>
MFloat maia::math::determinant (std::array< std::array< T, N >, N > &m)
 
void maia::math::invert (MFloat *A, const MInt m, const MInt n)
 
template<class T >
void maia::math::invert (T &A, T &AInv, const MInt m, const MInt n)
 
template<class T >
void maia::math::invert (T &A, T &weights, T &AInv, const MInt m, const MInt n)
 
template<class T >
MInt maia::math::invertR (T &A, T &weights, T &AInv, const MInt m, const MInt n)
 
void maia::math::solveDenseMatrix (MFloat *A_coeff, MInt **pos, const MInt n, const MInt m, MFloat *b, MFloat *x)
 
void maia::math::solveSparseMatrixIterative (MFloat *A_coeff, MInt **pos, const MInt n, const MInt m, MFloat *b, MFloat *x)
 
void maia::math::solveSparseMatrix (MFloat *A_coeff, MInt **pos, const MInt n, const MInt m, MFloat *b, MFloat *x)
 
void maia::math::multiplySparseMatrixVector (MFloat *A_coeff, MInt **pos, const MInt n, const MInt m, MFloat *b, MFloat *x)
 
void maia::math::calcEigenValues (MFloat A[3][3], MFloat w[3])
 
void maia::math::calcEigenValues (MFloat **A_in, MFloat *lambda_in, const MInt m)
 
void maia::math::calcEigenVectors (MFloat A[3][3], MFloat Q[3][3], MFloat w[3])
 
template<MInt nDim>
void maia::math::solveQR (std::array< std::array< MFloat, nDim >, nDim > &A_, std::array< MFloat, nDim > &b_)
 
template<typename T , std::size_t N>
void maia::math::adjointRow (std::array< std::array< T, N >, N > &m, std::array< T, N > &A, const MInt r)
 
template<typename T >
void maia::math::adjoint1stRow4x4 (std::array< std::array< T, 4 >, 4 > &m, std::array< T, 4 > &A)
 
template<typename T , std::size_t N>
void maia::math::adjoint1stRow (std::array< std::array< T, N >, N > &m, std::array< T, N > &A)
 
std::vector< MFloatmaia::math::svd (MFloat *const A, MFloat *const b, const MInt m, const MInt n, MFloat *const x)