Skip to content

Commit

Permalink
Merge pull request #18 from NGSolve/uzerbinati/powellSabin
Browse files Browse the repository at this point in the history
Create mesh even if there is an issue with labels for 1D boundary.
  • Loading branch information
UZerbinati authored Feb 5, 2024
2 parents 0c8a05b + d05fd01 commit cf89e2e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ngsPETSc/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
PETSc DMPlex using the petsc4py interface.
'''
import itertools
import numpy as np
import warnings

import numpy as np
from petsc4py import PETSc

import netgen.meshing as ngm
Expand Down Expand Up @@ -200,7 +201,10 @@ def createPETScDMPlex(self, mesh):
vStart, _ = plex.getDepthStratum(0) # vertices
for e in self.ngMesh.Elements1D():
join = plex.getJoin([vStart+v.nr-1 for v in e.vertices])
plex.setLabelValue(FACE_SETS_LABEL, join[0], int(e.index))
if len(join) > 0:
plex.setLabelValue(EDGE_SETS_LABEL, join[0], int(e.index))
else:
warnings.warn("Labled Netgen mesh not found in the plex.")
if not (1 == self.ngMesh.Elements2D().NumPy()["index"]).all():
for e in self.ngMesh.Elements2D():
join = plex.getFullJoin([vStart+v.nr-1 for v in e.vertices])
Expand Down

0 comments on commit cf89e2e

Please sign in to comment.