-
Notifications
You must be signed in to change notification settings - Fork 5
/
api.html
10339 lines (5341 loc) · 313 KB
/
api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>mumax3</title>
<link rel="stylesheet" href="https://unpkg.com/[email protected]/build/pure-min.css">
<link rel="stylesheet" type="text/css" href="style.css">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-50169601-1', 'mumax.github.io');
ga('send', 'pageview');
</script>
</head>
<body>
<div style="float:left">
<img src="nimble-cubes128.png"/>
</div>
<div style="float:left">
<span style="font-size:48px"><b>mumax</b><sup>3</sup><br/></span>
GPU-accelerated micromagnetism <br/><br/>
<a class="pure-button pure-button-primary" href="index.html">Home</a>
<a class="pure-button pure-button-primary" href="download.html">Download</a>
<a class="pure-button pure-button-primary" href="examples.html">Examples</a>
<a class="pure-button pure-button-primary" href="api.html">API</a>
<a class="pure-button pure-button-primary" href="https://groups.google.com/forum/#!forum/mumax2">Forum</a>
</div>
<br style="clear:both"/>
<hr/>
<div class="api-container">
<div class="api-menu">
<div style="margin: 0px; margin-bottom: 5ex;">
<h2 style="text-align: center; margin: 5px;">mumax3.10 API</h2>
<input style="text-align: center; margin: auto; width 50px; display: block" type="text" id="searchInput" onclick="onSearch()" onkeyup="onSearch()" placeholder="Enter a search term" title="Type in a name" size=15>
</div>
<h3>Basics</h3>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'syntax')" id="default-open">Syntax</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'mesh')">Mesh size and geometry</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'shapes')">Shapes</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'regions')">Material regions</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'initial')">Initial Magnetization</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'parameters')">Material parameters</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'excitation')">Excitation</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'outputquantities')">Output quantities</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'output')">Scheduling output</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'running')">Running</a></li>
</ul>
<h3>Advanced Features</h3>
<ul class="pure-menu-list">
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'currents')">Spin currents</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'mfm')">Magnetic Force Microscopy</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'slicing')">Slicing and dicing output</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'movingwindow')">Moving window</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'extensions')">Extensions</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'customquantities')">Custom quantities</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'customfields')">Custom effective field terms</a></li>
<li class="pure-menu-item"><a href="#" class="pure-menu-link api-section-link" onclick="openSection(event, 'misc')">Misc</a></li>
</ul>
<p style="font-size:8px; margin-top: 4em"><a href="api39c.html"> Go to mumax3.9c API</a></p>
</div>
<div class="api-content">
<div id="syntax" class="api-section" >
<h1> Syntax </h1>
<p>
The mumax<sup>3</sup> input syntax is a subset of <a href=http://golang.org>Go</a>'s syntax, somewhat similar to C. It is case-independent however, so msat is the same as Msat or MSAT.</p>
<h3>Defining variables</h3>
New variables are declared using <code>:=</code>. Variables have a fixed type, inferred from the declaration's right-hand-side. Assigning to existing variables is done using <code>=</code>. E.g.:
<pre><code>i := 7 // defines a new variable i, type automatically detected to be int
print(i) // now we can use i
i = 5 // assign new value, don't use ':=' (attempt to re-declare)
str := "hello" // defines str, type automatically is string
//str = 1 // would fail, cannot assign int to string
</code></pre>
<h3>Arithmetic</h3>
Most common arithmetic operations are possible. Also Go's <a href=http://golang.org/pkg/math>math</a> library and some common constants are available. For raise-to-the-power, pow(x,y) should be used.
<pre><code>x := pi*(3+4)/5
x = pow(x, 3)
x++
y := abs(cbrt(cosh(erf(erfc(gamma(J0(Y0(2))))))))
</pre></code>
<h3>Control structures</h3>
Loops are possible as well:
<pre><code>for i:=0; i<10; i++{
print(i)
}
</code></pre>
<h3>Implicit functions</h3>
Some of the API features accept a function as argument (e.g.: <code>RunWhile(func()bool)</code>, or all input parameters). In that case, and <i>only</i> in this case, the argument is implicitly converted to a function, which is re-evaluated each time it's needed. E.g.:
<pre><code>value := sin(pi*t) // value is a float64, RHS evaluated only once
Msat = value // time-independent Msat
</code></pre>
versus:
<pre><code>Msat = sin(pi*t) // RHS converted to function, re-evaluted every time
</code></pre>
<h3>Methods</h3>
Some of the API instances have methods defined on them. You can call methods on an instance by using '.' as in most object oriented programming languages.
E.g.: a material parameter such as <code>Msat</code> has the method <code>SetRegion(int, float)</code> to set the value of the material parameter in a certain region:
<pre><code>Msat.SetRegion(1, 800e3) // Set Msat=520e3 in region 1 </code></pre>
</div>
<div id="mesh" class="api-section" >
<h1> Mesh size and geometry </h1>
The simulation mesh defines the size of the box around your magnet. It should be set at the beginning of the script. The number of cells should preferably be powers of two, or at least have small prime factors (2,3,5,7). E.g.:
<pre><code>Nx := 128
Ny := 64
Nz := 2
sizeX := 500e-9
sizeY := 250e-9
sizeZ := 10e-9
SetGridSize(Nx, Ny, Nz)
SetCellSize(sizeX/Nx, sizeY/Ny, sizeZ/Nz)
</code></pre>
<h2> Periodic boundary conditions </h2>
Optionally, periodic boundary conditions can be enabled:
<pre><code>SetPBC(5, 0, 0) // 5 extra images on left and right sides.
SetGridSize(128, 64, 1)
SetCellSize(5e-9, 5e-9, 5e-9)
</code></pre>
Setting a nonzero PBC value in a direction enables wrap-around in that direction. The precise value passed determines how many repetitions are seen by the demag field. E.g., in the above example the demag field behaves as if 5 repetitions are present to the left and to the right side. Choosing a large number may cause long initialization time.
<h2> Resizing the mesh </h2>
The mesh can be changed at any later time in the simulation. This will cause the magnetization to be stretched onto the new mesh if needed, and the geometry and regions to be re-calculated. After resize some cells which had zero magnetization may now fall inside the magnet geometry, they will be initialized to random magnetization.
<h2> Setting the geometry </h2>
Optionally a magnet Shape other than the full simulation box can be specified. In order to set the geometry, you first need to <a href="#" onclick="openSection(event, 'geometry')">define a shape</a>.
<pre><code> geometryShape := cylinder(400e-9, 20e-9).RotX(45*pi/180).Transl(1e-6,0,0)
SetGeom(geometryShape)
</code></pre>
<hr>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">SetCellSize</b>(float64, float64, float64) </span>
<p style="margin-left:40px" class="api-docstring"> Sets the X,Y,Z cell size in meters </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example1">[1]</a>
<a href="examples.html#example2">[2]</a>
<a href="examples.html#example3">[3]</a>
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example5">[5]</a>
<a href="examples.html#example6">[6]</a>
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example8">[8]</a>
<a href="examples.html#example9">[9]</a>
<a href="examples.html#example10">[10]</a>
<a href="examples.html#example11">[11]</a>
<a href="examples.html#example12">[12]</a>
<a href="examples.html#example13">[13]</a>
<a href="examples.html#example14">[14]</a>
<a href="examples.html#example15">[15]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">SetGeom</b>(Shape) </span>
<p style="margin-left:40px" class="api-docstring"> Sets the geometry to a given shape </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example6">[6]</a>
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example8">[8]</a>
<a href="examples.html#example9">[9]</a>
<a href="examples.html#example11">[11]</a>
<a href="examples.html#example12">[12]</a>
<a href="examples.html#example14">[14]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">SetGridSize</b>(int, int, int) </span>
<p style="margin-left:40px" class="api-docstring"> Sets the number of cells for X,Y,Z </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example1">[1]</a>
<a href="examples.html#example2">[2]</a>
<a href="examples.html#example3">[3]</a>
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example5">[5]</a>
<a href="examples.html#example6">[6]</a>
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example8">[8]</a>
<a href="examples.html#example9">[9]</a>
<a href="examples.html#example10">[10]</a>
<a href="examples.html#example11">[11]</a>
<a href="examples.html#example12">[12]</a>
<a href="examples.html#example13">[13]</a>
<a href="examples.html#example14">[14]</a>
<a href="examples.html#example15">[15]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">SetMesh</b>(int, int, int, float64, float64, float64, int, int, int) </span>
<p style="margin-left:40px" class="api-docstring"> Sets GridSize, CellSize and PBC at the same time </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">SetPBC</b>(int, int, int) </span>
<p style="margin-left:40px" class="api-docstring"> Sets the number of repetitions in X,Y,Z to create periodic boundary conditions. The number of repetitions determines the cutoff range for the demagnetization. </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">EdgeSmooth</b> </span>
<p style="margin-left:40px" class="api-docstring"> Geometry edge smoothing with edgeSmooth^3 samples per cell, 0=staircase, ~8=very smooth </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
</p>
</p>
</div>
</div>
<div id="shapes" class="api-section" >
<h1> Shapes </h1>
A shape is an abstract object which outlines an area in a 3D universe. Shapes are useful for different tasks, e.g.: to define the geometry of a magnet, to define material regions, or to set locally a specific initial magnetization configuration.
One can specify primitive shapes, constructed at the origin (box center), and translate/rotate them if needed. All positions are specified in meters and the origin lies in the center of the simulation box. E.g.:
<pre><code>myShape := cylinder(400e-9, 20e-9).RotX(45*pi/180).Transl(1e-6,0,0))
anotherShape := Circle(400e-9).sub(Circle(200e-9))
</code></pre>
<hr/>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Cell</b>(int, int, int) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Single cell with given integer index (i, j, k) </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example1">[1]</a>
<a href="examples.html#example2">[2]</a>
<a href="examples.html#example3">[3]</a>
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example5">[5]</a>
<a href="examples.html#example6">[6]</a>
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example8">[8]</a>
<a href="examples.html#example9">[9]</a>
<a href="examples.html#example10">[10]</a>
<a href="examples.html#example11">[11]</a>
<a href="examples.html#example12">[12]</a>
<a href="examples.html#example13">[13]</a>
<a href="examples.html#example14">[14]</a>
<a href="examples.html#example15">[15]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Circle</b>(float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> 2D Circle with diameter in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example6">[6]</a>
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example8">[8]</a>
<a href="examples.html#example12">[12]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Cone</b>(float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> 3D Cone with diameter and height in meter. The top of the cone points in the +z direction. </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Cuboid</b>(float64, float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Cuboid with sides in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Cylinder</b>(float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> 3D Cylinder with diameter and height in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example5">[5]</a>
<a href="examples.html#example6">[6]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Ellipse</b>(float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> 2D Ellipse with axes in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example14">[14]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Ellipsoid</b>(float64, float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> 3D Ellipsoid with axes in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">GrainRoughness</b>(float64, float64, float64, int) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Grainy surface with different heights per grain with a typical grain size (first argument), minimal height (second argument), and maximal height (third argument). The last argument is a seed for the random number generator. </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">ImageShape</b>(string) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Use black/white image as shape </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Layer</b>(int) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Single layer (along z), by integer index starting from 0 </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example13">[13]</a>
<a href="examples.html#example14">[14]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Layers</b>(int, int) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Part of space between cell layer1 (inclusive) and layer2 (exclusive), in integer indices </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Rect</b>(float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> 2D rectangle with size in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example6">[6]</a>
<a href="examples.html#example9">[9]</a>
<a href="examples.html#example11">[11]</a>
<a href="examples.html#example12">[12]</a>
<a href="examples.html#example15">[15]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Square</b>(float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> 2D square with size in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example6">[6]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Universe</b>() Shape </span>
<p style="margin-left:40px" class="api-docstring"> Entire space </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">XRange</b>(float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Part of space between x1 (inclusive) and x2 (exclusive), in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example7">[7]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">YRange</b>(float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Part of space between y1 (inclusive) and y2 (exclusive), in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">ZRange</b>(float64, float64) Shape </span>
<p style="margin-left:40px" class="api-docstring"> Part of space between z1 (inclusive) and z2 (exclusive), in meter </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( Shape ) Intersect( Shape ) Inverse( ) Repeat( float64 float64 float64 ) RotX( float64 ) RotY( float64 ) RotZ( float64 ) Scale( float64 float64 float64 ) Sub( Shape ) Transl( float64 float64 float64 ) Xor( Shape )
</span> </p>
</p>
</div>
</div>
<div id="regions" class="api-section" >
<h1> Material regions </h1>
Optionally, up to 256 material regions can be defined. Since each cell is made from one material, it is associated with exactly one region. So <em>regions can not overlap</em>. Each cell is assigned material region 0 by default. It's a good idea to output <code>regions</code> to verify whether each cell is assigned to the intended region. Each region can have its own material parameters, and we can output averages over each region. E.g.:
<pre><code>DefRegion(1, circle(1e-6))
DefRegion(0, circle(1e-6).Inverse()) // redundant
save(regions)
Msat.SetRegion(1, 800e6)
tableAdd(m.Region(1)) // add average m over region 1 to table
</code></pre>
<hr/>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">DefRegion</b>(int, Shape) </span>
<p style="margin-left:40px" class="api-docstring"> Define a material region with given index (0-255) and shape </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example12">[12]</a>
<a href="examples.html#example13">[13]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">DefRegionCell</b>(int, int, int, int) </span>
<p style="margin-left:40px" class="api-docstring"> Set a material region (first argument) in one cell by the index of the cell (last three arguments) </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">regions</b> </span>
<p style="margin-left:40px" class="api-docstring"> Outputs the region index for each cell </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Average( ) EvalTo( Slice ) GetCell( int int int ) Gpu( ) HostArray( ) HostList( ) LoadFile( string ) SetCell( int int int int )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example12">[12]</a>
</p>
</p>
</div>
</div>
<div id="initial" class="api-section" >
<h1> Initial magnetization </h1>
The initial magnetization is set by assigning a <code>Config</code> to m, setting it in separate regions, or by loading a file directly.
<pre><code>m = uniform(1, 0, 0)
m.SetRegion(1, vortex(1, 1))
m.LoadFile("config.ovf")
m.SetInShape(circle(50e-9), uniform(0,0,1))
</code></pre>
<hr/>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">m</b> </span>
<p style="margin-left:40px" class="api-docstring"> Reduced magnetization (unit length) </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Average( ) Buffer( ) Comp( int ) EvalTo( Slice ) GetCell( int int int ) LoadFile( string ) Quantity( ) Region( int ) Set( Config ) SetArray( Slice ) SetCell( int int int data.Vector ) SetInShape( Shape Config ) SetRegion( int Config )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example1">[1]</a>
<a href="examples.html#example2">[2]</a>
<a href="examples.html#example3">[3]</a>
<a href="examples.html#example4">[4]</a>
<a href="examples.html#example5">[5]</a>
<a href="examples.html#example6">[6]</a>
<a href="examples.html#example7">[7]</a>
<a href="examples.html#example8">[8]</a>
<a href="examples.html#example9">[9]</a>
<a href="examples.html#example10">[10]</a>
<a href="examples.html#example11">[11]</a>
<a href="examples.html#example12">[12]</a>
<a href="examples.html#example13">[13]</a>
<a href="examples.html#example14">[14]</a>
<a href="examples.html#example15">[15]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Antivortex</b>(int, int) Config </span>
<p style="margin-left:40px" class="api-docstring"> Antivortex magnetization with given circulation and core polarization </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">BlochSkyrmion</b>(int, int) Config </span>
<p style="margin-left:40px" class="api-docstring"> Bloch skyrmion magnetization with given chirality and core polarization </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example5">[5]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Conical</b>(data.Vector, data.Vector, float64) Config </span>
<p style="margin-left:40px" class="api-docstring"> Conical state for given wave vector, cone direction, and cone angle </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">Helical</b>(data.Vector) Config </span>
<p style="margin-left:40px" class="api-docstring"> Helical state for given wave vector </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">NeelSkyrmion</b>(int, int) Config </span>
<p style="margin-left:40px" class="api-docstring"> Néél skyrmion magnetization with given charge and core polarization </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example5">[5]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">RandomMag</b>() Config </span>
<p style="margin-left:40px" class="api-docstring"> Random magnetization </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
<p style="margin-left:40px; color:grey"> examples:
<a href="examples.html#example3">[3]</a>
<a href="examples.html#example5">[5]</a>
</p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">RandomMagSeed</b>(int) Config </span>
<p style="margin-left:40px" class="api-docstring"> Random magnetization with given seed </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
</p>
</div>
<div class="api-entry">
<p><span style="color:#000088; font-size:1.5em; font-family: monospace"> <b class="api-identifier">TwoDomain</b>(float64, float64, float64, float64, float64, float64, float64, float64, float64) Config </span>
<p style="margin-left:40px" class="api-docstring"> Twodomain magnetization with with given magnetization in left domain, wall, and right domain </p>
<p style="margin-left:40px"> <span style="color:grey"> <b>methods:</b>
Add( float64 Config ) RotZ( float64 ) Scale( float64 float64 float64 ) Transl( float64 float64 float64 )
</span> </p>
<p style="margin-left:40px; color:grey"> examples: