https://github.com/owlas/magpy
C++ accelerated python module for simulating magnetic nanostructures
https://github.com/owlas/magpy
cpp11 magnetism parallel python3 scientific-computing stochastic-differential-equations
Last synced: 10 months ago
JSON representation
C++ accelerated python module for simulating magnetic nanostructures
- Host: GitHub
- URL: https://github.com/owlas/magpy
- Owner: owlas
- License: bsd-3-clause
- Created: 2016-12-14T16:14:05.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-07T10:34:13.000Z (about 8 years ago)
- Last Synced: 2025-04-03T11:38:58.559Z (11 months ago)
- Topics: cpp11, magnetism, parallel, python3, scientific-computing, stochastic-differential-equations
- Language: C++
- Homepage: https://magpy.readthedocs.io
- Size: 3.22 MB
- Stars: 4
- Watchers: 0
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 
magpy is a C++ accelerated python package for simulating systems of
magnetic nanoparticles.
**Current status**
[](https://circleci.com/gh/owlas/magpy)
[](http://magpy.readthedocs.io/en/latest/?badge=latest)
[](https://waffle.io/owlas/magpy)
[](https://anaconda.org/owlas/magpy/)

[](https://anaconda.org/owlas/magpy/)
[](https://anaconda.org/owlas/magpy/)
[](https://zenodo.org/badge/latestdoi/76475957)
**Features**
- C++ accelerated time-integration
- Stochastic Landau-Lifshitz-Gilbert equation
- Explicit Heun scheme integration
- Implicit Midpoint method
- Parallelism at the highest level. Use the power of embarrassingly
parallel!
- Thermal activation model for single particles
- Energy dissipation and SAR calculations
Join the chat at:
[](https://gitter.im/magpy-users/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Documentation
Getting started guides, example code, tutorials, and the API documentation are
available at http://magpy.readthedocs.io
They can also be built locally with sphinx. Requirements are found in the `enviornment.yml` file:
``` shell
$ cd docs
$ cat environment.yml
$ make html
```
## Installation
Detailed instructions can be found at http://magpy.readthedocs.io
## Tests
### Unit tests
Unit tests exist for the C++ code (gtest) and python code (pytest).
The following code snippet will run the C++ unit tests with gtest.
``` shell
$ cd /path/to/magpy/project
$ make run-tests
```
In order to run the python unit tests:
``` shell
$ cd /path/to/magpy/project
$ pytest -v magpy
```
### Numerical tests
The numerical tests check the stability of the numerical integrators:
``` shell
$ cd /path/to/magpy/project
$ make test/convergence/run
$ cd test/convergence
$ chmod +x run
$ ./run
```
This command will populate the directory `./test/convergence/output` with results.
The results are explained and visualised in `./docs/source/notebooks/convergence.ipynb`
(also see [hosted docs](https://magpy.readthedocs.io))
### Physics tests
For details see the docs in `./docs` or at [magpy.readthedocs.io](https://magpy.readthedocs.io)
The notebooks are validated using [nbval](https://github.com/computationalmodelling/nbval). Nbval
reruns all the documentation notebooks and checks that there has been no change in output.
This is particularly important to check if you have updated interfaces or changed the code
base in anyway.
The notebooks take a long time to rerun and aren't included in the continuous integration testing.
``` shell
$ cd /path/to/magpy/project
$ pytest --nbval-lax docs/source/notebooks
```
## Contributing
- Open an issue
- Make a pull request
- Join us on gitter