# How to define a nonconventional geometry to obtain exchange spring hysteresis loop structure using MuMax3?

I have tried to simulate the hysteresis loop for the exchange spring structure using Mumax3. I have already simulated the hysteresis loop for the conventional bilayer soft-hard structure. Please find the code (given in the link below) I used for the simulation and the hysteresis loop obtained from the simulation, which clearly shows two different coercivities from soft and hard layers, respectively. Hope, this code is correct. Please let me know if you found anything wrong in the code.

However, our experimental system is quite different from the conventional soft-hard structure. This system will also be a bilayer system like the conventional system. Additionally, we need to introduce the geometry as the following image (image-1.png) attached in the enclosure, where both the shaded black and the unshaded blank regions are magnetic. However, the magnetic properties of the two regions are different, i.e., the shaded black region is hard-magnetic, and the blank white region is soft-magnetic with OOP and IP anisotropy, respectively.

Now, what I faced the problem is that, while I set the hard magnetic properties in the figure, the rest of the image is still blank! Instead, I want to assign the blank portion as soft magnetic properties. As the unshaded portion is blank, I am not getting the required result! I am stuck at defining such nonconventional complex geometry.

Could you please let me know where I should modify the code for the nonconventional system?

I'll try to give you an answer and a way to proceed

However, our experimental system is quite different from the conventional soft-hard structure. This system will also be a bilayer system like the conventional system. Additionally, we need to introduce the geometry as the following image (image-1.png) attached in the enclosure, where both the shaded black and the unshaded blank regions are magnetic. However, the magnetic properties of the two regions are different, i.e., the shaded black region is hard-magnetic, and the blank white region is soft-magnetic with OOP and IP anisotropy, respectively.

From this If I understand correctly , you have a bilayer system and in the top layer there is a pattern as shown in this image. In the non-conventional code you have mentioned it like that.

print("The grid sizes for the simulation along X, Y, Z directions, respectively:")
Nx := 64
Ny := 64
Nz := 64
setgridsize(Nx, Ny, Nz)

print("The cell sizes for the simulation along X, Y, Z directions, respectively:")
cx := 5e-9
cy := 5e-9
cz := 5e-9
setcellsize(cx, cy, cz)
softth:=Nz-32
hardth:=Nz-softth

print("Define different regions:")
fig1:= imageShape("image-1.png")
defregion(1, (layers(softth, Nz))) <==============
defregion(2, fig1) <============================== These lines
setgeom( fig1 ) <=================================


But since you need the Fig 1 structure to be embedded in the cuboid

you need to set the geometry to a cuboid and then define a region inside the cuboid.

print("The grid sizes for the simulation along X, Y, Z directions, respectively:")
Nx := 64
Ny := 64
Nz := 64
setgridsize(Nx, Ny, Nz)

print("The cell sizes for the simulation along X, Y, Z directions, respectively:")
cx := 5e-9
cy := 5e-9
cz := 5e-9
setcellsize(cx, cy, cz)
softth:=Nz-32
hardth:=Nz-softth

print("Define different regions:")

// This is done to define an cuboidal geometry
setgeom( cuboid(Nx*cx, Ny*cy, Nz*cz) )
// to extract the geometry from the image
fig1:= imageShape("image-1.png")
//lower soft magnetic layer
defregion(1, (layers(softth, Nz)))
=================== set properties of region 1 here=================
//upper hard magnetic layer
defregion(2, (layers(0, 32)))
=================== set properties of region 2 here=================

defregion(3, fig1)
=================== set properties of the embedded geometry here=================


This should work logically.. because you are acquiring regions, setting the parameters and then going for the regions within the previous regions.

And if you need the pattern to be embedded in a soft magnetic single layer just delete region 2 and specify layer1 from 0 to 64.

You can visualize the geometry by following this

Hope this helps :)

• Wow! Really above and beyond for an answer! Nov 10 '20 at 17:45
• Thanks, Anoop. It worked for me with a little modification. Nov 10 '20 at 20:18
• @ArindamSamanta Glad to hear that! Could you suggest the modification in the code so that I could refine my answer. Nov 10 '20 at 20:45
• @AnoopANair There is nothing wrong with your answer. Actually, it is all about the requirement of the simulation. In my case, again I need to define the magnetization of the figure outside the loop. That's it. Also one thing, in Mumax3 the default region by default is '0'. Hence, if you just define layer '1', it wi;; automatically consider layer '0' as first layer. Nov 12 '20 at 21:41