-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring of Ewald summation policies and Energy class #247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice refactorization. Pairing strategy will fit there nicely in the future. Short summary follows:
- I am a proponent of a factory method, if enumeration is used to select and create a particular polymorphic instance.
- It should be possible to use automatic string-to-enum mapping in JSON.
- Can a group support
g.at(i)
andg[i]
instead of awkward(g.begin() + i)
syntax? - A lot of work should be done to comply with our naming standard. I picked only that cases that annoyed me most. ;-)
double kappa2 = 0; //!< Squared inverse Debye screening length | ||
double alpha = 0; | ||
double const_inf = 0; | ||
double check_k2_zero = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a more descriptive name. It is difficult to guess what this variable of type double
actually contains.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will talk more to @bjornstenqvist
private: | ||
EwaldData data; | ||
Policy policy; | ||
std::shared_ptr<EwaldPolicyBase> policy; //!< Policy for updating k-space |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a matter of taste. I am used to call it “strategy” when using composition in pure object-oriented programming style, and “policy” if generic programming (i.e., templates) is involved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many options, "method", "scheme", "policy", "strategy", "plan". Let's talk about this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A candidate for a squash commit with a hand-improved commit message. ;-)
This refactors Ewald policies and
Energy::Ewald
with separate policy objects for PBC, IPBC with and without Eigen optimisations. The policy is changed from static to dynamic and unittests and an ewald example is provided. Effectively this means that all Ewald code has moved from headers to cpp.spherical_sum