Skip to content
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

Fix for extep when NULL or only some elements from potential file are used. #1494

Merged
merged 2 commits into from Jun 11, 2019

Conversation

@mkanski
Copy link
Collaborator

commented Jun 5, 2019

Summary

This PR fixes force field file parsing for pair_style extep if NULL or only a subset of available elements are used.

Related Issues

Fixes #1493

Author(s)

Michał Kański, Jagiellonian University

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

Full

Implementation Notes

The problems are described in #1493.
The solution was to skip unused single entry lines (solves the 1st problem) and check for parameters in a whole array.

I'm attaching a set of tests to check the correctness of the changes.

Post Submission Checklist

Please check the fields below as they are completed after the pull request has been submitted. Delete lines that don't apply

  • The feature or features in this pull request is complete
  • Licensing 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

Further Information, Files, and Links

extep_tests.in.txt

@mkanski mkanski changed the title Fixed for extep when NULL or only some elements from potential file are used. Fix for extep when NULL or only some elements from potential file are used. Jun 5, 2019

@akohlmey akohlmey self-assigned this Jun 5, 2019

@akohlmey akohlmey added this to the Stable Release Summer 2019 milestone Jun 5, 2019

Fix a few more issues resulting from "nelements != atom->types"
this also detects in a more safely fashion, whether there is data in the second part of the input file, that is still formatted for he first part.
@akohlmey

This comment has been minimized.

Copy link
Member

commented Jun 5, 2019

I think there were a few more updates needed. more importantly. the file format allows the first part of the potential file be spread out over multiple lines. thus we need a smarter test. we now test for the first letter in the first 2-3 words. if the first 3 words, it is an old input, if there are two, it is a new section of the file.

@akohlmey akohlmey requested review from athomps and sjplimp Jun 5, 2019

@mkanski

This comment has been minimized.

Copy link
Collaborator Author

commented Jun 6, 2019

Yes, you are right. Thank you for the fix.

@akohlmey akohlmey requested review from jaapkroe and stanmoore1 Jun 7, 2019

@stanmoore1
Copy link
Contributor

left a comment

Looks fine to me.

@akohlmey akohlmey merged commit 8d985e5 into lammps:master Jun 11, 2019

6 checks passed

lammps/pull-requests/build-docs-pr head run ended
Details
lammps/pull-requests/cmake/cmake-serial-pr head run ended
Details
lammps/pull-requests/kokkos-omp-pr head run ended
Details
lammps/pull-requests/openmpi-pr head run ended
Details
lammps/pull-requests/serial-pr head run ended
Details
lammps/pull-requests/shlib-pr head run ended
Details

@mkanski mkanski deleted the mkanski:extep_hybrid branch Jun 14, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.