Skip to content

Commit

Permalink
Remove deprecated method for accessing PETSc Vec in Python (#3435)
Browse files Browse the repository at this point in the history
* Remove deprecated method

* Remove leftover import
  • Loading branch information
garth-wells authored Sep 25, 2024
1 parent 0da58d1 commit d5f56d6
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions python/dolfinx/fem/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from __future__ import annotations

import typing
import warnings
from functools import singledispatch

import numpy as np
Expand Down Expand Up @@ -484,25 +483,6 @@ def x(self) -> la.Vector:
"""Vector holding the degrees-of-freedom."""
return self._x

@property
def vector(self):
"""PETSc vector holding the degrees-of-freedom.
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:
Prefer :func`x` where possible.
"""
warnings.warn(
"dolfinx.fem.Function.vector is deprecated.\n"
"Please use dolfinx.fem.Function.x.petsc_vec "
"to access the underlying petsc4py wrapper",
DeprecationWarning,
)
return self.x.petsc_vec

@property
def dtype(self) -> np.dtype:
return np.dtype(self._cpp_object.x.array.dtype)
Expand Down

0 comments on commit d5f56d6

Please sign in to comment.