Skip to content

Minor clean-up#7

Merged
vanderhe merged 2 commits intovanderhe:hfxStressDraftfrom
bhourahine:getVirialCleanedUp
Feb 28, 2025
Merged

Minor clean-up#7
vanderhe merged 2 commits intovanderhe:hfxStressDraftfrom
bhourahine:getVirialCleanedUp

Conversation

@bhourahine
Copy link

Avoids division by undefined volume when not periodic, and moves the documentation

@vanderhe vanderhe merged commit ec98605 into vanderhe:hfxStressDraft Feb 28, 2025
0 of 3 checks passed
@bhourahine
Copy link
Author

@vanderhe unfortunately a little fast with the merging, I just also fixed the REKS cases in the PR (and rebased it on main).

@bhourahine
Copy link
Author

bhourahine commented Feb 28, 2025

REKS changes are
src/dftbp/dftb/hybridxc.F90
@@ -5791,15 +6017,209 @@ contains
end do
end do loopForceAtom

REMOVE:
if (this%tREKS) then
gradients(:,:) = gradients + tmpGradients
else
gradients(:,:) = gradients + 0.5_dp * nSpin * tmpGradients

ADD

if (.not.this%tREKS) then
  tmpGradients(:,:) = 0.5_dp * nSpin * tmpGradients
 end if

src/dftbp/reks/reksinterface.F90
@@ -942,7 +942,7 @@ module dftbp_reks_reksinterface
uncomments block and :
#:else
call hybridXc%addCamGradients_real(env, this%deltaRhoSqrL(:,:,:,iL), this%overSqr,&
& skOverCont, orb, denseDesc%iAtomStart, neighbourList%iNeighbour, nNeighbourSK,&

REMOVE
& nonSccDeriv, .false., lcDerivs(:,:,iL), symNeighbourList=symNeighbourList,&
ADD
& nonSccDeriv, 1.0_dp, .false., lcDerivs(:,:,iL), symNeighbourList=symNeighbourList,&

         & nNeighbourCamSym=nNeighbourCamSym)
     @:PROPAGATE_ERROR(errStatus)

Which is a little hacky as it has to pass a dummy cell volume in, event though non-periodic.

@vanderhe
Copy link
Owner

REKS changes are src/dftbp/dftb/hybridxc.F90 @@ -5791,15 +6017,209 @@ contains end do end do loopForceAtom

REMOVE: if (this%tREKS) then gradients(:,:) = gradients + tmpGradients else gradients(:,:) = gradients + 0.5_dp * nSpin * tmpGradients

ADD

if (.not.this%tREKS) then
  tmpGradients(:,:) = 0.5_dp * nSpin * tmpGradients
 end if

src/dftbp/reks/reksinterface.F90 @@ -942,7 +942,7 @@ module dftbp_reks_reksinterface uncomments block and : #:else call hybridXc%addCamGradients_real(env, this%deltaRhoSqrL(:,:,:,iL), this%overSqr,& & skOverCont, orb, denseDesc%iAtomStart, neighbourList%iNeighbour, nNeighbourSK,&

REMOVE & nonSccDeriv, .false., lcDerivs(:,:,iL), symNeighbourList=symNeighbourList,& ADD & nonSccDeriv, 1.0_dp, .false., lcDerivs(:,:,iL), symNeighbourList=symNeighbourList,&

         & nNeighbourCamSym=nNeighbourCamSym)
     @:PROPAGATE_ERROR(errStatus)

Which is a little hacky as it has to pass a dummy cell volume in, event though non-periodic.

@bhourahine Applied in dftbplus#1643.

@bhourahine
Copy link
Author

Still some failing MPI tests (compile and run), so shall I just force push to your branch once they are fixed, or are you changing things as well?

@vanderhe
Copy link
Owner

Still some failing MPI tests (compile and run), so shall I just force push to your branch once they are fixed, or are you changing things as well?

I'm going to lunch now, so feel free to force push 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants