Create a new module called geometry.py. Here's how it could work:
geometry.py
- New class called
Ellipsoid, takes PRO and OBL as arguments. Could inherit from some base class called Geometry.
- Other polyhedra could be added to this module.
energy.py
Ed() could be made a method of Ellipsoid
demag_factors could be made a method of Ellipsoid
get_material_parms() should be changed to take a geometry
Many other functions would need to be adjusted to remove PRO, OBL from the arguments and instead take a geometry.
Note that some fiddly stuff will have to be done with jax as I think you can't decorate a method - may have to call an additional function.
Create a new module called geometry.py. Here's how it could work:
geometry.py
Ellipsoid, takes PRO and OBL as arguments. Could inherit from some base class calledGeometry.energy.py
Ed()could be made a method ofEllipsoiddemag_factorscould be made a method ofEllipsoidget_material_parms()should be changed to take a geometryMany other functions would need to be adjusted to remove PRO, OBL from the arguments and instead take a geometry.
Note that some fiddly stuff will have to be done with jax as I think you can't decorate a method - may have to call an additional function.