Skip to content

Commit e143f63

Browse files
committed
Merge branch 'fmm' of github.com:computationalmodelling/fidimag into fmm
2 parents 3857b04 + 8065d78 commit e143f63

File tree

190 files changed

+58414
-3353
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

190 files changed

+58414
-3353
lines changed

.gitignore

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@
55
*.swp
66
*.pdf
77
*.tmp
8-
/local/
9-
8+
*.so
9+
local/
10+
*~
11+
*.bak
12+
.DS_Store
13+
.pytest_cache/
1014
# ignore automatically generated cython files
1115
fidimag/atomistic/lib/clib.c
16+
fidimag/common/lib/common_clib.c
1217
fidimag/common/dipolar/dipolar.c
1318
fidimag/common/neb/neb_clib.c
1419
fidimag/common/neb_method/*clib.c
1520
fidimag/common/sundials/cvode.c
1621
fidimag/micro/lib/baryakhtar/baryakhtar_clib.c
1722
fidimag/micro/lib/micro_clib.c
23+
fidimag/user/example/example.c
1824

1925
# ignore .cache from pytest
2026
.cache

.hgignore

Lines changed: 0 additions & 26 deletions
This file was deleted.

.travis.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@ group: deprecated-2017Q4
66
services:
77
- docker
88

9-
script:
10-
- make travis
9+
before_install:
10+
- docker build -t fidimag -f ./docker/travis/Dockerfile .
11+
- docker run -ti -d --name fidimag fidimag
12+
13+
jobs:
14+
include:
15+
- stage: Tests
16+
script: make test-docker
17+
- stage: Notebooks
18+
script: make ipynb-docker
1119

1220
notifications:
1321
email:

AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Weiwei Wang, Marc-Antonio Bisotti, David Cortes, Mark Vousden, Beckie Carey, Marijan Beg, Hans Fangohr
1+
Weiwei Wang, Marc-Antonio Bisotti, David Cortes, Thomas Kluyver, Mark Vousden, Ryan Pepper, Oliver Laslett, Rebecca Carey, and Hans Fangohr

CHANGELOG.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
Version 3.0 Alpha
2+
------------------
3+
* Changes to the helper functions init_scalar and init_vector (fidimag/common/helper.py)
4+
which allow users to pass additional parameters. These are then used within the sim
5+
classes to allow
6+
7+
For example:
8+
9+
```
10+
11+
mesh = CuboidMesh(nx=10, ny=1, nz=1, unit_length=1e-9)
12+
sim = Sim(mesh, Ms)
13+
14+
def init_domain_wall(pos, domain_centre)
15+
x, y, z = pos
16+
17+
if x < domain_centre:
18+
return (0, 0, 1)
19+
20+
else:
21+
return (0, 0, -1)
22+
23+
# Place a domain wall at 5nm
24+
sim.set_m(init_domain_wall, 5)
25+
# Place a domain wall at 3nm
26+
sim.set_m(init_domain_wall, 3)
27+
28+
```
29+
30+
* Setting currents is now more general, and is standardised across the simulation types.
31+
This allows us to use more general functions for setting the current.
32+
Previously, the current function was set as:
33+
```
34+
sim(mesh, driver='llg_stt')
35+
sim.driver.jx = 1e14 # A / m^2
36+
sim.driver.update_j_fun = lambda t: np.sin(t)
37+
```
38+
with the actual current used being multiplicative:
39+
40+
$ jx * sin(t) $
41+
42+
For the current-perpendicular to the plane STT ('llg_stt_cpp') driver
43+
we would now change this to
44+
45+
```
46+
sim.driver(mesh, driver='llg_stt_cpp')
47+
sim.driver.j_function = lambda t: 1e14 * np.sin(t)
48+
```
49+
and for the standard STT driver:
50+
51+
```
52+
sim.drive(mesh, driver='llg_stt')
53+
sim.driver.jz_function = lambda t: 1e14 * np.sin(t)
54+
# Can also set:
55+
# sim.driver.jx_function = ...
56+
# sim.driver.jy_function = ...
57+
58+
* Similarly, the TimeZeeman interaction is also no longer multiplicative;
59+
you can have an arbitrary function of the form:
60+
61+
def time_function(pos, t):
62+
x, y, z = pos
63+
# some calculation of Bx(pos, t), By(pos, t), Bz(pos, t)
64+
return (Bx, By, Bz)
65+
zee = TimeZeeman(np.array([0, 0, 0]), time_function)
66+
sim.add(zee)
67+
68+
* You can now remove energy classes from the simulation.
69+
70+
This can be useful in cases where you have an interaction
71+
but no longer need to calculate it because the simulation has
72+
reached a certain point, e.g. an applied field has been turned off.
73+
74+
In the data table, the entries corresponding to a given interaction
75+
will be zero everywhere once the interaction is removed.
76+
77+
78+
For example:
79+
80+
```
81+
sim.add(Zeeman((0, 0, B), name='Zeeman'))
82+
83+
sim.run_until(1e-9)
84+
sim.remove('Zeeman')
85+
```

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM ubuntu:16.04
33
RUN apt -y update
44
RUN apt install -y git python3 python3-pip gcc psutils cmake wget make
55
RUN apt install -y gfortran libblas-dev liblapack-dev python3-tk sudo fonts-lato
6-
RUN pip3 install cython matplotlib pytest scipy psutil pyvtk ipywidgets
6+
RUN pip3 install cython matplotlib pytest scipy psutil pyvtk ipywidgets -U
77
RUN pip3 install --no-cache-dir notebook
88

99
RUN ln -s /usr/bin/python3 /usr/bin/python

Makefile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ PYTEST = ${PYTHON} -m pytest
88
#####################
99

1010
build:
11-
${PYTHON} setup.py build_ext --inplace
11+
${PYTHON} setup.py build_ext --inplace -j2
1212

1313
clean:
1414
rm -rf ${EXTENSIONS_DIR}/*
1515
touch ${EXTENSIONS_DIR}/__init__.py
16+
rm -rf build
1617

1718
docker:
1819
docker build -t fidimag -f ./docker/travis/Dockerfile .
@@ -22,13 +23,19 @@ docker:
2223
# Tests #
2324
#########
2425

25-
test-docker: docker
26+
test-docker:
2627
docker exec fidimag make test-basic
2728
#docker exec fidimag make test-without-run-oommf
2829
#docker exec fidimag make test-ipynb
2930

30-
travis: test-docker
31+
ipynb-docker:
32+
while sleep 9m; do echo "===[ Still Running ]===\n"; done &
33+
docker exec fidimag make test-ipynb
34+
kill %1
35+
36+
travis-test: test-docker
3137
docker exec fidimag make codecov
38+
docker exec fidimag make test-ipynb
3239

3340
codecov:
3441
bash <(curl -s https://codecov.io/bash)

README.md

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,40 @@ The results can be straightforwardly visualised from the outputted VTK files usi
7070

7171

7272

73-
### Attributions
74-
The code is developed by Weiwei Wang, Marc-Antonio Bisotti, David Cortes, Thomas Kluyver, Mark Vousden, Ryan Pepper, Oliver Laslett, Rebecca Carey, and Hans Fangohr at the University of Southampton.
73+
### Attributions
74+
The code is currently developed by Weiwei Wang, David Cortes, Ryan Pepper and Hans Fangohr at Anhui University, University of Southampton and European XFEL. Previous developers who have worked on Fidimag are Marc-Antonio Bisotti, Thomas Kluyver, Mark Vousden, Oliver Laslett and Rebecca Carey.
7575

76-
This is an early experimental version; contributions and pull requests to both the code and documentation are welcome.
76+
Contributions and pull requests to both the code and documentation are welcome.
7777
If you use Fidimag, please cite as:
7878

79-
David Cortés-Ortuño, Weiwei Wang, Ryan Pepper, Marc-Antonio Bisotti, Thomas Kluyver, Mark Vousden, & Hans Fangohr. (2016). Fidimag v2.0 [Data set]. Zenodo. http://doi.org/10.5281/zenodo.167858A bib file is provided in the repository.
79+
Bisotti, M.-A., Cortés-Ortuño, D., Pepper, R., Wang, W., Beg, M., Kluyver, T. and Fangohr, H., 2018. Fidimag – A Finite Difference Atomistic and Micromagnetic Simulation Package. Journal of Open Research Software, 6(1), p.22. DOI: http://doi.org/10.5334/jors.223
8080

8181
### Publications
8282

8383
The following publications, in reverse chronological order, have used Fidimag:
8484

85-
[1] [Thermal stability and topological protection of skyrmions in nanotracks](https://www.nature.com/articles/s41598-017-03391-8), D. Cortés-Ortuño, W. Wang, M. Beg, R.A. Pepper, M-A. Bisotti, R. Carey, M. Vousden, T. Kluyver, O. Hovorka & H. Fangohr, Scientific Reports 7, 4060 (2017)
85+
[1] [Learning Magnetization Dynamics](https://arxiv.org/abs/1903.09499), A. Kovacs, J. Fischbacher, H. Oezelt, M. Gusenbauer, L. Exl, F. Bruckner, D.Suess, T.Schrefl, arXiV (2019)
8686

87-
[2] [Current-induced instability of domain walls in cylindrical nanowires](http://iopscience.iop.org/article/10.1088/1361-648X/aa9698/meta), W. Wang, Z. Zhang, R.A. Pepper, C. Mu, Y. Zhou & Hans Fangohr, Journal of Physics: Condensed Matter, 30, 1 (2017)
87+
[2] [Binding a hopfion in a chiral magnet nanodisk](https://journals.aps.org/prb/pdf/10.1103/PhysRevB.98.174437), Y. Liu, R. K. Lake, and J. Zang, Physical Review B 98, 174437 (2018)
8888

89-
[3] [Magnonic analog of relativistic Zitterbewegung in an antiferromagnetic spin chain](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.96.024430), W. Wang, C. Gu, Y. Zhou & H. Fangohr, Phys. Rev. B 96 (2017)
89+
[3] [Proposal for a micromagnetic standard problem for materials with Dzyaloshinskii–Moriya interaction](http://iopscience.iop.org/article/10.1088/1367-2630/aaea1c), D. C-Ortuño, M. Beg2, V. Nehruji3, L. Breth1, R. Pepper, T. Kluyver, G. Downing, T. Hesjedal, P. Hatton3, T. Lancaster, R. Hertel5, O. Hovorka and H. Fangohr, New Journal of Physics, Volume 20 (2018)
9090

91-
[4] [Magnon-Driven Domain-Wall Motion with the Dzyaloshinskii-Moriya Interaction](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.114.087203) W. Wang, M. Albert, M. Beg, M-A. Bisotti, D. Chernyshenko, D. Cortés-Ortuño, I. Hawke & H. Fangohr, Phys. Rev. Lett. 114, 087203 (2015)
91+
[4] [Driving chiral domain walls in antiferromagnets using rotating magnetic fields](https://link.aps.org/doi/10.1103/PhysRevB.97.184418) K.Pan, L.Xing, H.Y.Yuan, and W.Wang,
92+
Physical Review B 97, 184418 (2018).
93+
94+
[5] [Fidimag - A Finite Difference Atomistic and Micromagnetic Simulation Package](http://doi.org/10.5334/jors.223), Bisotti, M.-A., Cortés-Ortuño, D., Pepper, R., Wang, W., Beg, M., Kluyver, T. and Fangohr, H., Journal of Open Research Software, 6(1), p.22. (2018)
95+
96+
[6] [Thermal stability and topological protection of skyrmions in nanotracks](https://www.nature.com/articles/s41598-017-03391-8), D. Cortés-Ortuño, W. Wang, M. Beg, R.A. Pepper, M-A. Bisotti, R. Carey, M. Vousden, T. Kluyver, O. Hovorka & H. Fangohr, Scientific Reports 7, 4060 (2017)
97+
98+
[7] [Current-induced instability of domain walls in cylindrical nanowires](http://iopscience.iop.org/article/10.1088/1361-648X/aa9698/meta), W. Wang, Z. Zhang, R.A. Pepper, C. Mu, Y. Zhou & Hans Fangohr, Journal of Physics: Condensed Matter, 30, 1 (2017)
99+
100+
[8] [Magnonic analog of relativistic Zitterbewegung in an antiferromagnetic spin chain](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.96.024430), W. Wang, C. Gu, Y. Zhou & H. Fangohr, Phys. Rev. B 96 024430 (2017)
101+
102+
[9] [Driving magnetic skyrmions with microwave fields](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.92.020403) W. Wang, M. Beg, B. Zhang, W. Kuch, and H. Fangohr, Phys. Rev. B 92, 020403 (2015).
103+
104+
[10] [Microwave-induced dynamic switching of magnetic skyrmion cores in nanodots](https://aip.scitation.org/doi/10.1063/1.4914496) B. Zhang, W. Wang, M. Beg, H. Fangohr, and W. Kuch, Applied Physics Letters 106, 102401 (2015).
105+
106+
[11] [Magnon-Driven Domain-Wall Motion with the Dzyaloshinskii-Moriya Interaction](https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.114.087203) W. Wang, M. Albert, M. Beg, M-A. Bisotti, D. Chernyshenko, D. Cortés-Ortuño, I. Hawke & H. Fangohr, Phys. Rev. Lett. 114, 087203 (2015)
92107

93108
### Acknowledgements
94-
We acknowledge financial support from EPSRC’s Centre for Doctoral Training in Next Generation Computational Modelling (EP/L015382/1) and EPSRC’s Doctoral Training Centre in Complex System Simulation (EP/G03690X/1)
109+
We acknowledge financial support from EPSRC’s Centre for Doctoral Training in Next Generation Computational Modelling (EP/L015382/1), EPSRC’s Doctoral Training Centre in Complex System Simulation (EP/G03690X/1), EPSRC Programme grant on Skyrmionics (EP/N032128/1) and OpenDreamKitHorizon 2020 European Research Infrastructure project (676541).

bin/fix_load_path_mac.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
def extract_library(so_file):
2121
cmd = ('otool', '-L', so_file)
2222
output = subprocess.check_output(cmd)
23-
for line in output.split('\t'):
23+
for line in output.decode().split('\t'):
2424
m = patten.match(line)
25+
print(m, line)
2526
if m:
2627
lib_name = m.group()
2728
full_name = os.path.join(LIB_DIR, lib_name)
28-
#print lib_name, full_name
29+
print(lib_name, full_name)
2930
cmd = ('install_name_tool', '-change',
3031
lib_name, full_name, so_file
3132
)

bin/install-fftw.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#!/bin/bash
2-
echo "HELLO"
2+
33
# This script installs FFTW locally. It may need to environment
44
# variables to work, like 'export CC=gcc' in ARCHER.
55

6-
FFTW=fftw-3.3.4
6+
FFTW=fftw-3.3.8
77

88
set -e
99

@@ -33,10 +33,10 @@ download_and_install() {
3333
tar -xzf ${1}.tar.gz
3434
cd ${1}
3535
echo "Configuring "${1}"."
36-
./configure --quiet --enable-shared --enable-openmp --prefix=${LIBS_DIR}
36+
./configure --quiet --enable-shared --enable-openmp --enable-sse2 --enable-avx --prefix=${LIBS_DIR}
3737
echo "Compiling and installing "${1}"."
3838
{
39-
make
39+
make -j2
4040
make install
4141
} > /dev/null
4242
echo "Done."

0 commit comments

Comments
 (0)