Welcome to the MagnumNP Field Scan repository! This repository contains some useful helper scripts for running simulations using the MagnumNP simulation framework. This is my personal setup for running simulations, feel free to branch and improve this code and workflow!
To run a new simulation, you need to copy the scripts from this repository into your new simulation directory.
Make sure you have magnumnp on your system. If you don't, you can download it from magnumNP repo. Clone this repository into your current directory:
git clone https://github.com/joshuamsalazar/magnumnp-field-scan.git .
The way I run simulations here is:
- Pulling the scripts from the repo.
- Set up the structure geometry inside
m2.py
and material parameters. - Run a sample simulation with
$H_\text{ext}=0 \text{ mT}$ :$ python3 m2.py 0
. - Check the generated .vti file and data to see if it agrees with the desired structure.
- Run simulation in series for every external field amplitude:
$ ./xsweep.sh m2.py -10 10 1
- Generate the dataset with the results,
datsweep.dat
, by calling$ ./xdatsweep.sh
at any time.
The repository contains the following essential scripts:
- g* files for plotting with
gnuplot
. - x* files as
bash
scripts.
Runs simulations in series, changing the external field amplitude per simulation. Example usage: This command runs the m2.py file, variying the field amplitude from -10 mT to 10 mT.
./xsweep m2.py -10 10 1
Reads all the simulations for different field amplitudes and generates a datsweep.dat file with the relaxed magnetization directions at that state. Then, plots the generated dataset
./xdatsweep.dat
Generates and shows desired plot (SOT fields, Hext, or magnetization). If you want to see the magnetization state of, the simulation at
./xplot gmrx.py 3
Makes an screenshot from a top-view perspective automatically for every external field amplitude. To generate a figure from the simulation data at
./xscreenshot.sh -3
Extra scripts in this repo
To ensure you have the latest version of the scripts, you can pull updates from the repository:
git pull origin main