Skip to content

Commit 46bda91

Browse files
committed
Cheap fix for deprecated NewtonSolver - should switch to NonlinearProblem.
1 parent 8af8ed5 commit 46bda91

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

demo/demo_nonlinear-naghdi-clamped-semicylinder.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
from dolfinx.fem import Expression, Function, dirichletbc, functionspace, locate_dofs_topological
4646
from dolfinx.fem.bcs import DirichletBC
4747
from dolfinx.fem.function import Function as _Function
48-
from dolfinx.fem.petsc import NonlinearProblem, apply_lifting, assemble_vector, set_bc
48+
from dolfinx.fem.petsc import NewtonSolverNonlinearProblem, apply_lifting, assemble_vector, set_bc
4949
from dolfinx.mesh import CellType, create_rectangle, locate_entities_boundary
5050
from dolfinx.nls.petsc import NewtonSolver
5151
from ufl import grad, inner, split
@@ -545,8 +545,8 @@ def compute_cell_contributions(V, points):
545545
at that point"""
546546
# Determine what process owns a point and what cells it lies within
547547
mesh = V.mesh
548-
point_ownership_data = dolfinx.cpp.geometry.determine_point_ownership(
549-
mesh._cpp_object, points, 1e-6
548+
point_ownership_data = dolfinx.geometry.determine_point_ownership(
549+
mesh, points, 1e-6
550550
)
551551

552552
owning_points = np.asarray(point_ownership_data.dest_points).reshape(-1, 3)
@@ -589,7 +589,7 @@ def compute_cell_contributions(V, points):
589589
# We define a custom `NonlinearProblem` which is able to include the point
590590
# force.
591591
# %%
592-
class NonlinearProblemPointSource(NonlinearProblem):
592+
class NonlinearProblemPointSource(NewtonSolverNonlinearProblem):
593593
def __init__(
594594
self,
595595
F: ufl.form.Form,

0 commit comments

Comments
 (0)