Hey there.
I created a mesh with GMSH, .geo. I wanted to import this mesh to Fenics by using msh2xdmf file (msh2xdmf/msh2xdmf.py at master · floiseau/msh2xdmf · GitHub).
When the program runs this line:
msh2xdmf('malla_modo3.msh',2)
I get the error
File "/mnt/c/fenics/msh2xdmf.py", line 28, in msh2xdmf
export_domain(msh, dim, directory, prefix)
File "/mnt/c/fenics/msh2xdmf.py", line 45, in export_domain
data_array = [arr for (t, arr) in msh.cells if t == cell_type]
File "/mnt/c/fenics/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
This program msh2xmdf should be fine, as it works in a lot of other simulations. I’m guessing the problem is my mesh, but I checked the meshing on GMSH and it looked fine. Here is the original .geo from which I obtained .msh.
lc=0.1;
Point(1) = {0, 0, 0, lc};
Point(2) = {0.5, 0, 0, lc};
Point(3) = {0.5, 1, 0, lc};
Point(4) = {-0.5, 1, 0, lc};
Point(5) = {-0.5, 0.01, 0, lc};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {4, 4};
Line(4) = {3, 4};
Line(5) = {4, 5};
Line(6) = {5, 1};
Curve Loop(1) = {4, 5, 6, 1, 2};
Plane Surface(1) = {1};
Thanks in advance.