Hi all,
I am working on implementing a version of the linear shell formulation outlined by @bleyerj here (thanks for the fantastic resource!) and adapting it for dolfinx
. As he explains, the formulation uses a P2/CR
mixed space for displacements and rotations. Unfortunately, I am getting an error when setting up BC’s for this space as is done in the reference (I am using the latest docker build). Here is a MWE:
import dolfinx
import ufl
from mpi4py import MPI
# simple mesh
N = 4
mesh = dolfinx.UnitSquareMesh(MPI.COMM_WORLD, N, N, dolfinx.cpp.mesh.CellType.triangle)
# create mixed element function space
Ue = ufl.VectorElement("Lagrange", mesh.ufl_cell(), 2, dim=3)
Te = ufl.VectorElement("CR", mesh.ufl_cell(), 1, dim=3)
V = dolfinx.FunctionSpace(mesh, ufl.MixedElement([Ue, Te]))
# boundary conditions
def clamped_boundary(x):
return np.isclose(x[1], 0)
# locate dofs
tmpBc = dolfinx.fem.locate_dofs_geometrical(V, clamped_boundary)
The last line generates the following error for me:
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see FAQ — PETSc 3.20.1 documentation
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
[0]PETSC ERROR: Run with -malloc_debug to check if memory corruption is causing the crash.
application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
[unset]: write_line error; fd=-1 buf=:cmd=abort exitcode=59
:
system msg for write_line failure : Bad file descriptor
Interestingly, I do not get this error if I use only Ue
or Te
to build a (non-mixed) function space. Any thoughts on what might be the issue here and/or how I might work around it? I am still somewhat new to FEniCs so apologies if there is anything basic that I’m missing.