demagnetization factor for the cylinder

272 views
Skip to first unread message

Iana

unread,
Feb 13, 2024, 4:11:45 PM2/13/24
to mumax2
Dear Mumax community,

I am doing some demagnetization factor calculations using Mumax for the cylindrical shape. So far, I am getting the results that I didn't expect. My cylinder is very large with the diameter of 5000 nm and the thickness is 20 nm. I would expect that for the large very thin cylinder the demagnetization factor through the shortest dimension would be equal 1 (like for an infinite film). However, my code doesn't give that. Is there something that I missing in my code?

// Geometry and mesh definition

SetGridsize(512, 512, 4)
SetCellsize(5000e-9/512, 5000e-9/512, 20e-9/4)
SetGeom(cylinder(5000e-9, 20e-9))

EdgeSmooth = 8
DemagAccuracy = 8

// Material parameters
Msat = 735e3             // Saturation magnetization in A / m
Aex = 1.0e-11            // Exchange stiffness in J / m
Ku1 = 1.5e3              // First order uniaxial anisotropy in J/m^3
anisU = vector(1, 0, 0)  // Easy axis direction
alpha = 0.01            // Gilbert damping

// Initialize magnetization

m = uniform(0.0, 0.0, 1.0)
save(m)
print(m)
print(B_demag)

Thank you a lot for your help!
 
Nz_demag_factor.png

Антон Луценко

unread,
Feb 15, 2024, 5:07:25 AM2/15/24
to mumax2
Hi Iana,
You are setting up the magnetization with m = uniform(0.0, 0.0, 1.0) and save it directly afterwards. Try applying relax() after setting up the magnetization, and saving the quantities only after relax():

m = uniform(0.0, 0.0, 1.0)
relax()
save(m)
print(m)
print(B_demag)

Hope that helps!

Felipe Garcia

unread,
Feb 20, 2024, 11:28:03 AM2/20/24
to mum...@googlegroups.com
Dear Iana,

I think that you would like to have the value in saturation, but not in the relaxed state. The problem is that average B_demag does include all the cells, not only the ones defined by geometry, while m is using only the geometry.

One can see this, because adding to your script
 
defregion(1,cylinder(5000e-9, 20e-9))   // After the definition of geom

print(B_demag.region(1))   // At the end

One gets
print(B_demag.region(1))
//2.184538759053723e-11 2.967847321489933e-11 -0.9079482507819634
which is closer to the value you expect because if one divides this by muMs one gets a value of 0.983.

Regards,
Felipe

--
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 on the web visit https://groups.google.com/d/msgid/mumax2/94a63eb7-aa1d-4373-9bb7-612566e91db8n%40googlegroups.com.

Iana Volvach

unread,
Feb 20, 2024, 11:43:30 AM2/20/24
to mum...@googlegroups.com
Dear Felipe,

Thank you so much for your reply. That makes sense now to me. I appreciate your comment and I can see that it works now.

Sincerely,

Iana Volvach, Ph.D, 
Jacobs School of Engineering
University of California, San Diego


Reply all
Reply to author
Forward
0 new messages