-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Fixes and enhancements for type label support #4254
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
base: develop
Are you sure you want to change the base?
Conversation
…and Improper sections
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 don't merge until @jrgissing approves
@akohlmey is this to be merged before stable release? |
Yes. I am making an exception to the pre-stable rules for all type label and LAMMPS-GUI stuff that is required to complete our revising Simon's tutorials (and paper). Since the tutorial is explicitly referring to the stable version (for good reasons), we should get everything related to type labels into the best possible state and not postpone changes to be done right after the stable release. I have more stuff for LAMMPS-GUI coming and some requires (small) changes to the core code as well. |
@jrgissing do you have any suggestions for additional changes, or see any possible problems with the changes included here? |
@@ -1251,7 +1250,6 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset, | |||
error->one(FLERR, "Invalid atom type {} in {}: {}", itype, location, | |||
utils::trim(buf)); | |||
type[nlocal - 1] = itype; | |||
if (labelflag) type[nlocal - 1] = ilabel[itype - 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.
I am confused about many of the changes in this PR. Simply removing lines like these essentially reverts the type label functionality within a data file, and eliminates one of the main benefits of the framework, which is to automatically sync types between multiple input files when using type labels.
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 provide an example illustrating 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.
Please see attached for the example I was thinking of.
in.zip
Summary
This updates the labelmap, write_data, and read_data commands to make them behave more consistently, more flexible and lift some restrictions that were originally imposed. In particular:
write_data xxx.data types labels
only types with a type label assignment will be written as label; all others as numerical type.Related Issue(s)
This tries to implement what was discussed on PR 4252
#4252 (comment)
Author(s)
Axel Kohlmeyer, Temple U
Licensing
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
Backward Compatibility
Data files created by write_data differ when there are incomplete label maps.
Implementation Notes
Some internal APIs where changed, e.g. to remove no longer used parameters. The majority of changes are in the Atom and LabelMap classes. We probably also need to add (more) tests to the type label related functions in the Variable class and potentially make updates.
Post Submission Checklist