Skip to content

Quick introduction and howto for glemur.

SimonCan edited this page Feb 3, 2015 · 3 revisions

Introduction

GLEMuR is a finite difference Lagrangian code which uses mimetic differential operators and runs on Nvidia GPUs. GLEMuR stands for Gpu-based Lagrangian mimEtic Magnetic Relaxation. Its main purpose is to study the relaxation of magnetic relaxation in environments of zero resistivity and viscosity.

GLEMuR is not a general purpose equation solver, neither are the full magnetohydrodynamics equations implemented. For such problems refer to other numerical codes.

Quick Start

Requirements

optional, but strongly recommended:

  • IPython
  • Paraview
  • Bash

Setup the code

  1. Obtain GLEMuR from its repository: git clone https://[email protected]/SimonCan/glemur.git This creates the directory glemur with its source files.

  2. Add the binary and python directories to your PATH and PYTHONPATH environmental variables: export PATH=$PATH:glemur/bin, export PATH=$PYTHONPATH:glemur/python If you are using anything else then bash add the paths accordingly. For convenience, copy those lines into your ~/.bashrc.

  3. Compile GLEMuR within the glemur/src directory by simply typing make.

  4. Create the directory data.

  5. Run the code with ./glemur

Visualize the data

Before we can plot we need to make sure that IPython knows about GLEMuR by changing a few configuration files. These can reside in different directories, depending on which operating system or distribution you have. The following will work with Ubutnu 14.04:

  1. Add to your ~/.ipython/ipythonrc: import_all glemur.

  2. Add to your ~/.ipython/profile_default/startup/init.py: import glemur as gm and import pylab as plt.

  3. Go back to your simulation directory glemur/src and start ipython.

  4. Load and plot the data: ts = gm.readTs(), plt.plot(ts.t, ts.B2).

Advanced setup and visualization

  • Tidy up your simulation directory structure.
  • Simulation parameters.
  • Creating custom initial conditions.

Code internals

  • Time stepping.
  • Boundary conditions.
  • Mimetic operators.