From 0e295f44451c485ac7802ce6d70a4d5b27cabd55 Mon Sep 17 00:00:00 2001 From: Leandro Martinez Date: Tue, 8 Oct 2024 15:43:37 -0300 Subject: [PATCH] add some comments --- src/rigid_body/chain_rule.jl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/rigid_body/chain_rule.jl b/src/rigid_body/chain_rule.jl index 2ba37b5..af5f373 100644 --- a/src/rigid_body/chain_rule.jl +++ b/src/rigid_body/chain_rule.jl @@ -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 @@ -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},