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)
| 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.""" |
nothing calls this directly
no test coverage detected