Bugfixes in freelayerthickness.mx3 test#391
Open
jplauzie wants to merge 1 commit intomumax:masterfrom
Open
Conversation
fix 3 bugs in freelayerthickness test. Issue 1: Test passes despite torques being different, due to tolerance of 1e-5 being too loose. Issue 2: FLT is defined as thickness of the FM. For explicit setting in Case2, this should be 2e-9 Issue 3: We should explicitly set m of the cell, otherwise it changes between tests due to grid change. Issue 4(NOT FIXED): If you change the cellsize after SetGeom, STT torque is silently 0 and not set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
When trying to answer this discussion question, I ran into some strange behavior on the Slonczewski STT test here. My understanding is, FreeLayerThickness(FLT) should be set as the full thickness of the FM (e.g., in the mumax workshop for 3 layers of 1e-9, with 1 nonmagnetic spacer layer, they use FLT=2e-9).
This test has a few issues:
Issue1: The test passes despite torques being different (you can print out the torques), due to tolerance of 1e-5 being too loose. I believe 1e-5 is absolute error instead of relative
Issue 2: FLT is defined as thickness of the FM. For explicit setting in Case2, this should be 2e-9, not 1e-9, in order to be comparable to Case1 where FLT is unset but the gridsize is 2 and cellsize is 1e-9.
Issue3: When you change the gridsize in Z from 2 to 4, this changes the magnetization of the cell. Set m explicitly to be consistent, otherwise the torques still won't match. I set it to what the original test used, but the m could be something simpler. After both setting m and FLT to 2e-9, they match.
Issue4: (NOT fixed in this PR): If you change the cellsize after SetGeom, STT torque is silently 0 and not set. If you do Setcellsize before setgeom it's fine. Seems to be because the cell magnetization is (0,0,0). I am guessing it's just a geometry clipping issue because it happens if you increase the cellsize to 2e-9, but not if you decrease it to 0.5e-9. Kind of weird, because cell(0,0,0) should not be getting clipped out of the geometry or anything for a Setgeom(layers(0,2)).
Attached is a slightly modified test script that shows these issues in the original:
sttbug4.txt
This PR has a fixed test that should fix Issues 1-3 by setting a more strict tolerance (I don't know what the normal value is for torques? They're on the order of 1e-7 for these parameters. I know there are numerical noise issues at some point), setting the FLT explicitly on line 34 to 2e-9, and setting m in both cases explicitly.
(Peeking at Mumax+, it has a similar test , but the implementation seems slightly different. It uses relative error of 1e-5, and explicitly sets the FLT to 1e-9 (not 2e-9? seems like it should be 2e-9 for the same reason as here) for both cases). There are some (different) strange things in that test (torque_result uses magnet_wanted, and the torques seem to match even if i explicitly set different FLTs) so I will open a separate issue over there once I'm sure I fully understand it, if it's still weird. I'm not as good with Mumax+ yet.)
Best regards,
Josh L.