ubermag / mumax3c

mumax3 calculator.
https://ubermag.github.io
BSD 3-Clause "New" or "Revised" License
22 stars 7 forks source link

15 - energies [second attempt] #20

Closed lang-m closed 2 years ago

lang-m commented 2 years ago

Supersedes #19

swapneelap commented 2 years ago

@samjrholt and @lang-m the inter region interaction scripts are working now. Please go through the code and test mumax3c functionality when you find time.

samjrholt commented 2 years ago

When using uniaxial anisotropy, having system.energy.uniaxialanisotropy still has the attribute K even if we only set K1 and K2. This is causing it to fail when setting the anisotropy parameters. When these are not they are ubermagutil.typesystem.descriptors.Parameter but when they are set they are float.

samjrholt commented 2 years ago

@swapneelap This looks good. I've commented the bits I've spotted and I will retest when we have sorted the unique Ms problems.

swapneelap commented 2 years ago

When using uniaxial anisotropy, having system.energy.uniaxialanisotropy still has the attribute K even if we only set K1 and K2. This is causing it to fail when setting the anisotropy parameters. When these are not they are ubermagutil.typesystem.descriptors.Parameter but when they are set they are float.

Thank you for mentioning this. I had no idea :| . I'll fix it now.

swapneelap commented 2 years ago

@samjrholt I fixed the uniaxialanisotropy parameters check in commit e230ad8f259b4681dd4d89e2982da1bf37081f88. Let me know if it works.

samjrholt commented 2 years ago

When using uniaxial anisotropy, having system.energy.uniaxialanisotropy still has the attribute K even if we only set K1 and K2. This is causing it to fail when setting the anisotropy parameters. When these are not they are ubermagutil.typesystem.descriptors.Parameter but when they are set they are float.

Thank you for mentioning this. I had no idea :| . I'll fix it now.

I've given it a go and acts as I expect

swapneelap commented 2 years ago

@lang-m and @samjrholt Please have a look at the code. I have updated the DMI energy script. If we keep the magnetoelastic for the advanced tasks, I think we are done with the energy. If you both think it is OK, I'll merge the PR.

samjrholt commented 2 years ago

@swapneelap I've tested it and I'm getting an error of AttributeError: Object has no attribute get. from line 60 in the energy script when using DMI. The only other thing I think that is missing for now would it be possible to add using as Field to set an applied H field.

swapneelap commented 2 years ago

@samjrholt I'll try H from Field and let you know if I am able to do it.

swapneelap commented 2 years ago

@samjrholt and @lang-m After spending an embarrassingly long amount of time staring at the mumax3 forum, I was able to add B_ext from discretisedfield.Field in the script (commit 62179f9). Please have a look at it. If you think everything is in place for the energy terms scripts, we can merge this PR.