diff --git a/loop/src/mm_system_creator.cc b/loop/src/mm_system_creator.cc index d5ec8d66e0b46687b7887dc074d2b85d228fc37b..4a745c2c43e83c5ac2ad327ee98d778f661b30cf 100644 --- a/loop/src/mm_system_creator.cc +++ b/loop/src/mm_system_creator.cc @@ -58,7 +58,7 @@ void AddConnectivity_(ost::mol::mm::TopologyPtr top, uint start_idx, const uint idx2 = GetIndex_<non_contiguous>(info.index_two, start_idx, start_idx2, split_idx); const bool fixed_all = atom_masses[idx1] == 0 && atom_masses[idx2] == 0; - if (!fixed_all) { + if (!fixed_all && info.force_constant != 0.0) { top->AddHarmonicBond(idx1, idx2, info.bond_length, info.force_constant); } if (!fixed_all || !inaccurate_pot_energy) { @@ -76,7 +76,7 @@ void AddConnectivity_(ost::mol::mm::TopologyPtr top, uint start_idx, start_idx2, split_idx); const bool fixed_13 = atom_masses[idx1] == 0 && atom_masses[idx3] == 0; const bool fixed_all = fixed_13 && atom_masses[idx2] == 0; - if (!fixed_all) { + if (!fixed_all && info.force_constant != 0.0) { top->AddHarmonicAngle(idx1, idx2, idx3, info.angle, info.force_constant); } if (!fixed_13 || !inaccurate_pot_energy) { @@ -95,7 +95,8 @@ void AddConnectivity_(ost::mol::mm::TopologyPtr top, uint start_idx, start_idx2, split_idx); const bool fixed_13 = atom_masses[idx1] == 0 && atom_masses[idx3] == 0; const bool fixed_all = fixed_13 && atom_masses[idx2] == 0; - if (!fixed_all) { + if (!fixed_all && (info.angle_force_constant != 0.0 || + info.bond_force_constant != 0.0)) { top->AddUreyBradleyAngle(idx1, idx2, idx3, info.angle, info.angle_force_constant, info.bond_length, info.bond_force_constant); @@ -118,7 +119,7 @@ void AddConnectivity_(ost::mol::mm::TopologyPtr top, uint start_idx, start_idx2, split_idx); const bool fixed_all = atom_masses[idx1] == 0 && atom_masses[idx2] == 0 && atom_masses[idx3] == 0 && atom_masses[idx4] == 0; - if (!fixed_all) { + if (!fixed_all && info.force_constant != 0.0) { top->AddPeriodicDihedral(idx1, idx2, idx3, idx4, info.multiplicity, info.phase, info.force_constant); } @@ -137,7 +138,7 @@ void AddConnectivity_(ost::mol::mm::TopologyPtr top, uint start_idx, start_idx2, split_idx); const bool fixed_all = atom_masses[idx1] == 0 && atom_masses[idx2] == 0 && atom_masses[idx3] == 0 && atom_masses[idx4] == 0; - if (!fixed_all) { + if (!fixed_all && info.force_constant != 0.0) { top->AddPeriodicImproper(idx1, idx2, idx3, idx4, info.multiplicity, info.phase, info.force_constant); } @@ -156,7 +157,7 @@ void AddConnectivity_(ost::mol::mm::TopologyPtr top, uint start_idx, start_idx2, split_idx); const bool fixed_all = atom_masses[idx1] == 0 && atom_masses[idx2] == 0 && atom_masses[idx3] == 0 && atom_masses[idx4] == 0; - if (!fixed_all) { + if (!fixed_all && info.force_constant != 0.0) { top->AddHarmonicImproper(idx1, idx2, idx3, idx4, info.angle, info.force_constant); }