ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/Symplectic.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/Symplectic.cpp (file contents):
Revision 378 by mmeineke, Fri Mar 21 17:42:12 2003 UTC vs.
Revision 423 by mmeineke, Thu Mar 27 20:12:15 2003 UTC

# Line 35 | Line 35 | Symplectic::Symplectic( SimInfo* the_entry_plug, Force
35    myFF = the_ff;
36    isFirst = 1;
37  
38 +  molecules = entry_plug->molecules;
39 +  nMols = entry_plug->n_mol;
40  
39  srInteractions = entry_plug->sr_interactions;
40  nSRI           =           entry_plug->n_SRI;
41
41    // give a little love back to the SimInfo object
42    
43    if( entry_plug->the_integrator != NULL ) delete entry_plug->the_integrator;
# Line 51 | Line 50 | Symplectic::Symplectic( SimInfo* the_entry_plug, Force
50      mass[i] = entry_plug->atoms[i]->getMass();
51    }
52  
53 +  
54  
55    // check for constraints
56  
# Line 58 | Line 58 | Symplectic::Symplectic( SimInfo* the_entry_plug, Force
58  
59    Constraint *temp_con;
60    Constraint *dummy_plug;
61 <  temp_con = new Constraint[nSRI];
61 >  temp_con = new Constraint[entry_plug->n_SRI];
62    n_constrained = 0;
63    int constrained = 0;
64    
65 <  for(int i = 0; i < nSRI; i++){
65 >  SRI** theArray;
66 >  for(int i = 0; i < nMols; i++){
67      
68 <    constrained = srInteractions[i]->is_constrained();
69 <    
69 <    if(constrained){
68 >    theArray = molecules[i].getMyBonds();
69 >    for(int j=0; j<molecules[i].getNbonds(); j++){
70        
71 <      dummy_plug = srInteractions[i]->get_constraint();
72 <      temp_con[n_constrained].set_a( dummy_plug->get_a() );
73 <      temp_con[n_constrained].set_b( dummy_plug->get_b() );
74 <      temp_con[n_constrained].set_dsqr( dummy_plug->get_dsqr() );
71 >      constrained = theArray[j]->is_constrained();
72 >      
73 >      if(constrained){
74 >        
75 >        dummy_plug = theArray[j]->get_constraint();
76 >        temp_con[c_n_constrained].set_a( dummy_plug->get_a() );
77 >        temp_con[c_n_constrained].set_b( dummy_plug->get_b() );
78 >        temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() );
79 >        
80 >        c_n_constrained++;
81 >        constrained = 0;
82 >      }
83 >    }
84  
85 <      n_constrained++;
86 <      constrained = 0;
85 >    theArray = molecules[i].getMyBends();
86 >    for(int j=0; j<molecules[i].getNbends(); j++){
87 >      
88 >      constrained = theArray[j]->is_constrained();
89 >      
90 >      if(constrained){
91 >        
92 >        dummy_plug = theArray[j]->get_constraint();
93 >        temp_con[c_n_constrained].set_a( dummy_plug->get_a() );
94 >        temp_con[c_n_constrained].set_b( dummy_plug->get_b() );
95 >        temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() );
96 >        
97 >        c_n_constrained++;
98 >        constrained = 0;
99 >      }
100      }
101 +
102 +    theArray = molecules[i].getMyTorsions();
103 +    for(int j=0; j<molecules[i].getNtorsions(); j++){
104 +      
105 +      constrained = theArray[j]->is_constrained();
106 +      
107 +      if(constrained){
108 +        
109 +        dummy_plug = theArray[j]->get_constraint();
110 +        temp_con[c_n_constrained].set_a( dummy_plug->get_a() );
111 +        temp_con[c_n_constrained].set_b( dummy_plug->get_b() );
112 +        temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() );
113 +        
114 +        c_n_constrained++;
115 +        constrained = 0;
116 +      }
117 +    }
118    }
119  
120    if(n_constrained > 0){

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines