Skip to content

Commit 7528fa0

Browse files
committed
fix
1 parent e58dd9c commit 7528fa0

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

demos/netgen/netgen_mesh.py.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ We can set the degree of the geometry via ``netgen_flags`` keyword argument of t
346346
ngmesh = OCCGeometry(shape, dim=2).GenerateMesh(maxh=1.)
347347
else:
348348
ngmesh = netgen.libngpy._meshing.Mesh(2)
349-
mesh = Mesh(ngmesh, comm=COMM_WORLD, netgen_flags={"degree": 3})
349+
mesh = Mesh(ngmesh, comm=COMM_WORLD, netgen_flags={"degree": 4})
350350
VTKFile("output/MeshExample5.pvd").write(mesh)
351351

352352
.. figure:: Example5.png
@@ -365,7 +365,7 @@ We will now show how to solve the Poisson problem on a high-order mesh, of order
365365
ngmesh = OCCGeometry(shape, dim=3).GenerateMesh(maxh=1.)
366366
else:
367367
ngmesh = netgen.libngpy._meshing.Mesh(3)
368-
mesh = Mesh(ngmesh, netgen_flags={"degree": 4})
368+
mesh = Mesh(ngmesh, netgen_flags={"degree": 3})
369369

370370
# Solving the Poisson problem
371371
VTKFile("output/MeshExample6.pvd").write(mesh)

firedrake/netgen.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def netgen_distribute(V: firedrake.functionspaceimpl.WithGeometryBase,
3838
Parameters
3939
----------
4040
V
41-
The target function space defining the data DMPlex layout.
41+
The target function space defining the DMPlex layout.
4242
netgen_data
4343
The data in the layout of the underlying netgen mesh.
4444
@@ -97,9 +97,6 @@ def find_permutation(points_a: npt.NDArray[np.inexact], points_b: npt.NDArray[np
9797
raise ValueError("`points_a` and `points_b` must have the same shape.")
9898

9999
p = [np.where(cdist(a, b).T < tol)[1] for a, b in zip(points_a, points_b)]
100-
if len(p) == 0:
101-
return p
102-
103100
try:
104101
permutation = np.array(p, ndmin=2)
105102
except ValueError as e:
@@ -145,7 +142,7 @@ class FiredrakeMesh:
145142
:param netgen_flags: The dictionary of flags to be passed to ngsPETSc.
146143
:arg comm: the MPI communicator.
147144
'''
148-
def __init__(self, mesh, netgen_flags=None, user_comm=COMM_WORLD):
145+
def __init__(self, mesh, netgen_flags, user_comm=COMM_WORLD):
149146
self.comm = user_comm
150147
# Parsing netgen flags
151148
if not isinstance(netgen_flags, dict):

0 commit comments

Comments
 (0)