State
#include "Spirit/State.h"
To create a new state with one chain containing a single image, initialized by a config file, and run the most simple example of a spin dynamics simulation:
#import "Spirit/Simulation.h"
#import "Spirit/State.h"
const char * cfgfile = "input/input.cfg"; // Input file
State * p_state = State_Setup(cfgfile); // State setup
Simulation_LLG_Start(p_state, Solver_SIB); // Start a LLG simulation using the SIB solver
State_Delete(p_state) // State cleanup
-
struct State
The opaque state struct, containing all calculation data.
+-----------------------------+ | State | | +-------------------------+ | | | Chain | | | | +--------------------+ | | | | | 0th System ≡ Image | | | | | +--------------------+ | | | | +--------------------+ | | | | | 1st System ≡ Image | | | | | +--------------------+ | | | | . | | | | . | | | | . | | | | +--------------------+ | | | | | Nth System ≡ Image | | | | | +--------------------+ | | | +-------------------------+ | +-----------------------------+
This is passed to and is operated on by the API functions.
A new state can be created with
State_Setup(), where you can pass a config file specifying your initial system parameters. If you do not pass a config file, the implemented defaults are used. Note that you currently cannot change the geometry of the systems in your state once they are initialized.
-
State *State_Setup(const char *config_file = "", bool quiet = false)
Create the State and fill it with initial data.
config_file: if a config file is given, it will be parsed for keywords specifying the initial values. Otherwise, defaults are usedquiet: iftrue, the defaults are changed such that only very few messages will be printed to the console and no output files are written