Skip to content

ufl 2023.1 breaks old dolfin #151

@drew-parsons

Description

@drew-parsons

The change of API in ufl 2023.1 (2023.1.1.post0) breaks old dolfin.

It also breaks old ffc. ufl.log.WARNING was removed in ufl 2023 and is used by ffc. But ffc can be easily patched to treat any instance of WARNING as either INFO or ERROR.

dolfin cannot be so easily patched. The problem is not only ufl.log.WARNING. For instance demo_poisson.py gives

$ python3 demo_poisson.py 
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Calling FFC just-in-time (JIT) compiler, this may take some time.
Traceback (most recent call last):
  File "/projects/fenics/build/tests/dolfin/demo-python/documented/poisson/demo_poisson.py", line 170, in <module>
    solve(a == L, u, bc)
  File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/fem/solving.py", line 233, in solve
    _solve_varproblem(*args, **kwargs)
  File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/fem/solving.py", line 268, in _solve_varproblem
    problem = LinearVariationalProblem(eq.lhs, eq.rhs, u, bcs,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/fem/problem.py", line 58, in __init__
    L = Form(L, form_compiler_parameters=form_compiler_parameters)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/petsc/lib/python3/dist-packages/dolfin/fem/form.py", line 82, in __init__
    self.set_cell_domains(subdomains)
TypeError: set_cell_domains(): incompatible function arguments. The following argument types are supported:
    1. (self: dolfin.cpp.fem.Form, arg0: dolfin.cpp.mesh.MeshFunctionSizet) -> None

Invoked with: <dolfin.fem.form.Form object at 0x7f67280289b0>, [None]

Should ufl be patched (as version 2023.2, say) to restore support for old dolfin?

Or should the new namespace be changed from ufl to uflx ? This was done previously when ffc was changed to ffcx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions