SasView / sasmodels

Package for calculation of small angle scattering models using OpenCL.
BSD 3-Clause "New" or "Revised" License
15 stars 27 forks source link

Insert marketplacemodel bulk ferromagnets #592

Closed astellhorn closed 6 days ago

astellhorn commented 7 months ago

I have added the marketplace model "SANS in bulk ferromagnets". It consists of the files "magnetic_functions.c", "micromagnetic_FF_3D.c", and "micromagnetic_FF_3D.py". In the issue "Insert model "SANS of bulk ferromagnets" from the model marketplace #2784", I have mentioned that it would be good to (i) add the parameter descriptions for the choosable parameters in the GUI (e.g. radius = "Radius of the core", thickness = "Thickness of shell"), and (ii) to add the description of the whole model (given in the .py file) to the sasview webpage. Unfortunately, for both I do not know how to do this - could you have a look on that?

dehoni commented 4 months ago

MacOs Failing not finding Python 3.7. It wasn't me!

butlerpd commented 4 months ago

we recently dropped support for testing on python 3.9 because mac runners didn't support it. We apparently did not update sasmodel runners. 3.7, 3.8, AND 3.9 should be removed. We should add 3.11. I'll open an issue for this.

butlerpd commented 2 months ago

@butlerpd to talk to @pkienzle about how to handle

pkienzle commented 1 month ago

A more general question for something like a magnetic cylinder model which has orientation in both the nuclear and the magnetic scattering.

For non-magnetic models, kernel_iq.c rotates the model into the canonical orientation and calls Iqac for shapes with rotational symmetry or Iqabc for more general shapes. This removes the need for every model to implement the orientation transformation.

The underlying model here is a sphere so no need to reorient the shape. Instead it is using the Iqxy without any nuclear orientation parameters, but two magnetic orientation parameters.

If we try to implement magnetism on an oriented shape, then either we will need to move the rotation from (qx, qy, qz=0) back into Iqxy function, or we will need some way to indicate that the magnetic orientation parameters need to be rotated in the same way as the nuclear parameters so we can determine the projection into the scattering plane.

A related issue is dispersion in magnetic orientation. The main reason we converted to the Iqabc form was to handle orientational dispersion consistently regardless of the orientation of the shape. The solution was to apply two separate rotations, first applying the dispersion rotation, then rotating according to orientation. Actually, the inverse since we are rotating the measured (qx,qy,qz) into (qa, qb, qc) for the shape in canonical orientation.

With magnetic models implemented using Iqxy we will need to include dispersion parameters in the model parameter table and include the dispersion loop directly in the code.

dehoni commented 2 weeks ago

Here is a Mathematica notebook from the original paper that can produce testdata.

testdata_Michels_Honecker_2013.zip

krzywon commented 1 week ago

Based on the feedback from our call yesterday, the only outstanding issue here is the failing Ubuntu build. The unit tests for the model pass. I am working on the Ubuntu build in release_1.0.8_ubuntu_amd, so I think this can be merged. @pkienzle, can you give one final look, please?