pg_utils.numerics.matrices.MatrixExpander

class pg_utils.numerics.matrices.MatrixExpander(matrix: SystemMatrix, quad_recipes: ndarray, ranges_trial: List, ranges_test: List)[source]

Bases: object

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

Variables:
  • matrix (expansion.SystemMatrix) – a system matrix with either zero or InnerProduct1D as elements.

  • recipe (np.ndarray) – collection of QuadRecipe objects.

  • n_trials – ranges of trial functions for the expansion

  • n_tests – ranges of test functions for the expansion

__init__(matrix: SystemMatrix, quad_recipes: ndarray, ranges_trial: List, ranges_test: List) None[source]

Initialization

Parameters:
  • matrix (expansion.SystemMatrix) – a system matrix with either zero or InnerProduct1D as elements. Ideally in the future, this should also accept matrices containing elements written as a sum of inner products, for robustness.

  • quad_recipes (np.ndarray) – collection of QuadRecipe objects.

  • ranges_trial – ranges of trial functions for the expansion

  • ranges_test – ranges of test functions for the expansion

Methods

__init__(matrix, quad_recipes, ranges_trial, ...)

Initialization

expand([sparse, verbose])

Expand the matrix according to the recipes

expand(sparse=False, verbose=False)[source]

Expand the matrix according to the recipes