Clarification on .repeat() usage and creating non-magnetic layers in Mumax3

22 views
Skip to first unread message

Naintara

unread,
Nov 14, 2025, 6:54:04 AMNov 14
to mumax2

Dear Mumax community,

I have a question regarding the use of the .repeat(int, int, int) function in Mumax3.

I am trying to understand how .repeat(x, y, z) works in terms of spatial repetition. For example, if I want to repeat a square every 40e-9 m in the x-direction, does square.repeat(40e-9, 0, 0) mean that the square is repeated at intervals of 40e-9 m along x? In other words, is the argument of .repeat(x, y, z) interpreted as the periodic spacing in each direction?

Additionally, I would like to build a lattice made of many squares placed at 40e-9 m distance from each other, and then place a non-magnetic film on top of this lattice. Since non-magnetic materials do not have material parameters in Mumax3, I am unsure how to correctly define this layer.
Is there a recommended way to include non-magnetic regions in the geometry?

Any clarification or example would be very helpful.

Thank you very much.



Confidentiality Notice: This email and any attachments may contain confidential or privileged information. If you are not the intended recipient, please notify the sender by replying to this message, and then delete the email and any attachments permanently. Thank you.

Josh Lauzier

unread,
Nov 15, 2025, 1:48:49 AMNov 15
to mumax2
Hi,

Yes it is the spacing between repeats, measured from the centers of one square to the center of the next. There is a nice example on the example page under geometry for circles, using " setgeom( circle(200e-9).repeat(300e-9, 400e-9, 0) )", with a picture showing what it looks like.

In general, to represent non-magnetic materials, that is equivalent to having an empty region. If you want the non-magnetic layer to be on top of the squares, it is sufficient to simply not include it, and let it be modeled implicitly.  You could add an empty layer in your simulation, but there is no benefit to doing so, it won't affect the results and would just slow the simulation down by having more cells to evaluate. Anything outside of your simulation universe is already being treated as if it is nonmagnetic material (unless you're using PBCs). For areas that have to be included in your simulation box (say, you want non-magnetic material between your squares), it is sufficient to use the setgeom() command to set only where the magnetic material is.  You can also manually assign the nonmagnetic areas an Msat of 0 (you can also set Aex=0 and m=uniform(0,0,0) to be safe, but this is not required).

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