Skip to content

Commit

Permalink
fix code order, add spce xml
Browse files Browse the repository at this point in the history
  • Loading branch information
daico007 committed Nov 14, 2023
1 parent 2c17ff9 commit e8dd5e6
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gmso/formats/gro.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ def _validate_positions(pos_array):
"Topology contains some negative positions. Translating "
"in order to ensure all coordinates are non-negative."
)
unit = min_xyz.units
min_xyz = np.min(pos_array, axis=0)
unit = min_xyz.units
min_xyz0 = np.where(min_xyz < 0 * unit, min_xyz, 0 * u.unit)

pos_array -= min_xyz0
Expand Down
22 changes: 22 additions & 0 deletions gmso/utils/files/spce.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<ForceField version="0.0.1" name="SPC/E Water" combining_rule="geometric">
<AtomTypes>
<Type name="opls_116" class="OW" element="O" mass="15.99940" def="[O;X2](H)(H)" desc="SPC/E Oxygen" doi="10.1021/j100308a038"/>
<!-- Need to validate the Hydrogen SMARTS string below -->
<Type name="opls_117" class="HW" element="H" mass="1.00800" def="[H;X1][O;X2](H)" desc="SPC/E Hydrogen" doi="10.1021/j100308a038"/>
</AtomTypes>
<HarmonicBondForce>
<!-- https://github.com/gromacs/gromacs/blob/master/share/top/oplsaa.ff/spce.itp -->
<Bond class1="OW" class2="HW" length="0.100" k="345000.0"/>
</HarmonicBondForce>
<HarmonicAngleForce>
<!-- https://github.com/gromacs/gromacs/blob/master/share/top/oplsaa.ff/spce.itp -->
<!-- numpy.deg2rad(109.47).round(8) -->
<!-- numpy.__version__ 1.21.1 -->
<Angle class1="HW" class2="OW" class3="HW" angle="1.91061193" k="383.0"/>
</HarmonicAngleForce>
<NonbondedForce coulomb14scale="0.5" lj14scale="0.5">
<!-- https://github.com/gromacs/gromacs/blob/master/share/top/oplsaa.ff/spce.itp -->
<Atom type="opls_116" charge="-0.8476" sigma="0.316557" epsilon="0.650194"/>
<Atom type="opls_117" charge="0.4238" sigma="0.0" epsilon="0.0"/>
</NonbondedForce>
</ForceField>

0 comments on commit e8dd5e6

Please sign in to comment.