Coder Social home page Coder Social logo

owlas / magpy Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 3.0 3.3 MB

C++ accelerated python module for simulating magnetic nanostructures

Home Page: https://magpy.readthedocs.io

License: BSD 3-Clause "New" or "Revised" License

CMake 0.73% Makefile 0.63% C++ 85.47% M4 0.70% C 0.46% Python 11.43% Shell 0.57%
magnetism cpp11 parallel scientific-computing python3 stochastic-differential-equations

magpy's Introduction

magpy

magpy is a C++ accelerated python package for simulating systems of magnetic nanoparticles.

Current status

CircleCI Documentation Status Stories in Ready conda-version conda-license conda-downloads conda-link DOI

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:

Join the chat at https://gitter.im/magpy-users/Lobby

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:

    $ 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.

    $ cd /path/to/magpy/project
    $ make run-tests

In order to run the python unit tests:

    $ cd /path/to/magpy/project
    $ pytest -v magpy

Numerical tests

The numerical tests check the stability of the numerical integrators:

    $ 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)

Physics tests

For details see the docs in ./docs or at magpy.readthedocs.io

The notebooks are validated using 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.

    $ cd /path/to/magpy/project
    $ pytest --nbval-lax docs/source/notebooks

Contributing

  • Open an issue
  • Make a pull request
  • Join us on gitter

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.