Skip to content

Commit

Permalink
Fix!
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Oct 16, 2024
1 parent 3a1be80 commit ecc7288
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions interfaces/DFTB/r.dftb
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,19 @@ function extract_energy_and_gradients() {
# 1 0.009551273894 0.004605933524 0.000709843407
# 2 0.010527153681 0.006652360906 0.002907870190
# ```
awk -v natom="$natom" '
awk -v natom="$natom" -v out="$engrad_file" '
$1 == "Total" && $2 == "Forces" {
for (i = 0; i < natom; i++) {
getline;
for (i = 1; i <= natom; i++) {
getline
if ($1 != i || NF != 4) {
print "ERROR: Unexpected line in the DFTB+ output file"
print $0
exit 2
}
printf("%3.15e %3.15e %3.15e\n", -$2, -$3, -$4)
printf("%3.15e %3.15e %3.15e\n", -$2, -$3, -$4) >> out
}
}
' "$dftb_out" >> "$engrad_file"
' "$dftb_out"
}

##### LET'S GO! #####
Expand Down

0 comments on commit ecc7288

Please sign in to comment.