Skip to content

Commit

Permalink
Merge branch 'main' into sort-bonds
Browse files Browse the repository at this point in the history
  • Loading branch information
daico007 authored Sep 22, 2023
2 parents a0fd1f8 + 7537899 commit 5192013
Show file tree
Hide file tree
Showing 11 changed files with 834 additions and 234 deletions.
366 changes: 222 additions & 144 deletions gmso/formats/mcf.py

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions gmso/lib/jsons/FixedAnglePotential.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "FixedAnglePotential",
"expression": "DiracDelta(theta-theta_eq)",
"independent_variables": "theta",
"expected_parameters_dimensions": {
"theta_eq": "angle"
}
}
8 changes: 8 additions & 0 deletions gmso/lib/jsons/FixedBondPotential.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "FixedBondPotential",
"expression": "DiracDelta(r-r_eq)",
"independent_variables": "r",
"expected_parameters_dimensions": {
"r_eq": "length"
}
}
8 changes: 8 additions & 0 deletions gmso/tests/base_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,14 @@ def typed_water_system(self, water_system):
top = apply(top, ff)
return top

@pytest.fixture
def typed_tip3p_rigid_system(self, water_system):
top = water_system
top.identify_connections()
ff = ForceField(get_path("tip3p-rigid.xml"))
top = apply(top, ff)
return top

@pytest.fixture
def foyer_fullerene(self):
from foyer.tests.utils import get_fn
Expand Down
23 changes: 23 additions & 0 deletions gmso/tests/files/ethane-rigid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version='1.0' encoding='UTF-8'?>
<ForceField name="nitrogen" version="0.0.1">
<FFMetaData electrostatics14Scale="0.0" nonBonded14Scale="0.0" combiningRule="lorentz">
<Units energy="kJ/mol" mass="amu" charge="elementary_charge" distance="nm"/>
</FFMetaData>
<AtomTypes expression="4*epsilon * ((sigma/r)**12 - (sigma/r)**6)">
<ParametersUnitDef parameter="epsilon" unit="kJ/mol"/>
<ParametersUnitDef parameter="sigma" unit="nm"/>
<AtomType name="_CH3" atomclass="_CH3" element="_CH3" charge="0.0" mass="15.0" definition="[_CH3;X1]" description="UA carbon"> <Parameters>
<Parameter name="epsilon" value="0.814772"/>
<Parameter name="sigma" value="0.375"/>
</Parameters>
</AtomType>
</AtomTypes>
<BondTypes expression="DiracDelta(r-r_eq)">
<ParametersUnitDef parameter="r_eq" unit="nm"/>
<BondType name="BondType-Harmonic-1" type1="_CH3" type2="_CH3">
<Parameters>
<Parameter name="r_eq" value="0.154"/>
</Parameters>
</BondType>
</BondTypes>
</ForceField>
26 changes: 13 additions & 13 deletions gmso/tests/files/ethylene.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@
</Parameters>
</AngleType>
</AngleTypes>
<DihedralTypes expression="c_0 + c_1 * cos(psi) + c_2 * cos(psi)**2 + c_3 * cos(psi)**3 + c_4 * cos(psi)**4 + c_5 * cos(psi)**5">
<ParametersUnitDef parameter="c_0" unit="kJ/mol"/>
<ParametersUnitDef parameter="c_1" unit="kJ/mol"/>
<ParametersUnitDef parameter="c_2" unit="kJ/mol"/>
<ParametersUnitDef parameter="c_3" unit="kJ/mol"/>
<ParametersUnitDef parameter="c_4" unit="kJ/mol"/>
<ParametersUnitDef parameter="c_5" unit="kJ/mol"/>
<DihedralTypes expression="c0 + c1 * cos(phi) + c2 * cos(phi)**2 + c3 * cos(phi)**3 + c4 * cos(phi)**4 + c5 * cos(phi)**5">
<ParametersUnitDef parameter="c0" unit="kJ/mol"/>
<ParametersUnitDef parameter="c1" unit="kJ/mol"/>
<ParametersUnitDef parameter="c2" unit="kJ/mol"/>
<ParametersUnitDef parameter="c3" unit="kJ/mol"/>
<ParametersUnitDef parameter="c4" unit="kJ/mol"/>
<ParametersUnitDef parameter="c5" unit="kJ/mol"/>
<DihedralType name="DihedralType-RyckaertBellemans-1" type1="opls_144" type2="opls_143" type3="opls_143" type4="opls_144">
<Parameters>
<Parameter name="c_0" value="58.576"/>
<Parameter name="c_1" value="0.0"/>
<Parameter name="c_2" value="-58.576"/>
<Parameter name="c_3" value="0.0"/>
<Parameter name="c_4" value="0.0"/>
<Parameter name="c_5" value="0.0"/>
<Parameter name="c0" value="58.576"/>
<Parameter name="c1" value="0.0"/>
<Parameter name="c2" value="-58.576"/>
<Parameter name="c3" value="0.0"/>
<Parameter name="c4" value="0.0"/>
<Parameter name="c5" value="0.0"/>
</Parameters>
</DihedralType>
</DihedralTypes>
Expand Down
38 changes: 38 additions & 0 deletions gmso/tests/files/tip3p-rigid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version='1.0' encoding='UTF-8'?>
<ForceField name="TIP3P" version="0.0.1">
<FFMetaData electrostatics14Scale="0.5" nonBonded14Scale="0.5" combiningRule="lorentz">
<Units energy="kJ/mol" mass="amu" charge="elementary_charge" distance="nm"/>
</FFMetaData>
<AtomTypes expression="4*epsilon * ((sigma/r)**12 - (sigma/r)**6)">
<ParametersUnitDef parameter="epsilon" unit="kJ/mol"/>
<ParametersUnitDef parameter="sigma" unit="nm"/>
<AtomType name="opls_111" atomclass="OW" element="O" charge="-0.834" mass="16" definition="[O;X2]" description="water O">
<Parameters>
<Parameter name="epsilon" value="0.636386"/>
<Parameter name="sigma" value="0.315061"/>
</Parameters>
</AtomType>
<AtomType name="opls_112" atomclass="HW" element="H" charge="0.417" mass="1.011" definition="[H;X1]" description="water H">
<Parameters>
<Parameter name="epsilon" value="0.0"/>
<Parameter name="sigma" value="1.0"/>
</Parameters>
</AtomType>
</AtomTypes>
<BondTypes expression="DiracDelta(r-r_eq)">
<ParametersUnitDef parameter="r_eq" unit="nm"/>
<BondType name="BondType-Harmonic-1" type1="opls_111" type2="opls_112">
<Parameters>
<Parameter name="r_eq" value="0.09572"/>
</Parameters>
</BondType>
</BondTypes>
<AngleTypes expression="DiracDelta(theta-theta_eq)">
<ParametersUnitDef parameter="theta_eq" unit="radian"/>
<AngleType name="AngleType-Harmonic-1" type1="opls_112" type2="opls_111" type3="opls_112">
<Parameters>
<Parameter name="theta_eq" value="1.824218134"/>
</Parameters>
</AngleType>
</AngleTypes>
</ForceField>
Loading

0 comments on commit 5192013

Please sign in to comment.