--- trunk/OOPSE/libmdtools/Verlet.cpp 2003/03/21 17:42:12 378 +++ trunk/OOPSE/libmdtools/Verlet.cpp 2003/03/27 20:12:15 423 @@ -36,11 +36,11 @@ Verlet::Verlet( SimInfo &info, ForceFields* the_ff ){ entry_plug = &info; myFF = the_ff; - + c_natoms = info.n_atoms; c_atoms = info.atoms; - c_sr_interactions = info.sr_interactions; - c_n_SRI = info.n_SRI; + nMols = info.n_mol; + molecules = info.molecules; c_is_constrained = 0; c_box_x = info.box_x; c_box_y = info.box_y; @@ -67,25 +67,65 @@ Verlet::Verlet( SimInfo &info, ForceFields* the_ff ){ Constraint *temp_con; Constraint *dummy_plug; - temp_con = new Constraint[c_n_SRI]; + temp_con = new Constraint[info.n_SRI]; c_n_constrained = 0; int constrained = 0; - - for(int i = 0; i < c_n_SRI; i++){ + SRI** theArray; + for(int i = 0; i < nMols; i++){ - constrained = c_sr_interactions[i]->is_constrained(); - - if(constrained){ + theArray = molecules[i].getMyBonds(); + for(int j=0; jget_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() ); + 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; + } + } - c_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(c_n_constrained > 0){ @@ -94,11 +134,11 @@ Verlet::Verlet( SimInfo &info, ForceFields* the_ff ){ c_constrained_i = new int[c_n_constrained]; c_constrained_j = new int[c_n_constrained]; c_constrained_dsqr = new double[c_n_constrained]; - + for( int i = 0; i < c_n_constrained; i++){ /* add 1 to the index for the fortran arrays. */ - + c_constrained_i[i] = temp_con[i].get_a() + 1; c_constrained_j[i] = temp_con[i].get_b() + 1; c_constrained_dsqr[i] = temp_con[i].get_dsqr();