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

Method petsc_vec

python/dolfinx/la/__init__.py:93–110  ·  view source on GitHub ↗

PETSc vector holding the entries of the vector. Upon first call, this function creates a PETSc ``Vec`` object that wraps the degree-of-freedom data. The ``Vec`` object is cached and the cached ``Vec`` is returned upon subsequent calls. Note: When the objec

(self)

Source from the content-addressed store, hash-verified

91
92 @property
93 def petsc_vec(self):
94 """PETSc vector holding the entries of the vector.
95
96 Upon first call, this function creates a PETSc ``Vec`` object
97 that wraps the degree-of-freedom data. The ``Vec`` object is
98 cached and the cached ``Vec`` is returned upon subsequent calls.
99
100 Note:
101 When the object is destroyed it will destroy the underlying
102 petsc4py vector automatically.
103 """
104 assert dolfinx.has_petsc4py
105
106 from dolfinx.la.petsc import create_vector_wrap
107
108 if self._petsc_x is None:
109 self._petsc_x = create_vector_wrap(self)
110 return self._petsc_x
111
112 def scatter_forward(self) -> None:
113 """Update ghost entries."""

Callers

nothing calls this directly

Calls 1

create_vector_wrapFunction · 0.90

Tested by

no test coverage detected