Skip to content

Commit 890366f

Browse files
author
davidcorteso
committed
Fixing conglict with 1D domain wall notebook
2 parents 7c2b305 + 3c9f59a commit 890366f

Some content is hidden

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

69 files changed

+3073
-1106
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*.txt
12
*.pyc
23
/local/
34

@@ -35,3 +36,6 @@ test-reports
3536

3637
# ignore notebook checkpoint directory
3738
.ipynb_checkpoints/
39+
40+
*.npz
41+
*.npy

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ python:
33
- "3.5"
44
- "3.4"
55
- "2.7"
6-
sudo: false
7-
# command to install dependencies
6+
7+
88
before_install:
99
# We do this conditionally because it saves us some downloading if the
1010
# version is the same.
@@ -16,7 +16,7 @@ before_install:
1616
fi
1717
- bash miniconda.sh -b -p $HOME/miniconda
1818
- export PATH=/home/travis/miniconda/bin:$PATH
19-
19+
- sudo apt-get install liblapack-dev libblas-dev
2020
install:
2121
- conda create -q -y -n fidimag-test python=$TRAVIS_PYTHON_VERSION cython matplotlib pytest scipy pytest-cov gcc cmake psutil
2222
- source activate fidimag-test

Makefile

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
PROJECT_DIR = $(abspath .)
22
EXTENSIONS_DIR = ${PROJECT_DIR}/fidimag/extensions
3+
PYTHON = python
34

45
#####################
56
# Cython Extensions #
67
#####################
78

89

910
build:
10-
python setup.py build_ext --inplace
11+
${PYTHON} setup.py build_ext --inplace
1112

1213
clean:
1314
rm -rf ${EXTENSIONS_DIR}/*
@@ -21,6 +22,32 @@ clean:
2122
test:
2223
cd tests && py.test -v -m "not slow and not run_oommf"
2324

25+
test-clean:
26+
rm -rf neb*.ndt
27+
rm -rf relax_npys
28+
rm -rf relax.txt
29+
rm -rf skx_number_*
30+
rm -rf skx_num_*
31+
rm -rf vtks
32+
rm -rf spin.txt
33+
rm -rf unnamed_npys
34+
rm -rf unnamed.txt
35+
rm -rf 2dpbc_tensors.npz
36+
rm -rf 10spin.txt
37+
rm -rf dyn_npys
38+
rm -rf dyn_spin.txt
39+
rm -rf dyn.txt
40+
rm -rf dyn_vtks
41+
rm -rf m0.npy
42+
rm -rf skx_num.txt
43+
rm -rf test_energy.txt
44+
rm -rf unnamed_vtks
45+
rm -rf dw_cobalt.txt
46+
rm -rf mu_s.npy
47+
rm -rf npys
48+
rm -rf relax_vtks
49+
rm -rf m1.npy
50+
2451
test2:
2552
# like test, but run also outside the 'tests' directory.
2653
# Doesn't work on Hans laptop.

bin/install-fftw.sh

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

@@ -9,9 +9,12 @@ set -e
99

1010
# Create target directory if needed.
1111

12+
1213
HERE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
1314
FIDIMAG_DIR="$(dirname "$HERE_DIR")"
14-
LIBS_DIR=${FIDIMAG_DIR}/local
15+
16+
if [ -z $LIBS_DIR ]; then LIBS_DIR=${FIDIMAG_DIR}/local; fi
17+
1518
mkdir -p $LIBS_DIR
1619
cd ${LIBS_DIR}
1720
echo "Installing FFTW to "$LIBS_DIR"."

bin/install-sundials.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ type cmake >/dev/null 2>&1 || { printf "CMake required to build SUNDIALS. You ca
1313

1414
HERE_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
1515
FIDIMAG_DIR="$(dirname "$HERE_DIR")"
16-
LIBS_DIR=${FIDIMAG_DIR}/local
16+
17+
if [ -z $LIBS_DIR ]; then LIBS_DIR=${FIDIMAG_DIR}/local; fi
1718

1819
echo "Will install SUNDIALS to "${LIBS_DIR}" using CC="${CC}"."
1920
mkdir -p ${LIBS_DIR}

doc/ipynb/1d_domain_wall.ipynb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"# Set simulation parameters.\n",
111111
"sim.Ms = Ms\n",
112112
"sim.alpha = alpha\n",
113-
"sim.gamma = gamma\n",
113+
"sim.driver.gamma = gamma\n",
114114
"\n",
115115
"# Add energies.\n",
116116
"sim.add(UniformExchange(A=A))\n",
@@ -119,7 +119,7 @@
119119
" \n",
120120
"# Since the magnetisation dynamics is not important in this stage,\n",
121121
"# the precession term in LLG equation can be set to artificially zero.\n",
122-
"sim.do_precession = False"
122+
"sim.driver.do_precession = False"
123123
]
124124
},
125125
{
@@ -385,7 +385,7 @@
385385
"sim.set_m(m_init)\n",
386386
"\n",
387387
"# Relax the system to its equilibrium state.\n",
388-
"sim.relax(dt=1e-13, stopping_dmdt=0.01, max_steps=5000, save_m_steps=None, save_vtk_steps=None)"
388+
"sim.driver.relax(dt=1e-13, stopping_dmdt=0.01, max_steps=5000, save_m_steps=None, save_vtk_steps=None)"
389389
]
390390
},
391391
{
@@ -461,7 +461,7 @@
461461
"language_info": {
462462
"codemirror_mode": {
463463
"name": "ipython",
464-
"version": 3
464+
"version": 2
465465
},
466466
"file_extension": ".py",
467467
"mimetype": "text/x-python",

doc/ipynb/current-driven-domain-wall.ipynb

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@
115115
" sim = Sim(mesh)\n",
116116
"\n",
117117
" # Set simulation parameters.\n",
118-
" sim.set_tols(rtol=1e-8, atol=1e-8)\n",
118+
" sim.driver.set_tols(rtol=1e-8, atol=1e-8)\n",
119119
" sim.alpha = alpha\n",
120-
" sim.gamma = gamma\n",
120+
" sim.driver.gamma = gamma\n",
121121
" sim.Ms = Ms\n",
122122
"\n",
123123
" # Add energies to the system.\n",
@@ -128,8 +128,8 @@
128128
" sim.set_m(init_m)\n",
129129
" \n",
130130
" # Relax the system and save the state in m0.npy\n",
131-
" sim.relax(dt=1e-14, stopping_dmdt=0.01, max_steps=5000,\n",
132-
" save_m_steps=None, save_vtk_steps=None)\n",
131+
" sim.driver.relax(dt=1e-14, stopping_dmdt=0.01, max_steps=5000,\n",
132+
" save_m_steps=None, save_vtk_steps=None)\n",
133133
"\n",
134134
" np.save('m0.npy', sim.spin)"
135135
]
@@ -190,9 +190,9 @@
190190
" sim = Sim(mesh, name='dyn', driver='llg_stt')\n",
191191
" \n",
192192
" # Set the simulation parameters\n",
193-
" sim.set_tols(rtol=1e-12, atol=1e-14)\n",
193+
" sim.driver.set_tols(rtol=1e-12, atol=1e-14)\n",
194194
" sim.alpha = alpha\n",
195-
" sim.gamma = gamma\n",
195+
" sim.driver.gamma = gamma\n",
196196
" sim.Ms = Ms\n",
197197
"\n",
198198
" # Add energies to the system.\n",
@@ -203,15 +203,15 @@
203203
" sim.set_m(np.load('m0.npy'))\n",
204204
"\n",
205205
" # Set the spin-polarised current in the x direction.\n",
206-
" sim.jx = J\n",
207-
" sim.beta = beta\n",
206+
" sim.driver.jx = J\n",
207+
" sim.driver.beta = beta\n",
208208
"\n",
209209
" # The simulation will run for x ns and save\n",
210210
" # 'snaps' snapshots of the system in the process\n",
211211
" ts = np.linspace(0, time, snapshots)\n",
212212
"\n",
213213
" for t in ts:\n",
214-
" sim.run_until(t)\n",
214+
" sim.driver.run_until(t)\n",
215215
" sim.save_vtk()\n",
216216
" sim.save_m()\n"
217217
]
@@ -1019,7 +1019,11 @@
10191019
"name": "python",
10201020
"nbconvert_exporter": "python",
10211021
"pygments_lexer": "ipython2",
1022-
"version": "2.7.6"
1022+
"version": "2.7.11"
1023+
},
1024+
"widgets": {
1025+
"state": {},
1026+
"version": "1.1.2"
10231027
}
10241028
},
10251029
"nbformat": 4,

doc/ipynb/isolated_skyrmion.ipynb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"sim = Sim(mesh)\n",
169169
"sim.Ms = Ms_function(Ms)\n",
170170
"sim.alpha = alpha\n",
171-
"sim.gamma = gamma\n",
171+
"sim.driver.gamma = gamma\n",
172172
"\n",
173173
"# Add energies.\n",
174174
"sim.add(UniformExchange(A=A))\n",
@@ -177,7 +177,7 @@
177177
"\n",
178178
"# Since the magnetisation dynamics is not important in this stage,\n",
179179
"# the precession term in LLG equation can be set to artificially zero.\n",
180-
"sim.do_precession = False\n",
180+
"sim.driver.do_precession = False\n",
181181
"\n",
182182
"# Initialise the system.\n",
183183
"sim.set_m(init_m)"
@@ -559,7 +559,7 @@
559559
"source": [
560560
"# PYTEST_VALIDATE_IGNORE_OUTPUT\n",
561561
"# Relax the system to its equilibrium.\n",
562-
"sim.relax(dt=1e-13, stopping_dmdt=0.01, max_steps=5000, save_m_steps=None, save_vtk_steps=None)"
562+
"sim.driver.relax(dt=1e-13, stopping_dmdt=0.01, max_steps=5000, save_m_steps=None, save_vtk_steps=None)"
563563
]
564564
},
565565
{
@@ -650,6 +650,10 @@
650650
"nbconvert_exporter": "python",
651651
"pygments_lexer": "ipython2",
652652
"version": "2.7.11"
653+
},
654+
"widgets": {
655+
"state": {},
656+
"version": "1.1.2"
653657
}
654658
},
655659
"nbformat": 4,

doc/ipynb/spin-polarised-current-driven-skyrmion.ipynb

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113
"# Set parameters.\n",
114114
"sim.Ms = Ms\n",
115115
"sim.alpha = alpha\n",
116-
"sim.gamma = gamma\n",
117-
"sim.do_precession = False\n",
116+
"sim.driver.gamma = gamma\n",
117+
"sim.driver.do_precession = False\n",
118118
"\n",
119119
"# Add energies.\n",
120120
"sim.add(UniformExchange(A=A))\n",
@@ -174,7 +174,7 @@
174174
"outputs": [],
175175
"source": [
176176
"%%capture\n",
177-
"sim.relax(dt=1e-13, stopping_dmdt=0.1, max_steps=5000, save_m_steps=None, save_vtk_steps=None)\n",
177+
"sim.driver.relax(dt=1e-13, stopping_dmdt=0.1, max_steps=5000, save_m_steps=None, save_vtk_steps=None)\n",
178178
"np.save('m0.npy', sim.spin)"
179179
]
180180
},
@@ -252,21 +252,21 @@
252252
"# Set parameters.\n",
253253
"sim2.Ms = Ms\n",
254254
"sim2.alpha = alpha\n",
255-
"sim2.gamma = gamma\n",
255+
"sim2.driver.gamma = gamma\n",
256256
"\n",
257257
"# Add energies.\n",
258258
"sim2.add(UniformExchange(A=A))\n",
259259
"sim2.add(DMI(D))\n",
260260
"sim2.add(Zeeman(H))\n",
261261
"\n",
262-
"sim2.jx = -5e12\n",
262+
"sim2.driver.jx = -5e12\n",
263263
"sim2.alpha = 0.2\n",
264-
"sim2.beta = 0.2\n",
264+
"sim2.driver.beta = 0.2\n",
265265
"\n",
266266
"sim2.set_m(np.load('m0.npy'))\n",
267267
"\n",
268268
"for t in [0, 0.1, 0.2]:\n",
269-
" sim2.run_until(t*1e-9)\n",
269+
" sim2.driver.run_until(t*1e-9)\n",
270270
" plot_magnetisation(sim2.spin.copy(), mesh, title='t=%g ns'%t)"
271271
]
272272
}
@@ -287,7 +287,11 @@
287287
"name": "python",
288288
"nbconvert_exporter": "python",
289289
"pygments_lexer": "ipython2",
290-
"version": "2.7.12"
290+
"version": "2.7.11"
291+
},
292+
"widgets": {
293+
"state": {},
294+
"version": "1.1.2"
291295
}
292296
},
293297
"nbformat": 4,

doc/ipynb/spin-waves-in-periodic-system.ipynb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"# Set parameters.\n",
8989
"sim.Ms = Ms\n",
9090
"sim.alpha = alpha\n",
91-
"sim.gamma = gamma\n",
91+
"sim.driver.gamma = gamma\n",
9292
"\n",
9393
"# Add energies.\n",
9494
"sim.add(UniformExchange(A=A))\n",
@@ -262,7 +262,7 @@
262262
"t_array = np.arange(dt, t_sim, dt)\n",
263263
"\n",
264264
"for t in t_array:\n",
265-
" sim.run_until(t)\n",
265+
" sim.driver.run_until(t)\n",
266266
" plot_magnetisation(np.copy(sim.spin))"
267267
]
268268
},
@@ -290,7 +290,11 @@
290290
"name": "python",
291291
"nbconvert_exporter": "python",
292292
"pygments_lexer": "ipython2",
293-
"version": "2.7.6"
293+
"version": "2.7.11"
294+
},
295+
"widgets": {
296+
"state": {},
297+
"version": "1.1.2"
294298
}
295299
},
296300
"nbformat": 4,

0 commit comments

Comments
 (0)