Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
marijanbeg committed Mar 12, 2018
0 parents commit 1fdf203
Show file tree
Hide file tree
Showing 9 changed files with 697 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sudo: required

services:
- docker

script:
- make travis-build

notifications:
slack: joommf:eqKxGPXuUP3LxnOfxg7GWgDF
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:16.04

RUN apt-get -y update
RUN apt-get install -y git tk-dev tcl-dev

# Clone OOMMF repository.
WORKDIR /usr/local
RUN git clone http://github.com/fangohr/oommf.git

# Copy OOMMF extension repository.
COPY . /usr/local/oommf-extension-dmi-d2d/
WORKDIR /usr/local/oommf-extension-dmi-d2d/

# Copy OOMMF extension to OOMMF directory.
RUN cp src/* /usr/local/oommf/oommf/app/oxs/local/

# Compile OOMMF.
WORKDIR /usr/local/oommf
RUN make

# Create OOMMFTCL environment variable
ENV OOMMFTCL /usr/local/oommf/oommf/oommf.tcl

# Change working directory.
WORKDIR /usr/local/oommf-extension-dmi-d2d
11 changes: 11 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright <2018> David Cortés-Ortuño, Marijan Beg, Vanessa Nehruji, Ryan A. Pepper, and Hans Fangohr, European XFEL GmbH and University of Southampton

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
test-all:
ls -lh examples
tclsh $(OOMMFTCL) boxsi +fg examples/isolated_sk_DMI_D2d.mif -exitondone 1
ls -lh examples
tclsh $(OOMMFTCL) boxsi +fg examples/sk_lattice_DMI_D2d_PBCs.mif -exitondone 1
ls -lh examples

travis-build: SHELL:=/bin/bash
travis-build:
docker build --no-cache -t dockertestimage .
docker run -ti -d --name testcontainer dockertestimage
docker exec testcontainer make test-all
docker stop testcontainer
docker rm testcontainer
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[![Build Status](https://travis-ci.org/joommf/oommf-extension-dmi-d2d.svg?branch=master)](https://travis-ci.org/joommf/oommf-extension-dmi-d2d)
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)

# [OOMMF](https://math.nist.gov/oommf/) extension: Dzyaloshinskii-Moriya interaction (DMI) for the crystallographic class D<sub>2d</sub>

David Cortés-Ortuño<sup>1</sup>, Marijan Beg<sup>1,2</sup>, Vanessa Nehruji<sup>3</sup>, Ryan A. Pepper<sup>1</sup>, and Hans Fangohr<sup>1,2</sup>

<sup>1</sup> Faculty of Engineering and the Environment, University of Southampton, Southampton SO17 1BJ, United Kingdom
<sup>2</sup> European XFEL GmbH, Holzkoppel 4, 22869 Schenefeld, Germany
<sup>3</sup> Department of Physics, University of Durham, Durham DH1 3LE, United Kingdom

## Introduction

Different Dzyaloshinskii-Moriya interaction forms can be written as different combinations of Lifshitz invariants depending on the crystallographic class of the magnetic material [1].

## Energy density

The DMI energy density for the crystallographic class D<sub>2d</sub> as a sum of Lifshitz invariants [1] is

<a href="https://www.codecogs.com/eqnedit.php?latex=\LARGE&space;w&space;=&space;D&space;\left(&space;\mathcal{L}_{xz}^{(y)}&space;&plus;&space;\mathcal{L}_{yz}^{(x)}&space;\right)&space;=&space;D&space;\mathbf{m}&space;\cdot&space;\left(&space;\frac{\partial&space;\mathbf{m}}{\partial&space;x}&space;\times&space;\hat{x}&space;-&space;\frac{\partial&space;\mathbf{m}}{\partial&space;y}&space;\times&space;\hat{y}&space;\right)" target="_blank"><img src="https://latex.codecogs.com/gif.latex?\LARGE&space;w&space;=&space;D&space;\left(&space;\mathcal{L}_{xz}^{(y)}&space;&plus;&space;\mathcal{L}_{yz}^{(x)}&space;\right)&space;=&space;D&space;\mathbf{m}&space;\cdot&space;\left(&space;\frac{\partial&space;\mathbf{m}}{\partial&space;x}&space;\times&space;\hat{x}&space;-&space;\frac{\partial&space;\mathbf{m}}{\partial&space;y}&space;\times&space;\hat{y}&space;\right)" title="\LARGE w = D \left( \mathcal{L}_{xz}^{(y)} + \mathcal{L}_{yz}^{(x)} \right) = D \mathbf{m} \cdot \left( \frac{\partial \mathbf{m}}{\partial x} \times \hat{x} - \frac{\partial \mathbf{m}}{\partial y} \times \hat{y} \right)" /></a>

where <a href="https://www.codecogs.com/eqnedit.php?latex=D&space;[\text{J}/\text{m}^{2}]" target="_blank"><img src="https://latex.codecogs.com/gif.latex?D&space;[\text{J}/\text{m}^{2}]" title="D [\text{J}/\text{m}^{2}]" /></a> is the DMI constant and <a href="https://www.codecogs.com/eqnedit.php?latex=\mathbf{m}&space;=&space;\mathbf{M}/M_\text{s}" target="_blank"><img src="https://latex.codecogs.com/gif.latex?\mathbf{m}&space;=&space;\mathbf{M}/M_\text{s}" title="\mathbf{m} = \mathbf{M}/M_\text{s}" /></a> is the normalised magnetisation field.

## Periodic boundary conditions

This OOMMF extension works both with and without periodic boundary conditions (PBC). Therefore, it is possible to use the same class in either kind of mesh (`Oxs_RectangularMesh` or `Oxs_PeriodicRectangularMesh`).

## Installation

To install this extension:
1. Copy `DMI_D2d.cc` and `DMI_D2d.h` files from the `src` directory in this repository into the `app/oxs/local` directory in the OOMMF main directory.
2. Recompile OOMMF, usually by running
```
tclsh oommf.tcl pimake distclean && tclsh oommf.tcl pimake upgrade && tclsh oommf.tcl pimake
```

## Examples

Examples are provided in `.mif` files for the stabilisation of an isolated skyrmion in a confined cuboid (no periodic boundary conditions) and for the stabilisation of a skyrmion lattice in a unit cell of an infinite system (with periodic boundary conditions).

## Support

If you require support on installation or usage of this OOMMF extension as well as if you want to report a problem, you are welcome to raise an issue in our [joommf/help](https://github.com/joommf/help) repository.

## How to cite

If you use this OOMMF extension in your research, please cite it as:

## License

This extension is licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the [LICENSE](LICENSE) file.

## Acknowledgements

This extension was developed as a part of [OpenDreamKit](http://opendreamkit.org/) – Horizon 2020 European Research Infrastructure project (676541) and the [EPSRC Programme grant on Skyrmionics (EP/N032128/1)](https://www.skyrmions.ac.uk/).

## References

[1] A. Bogdanov and D. Yablonskii. Thermodynamically stable "vortices" in magnetically ordered crystals. The mixed state of magnets. [Zh. Eksp. Teor. Fiz 95, 178 (1989)](http://www.jetp.ac.ru/cgi-bin/e/index/e/68/1/p101?a=list).
105 changes: 105 additions & 0 deletions examples/isolated_sk_DMI_D2d.mif
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# MIF 2.1 ---------------------------------------------------------------------

# Generate an isolated skyrmion with interfacial (C_nv) DMI
#
# Authors: D. Cortes, M. Beg, H.Fangohr (2018)

set PI [expr {4 * atan(1.)}]
set MU0 [expr {4 * $PI * 1e-7}]

# -----------------------------------------------------------------------------
# PdFe on Ir(111) [PRL, 114(17):1-5, 2015]
# This is an interfacial system but the parameters should work similarly for
# the D2d symmetry. Spins only change the sense of rotation
set Ms [expr {1.1e6}]
set A [expr {2e-12}]
set D [expr {3.9e-3}]
set KU [expr {2.5e6}]
set BZ [expr {1.0}]

set XL [expr {15e-9}]
set YL [expr {$XL}]
set ZL [expr {2e-9}]

set xcell [expr {$XL / 20}]
set ycell [expr {$YL / 20}]
set zcell [expr {2e-9}]

# -----------------------------------------------------------------------------

# BoxAtlas
Specify Oxs_BoxAtlas:atlas [subst {
xrange {0 $XL}
yrange {0 $YL}
zrange {0 $ZL}
name atlas
}]

# RectangularMesh
Specify Oxs_RectangularMesh:mesh [subst {
cellsize {$xcell $ycell $zcell}
atlas Oxs_BoxAtlas:atlas
}]

# UniformExchange
Specify Oxs_UniformExchange [subst {
A $A
}]

# Uniaxial Anisotropy
Specify Oxs_UniaxialAnisotropy:Anisotropy [subst {
axis { 0 0 1 }
K1 $KU
}]

# D_2d DMI
Specify Oxs_DMI_D2d [subst {
default_D $D
atlas :atlas
D {
atlas atlas $D
}
}]

Specify Oxs_FixedZeeman:Bfield [subst {
comment {Field values in Tesla; scale to A/m}
multiplier [expr {1 / $MU0}]
field {0.0 0.0 $BZ}
}]

# CGEvolver
Specify Oxs_CGEvolve {}

# MinDriver
Specify Oxs_MinDriver [subst {
evolver Oxs_CGEvolve
stopping_mxHxm 0.01
mesh :mesh
Ms $Ms
m0 { Oxs_ScriptVectorField {
atlas :atlas
script { dot }
norm 1.0
script_args { relpt }
}}

basename isolated_sk_D2d
scalar_field_output_format {text %\#.15g}
vector_field_output_format {text %\#.15g}
}]

Destination table mmArchive
Destination mags mmArchive

Schedule DataTable table Stage 1
Schedule Oxs_MinDriver::Magnetization mags Stage 1

# =============================================================================

proc dot { x y z } {
set xnorm [expr {(2 * $x - 1)}]
set ynorm [expr {(2 * $y - 1)}]
set radius [expr {sqrt($xnorm * $xnorm + $ynorm * $ynorm)}]
if {$radius < 0.2} { return [list 0 0 -1] }
return [list 0 0 1]
}
115 changes: 115 additions & 0 deletions examples/sk_lattice_DMI_D2d_PBCs.mif
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# MIF 2.1 ---------------------------------------------------------------------

# Generate a skyrmion lattice in a "unit cell" with Periodic Boundaries
#
# Authors: D. Cortes, M. Beg, H.Fangohr (2018)

set PI [expr {4 * atan(1.)}]
set MU0 [expr {4 * $PI * 1e-7}]

# -----------------------------------------------------------------------------
# PdFe on Ir(111) [PRL, 114(17):1-5, 2015]
# This is an interfacial system but parameters should work similarly for D2d
# symmetry. Spins only change the sense of rotation for the skyrmion
set Ms [expr {1.1e6}]
set A [expr {2e-12}]
set D [expr {3.9e-3}]
set KU [expr {2.5e6}]
set BZ [expr {1.0}]

set XL [expr {15e-9}]
set YL [expr {$XL / sqrt(3)}]
set ZL [expr {2e-9}]

set xcell [expr {$XL / 64}]
set ycell [expr {$YL / 32}]
set zcell [expr {2e-9}]

# -----------------------------------------------------------------------------

# BoxAtlas
Specify Oxs_BoxAtlas:atlas [subst {
xrange {0 $XL}
yrange {0 $YL}
zrange {0 $ZL}
name atlas
}]

# RectangularMesh
Specify Oxs_PeriodicRectangularMesh:mesh [subst {
cellsize {$xcell $ycell $zcell}
atlas Oxs_BoxAtlas:atlas
periodic "xy"
}]

# UniformExchange
Specify Oxs_UniformExchange [subst {
A $A
}]

# Uniaxial Anisotropy
Specify Oxs_UniaxialAnisotropy:Anisotropy [subst {
axis { 0 0 1 }
K1 $KU
}]

# D_2d DMI
Specify Oxs_DMI_D2d [subst {
default_D $D
atlas :atlas
D {
atlas atlas $D
}
}]

Specify Oxs_FixedZeeman:Bfield [subst {
comment {Field values in Tesla; scale to A/m}
multiplier [expr {1 / $MU0}]
field {0.0 0.0 $BZ}
}]

# CGEvolver
Specify Oxs_CGEvolve {}

# MinDriver
Specify Oxs_MinDriver [subst {
evolver Oxs_CGEvolve
stopping_mxHxm 0.01
mesh :mesh
Ms $Ms
m0 { Oxs_ScriptVectorField {
atlas :atlas
script { skX }
norm 1.0
script_args { relpt }
}}

basename skL_D2d_PBCs
scalar_field_output_format {text %\#.15g}
vector_field_output_format {text %\#.15g}
}]

Destination table mmArchive
Destination mags mmArchive

Schedule DataTable table Stage 1
Schedule Oxs_MinDriver::Magnetization mags Stage 1

# =============================================================================

proc skX { x y z } {
set xnorm [expr {(2 * $x - 1)}]
set ynorm [expr {(2 * $y - 1)}]

foreach xsk [list -1.0 1.0 -1.0 1.0 0.0] ysk [list -1.0 -1.0 1.0 1.0 0.0] {

set xrel [expr {$xnorm - $xsk}]
set yrel [expr {$ynorm - $ysk}]
set radius [expr {sqrt($xrel * $xrel + $yrel * $yrel)}]

if {$radius < 0.3} { return [list 0 0 -1] }

}

return [list 0 0 1]
}
Loading

0 comments on commit 1fdf203

Please sign in to comment.