--- trunk/OOPSE/libmdtools/Symplectic.cpp 2003/03/21 17:42:12 378 +++ trunk/OOPSE/libmdtools/Symplectic.cpp 2003/03/27 20:12:15 423 @@ -35,10 +35,9 @@ Symplectic::Symplectic( SimInfo* the_entry_plug, Force myFF = the_ff; isFirst = 1; + molecules = entry_plug->molecules; + nMols = entry_plug->n_mol; - srInteractions = entry_plug->sr_interactions; - nSRI = entry_plug->n_SRI; - // give a little love back to the SimInfo object if( entry_plug->the_integrator != NULL ) delete entry_plug->the_integrator; @@ -51,6 +50,7 @@ Symplectic::Symplectic( SimInfo* the_entry_plug, Force mass[i] = entry_plug->atoms[i]->getMass(); } + // check for constraints @@ -58,24 +58,63 @@ Symplectic::Symplectic( SimInfo* the_entry_plug, Force Constraint *temp_con; Constraint *dummy_plug; - temp_con = new Constraint[nSRI]; + temp_con = new Constraint[entry_plug->n_SRI]; n_constrained = 0; int constrained = 0; - for(int i = 0; i < nSRI; i++){ + SRI** theArray; + for(int i = 0; i < nMols; i++){ - constrained = srInteractions[i]->is_constrained(); - - if(constrained){ + theArray = molecules[i].getMyBonds(); + for(int j=0; jget_constraint(); - temp_con[n_constrained].set_a( dummy_plug->get_a() ); - temp_con[n_constrained].set_b( dummy_plug->get_b() ); - temp_con[n_constrained].set_dsqr( dummy_plug->get_dsqr() ); + constrained = theArray[j]->is_constrained(); + + if(constrained){ + + dummy_plug = theArray[j]->get_constraint(); + temp_con[c_n_constrained].set_a( dummy_plug->get_a() ); + temp_con[c_n_constrained].set_b( dummy_plug->get_b() ); + temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() ); + + c_n_constrained++; + constrained = 0; + } + } - n_constrained++; - constrained = 0; + theArray = molecules[i].getMyBends(); + for(int j=0; jis_constrained(); + + if(constrained){ + + dummy_plug = theArray[j]->get_constraint(); + temp_con[c_n_constrained].set_a( dummy_plug->get_a() ); + temp_con[c_n_constrained].set_b( dummy_plug->get_b() ); + temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() ); + + c_n_constrained++; + constrained = 0; + } } + + theArray = molecules[i].getMyTorsions(); + for(int j=0; jis_constrained(); + + if(constrained){ + + dummy_plug = theArray[j]->get_constraint(); + temp_con[c_n_constrained].set_a( dummy_plug->get_a() ); + temp_con[c_n_constrained].set_b( dummy_plug->get_b() ); + temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() ); + + c_n_constrained++; + constrained = 0; + } + } } if(n_constrained > 0){