GithubHelp home page GithubHelp logo

neumann-a / stochasticphysics Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 2.0 1001 KB

A C++ "Framework" to perform stochastic simulations. Currently mainly focused on the simulation of the magnetisation behavior of nanoparticles in a makrospin approximation

License: Mozilla Public License 2.0

C++ 93.84% CMake 5.72% C 0.44%
physics-simulation magnetism stochastic-differential-equations nanoparticle magnetic-particle-imaging statistical-mechanics computational-physics physics

stochasticphysics's Introduction

CI status
Windows(clang-cl) Linux(g++/clang++)
dev branch
Windows(clang-cl) Linux(g++/clang++)

Introduction

This project is aimed to perform stochastic simulations of physical processes. Currently the project is focused to perform those simulations for single domain magnetic particles.


Getting Started

Installation prerequisite
  1. CMake
  2. MATLAB (Linux: Needs to be on PATH for CMake to find it!)
  3. C++ compiler e.g. clang(-cl) from LLVM (don't use MSVC if you care about performance; Also MSVC is not tested any longer).
Installation process
  1. Get the code (executed from <basedir>)
    • git clone https://github.com/Neumann-A/StochasticPhysics.git <srcdir>
    • cd <srcdir>
    • setup git submodules via git submodule init and git submodule update
  2. setup vcpkg.
    1. git clone https://github.com/microsoft/vcpkg.git (either in <srcdir> or <basedir>)
    2. (Optional) Bootstrap vcpkg. cd vcpkg
      • Windows: bootstrap.bat -disableMetrics -win64
      • Linux: ./bootstrap.sh -disableMetrics (optional: -useSystemBinaries)
    3. (Optional) Install dependencies via vcpkg
      • vcpkg install serar pcg-cpp eigen3 boost-random --overlay-ports=<srcdir>/vcpkg-ports
        • On Windows: use --triplet x64-windows or --triplet x64-windows-static
  3. configure with cmake e.g. cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -S <path-to-source> -B <path-to-build>. Available build options are: VCPKG_TARGET_TRIPLET, BUILD_TESTING, BUILD_BENCHMARKS
    • You might need to set -DVCPKG_TARGET_TRIPLET=<triplet> and -DVCPKG_HOST_TRIPLET=<triplet>
    • Other options (the default should be fine) Simulation_PCG, Simulation_Boost_Random,Simulation_WITH_GSL_Solvers (requires GSL), Simulation_WITH_ImplicitMidpoint
    • You can also look at the setup of the CI piplines for more info. These are located in the directory .gihub/worflows/ci.(linux|windows).yml
  4. build/install with cmake e.g. cmake --build [<options>] -B <path-to-build>
    • --target StoPhysApp_MultiArch or StochasticPhysics
    • --config Release
    • You can also look at the setup of the CI piplines for more info. These are located in the directory .gihub/worflows/ci.(linux|windows).yml
Running test
  • Same as installation process
  • Tests are located in the Tests subfolder
  • Not all tests are designed to be succesful.
  • List of availale test targets:
    • Random_State_Init_Test
    • Implicit_solver_Test
    • Neel_Problem_Test
    • Neel_Spherical_Test
    • BrownAndNeel_Relaxation_Test (TODO: remove Relaxation)
    • NeelSpherical_BrownEuler_Relaxation_Test (TODO: remove Relaxation)

Running Simulations

Execute either StochasticPhysics or StoPhysApp_MultiArch it will run a dummy simulation generating a pair of *.ini configfiles. Those configfiles can be modified and passed to the applications via:

  • StochasticPhysics -parfile:<SimulationSettings>
  • StoPhysApp_MultiArch --parameter_file=<SimulationSettings>

The main difference between the two applications is that the former is a single architecture executable while the later is a multi architecture executable (AVX, AVX2, AVX512). The single architecture executable will probably be removed in the future.

Example for other config files can be found in the examples folder.

Running the executables on Linux might require extra setup of LD_LIBRARY_PATH. The Code is optimized and tested mainly on Windows systems.

Citing

Since there is currently no publication covering the internals of the code, citing is done by referencing the github url and the used git commit id. This is done

Publications/Poster/Talks using this Code

Universität zu Lübeck
  • A. Neumann & T. M. Buzug
    Stochastic Simulations of Magnetic Particles: Comparison of Different Methods
    8th International Workshop on Magnetic Particle Imaging 213, Hamburg (Deutschland) (2018).

  • A. Neumann, S. Draack, F. Ludwig & T. M. Buzug
    Parameter estimations of magnetic particles: A comparison between measurements and simulations
    9th International Workshop on Magnetic Particle Imaging 79, New York (USA) (2019)

  • T. Klemme, T. M. Buzug & A. Neumann
    Exploring parameters of magnetic particles in 1D field excitation
    9th International Workshop on Magnetic Particle Imaging 189, New York (USA) (2019)

    T. Klemme, T. M. Buzug & A. Neumann
    Exploring Parameters of Magnetic Particles in 1D Field Excitation
    International Journal on Magnetic Particle Imaging, 6(2), 2004001, (2020)

  • A. Neumann, & T. M. Buzug
    Simulations of magnetic particles with arbitrary anisotropies
    International Journal on Magnetic Particle Imaging, 6(2) Suppl. 1, 2009032, (2020)

Others None yet

Regarding API/ABI stability

No gurantees on API or ABI stability are given.

stochasticphysics's People

Contributors

neumann-a avatar tobiasklemme avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

tobiasklemme

stochasticphysics's Issues

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.