Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Oct 8, 2024
1 parent 193859f commit 1083d4f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 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 @@ -39,15 +39,15 @@ displacement of the atoms in cartesian coordinates.
=#
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},
) where {D,T}
gcm = gmol.cm
grot = gmol.angles
(sb, cb), (sg, cg), (st, ct) = sincos.(angles)
#!format off
#!format: off
∂v∂β = sum(SMatrix[
-cb*sg*ct-sb*cg -cb*cg*ct+sb*sg cb*st
-sb*sg*ct+cb*cg -sb*cg*ct-cb*sg sb*st
Expand All @@ -64,7 +64,7 @@ function partial_derivatives(
sg*ct cg*ct -st
]; dims=1)
∂rot = vcat(∂v∂β, ∂v∂γ, ∂v∂θ)
#!format on
#!format: on
for i in eachindex(reference_coordinates, gxcar)
x = reference_coordinates[i]
gx = gxcar[i]
Expand Down

0 comments on commit 1083d4f

Please sign in to comment.