How to implement customized in-plane “shape anisotropy” per region in an easy-plane anisotropy system

9 views
Skip to first unread message

Chenghao Yang

unread,
Jan 15, 2026, 3:14:58 PM (2 days ago) Jan 15
to mumax2
Dear all,

Happy new year! Hope you all had a great break.

I am simulating a system of two stacked flims in MuMax3. Each flake is an easy-plane magnet (easy plane = x–y, hard axis = z), Easy-plane anisotropy implemented via Ku1 < 0 with anisU = (0,0,1) and Demagnetization field enabled


What I want to do

Because the two flakes have different aspect ratios, they should have different in-plane shape anisotropy strengths, I want to add an additional, weak, in-plane uniaxial anisotropy:

  • different strength for each flake (region-dependent)

  • easy axis along the long direction

  • without changing the original easy-plane anisotropy


What I am currently considering

I am considering implementing this as a custom anisotropy field, similar to:

with:

  • in-plane (e.g. along y)

  • masking the field and energy density by region (one term per flake)

I am also aware that:

  • enabling PBC in x/y suppresses real shape anisotropy

  • extracting from the demag field by saturating along x vs y may be a robust way to estimate the effective in-plane shape anisotropy field


My specific questions
  1. Is adding a custom uniaxial field per region the recommended way to model different in-plane shape anisotropy strengths in an easy-plane system?

  2. Is there a more canonical / built-in MuMax3 approach to represent region-dependent in-plane shape anisotropy without altering the easy-plane term?

  3. When using a custom field, is it correct to define the energy density as
    and add it via AddEdensTerm

Any guidance or recommended patterns would be greatly appreciated.

Best,

Gary

Josh Lauzier

unread,
Jan 16, 2026, 12:18:55 AM (yesterday) Jan 16
to mumax2
Hi,

If you want to investigate different shape anisotropies, the direct way would be to just vary the geometries of the flakes themselves. There's no need to do it via an artificial uniaxial anisotropy unless for some reason you can't change the geometry. (i.e. if it would be too computationally expensive or something, because the flakes are too large). If you have demag enabled, you will already have shape anisotropy- they are two terms for the same thing, shape anisotropy comes because of the demag field. You don't need to double count it by adding a uniaxial anisotropy on top of that, unless for some reason you are unable to simulate the entire flake geometry properly.

However, if you're sure that is what you want, then yes a custom field would be the way to do it. However, note that when using custom fields, it is not just AddEdensTerm that matters for calculations. It's also AddFieldTerm(). You should do both (for most things, AddFieldTerm is actually more important, because the fields/torques are used directly, not the energies). For the syntax, look to the section "custom effective field terms" in the API. You can reuse that identically except your K will be negative.

Best,
Josh L.

Chenghao Yang

unread,
Jan 16, 2026, 9:21:02 AM (15 hours ago) Jan 16
to mum...@googlegroups.com

Hi Josh,

Thank you very much for the clear and detailed explanation — that makes perfect sense.

In my case, the reason I am not directly varying the lateral geometry is indeed due to computational cost. The real flakes are several microns in size, but in the simulation I only model the overlapped region of the two flakes (homojunction stack along z). With this reduced geometry, the demagnetization field alone no longer captures the correct in-plane shape anisotropy associated with the full flake dimensions.

Therefore, my intention is to approximate the missing in-plane shape anisotropy for each flake by adding a weak, region-dependent uniaxial term:

  • the material remains easy-plane (Ku1 < 0 with anisU = z is unchanged),

  • both flakes share the same in-plane easy direction (long axis),

  • but the strength of the in-plane anisotropy differs due to their different aspect ratios.

Following your advice, below is the snippet I am currently using; I would appreciate it if you could confirm that this is a reasonable implementation for this purpose.

// =================== EXTRA IN-PLANE "SHAPE" ANISOTROPY (CUSTOM) ===================
// Note: c1 and c2 are the Define Cuboid Shapes
// Target effective in-plane anisotropy fields Bshape1 := 3e-3 // 3 mT for flake 1 Bshape2 := 1e-3 // 1 mT for flake 2 Ms1 := 129e3 Ms2 := 129e3 // Convert Bk -> K via Bk = 2K/Ms Ksh1 := 0.5 * Ms1 * Bshape1 Ksh2 := 0.5 * Ms2 * Bshape2 // Same in-plane easy axis for both flakes (homojunction, not cross-bar) u := ConstVector(0, 1, 0) // --- Region 1 --- Bani1 := Mul(Const(2*Ksh1/Ms1), Mul(Dot(u, m), u)) Eani1 := Mul(Const(-Ksh1), Mul(Dot(u, m), Dot(u, m))) AddFieldTerm(Masked(Bani1, c1)) AddEdensTerm(Masked(Eani1, c1)) // --- Region 2 --- Bani2 := Mul(Const(2*Ksh2/Ms2), Mul(Dot(u, m), u)) Eani2 := Mul(Const(-Ksh2), Mul(Dot(u, m), Dot(u, m))) AddFieldTerm(Masked(Bani2, c2)) AddEdensTerm(Masked(Eani2, c2))

This term is meant to be purely phenomenological, representing the in-plane shape anisotropy that would arise from the full flake geometry, while keeping the simulation size tractable.

Thanks again for your help and for the clarification about custom fields versus energies — it was very helpful.

Best regards,
Gary


Josh Lauzier <joshl...@gmail.com> 于2026年1月16日周五 05:19写道:
--
You received this message because you are subscribed to a topic in the Google Groups "mumax2" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mumax2/6RutdTZk6Y4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mumax2+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mumax2/00fb1db6-bd82-4415-a516-c888091069f5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages