Skip to content

Commit

Permalink
Honor partition params + pyproject.toml update (#72)
Browse files Browse the repository at this point in the history
Fix mesh distribution for a Netgen mesh
  • Loading branch information
StefanoFochesatto authored Feb 3, 2025
1 parent e70f901 commit 0cc7e30
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 30 deletions.
5 changes: 3 additions & 2 deletions ngsPETSc/utils/firedrake/meshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def refineMarkedElements(self, mark):
:arg mark: the marking function which is a Firedrake DG0 function.
'''
DistParams = self._distribution_parameters
els = {2: self.netgen_mesh.Elements2D, 3: self.netgen_mesh.Elements3D}
dim = self.geometric_dimension()
if dim in [2,3]:
Expand All @@ -66,8 +67,8 @@ def refineMarkedElements(self, mark):
el.refine = False
self.netgen_mesh.Refine(adaptive=True)
mark = mark-np.ones(mark.shape)
return fd.Mesh(self.netgen_mesh)
return fd.Mesh(netgen.libngpy._meshing.Mesh(dim))
return fd.Mesh(self.netgen_mesh, distribution_parameters=DistParams)
return fd.Mesh(netgen.libngpy._meshing.Mesh(dim), distribution_parameters=DistParams)
else:
raise NotImplementedError("No implementation for dimension other than 2 and 3.")

Expand Down
60 changes: 32 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,50 @@
[tool.poetry]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[project]
name = "ngsPETSc"
version = "0.0.8"
description = "NGSolve/Netgen interface to PETSc"
authors = [
"Umberto Zerbinati <[email protected]>",
"Patrick E. Farrell <[email protected]>",
"Stefano Zampini <[email protected]>",
"Jack Betteridge <[email protected]>",
{ name = "Umberto Zerbinati", email = "[email protected]" },
{ name = "Patrick E. Farrell", email = "[email protected]" },
{ name = "Stefano Zampini", email = "[email protected]" },
{ name = "Jack Betteridge", email = "[email protected]" }
]
maintainers = [
"Umberto Zerbinati <[email protected]>",
{ name = "Umberto Zerbinati", email = "[email protected]" }
]
readme = "README.md"
license = "MIT"
packages = [
{include = "ngsPETSc"}
]
documentation = "https://ngspetsc.readthedocs.io/en/latest/"
repository = "https://github.com/NGSolve/ngsPETSc"
requires-python = ">=3.9,<4.0"
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Development Status :: 3 - Alpha"
]
dependencies = [
"netgen-mesher >= 6.2,<7.0",
"netgen-occt >=7.8,<8.0",
"petsc4py >=3.22.1,<4.0",
"numpy >=2,<3",
"scipy >=1,<2",
]

[project.urls]
Documentation = "https://ngspetsc.readthedocs.io/en/latest/"
Repository = "https://github.com/NGSolve/ngsPETSc"

[project.optional-dependencies]
firedrake = [
"firedrake"
]

[tool.poetry.dependencies]
python = "^3.9"
netgen-mesher = "^6.2"
netgen-occt = "^7.8"
petsc4py = "^3.22.1"
numpy = "^2"
scipy = "^1"
[tool.poetry]
packages = [
{ include = "ngsPETSc" }
]

[tool.poetry.group.dev.dependencies]
pytest = "^8.3"
Expand All @@ -40,12 +53,3 @@ pylint = "^3.3"
[tool.poetry.group.ngsolve.dependencies]
ngsolve = "^6.2"
mpi4py = "^4"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[project.optional-dependencies]
firedrake = [
"firedrake",
]

0 comments on commit 0cc7e30

Please sign in to comment.