Skip to content

Unknown entities when creating physical group of lines and surfaces

I am creating a simple 2D mesh using the python API.

In the script (attached), I create multiple curves, for example (lines 80-82):

for i,line_i in enumerate(lines,1): gline = gmsh.model.geo.addLine(line_i[0],line_i[1],i) print(gline)

Then, I try to create groups of curves, for example (lines 88-90):

for i,curve_group_i in enumerate(curve_groups,1): gmsh.model.addPhysicalGroup(1,curve_groups[curve_group_i],i,name=curve_group_i) ggroup = gmsh.model.getEntitiesForPhysicalGroup(1,i) print(ggroup)

However, when I try to add the physical groups, I get the warning message:

Warning : Unknown entity of dimension 1 and tag # in physical group [i]

I'm not sure what I'm missing here. I don't get this error when I run t1.py, but I can't see any fundamental differences between the approaches used in both files.

Any insight would be appreciated.

example_mesh_generation.py

Edited by Kevin Irick