Asking a question: How to build a 3D spiral model in mumax3

29 views
Skip to first unread message

李H

unread,
Jul 7, 2026, 6:19:34 AMJul 7
to mumax2
b4aa841cdf3c4e72dba3e1d2a7c6c3b1.png6b85d0e44840800dbfe23a90856bf70d.pngDear developer, may I ask how I can go about building a model? Looking forward to your answer. Thank you sincerely.

Josh Lauzier

unread,
Jul 8, 2026, 1:02:54 AMJul 8
to mumax2
Hi,

If you need a spiral magnetization, you can use the Helical() command. If you want a helical geometry, I don't think there is an easy-built in way. You would probably need to build it up using more primitive shapes, or load it from a file. Probably you could do something like:

SetGridsize(40,40,20)
SetCellsize(2e-9,2e-9,4e-9)

r := 10e-9          
pitch := 2e-9       
dphi := 10*pi/180   
primitive := cylinder(20e-9,4e-9)
helix := primitive.transl(r,0,-20e-9)
imax := 36

for i:=0.0; i<=imax; i++ {

    phi := i*dphi
    x := r*cos(phi)
    y := r*sin(phi)
    z := -20e-9 + i*pitch
    piece := primitive.transl(x,y,z)
    helix = helix.add(piece)

    m.SetInShape(piece, uniform(cos(phi),sin(phi),0))
}
SetGeom(helix)

This builds up a helix by doing a cylinder(circle) for each layer. tweak as necessary.

Best,
Josh L.
Reply all
Reply to author
Forward
0 new messages