Spirit Code Structure

From iffwiki
Revision as of 12:36, 24 September 2016 by Gmueller (talk | contribs) (Init)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This Page explains the code structure of the Spirit code, it's namespaces, modules and approaches.


Modules

Core

Data

Engine

Utility

API

GL

This library provides OpenGL functions for visualisations of vector fields (specialized to spins)

QT UI

This User Interface, built with QT5, provides a live visualisation, the ability to start and stop simulations and to set parameters.

Python UI

This User Interface is a convenient way of using the core library in an automated way or on systems where a Graphical User Interface is not available. An interface layer has been written to provide python functions which resemble those of the core API.

Web UI

This User Interface, written in JavaScript, CSS and HTML, has been created in order to be able to showcase the code, e.g. in presentations or on mobile devices. For this interface, no installation is required and most non-mobile browsers and a few mobile ones will work.

The Web UI may also be used for educational purposes, e.g. to study spin spirals or antiferromagnets in lower level university courses. For this, some further development of the website around this will be necessary. It might even be used to teach school classes some basic magnetism.


The Engine

Method

Run logic.

  • LLG
  • GNEB
  • MMF


Optimizer

Iterates on Spin Systems to move them according to an applied force (independent of if it is physical or virtual).

  • Semi-Implicit B (SIB)
  • Heun
  • Conjugate Gradient (CG)
  • Quick-Min (QM)


Hamiltonian

Calculates energy and effective field which are needed by the optimizer and the force calculation. There are two cases currently implemented:

  • isotropic interactions, formulated in shells of neighbours
  • anisotropic interactions, formulated pair-wise


Modularity

The Method, the Optimizer (currently not yet the Hamiltonian) can be interchanged flexibly at run time. It is a goal of the developers to be able to change to a new Geometry at runtime.

This modular structure makes it very easy to extend the code and add new algorithms or physical models. In order to implement a new model, one might only need to write a new Hamiltonian, which provides a way to calculate Energies, Energy Gradients and Hessian matrices.