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

Comparing trunk/OOPSE/utils/sysbuilder/bilayerSys.cpp (file contents):
Revision 724 by mmeineke, Tue Aug 26 20:13:17 2003 UTC vs.
Revision 821 by mmeineke, Fri Oct 24 22:17:45 2003 UTC

# Line 34 | Line 34 | int buildRandomBilayer( void );
34  
35   int buildRandomBilayer( void );
36  
37 void getRandomRot( double rot[3][3] );
38
37   int buildBilayer( int isRandom ){
38    
39    if( isRandom ){
40      return buildRandomBilayer();
41    }
42    else{
43 <    sprintf( painCave.errMsg,
44 <             "Cannot currently create a non-random bilayer.\n" );
47 <    painCave.isFatal = 1;
48 <    simError();
43 >
44 >    std::cerr << "unsupported feature\n";
45      return 0;
46    }
47   }
# Line 252 | Line 248 | int buildRandomBilayer( void ){
248  
249    int nCellsX, nCellsY, nCellsZ;
250  
251 <  const double boxTargetX = 20;
252 <  const double boxTargetY = 20;
251 >  const double boxTargetX = 66.22752;
252 >  const double boxTargetY = 60.53088;
253  
254    nCellsX = (int)ceil(boxTargetX / waterCell);
255    nCellsY = (int)ceil(boxTargetY / waterCell);
# Line 283 | Line 279 | int buildRandomBilayer( void ){
279    double box_y = waterCell * nCellsY;
280    double box_z = waterCell * nCellsZ;
281          
286  
287
282    // create an fcc lattice in the water box.
283    
284    ndx = 0;
# Line 575 | Line 569 | int buildRandomBilayer( void ){
569    //     if( writer != NULL ) delete writer;
570  
571    return 1;
578 }
579
580 void getRandomRot( double rot[3][3] ){
581
582  double theta, phi, psi;
583  double cosTheta;
584
585  // select random phi, psi, and cosTheta
586
587  phi = 2.0 * M_PI * drand48();
588  psi = 2.0 * M_PI * drand48();
589  cosTheta = (2.0 * drand48()) - 1.0; // sample cos -1 to 1
590
591  theta = acos( cosTheta );
592
593  rot[0][0] = (cos(phi) * cos(psi)) - (sin(phi) * cos(theta) * sin(psi));
594  rot[0][1] = (sin(phi) * cos(psi)) + (cos(phi) * cos(theta) * sin(psi));
595  rot[0][2] = sin(theta) * sin(psi);
596  
597  rot[1][0] = -(cos(phi) * sin(psi)) - (sin(phi) * cos(theta) * cos(psi));
598  rot[1][1] = -(sin(phi) * sin(psi)) + (cos(phi) * cos(theta) * cos(psi));
599  rot[1][2] = sin(theta) * cos(psi);
600
601  rot[2][0] = sin(phi) * sin(theta);
602  rot[2][1] = -cos(phi) * sin(theta);
603  rot[2][2] = cos(theta);  
572   }
605                        
573  
607
574   void buildMap( double &x, double &y, double &z,
575                 double boxX, double boxY, double boxZ ){
576    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines