Skip to content

Print warning when writing PairCoeff section in data file may not sufficiently reproduce all pair coefficients#2292

Merged
akohlmey merged 2 commits intolammps:masterfrom
akohlmey:warning-no-mixing-data-file
Aug 18, 2020
Merged

Print warning when writing PairCoeff section in data file may not sufficiently reproduce all pair coefficients#2292
akohlmey merged 2 commits intolammps:masterfrom
akohlmey:warning-no-mixing-data-file

Conversation

@akohlmey
Copy link
Copy Markdown
Member

@akohlmey akohlmey commented Aug 18, 2020

Summary

The write_data command will be default always write out a PairCoeff section which includes only the pair_coeff parameters for itype == jtype. This PR adds code to detect if a pair_coeff command was explicitly run for itype != jtype and then print a warning when writing a data file, that the option pair ij is needed, i.e. requesting to write a PairIJCoeff section, to fully reproduce the pairwise force field settings.

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

Yes.

Implementation Notes

I have been thinking about having this flag determine the default for the pair keyword for write_data, but that would change behavior and printing a warning should be sufficient to alert people (and definitely preferable to silently writing out different force field data).

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
  • 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

@akohlmey akohlmey added this to the Stable Release Summer 2020 milestone Aug 18, 2020
@akohlmey akohlmey requested a review from sjplimp August 18, 2020 16:32
@akohlmey akohlmey self-assigned this Aug 18, 2020
@akohlmey akohlmey merged commit d63f3d8 into lammps:master Aug 18, 2020
@akohlmey akohlmey deleted the warning-no-mixing-data-file branch August 18, 2020 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants