Skip to content

Commit 7b1f972

Browse files
committed
Urey-Bradley docstring
1 parent 95bcff6 commit 7b1f972

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

β€Žsrc/interactions/urey_bradley.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and a harmonic bond between the outer atoms.
1010
The second atom is the middle atom.
1111
The potential energy is defined as
1212
```math
13-
V(\theta, r) = \frac{1}{2} kangle (\theta - \theta_0)^2 + \frac{1}{2} kbond (r - r_0)^2
13+
V(\theta, r) = \frac{1}{2} k_a (\theta - \theta_0)^2 + \frac{1}{2} k_b (r - r_0)^2
1414
```
1515
"""
1616
@kwdef struct UreyBradley{KA, A, KB, D}

β€Žsrc/types.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,26 +1261,27 @@ function System(sys::AtomsBase.AbstractSystem{D};
12611261

12621262
# AtomsBase does not specify a type for coordinates or velocities so we convert to SVector
12631263
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"))
12651266
end
1266-
12671267
coords = map(AtomsBase.position(sys, :)) do r
12681268
SVector(r...)
12691269
end
12701270

1271-
vels = nothing
12721271
if :velocity in AtomsBase.atomkeys(sys)
12731272
vels = map(AtomsBase.velocity(sys, :)) do v
12741273
SVector(v...)
12751274
end
1275+
else
1276+
vels = nothing
12761277
end
12771278

12781279
mass_dim = dimension(AtomsBase.mass(sys, 1))
12791280
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 " *
12811282
"are molar but mass units are not"))
12821283
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 " *
12841285
"are molar but energy units are not"))
12851286
end
12861287

0 commit comments

Comments
Β (0)