MCPcopy Create free account
hub / github.com/FEniCS/dolfinx / _ghost_update

Function _ghost_update

python/dolfinx/la/petsc.py:35–42  ·  view source on GitHub ↗

Helper function for ghost updating PETSc vectors.

(x: PETSc.Vec, insert_mode: PETSc.InsertMode, scatter_mode: PETSc.ScatterMode)

Source from the content-addressed store, hash-verified

33
34
35def _ghost_update(x: PETSc.Vec, insert_mode: PETSc.InsertMode, scatter_mode: PETSc.ScatterMode): # type: ignore[name-defined]
36 """Helper function for ghost updating PETSc vectors."""
37 if x.getType() == PETSc.Vec.Type.NEST: # type: ignore[attr-defined]
38 for x_sub in x.getNestSubVecs():
39 x_sub.ghostUpdate(addv=insert_mode, mode=scatter_mode)
40 x_sub.destroy()
41 else:
42 x.ghostUpdate(addv=insert_mode, mode=scatter_mode)
43
44
45def _zero_vector(x: PETSc.Vec): # type: ignore[name-defined]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected