Skip to content

Commit

Permalink
Removed MPI direct dependency from ngsPETSc.
Browse files Browse the repository at this point in the history
MPI should either come from NGSolve/Firedrake or FEniCSx.

Signed-off-by: Umberto Zerbinati <[email protected]>
  • Loading branch information
Umberto Zerbinati committed Dec 7, 2024
1 parent cccb036 commit ec3d189
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 1 addition & 3 deletions ngsPETSc/eps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
warnings.warn("Import Warning: it was not possible to import SLEPc")
SLEPc = None

from mpi4py import MPI

from ngsolve import GridFunction

from ngsPETSc import Matrix, VectorMapping
Expand Down Expand Up @@ -41,7 +39,7 @@ class EigenSolver():
if SLEPc is not None:
def __init__(self, pencil, fes, nev, ncv=SLEPc.DECIDE, optionsPrefix=None,
solverParameters=None):
self.comm = MPI.COMM_WORLD
self.comm = PETSc.COMM_WORLD.tompi4py()
if not isinstance(pencil, tuple): pencil=tuple([pencil])
self.penLength = len(pencil)
self.fes = fes
Expand Down
4 changes: 1 addition & 3 deletions ngsPETSc/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ class comp:
"dummy class"
Mesh = type(None)

from mpi4py import MPI

FACE_SETS_LABEL = "Face Sets"
CELL_SETS_LABEL = "Cell Sets"
EDGE_SETS_LABEL = "Edge Sets"
Expand All @@ -33,7 +31,7 @@ class MeshMapping:
'''

def __init__(self, mesh=None, comm=MPI.COMM_WORLD, name="Default"):
def __init__(self, mesh=None, comm=PETSc.COMM_WORLD.tompi4py(), name="Default"):
self.name = name
self.comm = comm
if isinstance(mesh,(ngs.comp.Mesh,ngm.Mesh)):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ python = "^3.9"
netgen-mesher = "^6.2"
netgen-occt = "^7.8"
petsc4py = "^3.22.1"
mpi4py = "^4"
numpy = "^2"
scipy = "^1"

Expand All @@ -40,6 +39,7 @@ pylint = "^3.3"

[tool.poetry.group.ngsolve.dependencies]
ngsolve = "^6.2"
mpi4py = "^4"

[build-system]
requires = ["poetry-core"]
Expand Down

0 comments on commit ec3d189

Please sign in to comment.