Error example: Drag minimization over an obstacle in Stokes-flow

Esteemed,

as an example http://www.dolfin-adjoint.org/en/latest/documentation/stokes-shape-opt/stokes_problem.html, I downloaded the code at https://github.com/dolfin-adjoint/pyadjoint / tree / master / examples / stokes-shape-opt.

Well, trying to generate the mesh using the create_mesh.py code, generated the following error:

File "/Users/xyz/opt/anaconda3/envs/fenics2/lib/python3.8/site-packages/pygmsh/built_in/geometry.py", line 522, in <listcomp>
     nodes = list (set ([p.id for and in edges_list for p in e.points]))

AttributeError: 'EllipseArc' object has no attribute 'points'

Some help?

What version of pygmsh are you using? Based on the directory structure looks like it’s old.

The code in the file is based on an older version of pygmsh. I am updating it to use the GMSH python API. I’ll let you know once it is pushed.

1 Like

I am using pygmsh version 6.1.1.

A branch with updated mesh generation can be found here. Note that it does no longer depend on pygmsh, but directly on the python API. See the following Pull request for updates on when this is in master.

2 Likes

Thanks, it worked, but the names of the facets marker values must be changed in the code stokes_problem.py

line 99: from create_mesh import inflow_marker, outflow_marker, wall_marker, obstacle_marker, c_x, c_y, L, H

and the other lines that call those names.

They have been changed in the corresponding file in the pull request.

1 Like