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 763 by tim, Mon Sep 15 16:52:02 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 573 | Line 569 | int buildRandomBilayer( void ){
569    //     if( writer != NULL ) delete writer;
570  
571    return 1;
576 }
577
578 void getRandomRot( double rot[3][3] ){
579
580  double theta, phi, psi;
581  double cosTheta;
582
583  // select random phi, psi, and cosTheta
584
585  phi = 2.0 * M_PI * drand48();
586  psi = 2.0 * M_PI * drand48();
587  cosTheta = (2.0 * drand48()) - 1.0; // sample cos -1 to 1
588
589  theta = acos( cosTheta );
590
591  rot[0][0] = (cos(phi) * cos(psi)) - (sin(phi) * cos(theta) * sin(psi));
592  rot[0][1] = (sin(phi) * cos(psi)) + (cos(phi) * cos(theta) * sin(psi));
593  rot[0][2] = sin(theta) * sin(psi);
594  
595  rot[1][0] = -(cos(phi) * sin(psi)) - (sin(phi) * cos(theta) * cos(psi));
596  rot[1][1] = -(sin(phi) * sin(psi)) + (cos(phi) * cos(theta) * cos(psi));
597  rot[1][2] = sin(theta) * cos(psi);
598
599  rot[2][0] = sin(phi) * sin(theta);
600  rot[2][1] = -cos(phi) * sin(theta);
601  rot[2][2] = cos(theta);  
572   }
603                        
573  
605
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