MPI-AMRVAC
3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
|
This document describes the use of Python for processing MPI-AMRVAC simulation data. Both the reading of native .dat
- and vtk
-filetypes (.vtu
, .pvtu
, .vti
) are supported. The goal of these Python tools is to provide additional data-analysis support with main focus on 1D and 2D simulation data, although there is functionality to read in and process 3D datasets.
All Python tools are located in the directory $AMRVAC_DIR/tools/python
. This folder contains a setup script to install the package, a small readme with some instructions and finally the subdirectory amrvac_pytools
itself, containing the Python tools for both the .dat files and .vtk files.
These tools were originally initiated by Oliver Porth (in particular the vtk
readers), and have recently been refactored and extended to include datfile support by Niels Claes and Clément Robert.
The Python tools depend on a few standard packages:
The tools are packed into a handy Python package, which is continuously further developed and improved. We recommend installing it with develop arguments, so that it does not need to be reinstalled with each update. This can be done in three distinct ways:
conda
(recommended) cd $AMRVAC_DIR/tools/python conda install conda-build conda develop .
pip
cd $AMRVAC_DIR/tools/python pip install -e .
cd $AMRVAC_DIR/tools/python python setup.py develop
Ofcourse, adding the folder directly to your PYTHONPATH works as well but is not recommended.
export PYTHONPATH=$AMRVAC_DIR/tools/python:$PYTHONPATH
Start > Control panel > Edit the system environment variables > tab 'advanced' > environment variablesCreate or edit the variable
PYTHONPATH
in the system variables list, where you add the full path to .../amrvac/tools/python
. Multiple paths for a single environment variable are separated by a semicolon ';'.