def export_domain(msh, dim, directory, prefix):
"""
Export the domain XDMF file as well as the subdomains values.
"""
# Set cell type
if dim == 2:
cell_type = "triangle"
elif dim == 3:
cell_type = "tetra"
# Generate the cell block for the domain cells
data_array = [arr for (t, arr) in msh.cells if t == cell_type]
if len(data_array) == 0:
print("WARNING: No domain physical group found.")
return
else:
data = np.concatenate(data_array)
cells = [
meshio.CellBlock(
type=cell_type,
data=data,
)
]
error:
raceback (most recent call last):
File "/home/ayush/msh2xdmf.py", line 257, in <module>
msh2xdmf(args.msh_file, args.dimension, directory=current_directory)
File "/home/ayush/msh2xdmf.py", line 28, in msh2xdmf
export_domain(msh, dim, directory, prefix)
File "/home/ayush/msh2xdmf.py", line 45, in export_domain
data_array = [arr for (t, arr) in msh.cells if t == cell_type]
File "/home/ayush/msh2xdmf.py", line 45, in <listcomp>
data_array = [arr for (t, arr) in msh.cells if t == cell_type]
TypeError: cannot unpack non-iterable CellBlock object