Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Newton's method + R space + Fieldsplit throws PyOP2 error #3837

Open
ABaierReinio opened this issue Oct 24, 2024 · 0 comments
Open

BUG: Newton's method + R space + Fieldsplit throws PyOP2 error #3837

ABaierReinio opened this issue Oct 24, 2024 · 0 comments
Assignees
Labels

Comments

@ABaierReinio
Copy link

When using Newton's method on a form that involves R spaces, and doing a fieldsplit, a PyOP2 error is thrown.

MWE below:

from firedrake import *

M = UnitSquareMesh(5, 5)

V = FunctionSpace(M, "CG", 1)
R = FunctionSpace(M, "R", 0)
Z = V * R

func = Function(Z)
u, l = split(func)
v, w = TestFunctions(Z)

F = (
    (u + u**2 - 8) * v * dx
    + l * w * dx
)

newton_solver_parameters = {"snes_type" : "newtonls",
                            "snes_monitor" : "",
                            "snes_converged_reason" : "",
                            "mat_type" : "nest",
                            "ksp_type" : "fgmres",
                            "ksp_monitor" : "",
                            "pc_type": "fieldsplit",
                            "pc_fieldsplit_type": "schur",
                            "pc_fieldsplit_schur_fact_type": "full",
                            "pc_fieldsplit_0_fields": "0",
                            "pc_fieldsplit_1_fields" : "1",
                            "fieldsplit_0_ksp_type" : "preonly",
                            "fieldsplit_0_pc_type" : "lu",
                            "fieldsplit_0_pc_factor_mat_solver_type" : "mumps",
                            "fieldsplit_1_ksp_type" : "gmres",
                            "fieldsplit_1_max_it" : 1,
                            "fieldsplit_1_convergence_test" : "skip"
                            }

solve(F == 0, func, solver_parameters=newton_solver_parameters)

The script successfully does an iteration of Newton's method, but it then throws the error

  File "/firedrake/src/PyOP2/pyop2/parloop.py", line 421, in reduction_begin
    requests.append(self.comm.Iallreduce(glob._data, glob._buf, op=mpi_op))
AttributeError: 'Mat' object has no attribute '_data'
@connorjward connorjward self-assigned this Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants