19. Partial differential equations#
This chapter gives an introduction to solving partial differential equations (PDEs) using the open source software package Netgen/NGSolve.
19.1. Installation:#
Install a recent Python. Then it should be easy to install NGSolve using
pip install jupyter numpy scipy matplotlib
pip install ngsolve
pip install webgui_jupyter_widgets
To check the installation of NGSolve run in the console:
python3 -c "import ngsolve; print(ngsolve.__version__)"
Then, open jupyter-notebook, create a new notebook, create and execute a cell with
from ngsolve import *
from ngsolve.webgui import Draw
Draw (unit_cube.shape);
Known issues are
Use pip3 instead of pip if there is no pip
If you get an error like
externally-managed-environment
, then either use virtual environments, or add the flag--break-system-packages
to the pip command, see explanation
If local installation does not work, there are alternatives:
login to a jupyter server from your browser:
jupyterhub.cerbsim.com
user: ngshub_xx
pwd: solve!xx
with xx number from 01 to 31run NGSolve online within jupyter-lite:
https://jschoeberl.github.io/IntroFEM-lite/lab?path=ringveranstaltung.ipynb
The first time it might take a few minutes to start, and then again to import ngsolve.
Further reading: https://jschoeberl.github.io/iFEM/intro.html