Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
math Module Reference

Data Types

interface  abscmp
 
interface  flipv
 
interface  relcmp
 
interface  reord
 
interface  sort
 
interface  swap
 

Functions/Subroutines

pure logical function, public sabscmp (x, y, tol)
 Return single precision absolute comparison \( | x - y | < \epsilon \).
 
pure logical function, public dabscmp (x, y, tol)
 Return double precision absolute comparison \( | x - y | < \epsilon \).
 
pure logical function srelcmp (x, y, eps)
 Return single precision relative comparison \( | x - y |<= \epsilon*|y| \).
 
pure logical function drelcmp (x, y, eps)
 Return double precision relative comparison \( | x - y |/|y| < \epsilon \).
 
pure real(kind=rp) function, public lambert_w0 (x, niter)
 Approximate the principal real branch of the Lambert W function for non-negative real x.
 
subroutine, public rzero (a, n)
 Zero a real vector.
 
subroutine, public izero (a, n)
 Zero an integer vector.
 
subroutine, public row_zero (a, m, n, e)
 Sets row e to 0 in matrix a.
 
subroutine, public rone (a, n)
 Set all elements to one.
 
subroutine, public copy (a, b, n)
 Copy a vector \( a = b \).
 
subroutine, public masked_copy_0 (a, b, mask, n, n_mask)
 Copy a masked vector \( a(mask) = b(mask) \).
 
subroutine, public masked_copy (a, b, mask, n, n_mask)
 Copy a masked vector \( a(mask) = b(mask) \).
 
subroutine, public masked_gather_copy_0 (a, b, mask, n, n_mask)
 Gather a masked vector to reduced contigous vector \( a = b(mask) \).
 
subroutine, public face_masked_gather_copy_0 (a, b, mask, facet, lx, ly, lz, n_mask)
 Gather values from a face-local SEM field to a reduced contiguous vector.
 
subroutine, public masked_gather_copy (a, b, mask, n, n_mask)
 Gather a masked vector to reduced contigous vector \( a = b(mask) \).
 
subroutine, public masked_scatter_copy_0 (a, b, mask, n, n_mask)
 Scatter a contigous vector to masked positions in a target array \( a(mask) = b \).
 
subroutine, public masked_scatter_copy (a, b, mask, n, n_mask)
 Scatter a contigous vector to masked positions in a target array \( a(mask) = b \).
 
subroutine, public cfill_mask (a, c, n, mask, n_mask)
 Fill a constant to a masked vector. \( a_i = c, for i in mask \).
 
subroutine, public cmult (a, c, n)
 Multiplication by constant c \( a = c \cdot a \).
 
subroutine, public cmult2 (a, b, c, n)
 Multiplication by constant c \( a = c \cdot b \).
 
subroutine, public cdiv (a, c, n)
 Division of constant c by elements of a \( a = c / a \).
 
subroutine, public cdiv2 (a, b, c, n)
 Division of constant c by elements of a \( a = c / b \).
 
subroutine, public cadd (a, s, n)
 Add a scalar to vector \( a_i = a_i + s \).
 
subroutine, public cadd2 (a, b, s, n)
 Add a scalar to vector \( a_i = b_i + s \).
 
subroutine, public cfill (a, c, n)
 Set all elements to a constant c \( a = c \).
 
subroutine, public cwrap (a, min_val, max_val, n)
 Wrap value around a range [min, max)
 
real(kind=rp) function, public glsum (a, n)
 Sum a vector of length n.
 
real(kind=rp) function, public glmax (a, n)
 Max of a vector of length n.
 
real(kind=rp) function, public glamax (a, n)
 Max of the absolute value of a vector of length n.
 
integer function, public glimax (a, n)
 Max of an integer vector of length n.
 
real(kind=rp) function, public glmin (a, n)
 Min of a vector of length n.
 
integer function, public glimin (a, n)
 Min of an integer vector of length n.
 
subroutine, public chsign (a, n)
 Change sign of vector \( a = -a \).
 
real(kind=rp) function, public vlamax (vec, n)
 maximum absolute value of a vector of length n, rank-local
 
real(kind=rp) function, public vlmax (vec, n)
 maximum value of a vector of length n
 
real(kind=rp) function, public vlmin (vec, n)
 minimun value of a vector of length n
 
subroutine, public invcol1 (a, n)
 Invert a vector \( a = 1 / a \).
 
subroutine, public invcol3 (a, b, c, n)
 Invert a vector \( a = b / c \).
 
subroutine, public invers2 (a, b, n)
 Compute inverted vector \( a = 1 / b \).
 
subroutine, public vcross (u1, u2, u3, v1, v2, v3, w1, w2, w3, n)
 Compute a cross product \( u = v \times w \) assuming vector components \( u = (u_1, u_2, u_3) \) etc.
 
subroutine, public vdot2 (dot, u1, u2, v1, v2, n)
 Compute a dot product \( dot = u \cdot v \) (2-d version) assuming vector components \( u = (u_1, u_2, u_3) \) etc.
 
subroutine, public vdot3 (dot, u1, u2, u3, v1, v2, v3, n)
 Compute a dot product \( dot = u \cdot v \) (3-d version) assuming vector components \( u = (u_1, u_2, u_3) \) etc.
 
real(kind=rp) function, public vlsc3 (u, v, w, n)
 Compute multiplication sum \( dot = u \cdot v \cdot w \).
 
real(kind=rp) function, public vlsc2 (u, v, n)
 Compute multiplication sum \( dot = u \cdot v \).
 
subroutine, public add2 (a, b, n)
 Vector addition \( a = a + b \).
 
subroutine, public add3 (a, b, c, n)
 Vector addition \( a = b + c \).
 
subroutine, public add4 (a, b, c, d, n)
 Vector addition \( a = b + c + d\).
 
subroutine, public sub2 (a, b, n)
 Vector substraction \( a = a - b \).
 
subroutine, public sub3 (a, b, c, n)
 Vector subtraction \( a = b - c \).
 
subroutine, public add2s1 (a, b, c1, n)
 Vector addition with scalar multiplication \( a = c_1 a + b \) (multiplication on first argument)
 
subroutine, public add2s2 (a, b, c1, n)
 Vector addition with scalar multiplication \( a = a + c_1 b \) (multiplication on second argument)
 
subroutine, public addsqr2s2 (a, b, c1, n)
 Returns \( a = a + c1 * (b * b )\).
 
subroutine, public invcol2 (a, b, n)
 Vector division \( a = a / b \).
 
subroutine, public col2 (a, b, n)
 Vector multiplication \( a = a \cdot b \).
 
subroutine, public col3 (a, b, c, n)
 Vector multiplication with 3 vectors \( a = b \cdot c \).
 
subroutine, public subcol3 (a, b, c, n)
 Returns \( a = a - b*c \).
 
subroutine, public add3s2 (a, b, c, c1, c2, n)
 Returns \( a = c1 * b + c2 * c \).
 
subroutine, public add4s3 (a, b, c, d, c1, c2, c3, n)
 Returns \( a = c1 * b + c2 * c + c3 * d \).
 
subroutine, public add5s4 (a, b, c, d, e, c1, c2, c3, c4, n)
 Returns \( a = a + c1 * b + c2 * c + c3 * d + c4 * e\).
 
subroutine, public subcol4 (a, b, c, d, n)
 Returns \( a = a - b*c*d \).
 
subroutine, public addcol3 (a, b, c, n)
 Returns \( a = a + b*c \).
 
subroutine, public addcol4 (a, b, c, d, n)
 Returns \( a = a + b*c*d \).
 
subroutine, public addcol3s2 (a, b, c, s, n)
 Returns \( a = a + s(b*c) \).
 
subroutine, public ascol5 (a, b, c, d, e, n)
 Returns \( a = b \dot c - d \cdot e \).
 
subroutine, public p_update (a, b, c, c1, c2, n)
 Returns \( a = b \dot c1 ( a - c2 \cdot c )\).
 
subroutine, public x_update (a, b, c, c1, c2, n)
 Returns \( a = b \dot c1 ( a - c2 \cdot c )\).
 
real(kind=rp) function, public glsc2 (a, b, n)
 Weighted inner product \( a^T b \).
 
real(kind=rp) function, public glsc3 (a, b, c, n)
 Weighted inner product \( a^T b c \).
 
real(kind=rp) function, public glsc4 (a, b, c, d, n)
 
real(kind=rp) function, public glsubnorm (a, b, n)
 Returns the norm of the difference of two vectors \( \sqrt{(a-b)^T (a-b)} \).
 
subroutine sortrp (a, ind, n)
 Heap Sort for double precision arrays.
 
subroutine sorti4 (a, ind, n)
 Heap Sort for single integer arrays.
 
subroutine swapdp (b, ind, n)
 sort double precision array acording to ind vector
 
subroutine swapi4 (b, ind, n)
 sort single integer array acording to ind vector
 
subroutine reorddp (b, ind, n)
 reorder double precision array - inverse of swap
 
subroutine reordi4 (b, ind, n)
 reorder single integer array - inverse of swap
 
subroutine flipvdp (b, ind, n)
 Flip double precision vector b and ind.
 
subroutine flipvi4 (b, ind, n)
 Flip single integer vector b and ind.
 
subroutine, public absval (a, n)
 Take the absolute value of an array.
 
subroutine, public pwmax2 (a, b, n)
 Point-wise maximum of two vectors \( a = \max(a, b) \).
 
subroutine, public pwmax3 (a, b, c, n)
 Point-wise maximum of two vectors \( a = \max(b, c) \).
 
subroutine, public cpwmax2 (a, b, n)
 Point-wise maximum of scalar and vector \( a = \max(a, b) \).
 
subroutine, public cpwmax3 (a, b, c, n)
 Point-wise maximum of scalar and vector \( a = \max(b, c) \).
 
subroutine, public pwmin2 (a, b, n)
 Point-wise minimum of two vectors \( a = \min(a, b) \).
 
subroutine, public pwmin3 (a, b, c, n)
 Point-wise minimum of two vectors \( a = \min(b, c) \).
 
subroutine, public cpwmin2 (a, b, n)
 Point-wise minimum of scalar and vector \( a = \min(a, b) \).
 
subroutine, public cpwmin3 (a, b, c, n)
 Point-wise minimum of scalar and vector \( a = \min(b, c) \).
 
real(rp) function, dimension(3, 3), public matinv39 (a11, a12, a13, a21, a22, a23, a31, a32, a33)
 
real(kind=xp) function, dimension(3, 3), public matinv3 (a)
 Performs a direct calculation of the inverse of a 3×3 matrix. M33INV and M44INV by David G. Simpson pure function version from https://fortranwiki.org/fortran/show/Matrix+inversion Invert 3x3 matrix.
 
real(kind=rp) function, public math_stepf (x)
 Smooth step function S(x) Returns 0 for x <= 0, 1 for x >= 1, and smooth transition in between.
 
real(kind=rp) function, public math_dstepf (x)
 Derivative of math_stepf with respect to x: d(stepf)/dx.
 
subroutine, public sqrt_inplace (a, n)
 Sqrt a vector \( a = sqrt(a) \).
 
subroutine, public power (ap, a, p, n)
 Take the power of a vector \( a^p \).
 
pure subroutine, public eig_sym2 (a11, a22, a12, e1, e2)
 Eigenvalues of a symmetric 2x2 matrix, descending.
 
pure subroutine, public eig_sym3 (a11, a22, a33, a12, a13, a23, e1, e2, e3)
 Eigenvalues of a symmetric 3x3 matrix, descending.
 

Variables

real(kind=rp), parameter, public neko_eps = epsilon(1.0_rp)
 Machine epsilon \( \epsilon \).
 
real(kind=dp), parameter, public neko_eps_dp = epsilon(1.0_dp)
 
real(kind=sp), parameter, public neko_eps_sp = epsilon(1.0_sp)
 
real(kind=rp), parameter, public neko_m_ln2 = log(2.0_rp)
 \( ln(2) \)
 
real(kind=rp), parameter, public pi = 4._rp*atan(1._rp)
 \( \pi \)
 

Function/Subroutine Documentation

◆ absval()

subroutine, public math::absval ( real(kind=rp), dimension(n), intent(inout)  a,
integer, intent(in)  n 
)
Parameters
[in,out]avector to be manipulated
[in]narray size

Definition at line 1688 of file math.F90.

Here is the caller graph for this function:

◆ add2()

subroutine, public math::add2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 948 of file math.F90.

Here is the caller graph for this function:

◆ add2s1()

subroutine, public math::add2s1 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  c1,
integer, intent(in)  n 
)

Definition at line 1029 of file math.F90.

Here is the caller graph for this function:

◆ add2s2()

subroutine, public math::add2s2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  c1,
integer, intent(in)  n 
)

Definition at line 1046 of file math.F90.

Here is the caller graph for this function:

◆ add3()

subroutine, public math::add3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 963 of file math.F90.

Here is the caller graph for this function:

◆ add3s2()

subroutine, public math::add3s2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), intent(in)  c1,
real(kind=rp), intent(in)  c2,
integer, intent(in)  n 
)

Definition at line 1141 of file math.F90.

Here is the caller graph for this function:

◆ add4()

subroutine, public math::add4 ( real(kind=rp), dimension(n), intent(out)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), dimension(n), intent(in)  d,
integer, intent(in)  n 
)

Definition at line 979 of file math.F90.

Here is the caller graph for this function:

◆ add4s3()

subroutine, public math::add4s3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), dimension(n), intent(in)  d,
real(kind=rp), intent(in)  c1,
real(kind=rp), intent(in)  c2,
real(kind=rp), intent(in)  c3,
integer, intent(in)  n 
)

Definition at line 1158 of file math.F90.

Here is the caller graph for this function:

◆ add5s4()

subroutine, public math::add5s4 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), dimension(n), intent(in)  d,
real(kind=rp), dimension(n), intent(in)  e,
real(kind=rp), intent(in)  c1,
real(kind=rp), intent(in)  c2,
real(kind=rp), intent(in)  c3,
real(kind=rp), intent(in)  c4,
integer, intent(in)  n 
)

Definition at line 1176 of file math.F90.

◆ addcol3()

subroutine, public math::addcol3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1212 of file math.F90.

Here is the caller graph for this function:

◆ addcol3s2()

subroutine, public math::addcol3s2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), intent(in)  s,
integer, intent(in)  n 
)

Definition at line 1245 of file math.F90.

Here is the caller graph for this function:

◆ addcol4()

subroutine, public math::addcol4 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), dimension(n), intent(in)  d,
integer, intent(in)  n 
)

Definition at line 1228 of file math.F90.

Here is the caller graph for this function:

◆ addsqr2s2()

subroutine, public math::addsqr2s2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  c1,
integer, intent(in)  n 
)

Definition at line 1062 of file math.F90.

Here is the caller graph for this function:

◆ ascol5()

subroutine, public math::ascol5 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), dimension(n), intent(in)  d,
real(kind=rp), dimension(n), intent(in)  e,
integer, intent(in)  n 
)

Definition at line 1262 of file math.F90.

◆ cadd()

subroutine, public math::cadd ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  s,
integer, intent(in)  n 
)

Definition at line 579 of file math.F90.

Here is the caller graph for this function:

◆ cadd2()

subroutine, public math::cadd2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  s,
integer, intent(in)  n 
)

Definition at line 594 of file math.F90.

Here is the caller graph for this function:

◆ cdiv()

subroutine, public math::cdiv ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 548 of file math.F90.

◆ cdiv2()

subroutine, public math::cdiv2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 563 of file math.F90.

◆ cfill()

subroutine, public math::cfill ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 610 of file math.F90.

Here is the caller graph for this function:

◆ cfill_mask()

subroutine, public math::cfill_mask ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  c,
integer, intent(in)  n,
integer, dimension(n_mask), intent(in)  mask,
integer, intent(in)  n_mask 
)

Definition at line 501 of file math.F90.

Here is the caller graph for this function:

◆ chsign()

subroutine, public math::chsign ( real(kind=rp), dimension(n), intent(inout)  a,
integer, intent(in)  n 
)

Definition at line 759 of file math.F90.

Here is the caller graph for this function:

◆ cmult()

subroutine, public math::cmult ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 517 of file math.F90.

Here is the caller graph for this function:

◆ cmult2()

subroutine, public math::cmult2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 532 of file math.F90.

Here is the caller graph for this function:

◆ col2()

subroutine, public math::col2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1094 of file math.F90.

Here is the caller graph for this function:

◆ col3()

subroutine, public math::col3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1109 of file math.F90.

Here is the caller graph for this function:

◆ copy()

subroutine, public math::copy ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 304 of file math.F90.

Here is the caller graph for this function:

◆ cpwmax2()

subroutine, public math::cpwmax2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1735 of file math.F90.

Here is the caller graph for this function:

◆ cpwmax3()

subroutine, public math::cpwmax3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1750 of file math.F90.

Here is the caller graph for this function:

◆ cpwmin2()

subroutine, public math::cpwmin2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1796 of file math.F90.

Here is the caller graph for this function:

◆ cpwmin3()

subroutine, public math::cpwmin3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1811 of file math.F90.

Here is the caller graph for this function:

◆ cwrap()

subroutine, public math::cwrap ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), intent(in)  min_val,
real(kind=rp), intent(in)  max_val,
integer, intent(in)  n 
)

Definition at line 625 of file math.F90.

Here is the caller graph for this function:

◆ dabscmp()

pure logical function, public math::dabscmp ( real(kind=dp), intent(in)  x,
real(kind=dp), intent(in)  y,
real(kind=dp), intent(in), optional  tol 
)

Definition at line 144 of file math.F90.

Here is the caller graph for this function:

◆ drelcmp()

pure logical function math::drelcmp ( real(kind=dp), intent(in)  x,
real(kind=dp), intent(in)  y,
real(kind=dp), intent(in), optional  eps 
)
private

Definition at line 192 of file math.F90.

Here is the caller graph for this function:

◆ eig_sym2()

pure subroutine, public math::eig_sym2 ( real(kind=dp), intent(in)  a11,
real(kind=dp), intent(in)  a22,
real(kind=dp), intent(in)  a12,
real(kind=dp), intent(out)  e1,
real(kind=dp), intent(out)  e2 
)
Parameters
a11Diagonal entry (1,1).
a22Diagonal entry (2,2).
a12Off-diagonal entry.
e1The larger eigenvalue.
e2The smaller eigenvalue.

Definition at line 1961 of file math.F90.

◆ eig_sym3()

pure subroutine, public math::eig_sym3 ( real(kind=dp), intent(in)  a11,
real(kind=dp), intent(in)  a22,
real(kind=dp), intent(in)  a33,
real(kind=dp), intent(in)  a12,
real(kind=dp), intent(in)  a13,
real(kind=dp), intent(in)  a23,
real(kind=dp), intent(out)  e1,
real(kind=dp), intent(out)  e2,
real(kind=dp), intent(out)  e3 
)

Closed form via the characteristic polynomial of the deviatoric part, which avoids an iterative solve for what is a per quadrature point diagnostic. A diagonal matrix is handled by the general path and comes back exact; only the isotropic case is special, because the deviatoric scaling is singular there.

Note
The smallest root is a difference of terms of order \( \lambda_{max} \), so its relative accuracy degrades as \( \epsilon \kappa \) – about 1e-10 at the 1e6 condition numbers this is used to detect, which is ample for a threshold test but would not be if \( \kappa \) approached \( 1/\epsilon \). That is why this works in double regardless of what rp is: in a single precision build the same amplification against \( \epsilon_{sp} \) would put a 6% error on \( \kappa \) at 1e6 and lose it entirely near 1e7, exactly where the answer matters most.
Both call sites in coef_metric_condition() pass a matrix scaled to unit magnitude: the geometric factors divided by their largest entry, and the same factors Jacobi scaled to a unit diagonal. The latter is exactly the identity for an orthogonal element, which is why the isotropic branch above is not merely defensive.
Parameters
a11Diagonal entry (1,1).
a22Diagonal entry (2,2).
a33Diagonal entry (3,3).
a12Off-diagonal entry (1,2).
a13Off-diagonal entry (1,3).
a23Off-diagonal entry (2,3).
e1The largest eigenvalue.
e2The intermediate eigenvalue.
e3The smallest eigenvalue.

Definition at line 2012 of file math.F90.

◆ face_masked_gather_copy_0()

subroutine, public math::face_masked_gather_copy_0 ( real(kind=rp), dimension(n_mask), intent(inout)  a,
real(kind=rp), dimension(:, :, :, :), intent(in)  b,
integer, dimension(0:n_mask), intent(in)  mask,
integer, dimension(0:n_mask), intent(in)  facet,
integer, intent(in)  lx,
integer, intent(in)  ly,
integer, intent(in)  lz,
integer, intent(in)  n_mask 
)
Parameters
aDestination array of size n_mask.
bSource face-local array indexed as b(:, :, facet, element).
maskMask array of length n_mask + 1, where mask(0) = n_mask.
facetFacet ids associated with the masked points.
lxNumber of points in the first SEM direction.
lyNumber of points in the second SEM direction.
lzNumber of points in the third SEM direction.
n_maskSize of the mask and destination arrays.

Definition at line 398 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ flipvdp()

subroutine math::flipvdp ( real(kind=rp), dimension(n), intent(inout)  b,
integer, dimension(n), intent(inout)  ind,
integer, intent(in)  n 
)
private
Parameters
[in,out]bvector to be reordered
[in,out]indpermutation array
[in]narray size

Definition at line 1629 of file math.F90.

◆ flipvi4()

subroutine math::flipvi4 ( integer(i4), dimension(n), intent(inout)  b,
integer, dimension(n), intent(inout)  ind,
integer, intent(in)  n 
)
private
Parameters
[in,out]bvector to be reordered
[in,out]indpermutation array
[in]narray size

Definition at line 1659 of file math.F90.

◆ glamax()

real(kind=rp) function, public math::glamax ( real(kind=rp), dimension(n)  a,
integer, intent(in)  n 
)

Returns \( \max_i |a_i| \) reduced over all ranks.

Definition at line 683 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glimax()

integer function, public math::glimax ( integer, dimension(n)  a,
integer, intent(in)  n 
)

Definition at line 702 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glimin()

integer function, public math::glimin ( integer, dimension(n)  a,
integer, intent(in)  n 
)

Definition at line 740 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glmax()

real(kind=rp) function, public math::glmax ( real(kind=rp), dimension(n)  a,
integer, intent(in)  n 
)

Definition at line 663 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glmin()

real(kind=rp) function, public math::glmin ( real(kind=rp), dimension(n)  a,
integer, intent(in)  n 
)

Definition at line 721 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glsc2()

real(kind=rp) function, public math::glsc2 ( real(kind=rp), dimension(n), intent(in)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1314 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glsc3()

real(kind=rp) function, public math::glsc3 ( real(kind=rp), dimension(n), intent(in)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1335 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glsc4()

real(kind=rp) function, public math::glsc4 ( real(kind=rp), dimension(n), intent(in)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), dimension(n), intent(in)  d,
integer, intent(in)  n 
)

Definition at line 1356 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glsubnorm()

real(kind=rp) function, public math::glsubnorm ( real(kind=rp), dimension(n), intent(in)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1381 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ glsum()

real(kind=rp) function, public math::glsum ( real(kind=rp), dimension(n)  a,
integer, intent(in)  n 
)

Definition at line 642 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ invcol1()

subroutine, public math::invcol1 ( real(kind=rp), dimension(n), intent(inout)  a,
integer, intent(in)  n 
)

Definition at line 819 of file math.F90.

Here is the caller graph for this function:

◆ invcol2()

subroutine, public math::invcol2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1078 of file math.F90.

Here is the caller graph for this function:

◆ invcol3()

subroutine, public math::invcol3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 833 of file math.F90.

Here is the caller graph for this function:

◆ invers2()

subroutine, public math::invers2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 848 of file math.F90.

Here is the caller graph for this function:

◆ izero()

subroutine, public math::izero ( integer, dimension(n), intent(inout)  a,
integer, intent(in)  n 
)

Definition at line 262 of file math.F90.

◆ lambert_w0()

pure real(kind=rp) function, public math::lambert_w0 ( real(kind=rp), intent(in)  x,
integer, intent(in)  niter 
)

The reference is Iacono and Boyd, DOI: 10.1007/s10444-017-9530-3 The iterative algorithm converges very fast, and 1 iteration is typically sufficient.

Definition at line 227 of file math.F90.

Here is the caller graph for this function:

◆ masked_copy()

subroutine, public math::masked_copy ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, dimension(n_mask)  mask,
integer, intent(in)  n,
integer, intent(in)  n_mask 
)
Parameters
aDestination array of size n.
bSource array of size n.
maskMask array of length n_mask + 1, where mask(0) = n_mask the length of the mask array.
nSize of the arrays a and b.
n_maskSize of the mask array mask.

Definition at line 348 of file math.F90.

◆ masked_copy_0()

subroutine, public math::masked_copy_0 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, dimension(0:n_mask)  mask,
integer, intent(in)  n,
integer, intent(in)  n_mask 
)
Parameters
aDestination array of size n.
bSource array of size n.
maskMask array of length n_mask + 1, where mask(0) = n_mask the length of the mask array.
nSize of the arrays a and b.
n_maskSize of the mask array mask.

Definition at line 325 of file math.F90.

Here is the caller graph for this function:

◆ masked_gather_copy()

subroutine, public math::masked_gather_copy ( real(kind=rp), dimension(n_mask), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, dimension(n_mask)  mask,
integer, intent(in)  n,
integer, intent(in)  n_mask 
)
Parameters
aDestination array of size n_mask.
bSource array of size n.
maskMask array of length n_mask. the length of the mask array.
nSize of the array b.
n_maskSize of the mask array mask and a.
Note
Assumes n .ge. n_mask.

Definition at line 433 of file math.F90.

Here is the caller graph for this function:

◆ masked_gather_copy_0()

subroutine, public math::masked_gather_copy_0 ( real(kind=rp), dimension(n_mask), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, dimension(0:n_mask)  mask,
integer, intent(in)  n,
integer, intent(in)  n_mask 
)
Parameters
aDestination array of size n_mask.
bSource array of size n.
maskMask array of length n_mask + 1, where mask(0) = n_mask the length of the mask array.
nSize of the array b.
n_maskSize of the mask array mask and a.
Note
Assumes n .ge. n_mask.

Definition at line 373 of file math.F90.

Here is the caller graph for this function:

◆ masked_scatter_copy()

subroutine, public math::masked_scatter_copy ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n_mask), intent(in)  b,
integer, dimension(n_mask)  mask,
integer, intent(in)  n,
integer, intent(in)  n_mask 
)
Parameters
aDestination array of size n.
bSource array of size n_mask.
maskMask array of length n_mask + 1, where mask(0) = n_mask + 1 the length of the mask array.
nSize of the array maskand array b.
mSize of the mask array a.
Note
Assumes n .ge. n_mask.

Definition at line 483 of file math.F90.

Here is the caller graph for this function:

◆ masked_scatter_copy_0()

subroutine, public math::masked_scatter_copy_0 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n_mask), intent(in)  b,
integer, dimension(0:n_mask)  mask,
integer, intent(in)  n,
integer, intent(in)  n_mask 
)
Parameters
aDestination array of size n.
bSource array of size n_mask.
maskMask array of length n_mask + 1, where mask(0) = n_mask + 1 the length of the mask array.
nSize of the array maskand array b.
mSize of the mask array a.
Note
Assumes n .ge. n_mask.

Definition at line 458 of file math.F90.

Here is the caller graph for this function:

◆ math_dstepf()

real(kind=rp) function, public math::math_dstepf ( real(kind=rp), intent(in)  x)

Definition at line 1899 of file math.F90.

Here is the caller graph for this function:

◆ math_stepf()

real(kind=rp) function, public math::math_stepf ( real(kind=rp), intent(in)  x)

Definition at line 1876 of file math.F90.

◆ matinv3()

real(kind=xp) function, dimension(3,3), public math::matinv3 ( real(kind=xp), dimension(3,3), intent(in)  a)

Definition at line 1850 of file math.F90.

Here is the caller graph for this function:

◆ matinv39()

real(rp) function, dimension(3,3), public math::matinv39 ( real(kind=rp), intent(in)  a11,
real(kind=rp), intent(in)  a12,
real(kind=rp), intent(in)  a13,
real(kind=rp), intent(in)  a21,
real(kind=rp), intent(in)  a22,
real(kind=rp), intent(in)  a23,
real(kind=rp), intent(in)  a31,
real(kind=rp), intent(in)  a32,
real(kind=rp), intent(in)  a33 
)

Definition at line 1829 of file math.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ p_update()

subroutine, public math::p_update ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), intent(in)  c1,
real(kind=rp), intent(in)  c2,
integer, intent(in)  n 
)

Definition at line 1280 of file math.F90.

Here is the caller graph for this function:

◆ power()

subroutine, public math::power ( real(kind=rp), dimension(n), intent(inout)  ap,
real(kind=rp), dimension(n), intent(in)  a,
real(kind=rp), intent(in)  p,
integer, intent(in)  n 
)

Definition at line 1940 of file math.F90.

Here is the caller graph for this function:

◆ pwmax2()

subroutine, public math::pwmax2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1705 of file math.F90.

Here is the caller graph for this function:

◆ pwmax3()

subroutine, public math::pwmax3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1720 of file math.F90.

Here is the caller graph for this function:

◆ pwmin2()

subroutine, public math::pwmin2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 1766 of file math.F90.

Here is the caller graph for this function:

◆ pwmin3()

subroutine, public math::pwmin3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1781 of file math.F90.

Here is the caller graph for this function:

◆ reorddp()

subroutine math::reorddp ( real(kind=rp), dimension(n), intent(inout)  b,
integer, dimension(n), intent(in)  ind,
integer, intent(in)  n 
)
private
Parameters
[in,out]bvector to be reordered
[in]indpermutation array
[in]narray size

Definition at line 1575 of file math.F90.

◆ reordi4()

subroutine math::reordi4 ( integer(i4), dimension(n), intent(inout)  b,
integer, dimension(n), intent(in)  ind,
integer, intent(in)  n 
)
private
Parameters
[in,out]bvector to be reordered
[in]indpermutation array
[in]narray size

Definition at line 1602 of file math.F90.

◆ rone()

subroutine, public math::rone ( real(kind=rp), dimension(n), intent(inout)  a,
integer, intent(in)  n 
)

Definition at line 290 of file math.F90.

Here is the caller graph for this function:

◆ row_zero()

subroutine, public math::row_zero ( real(kind=rp), dimension(m,n), intent(inout)  a,
integer, intent(in)  m,
integer, intent(in)  n,
integer, intent(in)  e 
)

Definition at line 276 of file math.F90.

◆ rzero()

subroutine, public math::rzero ( real(kind=rp), dimension(n), intent(inout)  a,
integer, intent(in)  n 
)

Definition at line 248 of file math.F90.

Here is the caller graph for this function:

◆ sabscmp()

pure logical function, public math::sabscmp ( real(kind=sp), intent(in)  x,
real(kind=sp), intent(in)  y,
real(kind=sp), intent(in), optional  tol 
)

Definition at line 129 of file math.F90.

Here is the caller graph for this function:

◆ sorti4()

subroutine math::sorti4 ( integer(i4), dimension(n), intent(inout)  a,
integer, dimension(n), intent(out)  ind,
integer, intent(in)  n 
)
private

Following p 231 Num. Rec., 1st Ed.

Parameters
[in,out]avector to be sorted
[out]indpermutation array
[in]narray size

Definition at line 1465 of file math.F90.

◆ sortrp()

subroutine math::sortrp ( real(kind=rp), dimension(n), intent(inout)  a,
integer, dimension(n), intent(out)  ind,
integer, intent(in)  n 
)
private

Following p 231 Num. Rec., 1st Ed.

Parameters
[in,out]avector to be sorted
[out]indpermutation array
[in]narray size

Definition at line 1407 of file math.F90.

◆ sqrt_inplace()

subroutine, public math::sqrt_inplace ( real(kind=rp), dimension(n), intent(inout)  a,
integer, intent(in)  n 
)

Definition at line 1926 of file math.F90.

Here is the caller graph for this function:

◆ srelcmp()

pure logical function math::srelcmp ( real(kind=sp), intent(in)  x,
real(kind=sp), intent(in)  y,
real(kind=sp), intent(in), optional  eps 
)
private

Definition at line 177 of file math.F90.

Here is the caller graph for this function:

◆ sub2()

subroutine, public math::sub2 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
integer, intent(in)  n 
)

Definition at line 996 of file math.F90.

Here is the caller graph for this function:

◆ sub3()

subroutine, public math::sub3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1011 of file math.F90.

Here is the caller graph for this function:

◆ subcol3()

subroutine, public math::subcol3 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
integer, intent(in)  n 
)

Definition at line 1125 of file math.F90.

Here is the caller graph for this function:

◆ subcol4()

subroutine, public math::subcol4 ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), dimension(n), intent(in)  d,
integer, intent(in)  n 
)

Definition at line 1195 of file math.F90.

◆ swapdp()

subroutine math::swapdp ( real(kind=rp), dimension(n), intent(inout)  b,
integer, dimension(n), intent(in)  ind,
integer, intent(in)  n 
)
private
Parameters
[in,out]bvector to be reordered
[in]indpermutation array
[in]narray size

Definition at line 1521 of file math.F90.

◆ swapi4()

subroutine math::swapi4 ( integer(i4), dimension(n), intent(inout)  b,
integer, dimension(n), intent(in)  ind,
integer, intent(in)  n 
)
private
Parameters
[in,out]bvector to be reordered
[in]indpermutation array
[in]narray size

Definition at line 1548 of file math.F90.

◆ vcross()

subroutine, public math::vcross ( real(kind=rp), dimension(n), intent(out)  u1,
real(kind=rp), dimension(n), intent(out)  u2,
real(kind=rp), dimension(n), intent(out)  u3,
real(kind=rp), dimension(n), intent(in)  v1,
real(kind=rp), dimension(n), intent(in)  v2,
real(kind=rp), dimension(n), intent(in)  v3,
real(kind=rp), dimension(n), intent(in)  w1,
real(kind=rp), dimension(n), intent(in)  w2,
real(kind=rp), dimension(n), intent(in)  w3,
integer, intent(in)  n 
)

Definition at line 864 of file math.F90.

Here is the caller graph for this function:

◆ vdot2()

subroutine, public math::vdot2 ( real(kind=rp), dimension(n), intent(out)  dot,
real(kind=rp), dimension(n), intent(in)  u1,
real(kind=rp), dimension(n), intent(in)  u2,
real(kind=rp), dimension(n), intent(in)  v1,
real(kind=rp), dimension(n), intent(in)  v2,
integer, intent(in)  n 
)

Definition at line 883 of file math.F90.

◆ vdot3()

subroutine, public math::vdot3 ( real(kind=rp), dimension(n), intent(out)  dot,
real(kind=rp), dimension(n), intent(in)  u1,
real(kind=rp), dimension(n), intent(in)  u2,
real(kind=rp), dimension(n), intent(in)  u3,
real(kind=rp), dimension(n), intent(in)  v1,
real(kind=rp), dimension(n), intent(in)  v2,
real(kind=rp), dimension(n), intent(in)  v3,
integer, intent(in)  n 
)

Definition at line 900 of file math.F90.

Here is the caller graph for this function:

◆ vlamax()

real(kind=rp) function, public math::vlamax ( real(kind=rp), dimension(n), intent(in)  vec,
integer  n 
)

Definition at line 773 of file math.F90.

◆ vlmax()

real(kind=rp) function, public math::vlmax ( real(kind=rp), dimension(n), intent(in)  vec,
integer  n 
)

Definition at line 788 of file math.F90.

Here is the caller graph for this function:

◆ vlmin()

real(kind=rp) function, public math::vlmin ( real(kind=rp), dimension(n), intent(in)  vec,
integer, intent(in)  n 
)

Definition at line 803 of file math.F90.

Here is the caller graph for this function:

◆ vlsc2()

real(kind=rp) function, public math::vlsc2 ( real(kind=rp), dimension(n), intent(in)  u,
real(kind=rp), dimension(n), intent(in)  v,
integer, intent(in)  n 
)

Definition at line 932 of file math.F90.

Here is the caller graph for this function:

◆ vlsc3()

real(kind=rp) function, public math::vlsc3 ( real(kind=rp), dimension(n), intent(in)  u,
real(kind=rp), dimension(n), intent(in)  v,
real(kind=rp), dimension(n), intent(in)  w,
integer, intent(in)  n 
)

Definition at line 916 of file math.F90.

◆ x_update()

subroutine, public math::x_update ( real(kind=rp), dimension(n), intent(inout)  a,
real(kind=rp), dimension(n), intent(in)  b,
real(kind=rp), dimension(n), intent(in)  c,
real(kind=rp), intent(in)  c1,
real(kind=rp), intent(in)  c2,
integer, intent(in)  n 
)

Definition at line 1297 of file math.F90.

Variable Documentation

◆ neko_eps

real(kind=rp), parameter, public math::neko_eps = epsilon(1.0_rp)

Definition at line 70 of file math.F90.

◆ neko_eps_dp

real(kind=dp), parameter, public math::neko_eps_dp = epsilon(1.0_dp)

Definition at line 71 of file math.F90.

◆ neko_eps_sp

real(kind=sp), parameter, public math::neko_eps_sp = epsilon(1.0_sp)

Definition at line 72 of file math.F90.

◆ neko_m_ln2

real(kind=rp), parameter, public math::neko_m_ln2 = log(2.0_rp)

Definition at line 75 of file math.F90.

◆ pi

real(kind=rp), parameter, public math::pi = 4._rp*atan(1._rp)

Definition at line 78 of file math.F90.