mumax / 3

GPU-accelerated micromagnetic simulator
Other
457 stars 151 forks source link

Problem With Layers #163

Closed charliekind closed 6 years ago

charliekind commented 6 years ago

I am having a problem trying to define two separate layers. Using the following code I get layer0 correctly but layer1 is just zero vectors?? Any ideas, what am I doing wrong?

xStretch := 1 / 2 yStretch := 1 / 2 Nx := 512 xStretch Ny := 512 yStretch Nz := 1 sizeX := (1024e-9) xStretch sizeY := (1024e-9) yStretch sizeZ := 1e-9 SetGridsize(Nx, Ny, Nz) SetCellSize(sizeX/Nx, sizeY/Ny, sizeZ/Nz) Msat = 9e5 Aex = 1e-11 alpha = 0.5 Ku1 = 56e4 defRegion(0, layer(0)) defRegion(1, layer(1)) anisU.setRegion(0, vector(0, 0, -1)) anisU.setRegion(1, vector(0, 0, 1)) m.setRegion(0, Uniform(0, 0, -1)) m.setRegion(1, Uniform(0, 0, 1)) RKKY := -1e-3 scale := (RKKY sizeZ) / (2 Aex.Average()) ext_scaleExchange(0, 1, scale) print(scale) //-0.05000000019979015 run(10e-11) snapshot(m.Region(0)) snapshot(m.Region(1)) save(m.Region(0)) save(m.Region(1))

JeroenMulkers commented 6 years ago

Your grid is only one layer thick. layer(1) is outside the simulation box.

charliekind commented 6 years ago

Dammit .... thanks!