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

Comparing trunk/OOPSE/utils/bilayerSys.cpp (file contents):
Revision 501 by mmeineke, Tue Apr 15 21:20:35 2003 UTC vs.
Revision 502 by mmeineke, Tue Apr 15 21:47:54 2003 UTC

# Line 34 | Line 34 | int buildRandomBilayer( void ){
34   int buildRandomBilayer( void ){
35  
36    int i,j,k;
37 <  int nAtoms, atomIndex;
37 >  int nAtoms, atomIndex, molIndex, molID;
38    int* molSeq;
39    int* molMap;
40    int* cardDeck;
# Line 67 | Line 67 | int buildRandomBilayer( void ){
67    nSites = 0;
68    while( nSites < bsInfo.totNmol ){
69      nCells++;
70 <    nSites = 4 * pow( nCells, 3 );
70 >    nSites = 4.0 * pow( (double)nCells, 3.0 );
71    }
72  
73  
# Line 107 | Line 107 | int buildRandomBilayer( void ){
107      for(j=0; j<bsInfo.componentsNmol[i]; j++){
108        molSeq[molIndex] = i;
109        molIndex++;
110 <      nAtoms += bsInfo.compStamp[i]->getNAtoms();
110 >      nAtoms += bsInfo.compStamps[i]->getNAtoms();
111      }
112    }
113    
# Line 121 | Line 121 | int buildRandomBilayer( void ){
121    for(i=0; i<bsInfo.nComponents; i++){
122      if(cell < locate[i]->getMaxLength() ) cell = locate[i]->getMaxLength();
123    }
124 <  cell *= M_SQRT_2;
124 >  cell *= M_SQRT2;
125  
126    siteIndex = 0;
127    atomIndex = 0;
# Line 138 | Line 138 | int buildRandomBilayer( void ){
138            molID = molSeq[molMap[siteIndex]];
139            locate[molID]->placeMol( pos, rot, &atoms[atomIndex] );
140            
141 <          atomIndex += bsInfo.compStamps[molID]->getNatoms();
141 >          atomIndex += bsInfo.compStamps[molID]->getNAtoms();
142          }
143          siteIndex++;
144  
# Line 151 | Line 151 | int buildRandomBilayer( void ){
151            molID = molSeq[molMap[siteIndex]];
152            locate[molID]->placeMol( pos, rot, &atoms[atomIndex] );
153            
154 <          atomIndex += bsInfo.compStamps[molID]->getNatoms();
154 >          atomIndex += bsInfo.compStamps[molID]->getNAtoms();
155          }
156          siteIndex++;
157  
# Line 164 | Line 164 | int buildRandomBilayer( void ){
164            molID = molSeq[molMap[siteIndex]];
165            locate[molID]->placeMol( pos, rot, &atoms[atomIndex] );
166            
167 <          atomIndex += bsInfo.compStamps[molID]->getNatoms();
167 >          atomIndex += bsInfo.compStamps[molID]->getNAtoms();
168          }
169          siteIndex++;
170  
# Line 177 | Line 177 | int buildRandomBilayer( void ){
177            molID = molSeq[molMap[siteIndex]];
178            locate[molID]->placeMol( pos, rot, &atoms[atomIndex] );
179            
180 <          atomIndex += bsInfo.compStamps[molID]->getNatoms();
180 >          atomIndex += bsInfo.compStamps[molID]->getNAtoms();
181          }
182          siteIndex++;
183        }
# Line 191 | Line 191 | int buildRandomBilayer( void ){
191    bsInfo.boxZ = nCells * cell;
192    
193    simnfo = new SimInfo();
194 <  simnfo.n_atoms = nAtoms;
195 <  simnfo.box_x = bsInfo.boxX;
196 <  simnfo.box_y = bsInfo.boxY;
197 <  simnfo.box_z = bsInfo.boxZ;
194 >  simnfo->n_atoms = nAtoms;
195 >  simnfo->box_x = bsInfo.boxX;
196 >  simnfo->box_y = bsInfo.boxY;
197 >  simnfo->box_z = bsInfo.boxZ;
198    
199 <  sprintf( simnfo.statusName, "%s.dump", bsInfo.outPrefix );
200 <  sprintf( simnfo.finalName, "%s.init", bsInfo.outPrefix );
199 >  sprintf( simnfo->statusName, "%s.dump", bsInfo.outPrefix );
200 >  sprintf( simnfo->finalName, "%s.init", bsInfo.outPrefix );
201    
202 <  simnfo.atoms = atoms;
202 >  simnfo->atoms = atoms;
203    
204    // set up the writer and write out
205    
206 <  writer = new DumpWriter( &simnfo );
206 >  writer = new DumpWriter( simnfo );
207    writer->writeFinal();
208      
209    // clean up the memory
# Line 246 | Line 246 | void getRandomRot( double rot[3][3] ){
246  
247    rot[0][0] = (cos(phi) * cos(psi)) - (sin(phi) * cos(theta) * sin(psi));
248    rot[0][1] = (sin(phi) * cos(psi)) + (cos(phi) * cos(theta) * sin(psi));
249 <  rot[0][2[ = sin(theta) * sin(psi);
249 >  rot[0][2] = sin(theta) * sin(psi);
250    
251    rot[1][0] = -(cos(phi) * sin(psi)) - (sin(phi) * cos(theta) * cos(psi));
252    rot[1][1] = -(sin(phi) * sin(psi)) + (cos(phi) * cos(theta) * cos(psi));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines