Skip to content

Commit

Permalink
Merge branch 'develop' into fixed-micromagnetic
Browse files Browse the repository at this point in the history
  • Loading branch information
GPMueller committed Dec 8, 2021
2 parents 5d92ab1 + edbfcbd commit cbb92bd
Show file tree
Hide file tree
Showing 587 changed files with 105,447 additions and 44,846 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,31 @@ jobs:
name: spirit-windows
path: |
${{runner.workspace}}/build/*.zip
draft-release:
if: github.event_name == 'push' && startsWith( github.ref, 'refs/tags/' )
needs: [test, webapp-mobile, webapp-desktop, deploy-package]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- name: 📄 Generate a changelog
id: changelog
uses: metcalfc/changelog-generator@v1.0.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

- name: 📄 Print the changelog
run: echo "${{ steps.changelog.outputs.changelog }}"

- name: 🎉 Create draft release
id: draft_release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog.outputs.changelog }}
draft: true
29 changes: 17 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ set( CMAKE_POSITION_INDEPENDENT_CODE ON )
set( CMAKE_CXX_STANDARD 14 )
### Set the cmake subdirectory
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" )
### Need to use pthread if emscripten is used
if( SPIRIT_BUILD_FOR_JS AND SPIRIT_UI_USE_IMGUI )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=2")
endif()
####################################################################


Expand Down Expand Up @@ -207,6 +203,18 @@ endif()
###
if( SPIRIT_BUILD_FOR_JS )
set( SPIRIT_BUILD_FOR_CXX OFF )
set( SPIRIT_USE_CUDA OFF )
set( SPIRIT_USE_OPENMP OFF )
set( SPIRIT_UI_CXX_USE_QT OFF )
set( SPIRIT_UI_USE_IMGUI ON )

if( ${CMAKE_SYSTEM_NAME} MATCHES "Emscripten" )
message( WARNING "You set SPIRIT_BUILD_FOR_JS to ON but your are not using emscripten. That might not work" )
endif()
endif()
### Need to use pthread if emscripten is used
if( SPIRIT_BUILD_FOR_JS AND SPIRIT_UI_USE_IMGUI )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -s USE_PTHREADS=1 -s USE_PTHREADS=1 -s WASM=1" )
endif()
####################################################################

Expand All @@ -226,23 +234,20 @@ endif()
add_subdirectory( core )
### Web UI
if( SPIRIT_BUILD_FOR_JS )
add_subdirectory( VFRendering )
if( SPIRIT_UI_USE_IMGUI )
add_definitions( -DSPIRIT_UI_USE_IMGUI )
add_subdirectory( ui-cpp )
else()
add_subdirectory( ui-web )
endif()
add_subdirectory( VFRendering )
add_subdirectory( ui-cpp )
add_subdirectory( ui-web )
### CXX UI
elseif( SPIRIT_BUILD_FOR_CXX )
if( SPIRIT_UI_CXX_USE_QT )
add_definitions( -DSPIRIT_UI_CXX_USE_QT )
add_subdirectory( VFRendering )
endif()
if( SPIRIT_UI_USE_IMGUI )
elseif( SPIRIT_UI_USE_IMGUI )
add_definitions( -DSPIRIT_UI_USE_IMGUI )
add_subdirectory( VFRendering )
endif()
add_subdirectory( VFRendering )
add_subdirectory( ui-cpp )
endif()
####################################################################
Expand Down
4 changes: 2 additions & 2 deletions core/CMake/Spirit_Version.hpp.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#ifndef SPIRIT_UTILITY_VERSION_HPP
#define SPIRIT_UTILITY_VERSION_HPP
#ifndef SPIRIT_CORE_UTILITY_VERSION_HPP
#define SPIRIT_CORE_UTILITY_VERSION_HPP

#include <string>

Expand Down
46 changes: 23 additions & 23 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,27 +97,27 @@ include( GetGitRevisionDescription )
get_git_head_revision( GIT_REFSPEC GIT_SHA1 )
string( SUBSTRING "${GIT_SHA1}" 0 13 GIT_REV )
#----- Meta information about the project
set(META_PROJECT_NAME "Spirit")
set(META_PROJECT_DESCRIPTION "Optimizations and Dynamics Framework for atomistic Spin systems")
set(META_AUTHOR_ORGANIZATION "")
set(META_AUTHOR_DOMAIN "https://spirit-code.github.io")
set(META_AUTHOR_MAINTAINER "Gideon Mueller")
set(META_AUTHOR_EMAIL "g.mueller@fz-juelich.de")
set(META_VERSION_MAJOR "2")
set(META_VERSION_MINOR "1")
set(META_VERSION_PATCH "1")
set(META_VERSION "${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}")
set(META_VERSION_REVISION "${GIT_REV}")
set( META_PROJECT_NAME "Spirit" )
set( META_PROJECT_DESCRIPTION "Optimizations and Dynamics Framework for atomistic Spin systems" )
set( META_AUTHOR_ORGANIZATION "" )
set( META_AUTHOR_DOMAIN "https://spirit-code.github.io" )
set( META_AUTHOR_MAINTAINER "Gideon Mueller" )
set( META_AUTHOR_EMAIL "g.mueller@fz-juelich.de" )
set( META_VERSION_MAJOR "2" )
set( META_VERSION_MINOR "1" )
set( META_VERSION_PATCH "1" )
set( META_VERSION "${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH}" )
set( META_VERSION_REVISION "${GIT_REV}" )
#----- Compiler
set(META_COMPILER "${CMAKE_CXX_COMPILER_ID}")
set(META_COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION}")
set(META_COMPILER_FULL "${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION})")
set( META_COMPILER "${CMAKE_CXX_COMPILER_ID}" )
set( META_COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION}" )
set( META_COMPILER_FULL "${CMAKE_CXX_COMPILER_ID} (${CMAKE_CXX_COMPILER_VERSION})" )
#----- Propagate version and name_version upwards
set(SPIRIT_META_VERSION_MAJOR ${META_VERSION_MAJOR} PARENT_SCOPE)
set(SPIRIT_META_VERSION_MINOR ${META_VERSION_MINOR} PARENT_SCOPE)
set(SPIRIT_META_VERSION_PATCH ${META_VERSION_PATCH} PARENT_SCOPE)
set(SPIRIT_META_VERSION "${META_VERSION}" PARENT_SCOPE)
set(SPIRIT_META_NAME_VERSION "${META_PROJECT_NAME} v${META_VERSION} (${META_VERSION_REVISION})" PARENT_SCOPE)
set( SPIRIT_META_VERSION_MAJOR ${META_VERSION_MAJOR} PARENT_SCOPE )
set( SPIRIT_META_VERSION_MINOR ${META_VERSION_MINOR} PARENT_SCOPE )
set( SPIRIT_META_VERSION_PATCH ${META_VERSION_PATCH} PARENT_SCOPE )
set( SPIRIT_META_VERSION "${META_VERSION}" PARENT_SCOPE )
set( SPIRIT_META_NAME_VERSION "${META_PROJECT_NAME} v${META_VERSION} (${META_VERSION_REVISION})" PARENT_SCOPE )
####################################################################


Expand Down Expand Up @@ -439,11 +439,11 @@ if( SPIRIT_BUILD_FOR_CXX OR SPIRIT_BUILD_FOR_JS )
message( STATUS ">> Building static C/C++ library ${META_PROJECT_NAME}_static" )
add_library( ${META_PROJECT_NAME}_static STATIC $<TARGET_OBJECTS:${META_PROJECT_NAME}> )
### Forward public includes from the object library
target_include_directories(${META_PROJECT_NAME}_static PUBLIC
$<TARGET_PROPERTY:${META_PROJECT_NAME},INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories( ${META_PROJECT_NAME}_static PUBLIC
$<TARGET_PROPERTY:${META_PROJECT_NAME},INTERFACE_INCLUDE_DIRECTORIES> )
### Apply interface link dependencies from the object library
target_link_libraries(${META_PROJECT_NAME}_static PRIVATE
$<TARGET_PROPERTY:${META_PROJECT_NAME},INTERFACE_LINK_LIBRARIES>)
target_link_libraries( ${META_PROJECT_NAME}_static PRIVATE
$<TARGET_PROPERTY:${META_PROJECT_NAME},INTERFACE_LINK_LIBRARIES> )
#--------------------------------------------------

#--------------------------------------------------
Expand Down
3 changes: 3 additions & 0 deletions core/docs/Input.md
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ llg_force_convergence 10e-9
llg_n_iterations 2000000
### Number of iterations after which to save
llg_n_iterations_log 2000
### Number of iterations that gets run with no checks or outputs (Increasing this boosts performance, especially in CUDA builds)
llg_n_iterations_amortize 1

```

**LLG:**
Expand Down
4 changes: 4 additions & 0 deletions core/docs/c-api/Configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ void Configuration_Skyrmion(State *state, float r, float order, float phase, boo

Create a skyrmion configuration



### Configuration_DW_Skyrmion

```C
void Configuration_DW_Skyrmion(State *state, float dw_radius, float dw_width, float order, float phase, bool upDown, bool achiral, bool rl, const float position[3]=defaultPos, const float r_cut_rectangular[3]=defaultRect, float r_cut_cylindrical=-1, float r_cut_spherical=-1, bool inverted=false, int idx_image=-1, int idx_chain=-1)
```
Expand Down
6 changes: 3 additions & 3 deletions core/docs/c-api/HTST.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Note that `HTST_Calculate` needs to be called before using any of the getter fun
### HTST_Calculate

```C
float HTST_Calculate(State * state, int idx_image_minimum, int idx_image_sp, int n_eigenmodes_keep=0, int idx_chain=-1)
float HTST_Calculate(State * state, int idx_image_minimum, int idx_image_sp, int n_eigenmodes_keep=0, bool sparse=false, int idx_chain=-1)
```
Calculates the HTST transition rate prefactor for the transition from a minimum over saddle point.
Expand All @@ -26,7 +26,7 @@ Calculates the HTST transition rate prefactor for the transition from a minimum
- `n_eigenmodes_keep`: the number of energy eigenmodes to keep in memory (0 = none, negative value = all)
- `sparse`: when set to `true` the sparse version is used, which greatly improves speed and memory footprint,
but does not evaluate the eigenvectors and all single eigenvalues.
The sparse version should only be used in the abscence of DDI.
The sparse version should only be used in the abscence of DDI
Note: The Get_Eigenvalues/vectors functions only work after HTST_Calculate with sparse=false has been called.
Note: In the sparse version zero mode checking has not been implemented yet.
Expand All @@ -39,7 +39,7 @@ respectively.
### HTST_Get_Info
```C
void HTST_Get_Info( State * state, float * temperature_exponent, float * me, float * Omega_0, float * s, float * volume_min, float * volume_sp, float * prefactor_dynamical, float * prefactor, int idx_chain=-1 )
void HTST_Get_Info( State * state, float * temperature_exponent, float * me, float * Omega_0, float * s, float * volume_min, float * volume_sp, float * prefactor_dynamical, float * prefactor, int * n_eigenmodes_keep, int idx_chain=-1 )
```

Retrieves a set of information from HTST:
Expand Down
14 changes: 7 additions & 7 deletions core/docs/c-api/Hamiltonian.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ Set the Dzyaloshinskii-Moriya interaction in terms of neighbour shells [meV]
### Hamiltonian_Set_DDI
```C
void Hamiltonian_Set_DDI(State *state, int ddi_method, int n_periodic_images[3], float cutoff_radius=0, int idx_image=-1, int idx_chain=-1)
void Hamiltonian_Set_DDI(State *state, int ddi_method, int n_periodic_images[3], float cutoff_radius=0, bool pb_zero_padding=true, int idx_image=-1, int idx_chain=-1)
```

Configure the dipole-dipole interaction
Expand All @@ -176,6 +176,7 @@ Configure the dipole-dipole interaction
boundary conditions are used
- `cutoff_radius`: the distance at which to stop the direct summation,
if used
- `pb_zero_padding`: if `True` zero padding is used even for periodical directions



Expand Down Expand Up @@ -273,15 +274,14 @@ Returns the number of Dzyaloshinskii-Moriya interaction pairs
### Hamiltonian_Get_DDI

```C
void Hamiltonian_Get_DDI(State *state, int * ddi_method, int n_periodic_images[3], float * cutoff_radius, int idx_image=-1, int idx_chain=-1)
void Hamiltonian_Get_DDI(State *state, int * ddi_method, int n_periodic_images[3], float * cutoff_radius, bool * pb_zero_padding, int idx_image=-1, int idx_chain=-1)
```
Retrieves the dipole-dipole interaction configuration.
- `ddi_method`: see integers defined above
- `n_periodic_images`: how many repetition of the spin configuration to
append along the translation directions [a, b, c], if periodical
boundary conditions are used
- `cutoff_radius`: the distance at which to stop the direct summation,
if used
- `n_periodic_images`: how many repetitions of the spin configuration to
append along the translation directions [a, b, c], if periodical boundary conditions are used
- `cutoff_radius`: the distance at which to stop the direct summation, if method_cutoff is used
- `pb_zero_padding`: if `True` zero padding is used even for periodical directions
46 changes: 41 additions & 5 deletions core/docs/c-api/Simulation.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Solver_VP 0
Solver_SIB 1
```

`SIB`: Verlet-like velocity projection
`SIB`: Semi-implicit midpoint method B



Expand All @@ -48,7 +48,7 @@ Solver_SIB 1
Solver_Depondt 2
```

`Depondt`: Verlet-like velocity projection
`Depondt`: Heun method using rotations



Expand All @@ -58,7 +58,7 @@ Solver_Depondt 2
Solver_Heun 3
```

`Heun`: Verlet-like velocity projection
`Heun`: second-order midpoint



Expand All @@ -68,30 +68,40 @@ Solver_Heun 3
Solver_RungeKutta4 4
```

`RK4`: Verlet-like velocity projection
`RK4`: 4th order Runge-Kutta



### Solver_LBFGS_OSO

```C
Solver_LBFGS_OSO 5
```

`LBFGS_OSO`: Limited memory Broyden-Fletcher-Goldfarb-Shanno, exponential transform



### Solver_LBFGS_Atlas

```C
Solver_LBFGS_Atlas 6
```

`LBFGS_Atlas`: Limited memory Broyden-Fletcher-Goldfarb-Shannon, stereographic projection



### Solver_VP_OSO

```C
Solver_VP_OSO 7
```

`Solver_VP_OSO`: Verlet-like velocity projection, exponential transform



Start or stop a simulation
--------------------------------------------------------------------

Expand Down Expand Up @@ -163,7 +173,7 @@ Otherwise, nothing will happen.
### Simulation_N_Shot
```C
void Simulation_N_Shot(State *state, int N, int idx_image=-1, int idx_chain=-1);
void Simulation_N_Shot(State *state, int N, int idx_image=-1, int idx_chain=-1)
```

N iterations of a Method
Expand Down Expand Up @@ -224,6 +234,32 @@ Will only work if a GNEB simulation is running.



### Simulation_Get_MaxTorqueNorm

```C
float Simulation_Get_MaxTorqueNorm(State * state, int idx_image=-1, int idx_chain=-1)
```
Get maximum torque norm.
If a MC, LLG, MMF or EMA simulation is running this returns the max. torque on the current image.
If a GNEB simulation is running this returns the max. torque on the current chain.
### Simulation_Get_Chain_MaxTorqueNorms
```C
void Simulation_Get_Chain_MaxTorqueNorms(State * state, float * torques, int idx_chain=-1)
```

Get maximum torque norms on the images of a chain.

Will only work if a GNEB simulation is running.



### Simulation_Get_IterationsPerSecond

```C
Expand Down
14 changes: 12 additions & 2 deletions core/docs/c-api/System.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,23 @@ Returns the energy of a spin system.
### System_Get_Energy_Array_Names
```C
int System_Get_Energy_Array_Names(State * state, char* names, int idx_image=-1, int idx_chain=-1)
```

If 'names' is a nullptr, the required length of the char array is returned.



### System_Get_Energy_Array

```C
void System_Get_Energy_Array(State * state, float * energies, int idx_image=-1, int idx_chain=-1)
int System_Get_Energy_Array(State * state, float * energies, bool divide_by_nspins=true, int idx_image=-1, int idx_chain=-1)
```
Retrieves the energy contributions of a spin system.
If 'energies' is a nullptr, the required length of the energies array is returned.
Expand Down
Loading

0 comments on commit cbb92bd

Please sign in to comment.