Hello all,
I’m attempting to replicate the example provided in this tutorial by creating a hexahedral mesh domain using Hypermesh. I have also identified and tagged the facets separately to apply boundary conditions.
However, when I try to read my face tags (quad), my code terminates with a PETSC error message. In contrast, reading the cell tags for the hexahedral elements works without any issues.
I have visualized both XDMF files in ParaView, and the tags are correctly identified.
Could someone help me identify the issue?
MWE (verion-0.7.3)
import meshio
import dolfinx
import mpi4py
from mpi4py import MPI
import numpy as np
def create_mesh(mesh, cell_type, prune_z=False):
cells = mesh.get_cells_type(cell_type)
cell_data = mesh.get_cell_data("nastran:ref", cell_type)
out_mesh = meshio.Mesh(points=mesh.points, cells={cell_type: cells},
cell_data={"Region": [cell_data]})
return out_mesh
#'3d problem replication of [1](https://jsdokken.com/dolfinx-tutorial/chapter2/linearelasticity_code.html) by creating mesh using hypermesh and then importing to fenicsx using meshio'
filename='./Schreibtisch/nasdran_files/linear_elasticity_test.bdf'
msh = meshio.read(filename)
#print(msh.cell_data_dict)
quad_mesh = create_mesh(msh, "quad", True)
hex_mesh=create_mesh(msh, "hexahedron", True)
meshio.write("hexa.xdmf", hex_mesh)
meshio.write("quad.xdmf", quad_mesh)
filename_domain = 'hexa.xdmf'
filename_facets = 'quad.xdmf' #quad meshes to apply fixed boundary condition.
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, filename_domain, "r") as xdmf:
mesh = xdmf.read_mesh(name="Grid")
cell_tags = xdmf.read_meshtags(mesh, name="Grid")
mesh.topology.create_connectivity(mesh.topology.dim, mesh.topology.dim - 1)
with dolfinx.io.XDMFFile(MPI.COMM_WORLD, filename_facets, "r") as xdmf:
mesh = xdmf.read_mesh(name="Grid")
face_tags = xdmf.read_meshtags(mesh, name="Grid")
Error messaage
[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 https://petsc.org/release/faq/#valgrind and https://petsc.org/release/faq/
[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.
Abort(59) on node 0 (rank 0 in comm 0): application called MPI_Abort(MPI_COMM_WORLD, 59) - process 0
Mesh data in .bdf format created from Hypermesh
Mesh_file