pg_utils.numerics.matrices

Numerical computations of coefficient matrices (mass and stiffness matrices)

This module aims to compute quadrature of inner product matrices where .. math:

M_{ij} = \sum_k (w_k f_A(NA_i, \xi_k) f_B(NB_j, \xi_k))

Functions

invert_block_diag(matrix, block_seg)

Invert a block diagonal matrix

quad_matrix_gmpy2(operand_A, operand_B, ...)

Compute quadrature matrix using gmpy2, where \(w_k\) is wt_quad[k], \(\xi_k\) is xi_quad[k], \(f_A\) is operand_A and \(f_B\) is operand_B.

quad_matrix_mpmath(operand_A, operand_B, ...)

Compute quadrature matrix using mpmath, where \(w_k\) is wt_quad[k], \(\xi_k\) is xi_quad[k], \(f_A\) is operand_A and \(f_B\) is operand_B.

quad_matrix_scipy(operand_A, operand_B, ...)

Compute quadrature matrix using scipy, where \(w_k\) is wt_quad[k], \(\xi_k\) is xi_quad[k], \(f_A\) is operand_A and \(f_B\) is operand_B.

quad_matrix_sympy(operand_A, operand_B, ...)

Compute quadrature matrix using sympy, where \(w_k\) is wt_quad[k], \(\xi_k\) is xi_quad[k], \(f_A\) is operand_A and \(f_B\) is operand_B.

sparsify(array[, clip_threshold])

Create sparse array from dense array

Classes

InnerProdQuad(inner_prod, quad_method, ...)

Quadrature of inner product class generator for all inner product quadratures in 1D

InnerQuad_GaussJacobi(inner_prod[, ...])

Quadrature of inner product following Gauss-Jacobi quadrature

InnerQuad_Rule(inner_prod)

Quadrature of inner product based on certain rule Abstract base class for inner product quad evaluators

LabeledBlockArray(array, block_names, ...)

Block 1-D array with labels assigned to blocks

LabeledBlockMatrix(matrix, row_names, ...)

Block matrix with labels assigned to row & col blocks

MatrixExpander(matrix, quad_recipes, ...)

Evaluation class for expanding system matrices with InnerProduct1D elements into actual numerical matrices.

QuadRecipe([init_opt, gram_opt])