-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://github.com/mumax/3/pull/335
- Loading branch information
1 parent
ffca9e7
commit 2785aaa
Showing
2 changed files
with
52 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
N:=32 | ||
SetMesh(N, N, N, 1e-9,1e-9,1e-9, 0, 0, 0) | ||
|
||
//set material params | ||
alpha=1. | ||
Msat=350e3 | ||
Aex=10e-12 | ||
Ku1=1.0e6 | ||
|
||
//define a spherical shape | ||
diam:=16e-9 | ||
sphere := Ellipsoid(diam,diam,diam) | ||
defregion(1, sphere) | ||
|
||
seed:=238948790 | ||
randSeed(seed) | ||
GrainCutShape=true | ||
ext_make3Dgrains(8e-9, 2, 250, sphere, seed) | ||
|
||
for i:=2; i<254; i+=1 { | ||
anisU.setregion(i, vector(randNorm(),randNorm(),randNorm())) | ||
} | ||
|
||
|
||
//a cell in the sphere for which the nearest voronoi centre also lies in the sphere: nonzero region nr expected | ||
expect("region", regions.getcell(15,15,15), 191, 0) | ||
|
||
//a cell in the sphere for which the nearest voronoi centre lies outside the sphere: region nr 1 expected as it is not affected by make3Dgrains | ||
expect("region", regions.getcell(9,15,15), 1, 0) | ||
|
||
//a cell outside of the sphere for which the nearest voronoi centre lies inside the sphere: nonzero region nr expected as it was completed by make3Dgrains | ||
expect("region", regions.getcell(16,4,15), 64, 0) |