Package: oommfpy
.+------+-------+-------+-------+-------+-------+-------+
 .'      .'      .'      .'      .'      .'      .'      .'|
+---+--+'------+'------+'------+'------+'------+'------+'  -
|      |       |       |       |       |       |       |   |
|   O  +   O   +   M   +   M   +   F   +   P   +   Y   +   +
|      |       |       |       |       |       |       | .'
+------+'------+'------+'------+-------+-------+-------+'OOMMFPyA very minimal and simple Python library to read and extract data from OOMMF
magnetisation filesomf, which are also used in MuMax3. In addition to this
library we provide tools to plotomffiles and convert them tovtkfiles.Highlights:Readomffiles in any formatCan also readovffiles and MuMax3 filesPainless conversion of the data in anomffile into Numpy arrays for data
analysisFast calculation (using Numpy) of the skyrmion number in a slice of the
system in any plane orientation (xy,xz,yz)Fast reading ofomffiles in binary format (using Numpy'sfromfile)Minimal and super fast tool to convertomffiles to VTK formatPlot functionsEarly support for Paraview plugin: readomffiles directly!InstallThe easiest is to usepiporpoetryto install the package fromPyPIpip install oommfpyThe Github address can also be directly used to install the package viapippip install git+https://github.com/davidcortesortuno/oommfpyAlternatively, asetup.pyfile is provided to install this librarygit clone https://github.com/davidcortesortuno/oommfpy
cd oommfpy
pip install ./If successful, theplot_omfandomf2vtktools are installed in the
correspondingbindirectory 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.Paraview pluginA first version of a reader for Paraview is added in this last version. For now
the installation is a bit of a hack:After installing theoommfpylibrary, locate theoommfpyfolder from
thesite-packagesdirectoryDownload the latest version of Paraview with Python > 3.8 supportCopy theoommfpydirectory into the Paraview Pythonsite-packagesfolder.
For example, for Paraview 5.9.0 installed in thehomefolder:cp -r oommfpy $HOME/ParaView-5.9.0-MPI-Linux-Python3.8-64bit/lib/python3.8/site-packages/Open Paraview and go toTools -> Manage Plugins -> Load Newand select the
Python file in thetools/folder ofoommfpy(you can clone the
repository)Now you can open anyomffile without converting to VTK!DocumentationFor now check thedoc/ipynbfolder which contains a tutorial with basic
functionality. To load a file with a magnetisation field, which is found more
commonly in simulations, use theMagnetisationDataclass. To load any field,
such as the dipolar field, use theFieldDataclass.Scripts to convertomfto VTK can be called directly as, for example,omf2vtk -i omfs/my_oommf_output.omf -o test.vtkThe 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 theplot_omffunction. Use the--helpfor
details.TODOMore testsAdd pyproject.toml file to avoid manual installation of Cython in setup.pyMore options to plotting libraryPrintzcoordinate when computing sk numberAllow Periodic boundaries for the skyrmion number calculationAdd typing checkSupport for multiple OSCitationIf 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},
}