Skip to content

Commit

Permalink
fix type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Oct 8, 2024
1 parent c338969 commit d68cfd5
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/interatomic_distance_fg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ mutable struct InteratomicDistanceFG{D,T}
end

# Custom copy, reset and reducer functions
import CellListMap: copy_output, reset_output!, reducer
function copy_output(x::InteratomicDistanceFG)
function CellListMap.copy_output(x::InteratomicDistanceFG)
InteratomicDistanceFG(
x.f,
copy(x.g),
Expand All @@ -24,15 +23,15 @@ function copy_output(x::InteratomicDistanceFG)
copy(x.gxcar),
)
end
function reset_output!(output::InteratomicDistanceFG{D,T}) where {D,T}
function CellListMap.reset_output!(output::InteratomicDistanceFG{D,T}) where {D,T}
output.f = zero(T)
fill!(output.g, zero(MoleculePositions{D,T}))
output.dmin = typemax(T)
fill!(output.fmol, zero(T))
fill!(output.gxcar, zero(SVector{D,T}))
return output
end
function reducer(x::InteratomicDistanceFG, y::InteratomicDistanceFG)
function CellListMap.reducer(x::InteratomicDistanceFG, y::InteratomicDistanceFG)
x.f += y.f
x.g += y.g
x.dmin = max(x.dmin, y.dmin)
Expand Down Expand Up @@ -71,7 +70,7 @@ end
# Function that computes the function and gradient, and returns the function
# value and mutates the gradient array, to conform with the interface of SPGBox
# This function mutates the system.fg field.
function fg!(system::PeriodicSystem, packmol_system::PackmolSystem)
function fg!(system::CellListMap.ParticleSystem1, packmol_system::PackmolSystem)
# Compute the function value and component of the gradient relative to the cartesian
# coordinates for each atom
map_pairwise!(
Expand Down

0 comments on commit d68cfd5

Please sign in to comment.