Peano
Loading...
Searching...
No Matches
exahype2.solvers.MathUtils.MathUtils Class Reference

Static Public Member Functions

 matrixTranspose (M)
 Transpose a matrix M.
 
 matrixDot (A, B)
 A dot B.
 
 matrixInverse (M)
 M^-1.
 
 matrixInverse_Pivot (M)
 Compute a matrix inverse using a pivot algorithm.
 
 vectorPad (v, padSize)
 zero-pad a vector
 
 matrixPadAndFlatten_RowMajor (M, padSize)
 a b c d e f => a b c 0 d e f 0
 
 matrixPadAndFlatten_ColMajor (M, padSize)
 a b c d e f => a d 0 b e 0 c f 0
 
 getGaussLegendre (nDof)
 Return Gauss-Legendre weights, points.
 
 getGaussLobatto (nDof)
 Return Gauss-Lobatto weights, points.
 
 baseFunc1d (xi, xin, N)
 Computes the ADER-DG basis functions and their first derivative.
 
 assembleStiffnessMatrix (xGPN, wGPN, N)
 Computes the (reference) element stiffness matrix for an approximation of order N.
 
 assembleK1 (Kxi, xGPN, N)
 Computes the difference between the reference element mass operator evaluated at point xi=1.0 and the element stiffness matrix.
 
 assembleMassMatrix (xGPN, wGPN, N)
 Computes the (reference) element mass matrix for an approximation of order N.
 
 assembleDiscreteDerivativeOperator (MM, Kxi)
 Computes some derivative values for debugging purposes.
 
 assembleFineGridProjector1d (xGPN, j, N)
 Transforms the degrees of freedom located on a coarse grid edge nodes to degrees of freedoms located on nodes of a fine grid edge.
 
 LagrangBasisPoly (x, order, i, xi=None)
 Returns the i-th Lagrange basis polynomial as symbolic expression.
 
 assembleBasisFunction (quadNodes)
 
 assembleQuadratureConversion (fromQ, toQ, N)
 Return base conversion matrix.
 
 assembleDGToFV (nodes, weights, N, Nlim)
 Return conversion matrix from DG grid to FV grid.
 
 assembleFVToDG (dg2fv, weights, N, Nlim)
 Return conversion matrix from FV grid to DG grid.
 

Detailed Description

Definition at line 9 of file MathUtils.py.

Member Function Documentation

◆ assembleBasisFunction()

exahype2.solvers.MathUtils.MathUtils.assembleBasisFunction ( quadNodes)
static

Definition at line 1032 of file MathUtils.py.

◆ assembleDGToFV()

exahype2.solvers.MathUtils.MathUtils.assembleDGToFV ( nodes,
weights,
N,
Nlim )
static

Return conversion matrix from DG grid to FV grid.

Definition at line 1075 of file MathUtils.py.

◆ assembleDiscreteDerivativeOperator()

exahype2.solvers.MathUtils.MathUtils.assembleDiscreteDerivativeOperator ( MM,
Kxi )
static

Computes some derivative values for debugging purposes.

Args: MM: The (reference) element mass matrix for a approximation of order N. Kxi: The (reference) element stiffness matrix for a approximation of order N.

Returns: dudx: Derivative values for debugging purposes.

Definition at line 950 of file MathUtils.py.

◆ assembleFineGridProjector1d()

exahype2.solvers.MathUtils.MathUtils.assembleFineGridProjector1d ( xGPN,
j,
N )
static

Transforms the degrees of freedom located on a coarse grid edge nodes to degrees of freedoms located on nodes of a fine grid edge.

The difference in levels is 1.

Let us denote by P the 1d fine grid projector (=1d equidistantGridProjector). The fine grid DoF are computed according to:

u^{fine;j}_i = sum_{m} P^{j}_im u^{coarse}_m

Args: xGPN: Gauss-Legendre nodes (N nodes). j: Index of one the three subintervals: 0,1, or 2. N: Number of nodal basis functions (=order+1). Returns: equidistantGridProjector: The corresponding degrees of freedom located at nodes of an equidistant grid over (0,1).

Definition at line 972 of file MathUtils.py.

◆ assembleFVToDG()

exahype2.solvers.MathUtils.MathUtils.assembleFVToDG ( dg2fv,
weights,
N,
Nlim )
static

Return conversion matrix from FV grid to DG grid.

Definition at line 1091 of file MathUtils.py.

◆ assembleK1()

exahype2.solvers.MathUtils.MathUtils.assembleK1 ( Kxi,
xGPN,
N )
static

Computes the difference between the reference element mass operator evaluated at point xi=1.0 and the element stiffness matrix.

Args: K_xi: The (reference) element stiffness matrix for a approximation of order N. xGPN: Gauss-Legendre nodes (N nodes). N: Order of approximation corresponding to N+1 nodal basis functions. Returns: K1: <unknown>

Definition at line 895 of file MathUtils.py.

◆ assembleMassMatrix()

exahype2.solvers.MathUtils.MathUtils.assembleMassMatrix ( xGPN,
wGPN,
N )
static

Computes the (reference) element mass matrix for an approximation of order N.

Args: xGPN: Gauss-Legendre nodes (N nodes). wGPN: N Gauss-Legendre weights (N weights). N: Number of nodal basis functions (=order+1). Returns: M_xi: The (reference) element mass matrix.

Definition at line 922 of file MathUtils.py.

◆ assembleQuadratureConversion()

exahype2.solvers.MathUtils.MathUtils.assembleQuadratureConversion ( fromQ,
toQ,
N )
static

Return base conversion matrix.

Definition at line 1065 of file MathUtils.py.

◆ assembleStiffnessMatrix()

exahype2.solvers.MathUtils.MathUtils.assembleStiffnessMatrix ( xGPN,
wGPN,
N )
static

Computes the (reference) element stiffness matrix for an approximation of order N.

Args: xGPN: Gauss-Legendre nodes (N nodes). wGPN: Gauss-Legendre weights (N weights). N: Number of nodal basis functions (=order+1). Returns: K_xi: The (reference) element stiffness matrix.

Definition at line 867 of file MathUtils.py.

◆ baseFunc1d()

exahype2.solvers.MathUtils.MathUtils.baseFunc1d ( xi,
xin,
N )
static

Computes the ADER-DG basis functions and their first derivative.

Args: xi: The reference element point the basis functions are evaluated at. Here, xi refers to the greek letter that is often used as a reference element coordinate. xin: The reference element nodes corresponding to the nodal basis functions. N: Number of nodal basis functions (=order+1). Returns: phi: Basis function values. phi_xi: First derivatives of the basis functions.

Definition at line 828 of file MathUtils.py.

◆ getGaussLegendre()

exahype2.solvers.MathUtils.MathUtils.getGaussLegendre ( nDof)
static

Return Gauss-Legendre weights, points.

Definition at line 115 of file MathUtils.py.

◆ getGaussLobatto()

exahype2.solvers.MathUtils.MathUtils.getGaussLobatto ( nDof)
static

Return Gauss-Lobatto weights, points.

Definition at line 475 of file MathUtils.py.

◆ LagrangBasisPoly()

exahype2.solvers.MathUtils.MathUtils.LagrangBasisPoly ( x,
order,
i,
xi = None )
static

Returns the i-th Lagrange basis polynomial as symbolic expression.

Algorithm was obtained from https://wanglongqi.github.io/python/2014/03/24/implement-of-lagrange-polynomial/.

Parameters

x: symbolic variable Symbolic variable. order : number Order of the Lagrange basis polynomial. xi : number The node the basis polynomial should pass through i : number The node we are interested in.

Returns

Li: symbolic expression The i-th Lagrange basis polynomial as symbolic expression.

Definition at line 1003 of file MathUtils.py.

◆ matrixDot()

exahype2.solvers.MathUtils.MathUtils.matrixDot ( A,
B )
static

A dot B.

Definition at line 22 of file MathUtils.py.

◆ matrixInverse()

exahype2.solvers.MathUtils.MathUtils.matrixInverse ( M)
static

M^-1.

Definition at line 30 of file MathUtils.py.

◆ matrixInverse_Pivot()

exahype2.solvers.MathUtils.MathUtils.matrixInverse_Pivot ( M)
static

Compute a matrix inverse using a pivot algorithm.

Definition at line 35 of file MathUtils.py.

◆ matrixPadAndFlatten_ColMajor()

exahype2.solvers.MathUtils.MathUtils.matrixPadAndFlatten_ColMajor ( M,
padSize )
static

a b c d e f => a d 0 b e 0 c f 0

Definition at line 99 of file MathUtils.py.

◆ matrixPadAndFlatten_RowMajor()

exahype2.solvers.MathUtils.MathUtils.matrixPadAndFlatten_RowMajor ( M,
padSize )
static

a b c d e f => a b c 0 d e f 0

Definition at line 87 of file MathUtils.py.

◆ matrixTranspose()

exahype2.solvers.MathUtils.MathUtils.matrixTranspose ( M)
static

Transpose a matrix M.

Definition at line 17 of file MathUtils.py.

◆ vectorPad()

exahype2.solvers.MathUtils.MathUtils.vectorPad ( v,
padSize )
static

zero-pad a vector

Definition at line 80 of file MathUtils.py.


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