def test_forcefield_get_parameters_angle_type(self, opls_ethane_foyer): params = opls_ethane_foyer.get_parameters( "angle_type", key=["opls_140", "opls_135", "opls_140"]) assert allclose_units_mixed( params.values(), [276.144 * u.kJ / u.radian**2, 1.8814649337 * u.radian])
def test_forcefield_get_parameters_atom_type_copy(self, opls_ethane_foyer): params = opls_ethane_foyer.get_parameters("atom_type", key=["opls_140"], copy=False) params_copy = opls_ethane_foyer.get_parameters("atom_type", key=["opls_140"], copy=True) assert allclose_units_mixed(params.values(), params_copy.values())
def test_forcefield_get_parameters_dihedral_type(self, opls_ethane_foyer): params = opls_ethane_foyer.get_parameters( "dihedral_type", key=["opls_140", "opls_135", "opls_135", "opls_140"]) assert allclose_units_mixed(params.values(), [0.6276, 1.8828, 0.0, -2.5104, 0.0, 0.0] * u.kJ / u.mol)
def test_forcefield_get_potential_bond_type(self, opls_ethane_foyer): bt = opls_ethane_foyer.get_potential("bond_type", key=["opls_135", "opls_140"]) assert bt.name == "BondType-Harmonic-2" params = bt.parameters assert "k" in params assert "r_eq" in params assert sympify("r") in bt.independent_variables assert allclose_units_mixed(params.values(), [284512.0 * u.kJ / u.nm**2, 0.109 * u.nm])
def test_forcefield_get_parameters_atom_type(self, opls_ethane_foyer): params = opls_ethane_foyer.get_parameters("atom_type", key=["opls_140"]) assert allclose_units_mixed( params.values(), [ 0.12552 * u.kJ / u.mol, 0.25 * u.nm, 8.8542e-12 * u.Unit("A**2*s**4/(kg*m**3)"), 0.06 * u.C, ], )
def test_forcefield_get_potential_angle_type(self, opls_ethane_foyer): at = opls_ethane_foyer.get_potential( "angle_type", key=["opls_135", "opls_135", "opls_140"]) assert at.name == "AngleType-Harmonic-1" params = at.parameters assert "k" in params assert "theta_eq" in params assert sympify("theta") in at.independent_variables assert allclose_units_mixed( params.values(), [313.8 * u.kJ / u.radian**2, 1.932079482 * u.radian])
def test_forcefield_get_potential_dihedral_type(self, opls_ethane_foyer): dt = opls_ethane_foyer.get_potential( "dihedral_type", key=["opls_140", "opls_135", "opls_135", "opls_140"]) assert dt.name == "DihedralType-RB-Proper-1" params = dt.parameters assert "c0" in params assert "c1" in params assert "c2" in params assert "c3" in params assert "c4" in params assert "c5" in params assert sympify("phi") in dt.independent_variables assert allclose_units_mixed(params.values(), [0.6276, 1.8828, 0.0, -2.5104, 0.0, 0.0] * u.kJ / u.mol)
def test_forcefeld_get_potential_atom_type(self, opls_ethane_foyer): at = opls_ethane_foyer.get_potential("atom_type", key=["opls_135"]) assert at.expression == sympify( "ep * ((sigma/r)**12 - (sigma/r)**6) + q / (e0 * r)") params = at.parameters assert "ep" in params assert "sigma" in params assert "e0" in params assert sympify("r") in at.independent_variables assert allclose_units_mixed( params.values(), [ 0.276144 * u.kJ / u.mol, 0.35 * u.nm, 8.8542e-12 * u.Unit("A**2*s**4/(kg*m**3)"), -0.18 * u.C, ], )
def test_forcefield_get_parameters_bond_type(self, opls_ethane_foyer): params = opls_ethane_foyer.get_parameters("bond_type", key=["opls_135", "opls_135"]) assert allclose_units_mixed(params.values(), [224262.4 * u.kJ / u.nm**2, 0.1529 * u.nm])