petsctools.init module

petsctools.init.check_environment_matches_petsc4py_config()
petsctools.init.check_petsc_version(version_spec) → None
petsctools.init.init(argv: Sequence[str] | None = None, *, version_spec: SpecifierSet | str = '') → ModuleType

Initialise PETSc.

Parameters:
  • argv – Command line options to be passed to PETSc at initialisation. If unspecified then sys.argv is used.

  • version_spec – String describing PETSc version constraints. For example ‘>=3.25.2,<3.26’.

Returns:

The petsc4py.PETSc module. This is convenient for avoiding boilerplate.

Return type:

types.ModuleType