Skip to content

Fix: Fix the Ewald force and stress when atom number of some elements are zero. #5721

Merged
mohanchen merged 4 commits intodeepmodeling:developfrom
sunliang98:zero_atom
Dec 12, 2024
Merged

Fix: Fix the Ewald force and stress when atom number of some elements are zero. #5721
mohanchen merged 4 commits intodeepmodeling:developfrom
sunliang98:zero_atom

Conversation

@sunliang98
Copy link
Collaborator

Reminder

  • Have you linked an issue with this pull request?
  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you noticed possible changes of behavior below or in the linked issue?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Linked Issue

Fix #5672

Unit Tests and/or Case Tests for my changes

  • An intergrate test 123_PW_zero_atom is added.

What's changed?

  • Fix the Ewald force and stress when atom number of some elements are zero.
  • When atom number of some elements are zero, we output a warning:
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    Warning: atom number is 0 for atom type: Al
    If you are confident that this is not a mistake, please ignore this warning.
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  • When the total number of atom is zero, we warning and quit.

Any changes of core modules? (ignore if not applicable)

  • Example: I have added a new virtual function in the esolver base class in order to ...

@mohanchen mohanchen added Refactor Refactor ABACUS codes Bugs Bugs that only solvable with sufficient knowledge of DFT labels Dec 11, 2024
@mohanchen mohanchen merged commit 3b3466e into deepmodeling:develop Dec 12, 2024
@sunliang98 sunliang98 deleted the zero_atom branch January 6, 2025 06:08
Fisherd99 pushed a commit to Fisherd99/abacus-BSE that referenced this pull request Mar 31, 2025
… are zero. (deepmodeling#5721)

* Fix: Fix the Ewald force when atom number is zero.

* Fix: Fix the Ewald stress when atom number is zero.

* Test: Add an integrate test 123_PW_zero_atom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bugs Bugs that only solvable with sufficient knowledge of DFT Refactor Refactor ABACUS codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error of force calculation when atom number is 0 in ATOMIC_POSITIONS of STRU file

2 participants