Skip to content

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

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

akohlmey
Copy link
Member

@akohlmey akohlmey commented Aug 1, 2024

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:

  • assigning a type label of NULL will remove the entry from its label map
  • write_data no longer requires complete labelmaps to write them to data files. In particular
    • In the XXX Type Labels sections, it will write a label of NULL if no assignment exists
    • When using write_data xxx.data types labels only types with a type label assignment will be written as label; all others as numerical type.
  • When reading data files, LAMMPS will accept partial labelmaps and not abort. Thus the behavior for data files is closer to how restart files work.
  • The unit test tester has been significantly expanded to test the new or modified features thoroughly.

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

  • The feature or features in this pull request is complete
  • Licensing information is complete
  • Corresponding author information is complete
  • The source code follows the LAMMPS formatting guidelines
  • Suitable new documentation files and/or updates to the existing docs are included
  • The added/updated documentation is integrated and tested with the documentation build system
  • The feature has been verified to work with the conventional build system
  • The feature has been verified to work with the CMake based build system
  • Suitable tests have been added to the unittest tree.

@akohlmey akohlmey requested a review from jrgissing August 1, 2024 07:02
@akohlmey akohlmey self-assigned this Aug 1, 2024
@akohlmey akohlmey added enhancement refactor test_runs Enable to trigger run tests test_for_regression Enable to trigger regression tests gpu_unit_tests Enable to trigger GPU unit tests and removed test_runs Enable to trigger run tests test_for_regression Enable to trigger regression tests gpu_unit_tests Enable to trigger GPU unit tests labels Aug 1, 2024
@akohlmey akohlmey marked this pull request as ready for review August 1, 2024 22:45
@akohlmey akohlmey requested a review from sjplimp as a code owner August 1, 2024 22:45
Copy link
Contributor

@sjplimp sjplimp left a 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

@jrgissing
Copy link
Collaborator

@akohlmey is this to be merged before stable release?

@akohlmey
Copy link
Member Author

akohlmey commented Aug 5, 2024

@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.

@akohlmey
Copy link
Member Author

akohlmey commented Aug 6, 2024

@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];
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

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

@akohlmey akohlmey marked this pull request as draft September 9, 2024 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Inactive
Development

Successfully merging this pull request may close these issues.

3 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy