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

writing updated coord AND xtbopt.xyz during external driver optimization (including nicer printout) #828

Merged
merged 11 commits into from
Aug 18, 2023

Conversation

marcelmbn
Copy link
Member

  • write xtbopt.xyz constantly in the external driver mode so that not only "coord"-based external methods can be used for geometry optimization.
  • nicer formatting

src/extern/driver.f90 Outdated Show resolved Hide resolved
…r for each step depending on the original filetype
src/extern/driver.f90 Show resolved Hide resolved
Update to latest development.
…ecessarily has to be negative (-> exactly zero should also be okay)
@marcelmbn
Copy link
Member Author

Additional comment regarding the commit 7468cc9:
Before, the convergence threshold in the optimizer src/optimizer.f90 expected the energy change to be strictly negative and in the absolute value below the threshold to prevent small upward energy jumps from being acceptable. However, when using xtb as a driver and starting with a zero gradient, the energy doesn't change at all (-> 0.0_wp), meaning that it is also not strictly negative. Since the gradient is zero, this won't change during the procedure; thus, this would be a dead end.

MtoLStoN
MtoLStoN previously approved these changes Aug 17, 2023
@marcelmbn marcelmbn requested a review from awvwgk August 17, 2023 09:35
src/extern/driver.f90 Outdated Show resolved Hide resolved
Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
Comment on lines 134 to 135
write(env%unit,'(/,a,1x,a,/)') &
"updated geometry written to:",tmpname
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This output should be guarded by printlevel > 0

end if
if (.not. cache) then
call wrtm(mol%n, mol%at, mol%xyz)
call generateFileName(tmpname, 'xtbopt', extension, mol%ftype)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use xtbopt for the final optimized structure, but this routine can be called from a single point or hessian calculation. Better use a more neutral filename here.

@marcelmbn marcelmbn requested a review from awvwgk August 18, 2023 12:55
energy = 0.0_wp
gradient(:, :) = 0.0_wp
sigma(:, :) = 0.0_wp
hlgap = 0.0_wp
efix = 0.0_wp
dipole(:) = 0.0_wp

write(*,*) printlevel

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably a debug line, that should be removed.

Comment on lines 128 to 129
if (cache) then
if (printlevel > 0) &
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be a single if statement instead of a nested one.

Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now

@marcelmbn marcelmbn merged commit 8386f77 into grimme-lab:main Aug 18, 2023
11 checks passed
gorges97 pushed a commit to gorges97/xtb that referenced this pull request Mar 27, 2024
…ion (including nicer printout) (grimme-lab#828)

* writing updated coord AND xtbopt.xyz during external driver optimization

* resolved formatting error

* removed deprecated 'wrtm' call and included a general structure writer for each step depending on the original filetype

* more detailed printout and default setting of cache variable

* Modified convergence condition such that the energy change does not necessarily has to be negative (-> exactly zero should also be okay)

* Update src/extern/driver.f90

Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>

* more neutral structure file name and guarded printout

* Removed debug printout and merged nested if loops

---------

Co-authored-by: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com>
Signed-off-by: Johannes Gorges <58849467+gorges97@users.noreply.github.com>
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.

None yet

3 participants