Skip to content

cmt-dtu-energy/MagTense

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MagTense Logo

MagTense

MagTense is a framework for magnetostatic and micromagnetic calculations.

Features

  • Interfaces for MATLAB and Python, with the core implemented in Fortran for speed;
  • Fully analytical calculation of demagnetization tensor for cylinders, pieces of cylinders, prisms, circular pieces and tetrahedrons;
  • Micromagnetic solutions of the Landau-Lifshitz equations, using the analytical demagnetization tensor described above;
  • GPU-accelerated code with CUDA® (requires NVIDIA graphics card).
  • Uses Intel MKL for the micromagnetic simlations and can also utilize CVODE.
  • Tested in Linux and Windows 11+ (macOS not supported at the moment).

Installation and usage with the Python interface

Installation is recommended via pip (requires >=Python 3.12):

pip install magtense

Examples of how to calculate magnetostatic and micromagnetic problems using the Python interface can be found python/examples/.

Installation and usage with the Matlab interface

MagTense is directly useable in Matlab on Windows by downloading the MEX-files in Releases. Only Matlab 2023a or greater is required.

Examples of how to calculate magnetostatic and micromagnetic problems using the Matlab interface can be found in matlab/examples.

Building from source

If you want to build MagTense yourself this is certainly also an option. If you want to compile MagTense on Linux we provide a Makefile, which also works on Windows, where we also provide a Visual Studio project file, MagTense.sln.

For Python you can find detailed instructions for building the Python interface with the Fortran core here.

For Matlab MEX-files, we provide a Matlab function called buildMagTenseMEX.m that works on both OS. You can find more information here.

Further documentation

The webpage of the code is available at https://www.magtense.org.

The TechManual on the code is available at https://cmt-dtu-energy.github.io/MagTense.

Citation

If you use this package in a publication, or simply want to refer to it, please cite the paper below:

@article{BJORK2021168057,
title = {MagTense: A micromagnetic framework using the analytical demagnetization tensor},
journal = {Journal of Magnetism and Magnetic Materials},
volume = {535},
pages = {168057},
year = {2021},
issn = {0304-8853},
doi = {https://doi.org/10.1016/j.jmmm.2021.168057},
url = {https://www.sciencedirect.com/science/article/pii/S0304885321003334},
author = {R. Bj{\o}rk and E. B. Poulsen and K. K. Nielsen and A. R. Insinga},
}

About

MagTense - a micromagnetism and magnetostatic framework

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10