dolfinx.la

Linear algebra functionality

Functions

is_orthonormal(basis[, eps])

Check that list of PETSc vectors are orthonormal

matrix_csr(sp[, dtype])

Create a distributed sparse matrix.

orthonormalize(basis)

Orthogoalise set of PETSc vectors in-place

vector(map[, bs, dtype])

Create a distributed vector.

Classes

MatrixCSRMetaClass(sp)

A distributed sparse matrix that uses compressed sparse row storage.

VectorMetaClass(map, bs)

A distributed vector object.

class dolfinx.la.MatrixCSRMetaClass(sp)[source]

Bases: object

A distributed sparse matrix that uses compressed sparse row storage.

Parameters
  • sp – The sparsity pattern that defines the nonzero structure

  • matrix (of the matrix the parallel distribution of the) –

Note

Objects of this type should be created using matrix_csr() and not created using the class initialiser.

class dolfinx.la.VectorMetaClass(map, bs)[source]

Bases: object

A distributed vector object.

Parameters
  • map – Index map the describes the size and distribution of the vector

  • bs – Block size

Note

Objects of this type should be created using vector() and not created using the class initialiser.

dolfinx.la.create_petsc_vector()

create_vector(arg0: dolfinx.cpp.common.IndexMap, arg1: int) -> vec

Create a ghosted PETSc Vec for index map.

dolfinx.la.is_orthonormal(basis, eps: float = 1e-12) bool[source]

Check that list of PETSc vectors are orthonormal

dolfinx.la.matrix_csr(sp, dtype=<class 'numpy.float64'>) dolfinx.la.MatrixCSRMetaClass[source]

Create a distributed sparse matrix.

The matrix uses compressed sparse row storage.

Parameters
  • sp – The sparsity pattern that defines the nonzero structure of

  • matrix. (the matrix the parallel distribution of the) –

  • dtype – The scalar type.

Returns

A sparse matrix.

dolfinx.la.orthonormalize(basis)[source]

Orthogoalise set of PETSc vectors in-place

dolfinx.la.vector(map, bs=1, dtype=<class 'numpy.float64'>) dolfinx.la.VectorMetaClass[source]

Create a distributed vector.

Parameters
  • map – Index map the describes the size and distribution of the vector.

  • bs – Block size.

  • dtype – The scalar type.

Returns

A distributed vector.