Commit ffe57a3
authored
fix(lmp): avoid double qe2f in DPLR efield (deepmodeling#5732)
## Summary
- remove the second qe2f multiplication when forming fix dplr efield
forces
- keep the existing conversion when storing constant and equal-style
efield values
- add real-unit regressions for constant and equal-style efield paths so
qe2f != 1 is covered
Closes deepmodeling#5646.
## Tests
- git diff --check
- /tmp/deepmd-check-venv/bin/ruff check .
- /tmp/deepmd-check-venv/bin/ruff format --check .
## Not run
- Targeted LAMMPS DPLR pytest tests could not run in the local ad hoc
venv: the lammps Python module is not installed there, and pytest
startup segfaulted in the temporary environment before collection.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **Bug Fixes**
* Corrected electric-field force calculations so results are accumulated
consistently in real-unit simulations.
* Fixed related force and virial contributions to match expected values.
* **Tests**
* Added coverage for electric-field behavior in real units.
* Included checks for both constant and variable field settings to
confirm force results remain accurate.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 40d7a49 commit ffe57a3
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
655 | | - | |
| 655 | + | |
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
355 | 355 | | |
356 | 356 | | |
357 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
358 | 365 | | |
359 | 366 | | |
360 | 367 | | |
| |||
508 | 515 | | |
509 | 516 | | |
510 | 517 | | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
511 | 551 | | |
512 | 552 | | |
513 | 553 | | |
| |||
0 commit comments