-
Notifications
You must be signed in to change notification settings - Fork 188
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
Refactor bonded interaction parameter handling #4161
Conversation
src/config/config.hpp
Outdated
@@ -90,6 +90,11 @@ | |||
#define TINY_OIF_ELASTICITY_COEFFICIENT 1e-10 | |||
#endif | |||
|
|||
/** Maximal number of soft particles per IBM volcons bond (?) */ | |||
#ifndef IBM_MAX_NUM | |||
#define IBM_MAX_NUM 1000 |
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.
why?
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.
It's basically a relocation of a constant from here
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.
This constant had to be moved out to help with dependency inversion, IIRC.
return std::max(max_cut, cutoff(bond.type, bond.p)); | ||
}); | ||
auto const max_cut_bonded = boost::accumulate( | ||
bonded_ia_params, -1., |
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.
why do you initialize with -1 and not 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.
I think -1.
is the magic value that will be replaced by the more expressive macro BONDED_INACTIVE_CUTOFF
in #4066.
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.
Still don't understand this... The minimum value for the maximum cut off is zero and not some magic number.
@@ -99,31 +60,28 @@ double maximal_cutoff_bonded() { | |||
return (any_dihedrals) ? 2 * max_cut_bonded : max_cut_bonded; | |||
} | |||
|
|||
int bonded_ia_params_num_partners(int bond_id) { |
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.
int bonded_ia_params_num_partners(int bond_id) { | |
int no_of_partners(int bond_id) { |
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.
The bonded_ia_params_
prefix is used in this function and the ones above and below because it's acting on the variant called bonded_ia_params
. This will become clear once we add the correct doxygen group delimiters. We could even move these functions to src/script_interface
.
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.
Function moved to src/script_interface/interactions/bonded.hpp
and modified to call a new function with signature number_of_partners(Bonded_ia_parameters const &iaparams)
in src/core/bonded_interactions/bonded_interaction_data.cpp
.
1e4f86f
to
bcefbc8
Compare
- store bonded parameters in a boost::variant - make force/energy kernels methods of the bond structs - use boost::serialization for MPI communication Co-authored-by: Jean-Noël Grad <[email protected]>
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.
good to go from my side
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.
Please check that all types follow our naming convention (SnakeCase) and adjust the naming of the bond classes (remove the Parameters
suffix)
Fixes #3019, partial fix for #3680, closes #4066
Description of changes:
boost::variant