File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -5373,6 +5373,13 @@ void Molecule::BuildConnectivityTable()const
5373
5373
VFN_DEBUG_ENTRY (" Molecule::BuildConnectivityTable()" ,5 )
5374
5374
TAU_PROFILE (" Molecule::BuildConnectivityTable()" ," void ()" ,TAU_DEFAULT);
5375
5375
mConnectivityTable .clear ();
5376
+
5377
+ // First create an entry for all atoms in the table - avoids empty pointers
5378
+ // in the (pathological) case where some (or all) atoms are not connected
5379
+ for (unsigned long i = 0 ; i < mvpAtom.size (); ++i)
5380
+ mConnectivityTable [mvpAtom[i]];
5381
+
5382
+ // Then build the table from existing bonds
5376
5383
for (unsigned long i=0 ;i<mvpBond.size ();++i)
5377
5384
{
5378
5385
mConnectivityTable [&(mvpBond[i]->GetAtom1 ())].insert (&(mvpBond[i]->GetAtom2 ()));
@@ -5396,6 +5403,13 @@ void Molecule::BuildConnectivityTable()const
5396
5403
}
5397
5404
}
5398
5405
#endif
5406
+ // No atom should be un-connected, so warn if that happens
5407
+ // In fact all atoms should be inter-connected to all others...
5408
+ for (unsigned long i = 0 ; i < mvpAtom.size (); ++i)
5409
+ if (mConnectivityTable [mvpAtom[i]].size () == 0 )
5410
+ cout << " Warning: Molecule '" << this ->GetName () << " ' ConnectivityTable: Atom #"
5411
+ << i << " (" << mvpAtom[i]->GetName () << " ) has no bond !" << endl;
5412
+
5399
5413
mClockConnectivityTable .Click ();
5400
5414
VFN_DEBUG_EXIT (" Molecule::BuildConnectivityTable()" ,5 )
5401
5415
}
You can’t perform that action at this time.
0 commit comments