Troubleshooting Kernel Restarts: Challenges in Reading Large Mesh Files

import dolfinx
import numpy as np
from dolfinx.fem import assemble
import ufl
from dolfinx.fem import (Constant, Function, FunctionSpace,
assemble_scalar, dirichletbc, form, locate_dofs_geometrical)
from dolfinx.fem.petsc import LinearProblem
from dolfinx.mesh import create_unit_square
from mpi4py import MPI
from ufl import SpatialCoordinate, TestFunction, TrialFunction, dot, dx, ds, grad, Measure
from petsc4py.PETSc import ScalarType
from dolfinx import mesh, fem, io
from dolfinx.io import XDMFFile
comm = MPI.COMM_WORLD

Read mesh from file

infile = io.XDMFFile(MPI.COMM_WORLD, “/home/Documents/s/Domain.xdmf”, “r”)# Read mesh from file
msh = infile.read_mesh(name = “Grid”)# i am getting problem here

helloI’d like to ask a question. I should provide a small example, but in my case, I can’t create one because I’m dealing with a very large mesh. Additionally, I can’t share this file. When I attempt to read the mesh, I encounter errors, and my kernel restarts. Could you please tell me what might be the reason? The mesh quality seems good, and there are no memory issues. How can I fix this problem? Note that the issue specifically occurs when reading the mesh.

Please format the code properly. Furthermore, since the mesh is big and cannot be shared, it’s unlikely anyone will be able to give specific guidance.

The general suggestion when encountering this errors in jupyter notebooks is: copy the code into a standalone python script, and try to run the script. The script will still crash, but at least it will give a backtrace which may help you in understanding what is going on.

When you say large, what do you imply, one million cells or a hundred million cells?
Also, you can share the contents of Domain.xdmf if you have written it in a binary and not ascii format, so one could get an idea of what you are trying to do.