File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ and a harmonic bond between the outer atoms.
10
10
The second atom is the middle atom.
11
11
The potential energy is defined as
12
12
```math
13
- V(\t heta, r) = \f rac{1}{2} kangle (\t heta - \t heta_0)^2 + \f rac{1}{2} kbond (r - r_0)^2
13
+ V(\t heta, r) = \f rac{1}{2} k_a (\t heta - \t heta_0)^2 + \f rac{1}{2} k_b (r - r_0)^2
14
14
```
15
15
"""
16
16
@kwdef struct UreyBradley{KA, A, KB, D}
Original file line number Diff line number Diff line change @@ -1261,26 +1261,27 @@ function System(sys::AtomsBase.AbstractSystem{D};
1261
1261
1262
1262
# AtomsBase does not specify a type for coordinates or velocities so we convert to SVector
1263
1263
if ! (:position in AtomsBase. atomkeys (sys))
1264
- throw (ArgumentError (" Failed to construct Molly System form AbstractSystem. Missing position key." ))
1264
+ throw (ArgumentError (" failed to construct Molly System from AbstractSystem, " *
1265
+ " missing position key" ))
1265
1266
end
1266
-
1267
1267
coords = map (AtomsBase. position (sys, :)) do r
1268
1268
SVector (r... )
1269
1269
end
1270
1270
1271
- vels = nothing
1272
1271
if :velocity in AtomsBase. atomkeys (sys)
1273
1272
vels = map (AtomsBase. velocity (sys, :)) do v
1274
1273
SVector (v... )
1275
1274
end
1275
+ else
1276
+ vels = nothing
1276
1277
end
1277
1278
1278
1279
mass_dim = dimension (AtomsBase. mass (sys, 1 ))
1279
1280
if mass_dim == u " π" && dimension (energy_units) == u " π^2 * π * π^-1 * π^-2"
1280
- throw (ArgumentError (" When constructing System from AbstractSystem, energy units " *
1281
+ throw (ArgumentError (" when constructing System from AbstractSystem, energy units " *
1281
1282
" are molar but mass units are not" ))
1282
1283
elseif mass_dim == u " π * π^-1" && dimension (energy_units) == u " π^2 * π * π^-2"
1283
- throw (ArgumentError (" When constructing System from AbstractSystem, mass units " *
1284
+ throw (ArgumentError (" when constructing System from AbstractSystem, mass units " *
1284
1285
" are molar but energy units are not" ))
1285
1286
end
1286
1287
You canβt perform that action at this time.
0 commit comments