-
Notifications
You must be signed in to change notification settings - Fork 12
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
TypeError when running periodic demos with dolfinx/dolfinx_mpc v0.8.0 #131
Comments
Could you try with 0.8.1: https://github.com/jorgensd/dolfinx_mpc/tree/v0.8.1 |
Tried with 0.8.1 keeping dolfinx 0.8.0, the same error happened. I rerun these conda commands to create the env and install all the dependencies:
which leaves me with dolfinx 0.8.0 and dolfinx-mpc 0.8.1. Here is a MWE that reproduces the error after this installation: import numpy as np
from mpi4py import MPI
from dolfinx import fem, mesh
from dolfinx.common import Timer
from dolfinx_mpc import MultiPointConstraint
dolfinx_mesh = mesh.create_unit_cube(MPI.COMM_WORLD, 10, 10, 10)
V = fem.functionspace(dolfinx_mesh, ("Lagrange", 1, (dolfinx_mesh.geometry.dim, )))
def x_periodic_boundary(x):
return np.isclose(x[0], 1.0, atol=1e-8)
def x_periodic_relation(x):
out_x = np.zeros_like(x)
out_x[0] = 1 - x[0]
out_x[1] = x[1]
out_x[2] = x[2]
return out_x
with Timer("~PERIODIC: Initialize MPC"):
mpc = MultiPointConstraint(V)
mpc.create_periodic_constraint_geometrical(V, x_periodic_boundary, x_periodic_relation, bcs=[])
mpc.finalize() Thank you for your help! |
I can reproduce this. I think this is an issue with an incompatibility with nanobind versions. |
This is almost certainly an incompatibility in nanobind (likely a compiler version mismatch) that should be pinned but apparently isn't. Can you share the output of |
Yup, it's the same nanobind abi pinning issue that I believe I've fixed in dolfinx itself, but didn't realize it extended to mpc as well. The quickest workaround is to add When this PR is merged, the latest builds of everything should work together again. |
Thank you both for looking into this. The command This is the output of
|
Hello, I am unable to run the periodic demos using dolfinx 0.8.0 and dolfinx_mpc 0.8.0, with Python 3.12.6. The demos I can't run are the following:
In both cases I get a similar error, here's the error for
demo_periodic_geometrical.py
:And the error for
demo_periodic3d_topological.py
:I installed dolfinx and dolfinx_mpc via conda install, and made sure that both versions are 0.8.0. I am trying to run a similar code, where I impose periodic boundary conditions in opposite faces of an unit cell, but I get stuck when calling
create_periodic_constraint_geometrical
, as in the demo. If you have any idea how I could get around this, it would be very helpful. Thanks in advance!The text was updated successfully, but these errors were encountered: