Fix DFT+U forces for solids
Description
While working on the DFT+U stress tensor, I realized that the DFT+U forces got broken for periodic systems. Here is a list of changes done in the merge request:
- Changes the update of Coulomb integrals to ensure that geometry optimization with DFT+U works. A test is added to avoid regression.
- The GO mode now support ReportMemory.
- Fixes the torque for isolated systems by removing the center of mass.
- Do now compute and write the torque for periodic systems, as this is wrong.
- The DFT+U forces were not symmetrized anymore. This was introduced recently when changing the nonlocal forces and was not propagated to the DFT+U part.
- The forces were wrongly converted twice to Cartesian coordinates. This is due to a change from individual derivatives to a gradient (in correct coordinates) and it was forgotten to change this because this is not covered by any test at the moment.
- Adding matches for DFT+U forces in different conditions.
Thanks to @huebener for reporting the problem with the forces.
News snippet
Add here a one line description to be included in the Changes page. You can delete this section if the changes are trivial and of no consequence for the users.
Checklist
-
I have checked that my code follows the Octopus coding standards -
I have added tests for all the new features added in this request.