Skip to main content

Minimal Python lib to process OOMMF format output files

Project description

DOI

   .+------+-------+-------+-------+-------+-------+-------+
 .'      .'      .'      .'      .'      .'      .'      .'|
+---+--+'------+'------+'------+'------+'------+'------+'  -
|      |       |       |       |       |       |       |   |
|   O  +   O   +   M   +   M   +   F   +   P   +   Y   +   +
|      |       |       |       |       |       |       | .'
+------+'------+'------+'------+-------+-------+-------+'

OOMMFPy

A very minimal and simple Python library to read and extract data from OOMMF magnetisation files omf, which are also used in MuMax3. In addition to this library we provide tools to plot omf files and convert them to vtk files.

Highlights:

  • Read omf files in any format
  • Can also read ovf files and MuMax3 files
  • Painless conversion of the data in an omf file into Numpy arrays for data analysis
  • Fast calculation (using Numpy) of the skyrmion number in a slice of the system in any plane orientation (xy, xz, yz)
  • Fast reading of omf files in binary format (using Numpy's fromfile)
  • Minimal and super fast tool to convert omf files to VTK format
  • Plot functions

Install

The easiest is to use pip or poetry to install the package from PyPI

pip install oommfpy

The Github address can also be directly used to install the package via pip

pip install git+https://github.com/davidcortesortuno/oommfpy

Alternatively, a setup.py file is provided to install this library

git clone https://github.com/davidcortesortuno/oommfpy
cd oommfpy
pip install ./

If successful, the plot_omf and omf2vtk tools are installed in the corresponding bin directory and can be called from the command line.

A C library is built with the installation process, thus the setup file tries to install Cython if is not present in the system.

Documentation

For now check the doc/ipynb folder which contains a tutorial with basic functionality. To load a file with a magnetisation field, which is found more commonly in simulations, use the MagnetisationData class. To load any field, such as the dipolar field, use the FieldData class.

Scripts to convert omf to VTK can be called directly as, for example,

omf2vtk -i omfs/my_oommf_output.omf -o test.vtk

The input path can also be a directory or a path with a wildcard, e.g. omfs/*.omf. This method assumes the files in the path come from the same simulation as the tool loads the mesh from the first file in the path and then only updates the magnetisation fields.

Similar options are provided for the plot_omf function. Use the --help for details.

TODO

  • More tests
  • Add pyproject.toml file to avoid manual installation of Cython in setup.py
  • More options to plotting library
  • Print z coordinate when computing sk number
  • Allow Periodic boundaries for the skyrmion number calculation
  • Add typing check
  • Support for multiple OS

Citation

If you find this library useful, please cite this repository as:

@Misc{Cortes2019,
  author       = {David Cort{\'e}s-Ortu{\~n}o},
  title        = {OOMMFPy},
  howpublished = {Zenodo doi:10.5281/zenodo.2611194. Github: https://github.com/davidcortesortuno/oommfpy},
  year         = {2019},
  doi          = {10.5281/zenodo.2611194},
  url          = {https://doi.org/10.5281/zenodo.2611194},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

oommfpy-1.1b0.tar.gz (550.7 kB view details)

Uploaded Source

Built Distribution

oommfpy-1.1b0-cp38-cp38-manylinux_2_33_x86_64.whl (551.1 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.33+ x86-64

File details

Details for the file oommfpy-1.1b0.tar.gz.

File metadata

  • Download URL: oommfpy-1.1b0.tar.gz
  • Upload date:
  • Size: 550.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.3 Linux/5.11.4-1-default

File hashes

Hashes for oommfpy-1.1b0.tar.gz
Algorithm Hash digest
SHA256 ef336d678d757a91ba0f2902d6c0e8a817984f71fda2d1b181a2d06b82e8ae0f
MD5 58bc67f7d0b5ae25c3c9712764ee94b6
BLAKE2b-256 258874bbd225394171d1920307cd0717f163b6b12f88177dfe022ed0f258c328

See more details on using hashes here.

File details

Details for the file oommfpy-1.1b0-cp38-cp38-manylinux_2_33_x86_64.whl.

File metadata

  • Download URL: oommfpy-1.1b0-cp38-cp38-manylinux_2_33_x86_64.whl
  • Upload date:
  • Size: 551.1 kB
  • Tags: CPython 3.8, manylinux: glibc 2.33+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.6 CPython/3.8.3 Linux/5.11.4-1-default

File hashes

Hashes for oommfpy-1.1b0-cp38-cp38-manylinux_2_33_x86_64.whl
Algorithm Hash digest
SHA256 2bb9b9ee3e5f4d2734444915c5a14fba0cc0025db348c1db7378d18fdd0c2a7b
MD5 9fad0fb8995ff38fa70b97cc2a0e5e35
BLAKE2b-256 ff346b1a1267050e7167c4487523da529d03b6f96ae1dffb021c95fd1c333ed2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page