Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Micromagnetics #599

Draft
wants to merge 51 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
a3ea266
Core: added Micromagnetic Hamiltonian.
GPMueller May 24, 2019
013d8ae
Core: fixed physical constants.
GPMueller May 26, 2019
4445400
Core: added stub for chaning the Hamiltonian type.
GPMueller May 26, 2019
b6a26d1
Core: updated API and tests for constants.
GPMueller May 27, 2019
5e5b801
UI-QT: added widget for micromagnetic Hamiltonian.
GPMueller May 27, 2019
ba3e89e
Bugfixes for switching between Hamiltonians.
GPMueller May 27, 2019
88a97c7
Core: micromagnetic parameters in configparser.
GPMueller Jun 4, 2019
378e16b
Updated docs with micromagnetic model.
GPMueller Jun 4, 2019
67a100e
Core: added micromagnetic energy gradients.
DTolm Jun 25, 2019
f51028c
Hamiltonian micromagnetic
DTolm Jun 28, 2019
d9cd626
Cuda implementation of micromagnetics (no ddi)
DTolm Aug 14, 2019
b8b0bcf
Core: Started to implement input parsing for micromagnetic hamiltonian.
GPMueller Sep 24, 2019
d566ada
Some improvements on usability of micromagnetics.
GPMueller Sep 24, 2019
e2bc0ad
UI-Qt: connected a few micromagnetics settings.
GPMueller Sep 24, 2019
febe640
Core: Cuda code compiles now. Hamiltonian_Micromagnetic.cu still need…
Sep 27, 2019
270a3c8
Core: Made Hamiltonian_Micromagnetic.cu consistent with Hamiltonian_M…
Sep 27, 2019
da0838f
Core: CUDA DDI implementation for micromagnetics
DTolm Oct 29, 2019
c3aeac6
Merge branch 'develop' into fixed-micromagnetic
GPMueller Mar 26, 2020
a2e6c56
Merge branch 'develop' into fixed-micromagnetic
GPMueller Dec 21, 2020
d180044
Core: compilation fixes in `Hamiltonian_Micromagnetic`.
GPMueller Dec 22, 2020
e9ccd34
Core: applied clang-format to Hamiltonian_Micromagnetic files.
GPMueller Dec 23, 2020
7e4f952
Hamiltonian_Micromagnetic: Implemented magnetostatics
Apr 13, 2021
7d4432c
Improved how the demag tensor implementation handles edge cases.
Apr 14, 2021
143531e
Demagnetization_Tensor: Decreased sensitivity for switching to asymptote
Apr 14, 2021
f12ce6e
Hamiltonian_Micromagnetic: Implemented Gradient_DDI_Direct
Apr 14, 2021
2d84dbc
Hamiltonian_Micromagnetic: Moved definition of Ms out of the Hamilton…
Apr 14, 2021
a57b898
Micromagnetics: Current Snapshot
May 28, 2021
8447409
Incorporated upstream changes in core/data
Jun 9, 2021
ca00f12
Incorporated upstream changes in core/engine
Jun 9, 2021
515d4c5
Incorporated upstream changes in core/io
Jun 9, 2021
0fc19d5
forgotten update of FFT.cu
Jun 9, 2021
9e1df71
Incorporated upstream changes in core/Spirit
Jun 9, 2021
30657fa
Incorporated upstream changes in system.py
Jun 9, 2021
fb00b96
Incorporated upstream changes in core/utility
Jun 9, 2021
edd9010
Merge branch 'develop' into fixed_micromagnetic
Jun 11, 2021
9f5cf88
Fixed some errors stemming from previous merge
Jun 25, 2021
f186d1d
Hamiltonian_Micromagnetic: Compilation fix
Jun 25, 2021
798eac7
Merge branch 'develop' into fixed-micromagnetic
GPMueller Jun 26, 2021
e309eb5
Core: fix Rydberg/eV ratio and test.
GPMueller Jun 27, 2021
133be74
Hamiltonian_Micromagnetic: Updated E_DMI term. But there seems to be …
Jun 28, 2021
450aea4
Fix compilation with OpenMP. Wrong number of loops in one of t he col…
Jun 28, 2021
b924d64
Hamiltonian_Micromagnetic: Fixed errors when compiling with scalar=float
Jun 28, 2021
58dda4d
Unit-Tests: The test cases "Finite Differences" and "Dipole-Dipole In…
Jun 30, 2021
c66c6c7
Hamiltonian_Micromagnetic: Corrected Gradient_Exchange
Jun 30, 2021
33d133d
Hamiltonian_Micromagnetic: Additions for DDI
Jun 30, 2021
b15772d
Hamiltonian_Micromagnetic: Gradients.
Jul 1, 2021
5b32024
Core: fix CUDA build by commenting out code
GPMueller Sep 8, 2021
5d92ab1
Update formatting for changes on this branch
GPMueller Dec 8, 2021
cbb92bd
Merge branch 'develop' into fixed-micromagnetic
GPMueller Dec 8, 2021
9093d65
Merge branch 'develop' into fixed-micromagnetic
GPMueller Apr 25, 2022
7fed5e2
Core: minor micromagnetism fixes
GPMueller Apr 26, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ control of parameters.

### *Physics Features*

- Atomistic Spin Lattice Heisenberg Model including also DMI and dipole-dipole
- Atomistic spin lattice Heisenberg model including DMI and dipole-dipole interaction
- Micromagnetic model including DM and dipolar interactions
- **Spin Dynamics simulations** obeying the
[Landau-Lifschitz-Gilbert equation](https://en.wikipedia.org/wiki/Landau%E2%80%93Lifshitz%E2%80%93Gilbert_equation)
- Direct **Energy minimisation** with different solvers
Expand Down
2 changes: 1 addition & 1 deletion core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Spirit
This is the core library of the **Spirit** framework.

It is meant to provide useful and easy API functions to enable productive work
with Atomistic Dynamics Simulations and Optimizations.
with Atomistic and Micromagnetic Dynamics Simulations and Optimizations.
The current implementation is specific to atomistic spin models, but it may
easily be generalised.

Expand Down
87 changes: 81 additions & 6 deletions core/docs/Input.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ The following sections will list and explain the input file keywords.
1. [General Settings and Log](#General)
2. [Geometry](#Geometry)
3. [Heisenberg Hamiltonian](#Heisenberg)
4. [Gaussian Hamiltonian](#Gaussian)
5. [Method Output](#MethodOutput)
6. [Method Parameters](#MethodParameters)
7. [Pinning](#Pinning)
8. [Disorder and Defects](#Defects)
4. [Micromagnetic Hamiltonian](#Micromagnetic)
5. [Gaussian Hamiltonian](#Gaussian)
6. [Method Output](#MethodOutput)
7. [Method Parameters](#MethodParameters)
8. [Pinning](#Pinning)
9. [Disorder and Defects](#Defects)


General Settings and Log <a name="General"></a>
Expand Down Expand Up @@ -169,7 +170,7 @@ For more details, such as the notation used here, see [Phys. Rev. B **99** 22441
**General Parameters:**

```Python
### Hamiltonian Type (heisenberg_neighbours, heisenberg_pairs, gaussian)
### Hamiltonian Type (heisenberg_neighbours, heisenberg_pairs, micromagnetic, gaussian)
hamiltonian heisenberg_neighbours

### Boundary conditions (in a b c) = 0(open), 1(periodical)
Expand Down Expand Up @@ -306,6 +307,80 @@ Pairwise interactions are specified in meV per unique pair \<ij\>,
while quadruplets are specified in meV per unique quadruplet \<ijkl\>.


Micromagnetic Hamiltonian <a name="Micromagnetic"></a>
--------------------------------------------------

To use a micromagnetic Hamiltonian, use `micromagnetic` as input parameter after the `hamiltonian` keyword.

Note that Spirit only supports rectilinear geometries when using this Hamiltonian.

**Units:**

In the micromagnetic model, Spirit uses SI units:
- `m` (meter) for distances
- `J` (Joule) for energies
- `s` (second) for time

Therefore,
- `A [J/m]` for exchange stiffness
- `D [J/m^2]` for DMI
- `K [J/m^3]` for anisotropy
- `Ms [A/m]` for saturation magnetisation
Comment on lines +317 to +328
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should add a section like this to the Heisenberg Hamiltonian documentation. IMO it it is quite useful to have this overview in the beginning


**General Parameters:**

```Python
### boundary_conditions (in a b c) = 0(open), 1(periodical)
boundary_conditions 0 0 0

### The order of the finite difference approximation of the spatial gradient
spatial_gradient_order 2
```

**Static:**

```Python
# Saturation magnetisation [A/m]
Ms 1.3e6
```
while the magnetocrystalline anisotropy can be specified as an axis,
```Python
# Anisotropy [J/m^3]
anisotropy 0.3e6
```
or as a tensor
```Python
# Anisotropy [J/m^3]
tensor_anisotropy
0.3e6 0 0
0 0.3e6 0
0 0 0.3e6
```

**Interactions:**

The exchange interaction and DMI can each be set either as a constant,
```Python
# Stiffness [J/m]
exchange 10e-12
# DMI [J/m^2]
dmi 6e-3
```
or as a tensor,
```Python
# Stiffness [J/m]
tensor_exchange
10e-12 0 0
0 10e-12 0
0 0 10e-12
# DMI [J/m^2]
tensor_dmi
0 -6e-3 6e-3
6e-3 0 -6e-3
-6e-3 6e-3 0
```


Gaussian Hamiltonian <a name="Gaussian"></a>
----------------------------------------------------

Expand Down
15 changes: 12 additions & 3 deletions core/include/Spirit/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,26 @@ PREFIX scalar Constants_k_B() SUFFIX;
// Planck constant [meV*ps / rad]
PREFIX scalar Constants_hbar() SUFFIX;

// Millirydberg [mRy / meV]
PREFIX scalar Constants_mRy() SUFFIX;

// Gyromagnetic ratio of electron [rad / (s*T)]
PREFIX scalar Constants_gamma() SUFFIX;

// Electron g-factor [unitless]
PREFIX scalar Constants_g_e() SUFFIX;

// Millirydberg [mRy / meV]
PREFIX scalar Constants_mRy() SUFFIX;

// Erg [erg / meV]
PREFIX scalar Constants_erg() SUFFIX;

// Joule [J / meV]
PREFIX scalar Constants_Joule() SUFFIX;

// Pi [rad]
PREFIX scalar Constants_Pi() SUFFIX;

// Pi/2 [rad]
PREFIX scalar Constants_Pi_2() SUFFIX;

#include "DLL_Undefine_Export.h"
#endif
22 changes: 22 additions & 0 deletions core/include/Spirit/Hamiltonian.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,33 @@ Dipole-Dipole method
#define SPIRIT_DDI_METHOD_CUTOFF 3


/*
Definition of Hamiltonian types
--------------------------------------------------------------------
*/

typedef enum
{
Hamiltonian_Heisenberg = 0,
Hamiltonian_Micromagnetic = 1,
Hamiltonian_Gaussian = 2
} Hamiltonian_Type;

/*
Setters
--------------------------------------------------------------------
*/

/*
Set the kind of Hamiltonian to be used by all systems.
Can be (case is ignored):

- Heisenberg
- Micromagnetic
- Gaussian
*/
PREFIX void Hamiltonian_Set_Kind(State *state, Hamiltonian_Type type, int idx_chain=-1) SUFFIX;

// Set the boundary conditions along the translation directions [a, b, c]
PREFIX void Hamiltonian_Set_Boundary_Conditions(State *state, const bool* periodical, int idx_image=-1, int idx_chain=-1) SUFFIX;

Expand Down
11 changes: 9 additions & 2 deletions core/include/data/Geometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,17 @@ class Geometry
// Dimensionality of the points
int dimensionality;
int dimensionality_basis;
// Center and Bounds
// Center and bounds [Å]
Vector3 center, bounds_min, bounds_max;
// Unit Cell Bounds
// Unit cell bounds [Å]
Vector3 cell_bounds_min, cell_bounds_max;
// Unit cell size [m]
Vector3 cell_size;
// Unit cell volume [m^3]
scalar cell_volume;
// Computes the saturation magnetisation density [A/m]
// from the atomistic basis cell composition
scalar getMs();

private:
// Generate the full set of spin positions
Expand Down
1 change: 1 addition & 0 deletions core/include/engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set(HEADER_SPIRIT_ENGINE
${CMAKE_CURRENT_SOURCE_DIR}/Neighbours.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Hamiltonian.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Hamiltonian_Heisenberg.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Hamiltonian_Micromagnetic.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Hamiltonian_Gaussian.hpp
${CMAKE_CURRENT_SOURCE_DIR}/Eigenmodes.hpp
${CMAKE_CURRENT_SOURCE_DIR}/HTST.hpp
Expand Down
Loading