Coder Social home page Coder Social logo

magnumnp-field-scan's Introduction

MagnumNP Field Scan init-scripts

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!

Getting Started

To run a new simulation, you need to copy the scripts from this repository into your new simulation directory.

Prerequisites

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.

Helper scripts included:

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 $H_\text{ext}=3$ mT:

./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 $H_{ext}=-3 mT$:

./xscreenshot.sh -3

Extra scripts in this repo

Keeping Your Scripts Updated

To ensure you have the latest version of the scripts, you can pull updates from the repository:

git pull origin main

magnumnp-field-scan's People

Contributors

joshuamsalazar avatar

Stargazers

 avatar  avatar

Watchers

 avatar

magnumnp-field-scan's Issues

getting code inside a non empty directory

The initial code to let it work is pointing to the . directory. then pulling code from git command fails with the error

fatal: destination path '.' already exists and is not an empty directory.

So it would be better to indicate the folder has to be new...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.