Skip to content

Commit b02ed4b

Browse files
committed
Catch edge cases. [ci skip]
1 parent f002ba8 commit b02ed4b

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

wrapper/Convert/SireOpenMM/openmmmolecule.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,6 +1399,18 @@ void OpenMMMolecule::constructFromAmber(const Molecule &mol,
13991399
}
14001400
}
14011401
}
1402+
1403+
if (virtual_sites.size() != vsite_idxs.count())
1404+
{
1405+
throw SireError::incompatible_error(
1406+
QObject::tr("Molecule %1: detected %2 virtual site atom(s) but only "
1407+
"registered %3. Check atom geometry (degenerate coordinates?) "
1408+
"or atom naming conventions.")
1409+
.arg(number.toString())
1410+
.arg(vsite_idxs.count())
1411+
.arg(virtual_sites.size()),
1412+
CODELOC);
1413+
}
14021414
}
14031415

14041416
this->buildExceptions(mol, constrained_pairs, map);

0 commit comments

Comments
 (0)