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 also need to downgrade it to version 4.10 (see https://github.com/ipython/ipykernel/issues/358 ):

# Windows
pip install jupyter
pip install ipykernel==4.10.0

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()'