import numpy as np
from mpi4py import MPI
from dolfinx.mesh import create_box, CellType
from dolfinx.io import XDMFFile
#n=56 # This size still works fine
n=57 # This size makes paraview crash
mesh = create_box(MPI.COMM_WORLD, [np.array([0,0,0]), np.array([1,1,1])], [n,n,n], CellType.hexahedron)
encoding=XDMFFile.Encoding.ASCII
#encoding=XDMFFile.Encoding.HDF5
with XDMFFile(MPI.COMM_WORLD, ‘testmesh.xdmf’, “w”, encoding=encoding) as file:
file.write_mesh(mesh)
The output file makes Paraview crash. It opens fine for smaller mesh files (n<57) with the ASCII encoding. With the HDF5 encoding I don’t encounter any problems at all. Is there an inherent limitation in Paraview for ASCII encoding?
/home/dokken/Documents/src/debug/testmesh.xdmf:365297: parser error : xmlSAX2Characters: huge text node
0.9473684210526315 0.4210526315789473 0.87719298245
^
/home/dokken/Documents/src/debug/testmesh.xdmf:365297: parser error : Extra content at the end of the document
0.9473684210526315 0.4210526315789473 0.8771929824561403
^
xmlReadFile could not read /home/dokken/Documents/src/debug/testmesh.xdmf in XdmfCoreReader::XdmfCoreReaderImpl::openFile
terminate called after throwing an instance of 'XdmfError'
what(): xmlReadFile could not read /home/dokken/Documents/src/debug/testmesh.xdmf in XdmfCoreReader::XdmfCoreReaderImpl::openFile
error: exception occurred: Subprocess aborted
Which to me points to libxml has been set to a default size around 10 MB which you are hitting:
Seems like one would have to add XML_PARSE_HUGE to Verifying connection...
to be able to read huge XML files.