Installation¶
There are various ways to install magnum.fe on your computer. By purchasing magnum.fe you are supplied with a virtual machine image for use in VirtualBox and a Docker image. While the easiest way to get started is the virtual machine image, the Docker solution is faster and the better choice for the simulation on dedicated simluation servers.
Virtual Box¶
The magnum.fe virtual box contains a complete Linux system including the meshing software Gmsh and the postprocessing software Gnuplot and Paraview. In order to run the magnum.fe virtual machine you have to install the free host software VirtualBox that is available for Windows, Linux and Mac OS.
After installing, run VirtualBox and import the magnum.fe image (‘OVA’ file) by choosing File -> Import Appliance..., see Fig. 1.
You should now be able to start the virtual machine and login with user: ‘magnumfe’ and password: ‘magnumfe’. After successful login the virtual machine starts in a graphical user session with a terminal opened. You can start your first simulation by running one of the supplied examples in your home directory, e.g. the standard problem #4 by the MuMag group, see Fig. 2.
This example produces a PVD file that contains the magnetization configuration for each time step. You can watch the outcome in Paraview by typing paraview data/m.pvd
. In order to make your simulation results available on your host system you can use shared directories. To use a directory of your host system within the virtual machine add a shared folder by selecting Devices -> Shared Folder Settings..., see Fig. 3.
After reboot, the shared folder should be available at /media/sf_simulations
.
The supplied image by default will use 2GB of RAM and 2 CPUs. You can improve the performance of magnum.fe by increasing these resources according to your host systems capabilities.
Docker¶
The second option for the installation of magnum.fe is a Docker container. Docker, in contrast to the virtual machine, does not virtualize the complete operating system, but reuses the Kernel of the host system. The overhead produced by this virtualization is much lower than that of a complete virtual machine and the programs running in the Docker container have full access to the resources of the host system. However, the higher performance comes at the price of a more difficult setup. Like the VirtualBox the Docker client is available for Windows, Linux and Mac OS. After installing Docker you can load the magnum.fe Docker image by running
docker load -i magnumfe_master_08_31_15_38ada6b.tar
This creates a new image called ‘suessco/magnum.fe’. Now you can run your simulation scripts in the Docker container. A convenient way of doing so, is to mount the current directory in the container then run the script there. The advantage of this procedure is that the simulation results are directly written back to the filesystem of the host system.
docker run -v $(pwd):/sim -w /sim -t suessco/magnum.fe python run.py
Additionally it is recommended to mount /root/.instant
in the host system. This directory is used by the finite-element library FEniCS to cache runtime compiled code. The file docker_scripts.tar.gz
contains some convenience wrappers for standard tasks.
# Call simulation script
magnum.fe run.py
# Open interactive IPython session
imagnum.fe
# Convert mesh from Gmsh format to magnum.fe format
magnum.msh sample.msh sample.xml
Installation from Source¶
If the two virtual approaches do not meet your needs, please contact us to talk about the possibilty to install magnum.fe on your system from source.