Skip to content

Commit

Permalink
Change for petsc main compatibility projectCoordinates() -> setCoordi…
Browse files Browse the repository at this point in the history
…nateDisc()

with argument setting setCoordinateDisc(..., project=False) - is quicker i understand.

removing obsolete petsc_dm_project_coordinates() from
petsc_discretisation.pyx
  • Loading branch information
julesghub committed Nov 14, 2023
1 parent 81ee9dd commit 155382e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
20 changes: 0 additions & 20 deletions underworld3/cython/petsc_discretisation.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,6 @@ def petsc_dm_create_submesh_from_label(incoming_dm, boundary_label_name, boundar
return


def petsc_dm_project_coordinates(incoming_dm, incoming_petsc_fe=None):
"""
Something hangs in petsc4py version of this in parallel
"""

cdef DM c_dm = incoming_dm
cdef FE c_fe = incoming_petsc_fe

if incoming_petsc_fe is None:
ierr = DMProjectCoordinates( c_dm.dm, NULL ); CHKERRQ(ierr)

else:
ierr = DMProjectCoordinates( c_dm.dm, c_fe.fe ); CHKERRQ(ierr)


# DM should be updated, no value returned

return


def petsc_dm_find_labeled_points_local(dm, label_name, sectionIndex=False, verbose=False):
'''Identify local points associated with "Label"
Expand Down
5 changes: 4 additions & 1 deletion underworld3/discretisation.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,10 @@ def nuke_coords_and_rebuild(self):
PETSc.COMM_WORLD,
)

self.dm.projectCoordinates(self.petsc_fe)
if PETSc.Sys.getVersion() < (3,20,1):
self.dm.projectCoordinates(self.petsc_fe)
else:
self.dm.setCoordinateDisc(disc=self.petsc_fe, project=False)

## LM ToDo: check if this is still a valid issue under 3.18.x / 3.19.x
# if self.degree == 1:
Expand Down

0 comments on commit 155382e

Please sign in to comment.