diff --git a/src/somd2/runner/_somd1.py b/src/somd2/runner/_somd1.py index 0eae23c..b3f0755 100644 --- a/src/somd2/runner/_somd1.py +++ b/src/somd2/runner/_somd1.py @@ -70,8 +70,8 @@ def _make_compatible(system): # First fix zero LJ sigmas values. ################################## - # Create a null LJParameter. - null_lj = _SireMM.LJParameter() + # Tolerance for zero sigma values. + null_lj_sigma = 1e-9 for atom in mol.atoms(): # Get the end state LJ sigma values. @@ -79,7 +79,7 @@ def _make_compatible(system): lj1 = atom.property("LJ1") # Lambda = 0 state has a zero sigma value. - if lj0.sigma() == null_lj.sigma(): + if abs(lj0.sigma().value()) <= null_lj_sigma: # Use the sigma value from the lambda = 1 state. edit_mol = ( edit_mol.atom(atom.index()) @@ -90,7 +90,7 @@ def _make_compatible(system): ) # Lambda = 1 state has a zero sigma value. - if lj1.sigma() == null_lj.sigma(): + if abs(lj1.sigma().value()) <= null_lj_sigma: # Use the sigma value from the lambda = 0 state. edit_mol = ( edit_mol.atom(atom.index())