finesse.densematrix.DenseMatrix

Overview

class finesse.densematrix.DenseMatrix(name)[source]

Bases: object

Examples

Create a matrix with memory views of different submatrices for giving to components:

> DM = DenseMatrix(“abc”) > > DM.declare_equations(5, 0, ‘a’) > DM.declare_equations(5, 1, ‘b’) > DM.declare_equations(5, 2, ‘c’) > DM.declare_equations(2, 3, ‘d’) > > v1 = DM.declare_submatrix_view(0, 1, ‘b’) > v2 = DM.declare_subdiagonal_view(0, 2, ‘b’) > v3 = DM.declare_submatrix_view(3, 1, ‘b’) > > DM.construct() > > v1[:] = 1 > v2[:] = 0.5 > v3[:] = 0.75

Properties

DenseMatrix.name

DenseMatrix.num_equations

Methods

DenseMatrix.__init__(name)

DenseMatrix.add_block(Neqs, index, name)

Parameters:

DenseMatrix.clear_rhs()

DenseMatrix.construct()

Constructing the matrix involves taking the metadata submatrix positions throughout the matrix and allocating the memory and building the various CCS matrix structures.

DenseMatrix.declare_equations(Neqs, index, name)

Adds a submatrix to the matrix along its diagonal.

DenseMatrix.declare_subdiagonal_view(...)

DenseMatrix.declare_submatrix_view(...)

DenseMatrix.get_matrix_elements()

DenseMatrix.get_submatrix(_from, _to)

DenseMatrix.print_matrix()

DenseMatrix.print_rhs()

DenseMatrix.set_rhs(index, value)

DenseMatrix.solve(self, transpose, conjugate)

Solve the matrix with options for transposing and conjugating.