From ee82dffaef31b3d49702fa76dec9e8e6de76db81 Mon Sep 17 00:00:00 2001 From: Umberto Zerbinati Date: Wed, 6 Nov 2024 12:54:35 +0000 Subject: [PATCH 1/4] Minor fix for the JOSS Review (#58) * Fix read me * Fix install.html, removing superfluos package Signed-off-by: Umberto Zerbinati --------- Signed-off-by: Umberto Zerbinati Co-authored-by: Umberto Zerbinati --- README.md | 4 ++-- docs/src/install.rst | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 668fa82..5d652fd 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ If you already have NGSolve (with MPI support) and PETSc installed, you can inst cd ngsPETSc pip install . ``` -Alternatively, you can also build PETSc, SLEPc, and NGSolve from source following the instructions in the [documentation](https://ngspetsc.readthedocs.io/en/latest/installation.html). +Alternatively, you can also build PETSc, SLEPc, and NGSolve from source following the instructions in the [documentation](https://ngspetsc.readthedocs.io/en/latest/install.html). ## Getting started @@ -21,4 +21,4 @@ To get started with ngsPETSc, check out the [documentation](https://ngspetsc.rea To test the installation, you can run the tests in the `tests` folder, via the Makefile in the root directory of the repository: ```bash make test -``` \ No newline at end of file +``` diff --git a/docs/src/install.rst b/docs/src/install.rst index 852d80e..1e20a58 100644 --- a/docs/src/install.rst +++ b/docs/src/install.rst @@ -17,9 +17,7 @@ We now install PETSc from scratch in a suitable folder, with OpenMPI, HYPRE, Met :: git clone https://gitlab.com/petsc/petsc.git cd petsc - python configure --download-chaco \ - --download-cmake \ - --download-eigen \ + python configure --download-cmake \ --download-openmpi \ --download-hypre \ --download-metis \ @@ -28,13 +26,13 @@ We now install PETSc from scratch in a suitable folder, with OpenMPI, HYPRE, Met --download-mumps \ --download-scalapack \ --download-superlu_dist \ + --download-fblaslapack=1 \ --with-c2html=0 \ - --with-cxx-dialect=C++11 \ --with-debugging=0 \ - --download-fblaslapack=1 \ --with-fortran-bindings=0 \ --with-shared-libraries=1 \ - --with-petsc4py=1 \ + --with-petsc4py=1 + To build PETSc you need to run the Makefile as suggested at the end of the configuration script. We now need to set in the ``.bashrc`` (on OSX in ``.bash_profile``) file the ``PETSC_DIR``, ``PETSC_ARCH`` system variables as they appear when we finish build PETSc. You also need to add to your ``PYTHONPATH`` the ``PYTHONPATH`` that appears when we finished building PETSc. @@ -71,9 +69,11 @@ Now we build NGSolve from source. cmake -DCMAKE_INSTALL_PREFIX=${BASEDIR}/ngsolve-install ${BASEDIR}/ngsolve-src -DUSE_MPI=ON make make install + You should add to your ``.bashrc`` the ``BASEDIR`` system variable: :: - echo "export $BASEDIR=${BASEDIR}" >> ~/.bashrc + echo "export $BASEDIR=${BASEDIR}" >> ~/.bashrc + We suggest you add the following lines to your ``.bashrc``: :: export NETGENDIR="${BASEDIR}/ngsolve-install/bin" From f8803959b5da37d6da2a0b6057afdf0cc358ac1d Mon Sep 17 00:00:00 2001 From: Umberto Zerbinati Date: Wed, 6 Nov 2024 13:55:13 +0000 Subject: [PATCH 2/4] Fix Issue #56 (#59) Fix Issue #56 --------- Signed-off-by: Umberto Zerbinati Co-authored-by: Umberto Zerbinati --- docs/src/install.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/install.rst b/docs/src/install.rst index 1e20a58..adb65e1 100644 --- a/docs/src/install.rst +++ b/docs/src/install.rst @@ -11,7 +11,7 @@ First we install all the needed packages using apt and pip or an equivalent pack :: apt-get update apt-get -y install git build-essential cmake python3 python3-distutils python3-tk libpython3-dev libxmu-dev tk-dev tcl-dev g++ libglu1-mesa-dev liblapacke-dev libblas-dev liblapack-dev - pip install numpy cython pytest pytest-mpi + pip install numpy cython pytest pytest-mpi netgen-occt We now install PETSc from scratch in a suitable folder, with OpenMPI, HYPRE, Metis, MUMPS, SuprLU, Scalapack and eigen. :: @@ -66,7 +66,7 @@ Now we build NGSolve from source. mkdir $BASEDIR/ngsolve-build mkdir $BASEDIR/ngsolve-install cd $BASEDIR/ngsolve-build - cmake -DCMAKE_INSTALL_PREFIX=${BASEDIR}/ngsolve-install ${BASEDIR}/ngsolve-src -DUSE_MPI=ON + cmake -DCMAKE_INSTALL_PREFIX=${BASEDIR}/ngsolve-install ${BASEDIR}/ngsolve-src -DUSE_MPI=ON -DUSE_OCC=ON make make install From 7d1b9bc2caa213ccfd0de3bf5faf59b4fda93ea4 Mon Sep 17 00:00:00 2001 From: Umberto Zerbinati Date: Wed, 6 Nov 2024 15:19:20 +0000 Subject: [PATCH 3/4] Fix typing annotation of output type of GeometricModel in utils/fenicsx.py (#60) Co-authored-by: Francesco Ballarin --- ngsPETSc/utils/fenicsx.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ngsPETSc/utils/fenicsx.py b/ngsPETSc/utils/fenicsx.py index 89ed326..e5d5b4d 100644 --- a/ngsPETSc/utils/fenicsx.py +++ b/ngsPETSc/utils/fenicsx.py @@ -30,8 +30,7 @@ def model_to_mesh(self, hmax: float, gdim: int = 2, [_MPI.Comm, int, int, dolfinx.cpp.graph.AdjacencyList_int32], dolfinx.cpp.graph.AdjacencyList_int32] = dolfinx.mesh.create_cell_partitioner(dolfinx.mesh.GhostMode.none), - transform: typing.Any = None, routine: typing.Any = None) -> typing.Tuple[dolfinx.mesh.Mesh, - dolfinx.cpp.mesh.MeshTags_int32,dolfinx.cpp.mesh.MeshTags_int32]: + transform: typing.Any = None, routine: typing.Any = None) -> dolfinx.mesh.Mesh: """Given a NetGen model, take all physical entities of the highest topological dimension and create the corresponding DOLFINx mesh. From 8ede8bd56b2a3f8173c255aca5145f9e91b50e5b Mon Sep 17 00:00:00 2001 From: Umberto Zerbinati Date: Thu, 7 Nov 2024 00:45:58 +0000 Subject: [PATCH 4/4] State of the Field (#62) Update paper.md --------- Signed-off-by: Umberto Zerbinati Co-authored-by: Umberto Zerbinati --- paper/paper.bib | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ paper/paper.md | 22 ++++++++++---- 2 files changed, 97 insertions(+), 6 deletions(-) diff --git a/paper/paper.bib b/paper/paper.bib index 20db3dc..9da3f6c 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -24,6 +24,23 @@ @article{Firedrake year={2023}, doi= {10.25561/104839} } +@article{TETGEN, +author = {Si, Hang}, +title = {TetGen, a Delaunay-Based Quality Tetrahedral Mesh Generator}, +year = {2015}, +issue_date = {January 2015}, +publisher = {Association for Computing Machinery}, +address = {New York, NY, USA}, +volume = {41}, +number = {2}, +issn = {0098-3500}, +url = {https://doi.org/10.1145/2629697}, +doi = {10.1145/2629697}, +journal = {ACM Trans. Math. Softw.}, +month = feb, +articleno = {11}, +numpages = {36} +} @techreport{PETSc, author={Satish Balay and Shrirang Abhyankar and Mark~F. Adams and Steven Benson and Jed Brown and Peter Brune and Kris Buschelman and Emil Constantinescu and Lisandro @@ -181,3 +198,67 @@ @article{stevenson2006 R.}, year={2006}, pages={245--269} } +@article{FreeFEM, + title={FreeFem++ manual}, + author={Hecht, Fr{\'e}d{\'e}ric and Pironneau, Olivier and Le Hyaric, A and Ohtsuka, K}, + journal={Laboratoire Jacques Louis Lions}, + year={2005} +} +@Article{DUNE, +author={Dedner, Andreas +and Kl{\"o}fkorn, Robert +and Nolte, Martin +and Ohlberger, Mario}, +title={A generic interface for parallel and adaptive discretization schemes: abstraction principles and the Dune-Fem module}, +journal={Computing}, +year={2010}, +month={Nov}, +day={01}, +volume={90}, +number={3}, +pages={165-196}, +issn={1436-5057}, +doi={10.1007/s00607-010-0110-3}, +url={https://doi.org/10.1007/s00607-010-0110-3} +} +@Article{dealII, + title = {The \texttt{deal.II} Library, Version 9.5}, + author = {Daniel Arndt and Wolfgang Bangerth and Maximilian Bergbauer and + Marco Feder and Marc Fehling and Johannes Heinz and + Timo Heister and Luca Heltai and Martin Kronbichler and + Matthias Maier and Peter Munch and Jean-Paul Pelteret and + Bruno Turcksin and David Wells and Stefano Zampini}, + journal = {Journal of Numerical Mathematics}, + year = {2023}, + doi = {10.1515/jnma-2023-0089}, + pages = {231--246}, + volume = {31}, + number = {3}, + url = {https://dealii.org/deal95-preprint.pdf} +} +@misc{dolfinX, + author = {Baratta, Igor A. and + Dean, Joseph P. and + Dokken, Jørgen S. and + Habera, Michal and + Hale, Jack S. and + Richardson, Chris N. and + Rognes, Marie E. and + Scroggs, Matthew W. and + Sime, Nathan and + Wells, Garth N.}, + title = {{DOLFINx: The next generation FEniCS problem solving environment}}, + month = dec, + year = 2023, + publisher = {Zenodo}, + doi = {10.5281/zenodo.10447666}, + url = {https://doi.org/10.5281/zenodo.10447666} +} +@article{GMSH, + title={A three-dimensional finite element mesh generator with built-in pre-and post-processing facilities}, + author={Geuzaine, Christophe and Remacle, Jean-Fran{\c{c}}ois}, + journal={International Journal for Numerical Methods in Engineering}, + volume={11}, + pages={79}, + year={2020} +} diff --git a/paper/paper.md b/paper/paper.md index c666efb..2b35469 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -12,15 +12,23 @@ authors: - name: Patrick E. Farrell orcid: 0000-0002-1241-7060 equal-contrib: true + affiliation: 3 + - name: Matthias Hochsteger + orcid: 0009-0001-8842-3221 + equal-contrib: true + affiliation: 2 + - name: Christopher Lackner + orcid: 0009-0000-3448-3002 + equal-contrib: true affiliation: 2 - name: Joachim Schöberl - affiliation: 3 + affiliation: 2,4 equal-contrib: true orcid: 0000-0002-1250-5087 - name: Stefano Zampini orcid: 0000-0002-0435-0433 equal-contrib: true - affiliation: 4 + affiliation: 5 - name: Umberto Zerbinati orcid: 0000-0002-2577-1106 corresponding: true @@ -29,19 +37,21 @@ authors: affiliations: - name: Imperial College London, United Kingdom index: 1 - - name: University of Oxford, United Kingdom + - name: CERBSim GmbH, Austria index: 2 - - name: TU Wien, Austria + - name: University of Oxford, United Kingdom index: 3 - - name: King Abdullah University of Science and Technology, Saudi Arabia + - name: TU Wien, Austria index: 4 + - name: King Abdullah University of Science and Technology, Saudi Arabia + index: 5 date: 1 July 2024 bibliography: paper.bib --- # Summary -Combining advanced meshing techniques with robust solver capabilities is essential for solving difficult problems in computational science and engineering. This paper introduces ngsPETSc, software built with petsc4py [@petsc4py] that seamlessly integrates the NETGEN mesher [@Netgen], the NGSolve finite element library [@NGSolve], and the PETSc toolkit [@PETSc]. ngsPETSc enables the use of NETGEN meshes and geometries in PETSc-based solvers, and provides NGSolve users access to the wide array of linear, nonlinear solvers, and time-steppers available in PETSc. +Combining advanced meshing techniques with robust solver capabilities is essential for solving difficult problems in computational science and engineering. In recent years, various software packages have been developed to support the integration of meshing tools with finite element solvers. To mention a few, FreeFEM [@FreeFEM] includes built-in support for mesh generation, allowing users to create and manipulate meshes directly within the software. Similarly, deal.II [@dealII] provides a GridGenerator class for generating standard mesh geometries like grids and cylinders. Furthermore, deal.II can interface with OpenCASCADE [@OpenCASCADE] to refine existing grids while conforming to the geometry provided. Other finite element libraries, such as Firedrake [@Firedrake], DUNE-FEM [@DUNE], and FEniCSx [@dolfinX], rely on external tools like Gmsh [@GMSH] and Tetgen [@TETGEN] for mesh generation. This paper introduces ngsPETSc, software built with petsc4py [@petsc4py] that seamlessly integrates the NETGEN mesher [@Netgen], the NGSolve finite element library [@NGSolve], and the PETSc toolkit [@PETSc]. ngsPETSc enables the use of NETGEN meshes and geometries in PETSc-based solvers, and provides NGSolve users access to the wide array of linear, nonlinear solvers, and time-steppers available in PETSc. # Statement of Need