File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5373,6 +5373,13 @@ void Molecule::BuildConnectivityTable()const
53735373 VFN_DEBUG_ENTRY (" Molecule::BuildConnectivityTable()" ,5 )
53745374 TAU_PROFILE (" Molecule::BuildConnectivityTable()" ," void ()" ,TAU_DEFAULT);
53755375 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
53765383 for (unsigned long i=0 ;i<mvpBond.size ();++i)
53775384 {
53785385 mConnectivityTable [&(mvpBond[i]->GetAtom1 ())].insert (&(mvpBond[i]->GetAtom2 ()));
@@ -5396,6 +5403,13 @@ void Molecule::BuildConnectivityTable()const
53965403 }
53975404 }
53985405 #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+
53995413 mClockConnectivityTable .Click ();
54005414 VFN_DEBUG_EXIT (" Molecule::BuildConnectivityTable()" ,5 )
54015415}
You can’t perform that action at this time.
0 commit comments