Hello everyone,
I recently upgraded from FEniCSx version 0.6.0 to 0.7.2. Now I get an error message when determining the minimum element size hmin, which I can’t fix myself.
Here is my code as it worked before:
import dolfinx
from mpi4py import MPI
import numpy as np
mesh = dolfinx.mesh.create_unit_square(MPI.COMM_WORLD, 50, 50)
tdim = mesh.topology.dim
num_cells = mesh.topology.index_map(tdim).size_local
hmin = mesh.comm.allreduce(min(dolfinx.cpp.mesh.h(mesh, tdim, range(num_cells))), op=MPI.MIN)
I get the following error message:
Traceback (most recent call last):
File "/root/shared/Thesis/Fenicsx/3Dcube-8Incls+14Pores/Dry/Monotonic/Battery/MWE_hmin.py", line 11, in <module>
hmin = mesh.comm.allreduce(min(dolfinx.cpp.mesh.h(mesh, tdim, range(num_cells))), op=MPI.MIN)
TypeError: h(): incompatible function arguments. The following argument types are supported:
1. (mesh: dolfinx.cpp.mesh.Mesh_float32, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float32]
2. (mesh: dolfinx.cpp.mesh.Mesh_float64, dim: int, entities: numpy.ndarray[numpy.int32]) -> numpy.ndarray[numpy.float64]
Invoked with: <dolfinx.mesh.Mesh object at 0x7fb98c292260>, 2, range(0, 5000)
FEniCSX: 0.7.2 (installed via docker-container)
Ubuntu: 22.04
Thank you in advance and have a nice weekend!
With kind regards
Dejan