petsc4py.PETSc.NullSpace#

class petsc4py.PETSc.NullSpace#

Bases: Object

Nullspace object.

See also

MatNullSpace

Methods Summary

create([constant, vectors, comm])

Create the null space.

createRigidBody(coords)

Create rigid body modes from coordinates.

destroy()

Destroy the null space.

getFunction()

Return the callback to remove the nullspace.

getVecs()

Return the vectors defining the null space.

hasConstant()

Return whether the null space contains the constant.

remove(vec)

Remove all components of a null space from a vector.

setFunction(function[, args, kargs])

Set the callback to remove the nullspace.

test(mat)

Return if the claimed null space is valid for a matrix.

view([viewer])

View the null space.

Methods Documentation

create(constant=False, vectors=(), comm=None)#

Create the null space.

Collective.

Parameters:
  • constant (bool) – A flag to indicate the null space contains the constant vector.

  • vectors (Sequence[Vec]) – The sequence of vectors that span the null space.

  • comm – MPI communicator, defaults to Sys.getDefaultComm.

Return type:

Self

Source code at petsc4py/PETSc/Mat.pyx:5799

createRigidBody(coords)#

Create rigid body modes from coordinates.

Collective.

Parameters:

coords (Vec) – The block coordinates of each node. Requires the block size to have been set.

Return type:

Self

Source code at petsc4py/PETSc/Mat.pyx:5835

destroy()#

Destroy the null space.

Collective.

Source code at petsc4py/PETSc/Mat.pyx:5786

Return type:

Self

getFunction()#

Return the callback to remove the nullspace.

Not collective.

See also

setFunction

Source code at petsc4py/PETSc/Mat.pyx:5926

Return type:

MatNullFunction

getVecs()#

Return the vectors defining the null space.

Not collective.

Source code at petsc4py/PETSc/Mat.pyx:5904

Return type:

list[Vec]

hasConstant()#

Return whether the null space contains the constant.

Not collective.

Source code at petsc4py/PETSc/Mat.pyx:5890

Return type:

bool

remove(vec)#

Remove all components of a null space from a vector.

Collective.

Parameters:

vec (Vec) – The vector from which the null space is removed.

Return type:

None

Source code at petsc4py/PETSc/Mat.pyx:5940

setFunction(function, args=None, kargs=None)#

Set the callback to remove the nullspace.

Logically collective.

Parameters:
Return type:

None

Source code at petsc4py/PETSc/Mat.pyx:5856

test(mat)#

Return if the claimed null space is valid for a matrix.

Collective.

Parameters:

mat (Mat) – The matrix to check.

Return type:

bool

See also

MatNullSpaceTest

Source code at petsc4py/PETSc/Mat.pyx:5957

view(viewer=None)#

View the null space.

Collective.

Parameters:

viewer (Viewer | None) – A Viewer instance or None for the default viewer.

Return type:

None

Source code at petsc4py/PETSc/Mat.pyx:5767