compute_nullspace#

module opensg.utils.shared

opensg.utils.shared.compute_nullspace(V, ABD=False)#

Compute nullspace to restrict rigid body motions in finite element analysis.

Constructs a translational null space for the vector-valued function space V and ensures that it is properly orthonormalized. This is essential for solving systems with potential rigid body motions that need to be constrained.

Parameters:
  • V (dolfinx.fem.FunctionSpace) – Vector-valued function space (typically with 3 components for 3D problems) representing displacement degrees of freedom

  • ABD (bool, optional) – Flag indicating if this is for ABD matrix computation (default: False). Currently only affects internal dimension settings.

Returns:

petsc4py.PETSc.NullSpace – PETSc nullspace object containing orthonormalized basis vectors for translational rigid body modes. Used to constrain the linear system and ensure uniqueness of the solution.

Notes

The function creates a nullspace with 3 translational modes (one for each coordinate direction). The basis vectors are orthonormalized using the DOLFINx linear algebra utilities to ensure numerical stability.