You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, the interaction potentials are wrapped in layers of hand-typed match statements that appropriately yield the DOCA function, derivative of the DOCA function, etc. for each potential - thinking about keeping the code modular, I think it might make sense to rewrite it all as Interaction objects that implement an Interaction trait, including yielding the various functions. Maybe some operator overloading so that Interaction can be called like a function would be neat?
The text was updated successfully, but these errors were encountered:
This change is for the best, but it will require more work than I think I originally thought. Here's a to-do list for when I attempt this:
write an Interaction trait
write structs for ScreenedCoulomb, Spline, Polynomial, Exponential interactions that implement Interaction and new for building from enums/input file
refactor bca code to use structs that implement Interaction
write wrappers in input.rs that build the common Interactions (e.g., Kr-C) from the existing keywords to maintain backwards compatibility, as well as include the option to define your own manually
implement Fn trait from std so that the interactions can be called really easily:
kr_c = ScreenedCoulomb::new(...);
///if ScreenedCoulomb implements Fn, I could write:
kr_c(Z1, Z2, a, r) ///to get immediate access to the interaction potential
Right now, the interaction potentials are wrapped in layers of hand-typed match statements that appropriately yield the DOCA function, derivative of the DOCA function, etc. for each potential - thinking about keeping the code modular, I think it might make sense to rewrite it all as Interaction objects that implement an Interaction trait, including yielding the various functions. Maybe some operator overloading so that Interaction can be called like a function would be neat?
The text was updated successfully, but these errors were encountered: