Skip to content

Commit

Permalink
Merge branch 'main' into uz/papero
Browse files Browse the repository at this point in the history
  • Loading branch information
UZerbinati authored Nov 7, 2024
2 parents 23673c0 + 7d1b9bc commit c115dca
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 25 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/ngsPETSc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Install pytest
run: |
pip install pytest --break-system-packages
- name: Install Netgen and ngsPETSc
run: |
pip install netgen-mesher --break-system-packages
Expand Down Expand Up @@ -120,3 +120,29 @@ jobs:
pytest tests/regression/test_poisson_strong_bcs.py
pytest tests/multigrid/test_netgen_gmg.py
pytest tests/regression/test_netgen.py
firedrake-complex:
runs-on: ubuntu-latest
container:
image: firedrakeproject/firedrake-complex:latest
options: --user root
timeout-minutes: 50

steps:
- name: Check out repository code
uses: actions/checkout@v4

- name: Install Netgen and ngsPETSc
run: |
. /home/firedrake/firedrake/bin/activate
pip install netgen-mesher
pip install xdist pytest-timeout ipympl
NGSPETSC_NO_INSTALL_REQUIRED=ON pip install .
- name: Run part of the Firedrake test suite
run: |
. /home/firedrake/firedrake/bin/activate
cd $VIRTUAL_ENV/src/firedrake
pytest tests/regression/test_poisson_strong_bcs.py
pytest tests/multigrid/test_netgen_gmg.py
pytest tests/regression/test_netgen.py
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ 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

To get started with ngsPETSc, check out the [documentation](https://ngspetsc.readthedocs.io/en/latest/).
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
```
```
18 changes: 9 additions & 9 deletions docs/src/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ 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.
::
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 \
Expand All @@ -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.
Expand Down Expand Up @@ -68,12 +66,14 @@ 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

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"
Expand Down
3 changes: 1 addition & 2 deletions ngsPETSc/utils/fenicsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
26 changes: 16 additions & 10 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,46 @@ tags:
- FEM
- Meshing
authors:
- name: Jack Betteridge
orcid: 0000-0002-3919-8603
equal-contrib: true
affiliation: 1
- name: Patrick E. Farrell
orcid: 0000-0002-1241-7060
equal-contrib: true
affiliation: 1
affiliation: 2
- name: Matthias Hochsteger
orcid: 0009-0001-8842-3221
equal-contrib: true
affiliation: 2
affiliation: 3
- name: Christopher Lackner
orcid: 0009-0000-3448-3002
equal-contrib: true
affiliation: 2
affiliation: 3
- name: Joachim Schöberl
affiliation: 2,3
affiliation: 3,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
equal-contrib: true
affiliation: 1
affiliation: 2
affiliations:
- name: University of Oxford, United Kingdom
- name: Imperial College London, United Kingdom
index: 1
- name: CERBSim GmbH, Austria
index: 2
- name: TU Wien, Austria
- index: 2
- 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
---
Expand Down

0 comments on commit c115dca

Please sign in to comment.