Skip to content

Commit

Permalink
fix cell order
Browse files Browse the repository at this point in the history
  • Loading branch information
nschloe committed Jan 28, 2022
1 parent e57d36f commit 40d4d97
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/pygmsh/common/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,6 @@ def generate_mesh( # noqa: C901
for entity in self._OUTWARD_NORMALS:
gmsh.model.mesh.setOutwardOrientation(entity.id)

if order is not None:
gmsh.model.mesh.setOrder(order)

gmsh.option.setNumber("General.Terminal", 1 if verbose else 0)

# set algorithm
Expand All @@ -376,6 +373,11 @@ def generate_mesh( # noqa: C901

gmsh.model.mesh.generate(dim)

# setOrder() after generate(), see
# <https://github.com/nschloe/pygmsh/issues/515#issuecomment-1020106499>
if order is not None:
gmsh.model.mesh.setOrder(order)

return extract_to_meshio()

def save_geometry(self, filename: str):
Expand Down
3 changes: 3 additions & 0 deletions tests/built_in/test_hole_in_square.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ def test():
xmin, xmax, ymin, ymax, 0.0, lcar, holes=[squareHole.curve_loop]
)
mesh = geom.generate_mesh(order=2)

assert "triangle6" in mesh.cells_dict

# TODO support for volumes of triangle6
# ref = 16.0
# from helpers import compute_volume
Expand Down

0 comments on commit 40d4d97

Please sign in to comment.