Problem with GMSH

Hello FEniCS family,
Problem in generating a msh file (fenics 19):

File “/Users/mac/Projects/PCMFlow/Domain.py”, line 38, in channelMesh

AttributeError: ‘Geometry’ object has no attribute ‘add_line_loop’

See the following code :
#!/usr/bin/env python3

-- coding: utf-8 --

“”"
Created on Thu Jun 1 11:32:51 2023

@author: mac
“”"

from dolfin import *
from fenics import *
import pygmsh
#from fipy import CellVariable, Gmsh2D
import pyvista
import meshio
inflow = 1
outflow = 2
walls = 3
obstacle = 4

x = 5
y = 0.5
c_x = 0.3
c_y = 0.4
r_x = 0.04
d = 0.2

def channelMesh(res=0.03):
lcar=res
llcar=5*res
with pygmsh.geo.Geometry() as geometry:
for i in range(len(points)-1)]
outflow_list = [lines[1]]
flow_list = [lines[-1]]
wall_list = [lines[0], lines[2]]

``````    geometry.add_physical_surface(sf,label=12)

(points, cells, point_data,
cell_data, field_data) = geometry.generate_mesh()

meshio.write("meshFile.xdmf", meshio.Mesh(
points=points, cells={"triangle": cells["triangle"]}))

meshio.write("MeshFile.xdmf", meshio.Mesh(
points=points, cells={"line": cells["line"]},
cell_data["line"]["gmsh:physical"]}}))
``````

if name==“main”:

``````channelMesh(0.03)
``````

Any help is greatly appreciated!

This is a `pygmsh` question, not fenics related, and is better directed at the pygmsh developers

My first guess is that `add_line_loop` has been replaced with `add_curve_loop` in newer pygmsh releases.

1 Like