Skip to content

Commit

Permalink
Update finite differences to work with new Molecules format
Browse files Browse the repository at this point in the history
  • Loading branch information
hfmull committed Jul 2, 2022
1 parent b99886e commit ab248fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Molecules = "0.1, 0.2"
Molecules = "0.1, 0.3"
GaussianBasis = "^0.3"
Formatting = "^0.4.1"
PrettyTables = "1"
Expand Down
5 changes: 4 additions & 1 deletion src/Tools/FiniteDifferences.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
function create_displacement(mol, A::Int, i::Int, h)

disp = zeros(3)
disp[i] += h
new_mol = deepcopy(mol)
new_mol.atoms[A].xyz[i] += h
a = mol.atoms[A]
new_mol.atoms[A] = Atom(a.Z, a.mass, a.xyz + disp)

return new_mol
end
Expand Down

0 comments on commit ab248fd

Please sign in to comment.