Dear Mr./Mrs.,
I hope you're doing well.
I am currently working with MuMax3 and trying to save the magnetization data of specific regions (e.g., sub regions 5 and 6) to the table. However, I am unsure about the correct procedure to achieve this.
Could you please guide me on how to save the magnetization (m) of specific regions to the table in MuMax3? Any examples or suggestions would be greatly appreciated.
Part of my code is as follows.
Thank you for your help!
Best regards,
Giallo
SetGridsize(512, 128, 1) // Only x and y dimensions
SetCellsize(10e-9, 10e-9, 10e-9) // Cell size: 10nm x 10nm, 1 layer in z
// Create and define four rectangular regions
rect1 := Rect(1000e-9, 300e-9) // Input waveguide
rect1 = rect1.Transl(-1000e-9, 0, 0)
DefRegion(1, rect1)
rect2 := Rect(1000e-9, 1000e-9) // Design region
DefRegion(2, rect2)
rect3 := Rect(1000e-9, 300e-9) // Output waveguide 1
rect3 = rect3.Transl(1000e-9, 350e-9, 0)
DefRegion(3, rect3)
rect4 := Rect(1000e-9, 300e-9) // Output waveguide 2
rect4 = rect4.Transl(1000e-9, -350e-9, 0)
DefRegion(4, rect4)
structure := rect1.add(rect2).add(rect3).add(rect4)
setgeom(structure)
// plu geometry picture
Snapshot(geom)
// Set region properties
Ku1.setregion(1, 300) // Anisotropy constant for the rect1 region
anisU.setRegion(1, vector(1, 0, 0)) // Easy axis direction
Ku1.setregion(2, 300) // Anisotropy constant for the rect2 region
anisU.setRegion(2, vector(1, 0, 0)) // Easy axis direction
Ku1.setregion(3, 300) // Anisotropy constant for the rect3 region
anisU.setRegion(3, vector(1, 0, 0)) // Easy axis direction
Ku1.setregion(4, 300) // Anisotropy constant for the rect4 region
anisU.setRegion(4, vector(1, 0, 0)) // Easy axis direction
save(Ku1)
save(anisU)
// Define the magnetic parameters
Msat =1.4e5 // Saturation magnetization (A/m)
save(Msat)
Aex =3.5e-12 // Exchange stiffness (J/m)
alpha =2e-4 // Gilbert damping constant
// Optional: Set random magnetization for the design region (region2)
m.SetRegion(2, RandomMag())
// Set uniform magnetization for transmission waveguides (region1, region3, region4)
m.SetRegion(1, Uniform(1, 0, 0)) // region1: Uniform Mag. Input waveguide
m.SetRegion(3, Uniform(1, 0, 0)) // region3: Uniform Mag. Output waveguide1
m.SetRegion(4, Uniform(1, 0, 0)) // region4: Uniform Mag. Output waveguide2
// Save initial magnetization distribution
saveas(m, "m_initial")
// Define the external magnetic field along z-direction
B_ext = vector(0, 0, 0.2) // External magnetic field (T)
// Define the amplitude and frequency of the sine waves
wave_amplitude := 0.1e-3
wave_frequency_1 := 2.6e9
wave_frequency_2 := 2.8e9
// Apply external field and simulate until final state
TableAdd(B_ext)
TableAutoSave(1e-12)
// Create and define sub-regions 5 and 6 for detection
rect5 := Rect(100e-9, 300e-9) // Sub-region in the center of region3
rect5 = rect5.Transl(1500e-9, 350e-9, 0) // Centered in rect3
DefRegion(5, rect5)
rect6 := Rect(100e-9, 300e-9) // Sub-region in the center of region4
rect6 = rect6.Transl(1500e-9, -350e-9, 0) // Centered in rect4
DefRegion(6, rect6)