Using Jupyter notebook

Jupyter notebooks provide an interactive way to work with Netgen/NGSolve.

If you are using Anaconda, Jupyter is already installed. Make sure to have Anaconda with Python 3.7 installed.

Using the Python package manager pip you can install Jupyter via

# Mac/Linux
pip3 install jupyter

On Windows you need to use pip instead of pip3. Due to a bug in ipykernel on Windows you need upgrade it to at least ipykernel version 5.3.2. (see ):

# Windows
pip install --upgrade jupyter
pip install --upgrade ipykernel

To install the NGSolve Jupyter notebook extension, run

jupyter nbextension install --user --py ngsolve

Now, download the first NGSolve Jupyter notebook poisson.ipynb, and start

jupyter notebook poisson.ipynb

Step though the notebook by pressing "Shift-Enter" for every cell. A separate visualization window will pop up showing the generated mesh and computed solution.

Using Jupyter lab

The command needed to install the NGSolve Jupyter lab extension depends on the system and is generated with the following code:

python3 -c 'import ngsolve.webgui; ngsolve.webgui.howtoInstallJupyterLabextension()'