Enquiry regarding voronoi tesellation

269 views
Skip to first unread message

Payal Bhattacharjee

unread,
Sep 29, 2023, 2:32:15 AM9/29/23
to mumax2
Hi, everyone
I am trying to simulate the motion of a domain wall on a nanostrip according to the paper 'Current-driven domain wall mobility in polycrystalline Permalloy nanowires: A numerical study' by  J. Leliaert et al. DOI: https://doi.org/10.1063/1.4883297. The dimension of my problem is different from the one mentioned in the paper, and I am attaching my code below for your ready reference. While executing the simulation, I am getting one error message that reads, 'Cannot save the quantity: the OVF1 format only supports 3D-vector fields'. Can anyone please suggest what I need to change in this OVF1 format to run the simulation?  
Thanks in advance.


*********Code**********
Nx := 1000
Ny := 50
Nz := 1
cx := 2e-9
cy := 2e-9
cz := 10e-9

setgridsize(Nx, Ny, Nz)
setcellsize(cx, cy, cz)
SetMesh(Nx, Ny, Nz, cx, cy, cz, 0, 0, 0)
EdgeSmooth = 8
//resizing...

setgeom( rect(2000e-9, 100e-9))
saveas(geom, "rectangle")
Save(m)
m = randomMag()
relax()

// define grains with region number 0-255
grainSize  := 10e-9  // m
randomSeed := 1234567
maxRegion  := 255
ext_makegrains(grainSize, maxRegion, randomSeed)

defregion(256, rect(2000e-9, 100e-9).inverse()) // region 256 is outside, not really needed

//material_parameters
Msat = 860e3
Aex = 13e-12
alpha = 0.01
Ku1 = 0

// set random parameters per region
for i:=0; i<maxRegion; i++{
    // random 10% anisotropy variation
        K := 1e5
Ku1.SetRegion(i, K + randNorm() * 0.1 * K)
AnisU.setRegion(i, vector(1, 0, 0))
}

// reduce exchange coupling between grains by 10%
for i:=0; i<maxRegion; i++{
for j:=i+1; j<maxRegion; j++{
ext_ScaleExchange(i, j, 0.9)
}
}


m = Uniform(1,0,0)
m = TwoDomain(1,0,0, 0,1,0, -1,0,0)    // mx in left and right domain
snapshot(m)

// Remove surface charges from left (mx=1) and right (mx=-1) sides to mimic infinitely long wire.
BoundaryRegion := 0
MagLeft        := 1
MagRight       := -1
ext_rmSurfaceCharge(BoundaryRegion, MagLeft, MagRight)

relax()

OutputFormat = OVF1_TEXT
saveas(m,"Domainwall0")
relax()
saveas(m,"Domainwall1")

//STT parameters
Pol = 0.5
xi = 0.04

// send current
jc := 2.0e12   // current density in A/m2
J = vector(-jc,0,0)

// schedule output & run
save(regions)
autosave(m, 10e-12)
tableautosave(10e-12)
run(5e-9)

Josh Lauzier

unread,
Sep 29, 2023, 2:43:50 AM9/29/23
to mumax2
Hi,

Regions isn't a 3D vector quantity. However, unless you have a reason to use the OVF1 format, you can use OVF2 instead. It would instead be 'OutputFormat = OVF2_TEXT'

Best,
Josh L.

Payal Bhattacharjee

unread,
Sep 29, 2023, 2:51:27 AM9/29/23
to mumax2
Thank you so much, Josh.

Payal Bhattacharjee

unread,
Sep 29, 2023, 3:09:57 AM9/29/23
to mum...@googlegroups.com
Dear Josh,
I have changed the output format to OVF2_TEXT, but even after changing I am not able to see the desired image from the regions000000.ovf. Instead, I am getting a different image (attached below). Please give suggestions where I am wrong.
 Thank you.

***************Code*****************

Nx := 1000
Ny := 50
Nz := 1
cx := 2e-9
cy := 2e-9
cz := 10e-9

setgridsize(Nx, Ny, Nz)
setcellsize(cx, cy, cz)
SetMesh(Nx, Ny, Nz, cx, cy, cz, 0, 0, 0)
EdgeSmooth = 8
//resizing...

setgeom( rect(2000e-9, 100e-9))
saveas(geom, "rectangle")
Save(m)
m = randomMag()
relax()

//material_parameters
Msat = 860e3
Aex = 13e-12
alpha = 0.01
Ku1 = 0


// define grains with region number 0-255
grainSize  := 10e-9  // m
randomSeed := 1234567
maxRegion  := 255
ext_makegrains(grainSize, maxRegion, randomSeed)

// set random parameters per region
for i:=0; i<maxRegion; i++{
    // random 10% anisotropy variation
        K := 1e5
Ku1.SetRegion(i, K + randNorm() * 0.1 * K)
AnisU.setRegion(i, vector(1, 0, 0))
}

// reduce exchange coupling between grains by 10%
for i:=0; i<maxRegion; i++{
for j:=i+1; j<maxRegion; j++{
ext_ScaleExchange(i, j, 0.9)
}
}


m = Uniform(1,0,0)
m = TwoDomain(1,0,0, 0,1,0, -1,0,0)    // mx in left and right domain
snapshot(m)

// Remove surface charges from left (mx=1) and right (mx=-1) sides to mimic infinitely long wire.
BoundaryRegion := 0
MagLeft        := 1
MagRight       := -1
ext_rmSurfaceCharge(BoundaryRegion, MagLeft, MagRight)

relax()

OutputFormat = OVF2_TEXT

saveas(m,"Domainwall0")
relax()
saveas(m,"Domainwall1")

//STT parameters
Pol = 0.5
xi = 0.04

// send current
jc := 2.0e12   // current density in A/m2
J = vector(-jc,0,0)

// schedule output & run
save(regions)
save(exchCoupling)
autosave(m, 10e-12)
tableautosave(10e-12)
run(5e-9)

--
You received this message because you are subscribed to the Google Groups "mumax2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mumax2+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mumax2/2c71c8ea-9753-4738-975e-b834cb4f5ad6n%40googlegroups.com.
regions.png

Josh Lauzier

unread,
Sep 30, 2023, 4:19:15 AM9/30/23
to mumax2
Hi,

How are you generating the image? Using mumax3-convert, it should be on the command line as:

mumax3-convert -png filename.out/regions000000.ovf

You shouldn't have to do anything extra (although I would make sure you don't have any other regions files in the same folder, potentially left over from an older script).

Best,
Josh L.

Payal Bhattacharjee

unread,
Sep 30, 2023, 4:36:43 AM9/30/23
to mum...@googlegroups.com
I am viewing the image both in mumax-view and muview. There is no other file in the folder named 'regions' except this. Is the code correct? Is there any error in it? 
Thank you in advance for your help. 

Josh Lauzier

unread,
Oct 1, 2023, 3:08:35 AM10/1/23
to mumax2
Hi,

The mumax code itself is correct, and the OVF file itself looks normal. The issue is just in the post processing of the regions OVF file afterwards.

Unfortunately, I don't use mumax-view or muview often, so I don't have much advice there. It's possible they don't handle the regions OVF as a scalar OVF (similar to this issue: https://groups.google.com/g/mumax2/c/dyL04IYYiEI/m/PaeDdNrFAwAJ) and so don't know how to handle it. However, there is a nice picture of 3-D grain regions in the mumax3 workshop:

regionspic.jpg

I'm not sure how they generated that. It might be possible to do regions in mumax-view if one plays around with the settings (or perhaps this was made in something like Paraview, I am not sure. The blue tint to the background suggests Paraview to me).

I know that Snapshot(regions) function inside the mumax script, or call mumax3-convert on the OVF will work. Either will generate the image for regions properly for your case.

Best,
Josh L

Payal Bhattacharjee

unread,
Oct 1, 2023, 3:36:03 AM10/1/23
to mum...@googlegroups.com
Thank you so much for the detailed suggestion. I shall definitely try this inside the script. 

Reply all
Reply to author
Forward
0 new messages