mumax / 3

GPU-accelerated micromagnetic simulator
Other
450 stars 150 forks source link

Feature: DW shift per region or layer #219

Closed jsampaio closed 5 years ago

jsampaio commented 5 years ago

This change adds the possibility to ext_centerWall to follow only one region or one layer, which is useful for simulations of SAF (like the RKKY example) or odd-shaped geometries.

For the same kind of simulations, this change also introduces a new option for the shift. Instead of filling the new cells introduced by shift with the values of ShiftMagL and ShiftMagR, it is now possible to use the current values at the border by setting FudgeShift = true.

This change adds the following script functions and flags:

Example script:

c := 4e-9;
SetMesh(256, 32, 2, c, c, c, 0, 0, 0);
defRegion(0, layer(0));
defRegion(1, layer(1));

Msat = 1e6; 
Aex = 10e-12 ;
RKKY := -1e-3 ;
scale := (RKKY * c) / (2 * Aex.Average()) ; 
ext_scaleExchange(0, 1, scale);
anisU = vector(0, 0, 1);
Ku1 = 700000;

alpha = 0.1;
xi = 1;

m.setRegion(0, TwoDomain(0, 0, 1, 1, 0, 0, 0, 0, -1));
m.setRegion(1, TwoDomain(0, 0, -1, -1, 0, 0, 0, 0, 1));

FudgeShift = true; 
ShiftMagL = vector(0,0,1); ShiftMagR = vector(0, 0,-1); //needed for the direction of the shift.

ext_centerWallInRegion(0, 2);
//ext_centerWallInLayer(0, 2);

snapshot(m); print(TotalShift);
shift(20);
snapshot(m); print(TotalShift);
relax(); 
snapshot(m); print(TotalShift);

tableadd(ext_dwpos);
tableautosave(0.1e-9);
J = vector(1e10, 0, 0);
Run(50e-09);
godsic commented 5 years ago

@jsampaio Many thanks for cleaning this up. Could you please consider splitting this pull request in two, i.e., 'center wall' and 'shift'? Its a common practice to have a single feature per pull request and we would like to follow it for the sake of mumax3 maintainability.

jsampaio commented 5 years ago

@godsic ok! I will separate it into two pull requests

jsampaio commented 5 years ago

I opened two new pull requests, so I'll close this one