-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Maybe the best way to do it is using numpy.f2py to generate some Fortran extensions. This way, we can pass data from Python (much nicer for I/O and setup) and even run the Fortran stuff in CI as part of the test suite if desired. Manuele Faccenda has a refactored version of DRex with a more generic interface compared to the original. It seems like the newest Fortran DRex variant and is actively used, which makes it the best candidate for comparisons. I think I'll use that code as the basis for our Fortran extensions.
It seems like the preferred way of writing Fortran extensions that gives the most control over the data transfer involves adding f2py directives in the Fortran source (just as writing C extensions actually involves writing "Cython").
We want drop-in replacements for the following PyDRex methods:
-
minerals.update_all, which requires -
minerals.update_orientations, which requires -
core.derivatives
We also might want the statistical methods:
-
minerals.voigt_averages -
stats.resample_orientations(was this ever included in the Fortran?)
And it could be nice to have:
-
diagnostics.elasticity_components(but check the new routine from Tape & Tape 2024 first) -
diagnostics.finite_strain