Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Oct 8, 2024
1 parent 1083d4f commit 0e295f4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/rigid_body/chain_rule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function chain_rule!(fg, packmol_system::PackmolSystem{D,T}) where {D,T}
gmol = partial_derivatives(
fg.g[imol],
packmol_system.molecule_positon[imol].angles,
structure_type.reference_coordinates,
structure_type.reference_coordinates,
@view(fg.gxcar[ifmol:ilmol]),
)
fg.g[imol] = gmol
Expand All @@ -37,9 +37,12 @@ minimum distance between atoms relative to the rotations and translations of the
molecule, given the gradient of the minimum distance between atoms relative to the
displacement of the atoms in cartesian coordinates.
This function does not mutate any argument. It returns the gradient for the
molecule as a MoleculePosition data structure, to be used in the chain_rule! function.
=#
function partial_derivatives(
gmol::MoleculePosition{D,T},
gmol::MoleculePosition{D,T},
angles::SVector{D,T},
reference_coordinates::Vector{SVector{D,T}},
gxcar::SVector{D,T},
Expand Down

0 comments on commit 0e295f4

Please sign in to comment.