Bicomponent Magnonic Crystal

25 views
Skip to first unread message

Manjushree Maity Res. Scholar, Physics, IIT(BHU)

unread,
Aug 19, 2025, 4:50:37 AMAug 19
to mumax2
  Hello everyone,
I have a black-and-white image representing a magnetic bicomponent crystal, where the black and white regions correspond to different materials. I want to load this image into MuMax3 and automatically assign all black regions to one material and all white regions to another material. How can I do this correctly in MuMax3?

bicomponent_stripes.png  
bicomponent.png

Josh Lauzier

unread,
Aug 22, 2025, 1:47:01 AMAug 22
to mumax2
Hi,

You can do this with the ImageShape() command. Something like

a:= Imageshape("filename.png")
defregion(1,a)

This will define all the regions in white as region 1. By default, cells belong to region 0, so cells in the black regions will be region 0. You can assign your material parameters to regions 1 and 0 like normal.

As a side note, if these regions are just uniform (there are no defects, etc), you could also achieve the same thing using mumax's built in shapes like Rect() or Cuboid(). You can fairly easily do a repeating pattern with something like Rect(a1,0).repeat(N,0,0), where N is the number of repeats.

Best,
Josh L.

Manjushree Maity Res. Scholar, Physics, IIT(BHU)

unread,
Aug 23, 2025, 5:36:30 AMAug 23
to mum...@googlegroups.com
  Hello sir, 

Thank you for the explanation. I am familiar with the circle(200e-9).repeat(300e-9, 400e-9, 0) syntax, where the circle is periodically repeated with the given translation vector. However, in the case of Rect(a1,0).repeat(N,0,0), I am not fully clear on its meaning. From what I understand, Rect(a1,0) defines a vertical stripe of width a1 (finite in x, infinite in y), and the .repeat(N,0,0) command replicates this stripe N times along the x-direction.

What I would actually like to define is a finite stripe repeated periodically, similar to the figure I have attached in the previous mail. Could you please clarify how I should achieve this?

Thank you in advance for your guidance. 

Best Regards,
Manju

--
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 visit https://groups.google.com/d/msgid/mumax2/e3614ed6-feca-4720-bd9e-ac8056657bd6n%40googlegroups.com.

Josh Lauzier

unread,
Aug 24, 2025, 4:17:53 AMAug 24
to mumax2
Hi,

Sorry, that was my mistake, there are a few typos. It would instead be something like Rect(a1,W).repeat((a1+a2)/2,0,0). This creates a rectangle of length a1 in the x direction, and length W in the y-direction. It will then repeat it it every (a1+a2)/2 in the x direction ( (a1+a2)/2 is the distance from the center of one rectangular segment to another). If you need to shift it to line up at the start of the strip (since Rect() will start centered in the middle), you can also add a transl(), so  Rect(a1,W).repeat((a1+a2)/2,0,0).transl(a1/2,0,0) to make sure it lines up with the edge of the strip.

One can also use a for-loop, something like:

for i:=-imax; i<=imax; i+=1{
defregion(1,Rect(a1,W).transl(i*(a1+a2),0,0))
}

to accomplish the same thing.

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