Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasSachs committed Jan 13, 2023
1 parent a8c3ea2 commit 7ed5f0c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
3 changes: 0 additions & 3 deletions src/ACEbonds.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
module ACEbonds

import ACE
#import ACE: B1pMultiplier, AbstractState

include("temp_ACE_patch.jl") # MS: code in this file will be included in the next ACE update

include("envelopes.jl") # MS: I believe code in this file is depreciated?

Expand Down
11 changes: 0 additions & 11 deletions src/bondpot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ function energy(calc::ACEBondPotential, at::Atoms)
# find the right ace model
ace = _get_model(calc, at.Z[i], at.Z[j])
# transform the euclidean to cylindrical coordinates
#env = eucl2cyl(rrij, at.Z[i], at.Z[j], Rs, Zs)
env = env_transform(rrij, at.Z[i], at.Z[j], Rs, Zs, calc.cutoff)
# evaluate
Eij = evaluate(ace, env)
Expand All @@ -106,14 +105,11 @@ function forces(calc::ACEBondPotential, at::Atoms)
# find the right ace model
ace = _get_model(calc, Zi, Zj)
# transform the euclidean to cylindrical coordinates
#env = eucl2cyl(rrij, Zi, Zj, Rs, Zs)
env = env_transform(rrij, Zi, Zj, Rs, Zs, calc.cutoff)
# evaluate
dV_cyl = grad_config(ace, env)
#@show dV_cyl
# transform back?
dV_drrij, dV_dRs = rrule_env_transform(rrij::SVector, Zi, Zj, Rs, Zs, dV_cyl, calc.cutoff)
#rrule_eucl2cyl(rrij::SVector, Zi, Zj, Rs, Zs, dV_cyl)
# assemble the forces
F[i] += dV_drrij
F[j] -= dV_drrij
Expand All @@ -139,12 +135,10 @@ function virial(calc::ACEBondPotential, at::Atoms{T}) where {T}
# find the right ace model for this bond
ace = _get_model(calc, Zi, Zj)
# transform the euclidean to cylindrical coordinates
#env = eucl2cyl(rrij, Zi, Zj, Rs, Zs)
env = env_transform(rrij, Zi, Zj, Rs, Zs, calc.cutoff)
# evaluate
dV_cyl = grad_config(ace, env)
# transform back?
#dV_drrij, dV_dRs = rrule_eucl2cyl(rrij::SVector, Zi, Zj, Rs, Zs, dV_cyl)
dV_drrij, dV_dRs = rrule_env_transform(rrij::SVector, Zi, Zj, Rs, Zs, dV_cyl, calc.cutoff)
# assemble the virial
# dV_dRs contain derivative relative to midpoint
Expand All @@ -166,7 +160,6 @@ function energy(basis::ACEBondPotentialBasis, at::Atoms)
# find the right ace model
ace = _get_model(basis, at.Z[i], at.Z[j])
# transform the euclidean to cylindrical coordinates
#env = eucl2cyl(rrij, at.Z[i], at.Z[j], Rs, Zs)
env = env_transform(rrij, at.Z[i], at.Z[j], Rs, Zs, basis.cutoff)
# evaluate
ACE.evaluate!(Et, ace, ACE.ACEConfig(env))
Expand All @@ -183,12 +176,10 @@ function forces(basis::ACEBondPotentialBasis, at::Atoms)
# find the right ace model
ace = _get_model(basis, Zi, Zj)
# transform the euclidean to cylindrical coordinates
# env = eucl2cyl(rrij, Zi, Zj, Rs, Zs)
env = env_transform(rrij, Zi, Zj, Rs, Zs, basis.cutoff)
# evaluate
dB_cyl = evaluate_d(ace, env)
# transform back?
# dB_drrij, dB_dRs = rrule_eucl2cyl(rrij::SVector, Zi, Zj, Rs, Zs, dB_cyl)
dB_drrij, dB_dRs = rrule_env_transform(rrij, Zi, Zj, Rs, Zs, dB_cyl, basis.cutoff)
# assemble the forces
F[:, i] += dB_drrij
Expand All @@ -211,12 +202,10 @@ function virial(basis::ACEBondPotentialBasis, at::Atoms{T}) where {T}
# find the right ace model
ace = _get_model(basis, Zi, Zj)
# transform the euclidean to cylindrical coordinates
#env = eucl2cyl(rrij, Zi, Zj, Rs, Zs)
env = env_transform(rrij, Zi, Zj, Rs, Zs, basis.cutoff)
# evaluate
dB_cyl = evaluate_d(ace, env)
# transform back?
#dB_drrij, dB_dRs = rrule_eucl2cyl(rrij::SVector, Zi, Zj, Rs, Zs, dB_cyl)
dB_drrij, dB_dRs = rrule_env_transform(rrij, Zi, Zj, Rs, Zs, dB_cyl, basis.cutoff)
# assemble the virials
for iB = 1:length(basis)
Expand Down
22 changes: 0 additions & 22 deletions src/temp_ACE_patch.jl

This file was deleted.

0 comments on commit 7ed5f0c

Please sign in to comment.