Closed gdmcbain closed 3 years ago
The application here is reproducing one of FEniCS's tutorials in scikit-fem, unsteady incompressible two-dimensional Navier–Stokes flow over a cylinder; gdmcbain/fenics-tuto-in-skfem#5.
There I had used pygmsh; this being written before the change in licence and especially before everything was broken in pygmsh 7. kinnala/scikit-fem#482
Then I had been using https://github.com/nschloe/dmsh
from pathlib import Path
import dmsh
import skfem
import skfem.io.json
length = 2.2
height = 0.41
radius = 0.05
geo = dmsh.Difference(
dmsh.Rectangle(0.0, length, 0.0, height),
dmsh.Circle([.2, .2], radius)
)
points, triangles = dmsh.generate(geo, 0.025, tol=1e-9)
mesh = skfem.MeshTri(points.T, triangles.T)
mesh.define_boundary("inlet", lambda x: x[0] == .0)
mesh.define_boundary("outlet", lambda x: x[0] == length)
skfem.io.json.to_file(mesh, Path(__file__).with_suffix('.json'))
which was working well for a few months but it's been bitten a couple of times recently with upstream changes to dmsh and its dependency meshplex resulting variously in
Exception: Mesh._validate(): Mesh contains a vertex not belonging to any element.
AttributeError: 'MeshTri' object has no attribute 'node_coords'
(this being meshplex.MeshTri, not skfem.MeshTri
)UserWarning: Mesh._validate(): Mesh contains duplicate vertices.
so I thought I might dump dmsh and look for alternatives.
What's the status of holes
for adaptmesh.triangulate
?
It should accept the parameter in the latest commit, see https://github.com/kinnala/adaptmesh/blob/master/adaptmesh/__init__.py#L15. Plan was to release in a few weeks when I finish a paper revision.
Ah, yes, master works. Thanks!
The example of holes,
raises