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

Comparing trunk/OOPSE/libmdtools/SimInfo.cpp (file contents):
Revision 588 by gezelter, Thu Jul 10 17:10:56 2003 UTC vs.
Revision 619 by mmeineke, Tue Jul 15 22:22:41 2003 UTC

# Line 34 | Line 34 | SimInfo::SimInfo(){
34    setTemp = 0;
35    thermalTime = 0.0;
36    rCut = 0.0;
37 +  ecr = 0.0;
38 +  est = 0.0;
39  
40    usePBC = 0;
41    useLJ = 0;
# Line 77 | Line 79 | void SimInfo::setBoxM( double theBox[3][3] ){
79    for(i=0; i < 3; i++)
80      for (j=0; j < 3; j++) Hmat[i][j] = theBox[i][j];
81    
82 <  cerr
83 <    << "setting Hmat ->\n"
84 <    << "[ " << Hmat[0][0] << ", " << Hmat[0][1] << ", " << Hmat[0][2] << " ]\n"
85 <    << "[ " << Hmat[1][0] << ", " << Hmat[1][1] << ", " << Hmat[1][2] << " ]\n"
86 <    << "[ " << Hmat[2][0] << ", " << Hmat[2][1] << ", " << Hmat[2][2] << " ]\n";
82 >  //  cerr
83 >  // << "setting Hmat ->\n"
84 >  // << "[ " << Hmat[0][0] << ", " << Hmat[0][1] << ", " << Hmat[0][2] << " ]\n"
85 >  // << "[ " << Hmat[1][0] << ", " << Hmat[1][1] << ", " << Hmat[1][2] << " ]\n"
86 >  // << "[ " << Hmat[2][0] << ", " << Hmat[2][1] << ", " << Hmat[2][2] << " ]\n";
87  
88    calcBoxL();
89    calcHmatInv();
# Line 93 | Line 95 | void SimInfo::setBoxM( double theBox[3][3] ){
95      }
96    }
97  
98 <  setFortranBoxSize(FortranHmat, FortranHmatI, &orthoRhombic);
98 >  setFortranBoxSize(FortranHmat, FortranHmatInv, &orthoRhombic);
99  
100    smallestBoxL = boxLx;
101    if (boxLy < smallestBoxL) smallestBoxL = boxLy;
# Line 122 | Line 124 | void SimInfo::setBoxM( double theBox[3][3] ){
124      refreshSim();
125    }
126  
127 <  if (rCut > maxCutoff) {
127 >  if( ecr > maxCutoff ){
128 >
129      sprintf( painCave.errMsg,
130 <             "New Box size is forcing cutoff radius down to %lf\n",
130 >             "New Box size is forcing electrostatic cutoff radius "
131 >             "down to %lf\n",
132               maxCutoff );
133      painCave.isFatal = 0;
134      simError();
135  
136 <    status = 0;
137 <    LJ_new_rcut(&rCut, &status);
138 <    if (status != 0) {
139 <      sprintf( painCave.errMsg,
136 <               "Error in recomputing LJ shifts based on new rcut\n");
137 <      painCave.isFatal = 1;
138 <      simError();
139 <    }
136 >    ecr = maxCutoff;
137 >    est = 0.05 * ecr;
138 >
139 >    refreshSim();
140    }
141 +    
142   }
143  
144  
# Line 153 | Line 154 | void SimInfo::scaleBox(double scale) {
154    double theBox[3][3];
155    int i, j;
156  
157 <  cerr << "Scaling box by " << scale << "\n";
157 >  // cerr << "Scaling box by " << scale << "\n";
158  
159    for(i=0; i<3; i++)
160      for (j=0; j<3; j++) theBox[i][j] = Hmat[i][j]*scale;
# Line 163 | Line 164 | void SimInfo::calcHmatInv( void ) {
164   }
165  
166   void SimInfo::calcHmatInv( void ) {
167 <
167 >  
168 >  int i,j;
169    double smallDiag;
170    double tol;
171    double sanity[3][3];
# Line 173 | Line 175 | void SimInfo::calcHmatInv( void ) {
175    // Check the inverse to make sure it is sane:
176  
177    matMul3( Hmat, HmatInv, sanity );
176
177  cerr << "sanity => \n"
178       << sanity[0][0] << "\t" << sanity[0][1] << "\t" << sanity [0][2] << "\n"
179       << sanity[1][0] << "\t" << sanity[1][1] << "\t" << sanity [1][2] << "\n"
180       << sanity[2][0] << "\t" << sanity[2][1] << "\t" << sanity [2][2]
181       << "\n";
178      
179    // check to see if Hmat is orthorhombic
180    
# Line 270 | Line 266 | void SimInfo::matVecMul3(double m[3][3], double inVec[
266    outVec[0] = m[0][0]*a0 + m[0][1]*a1 + m[0][2]*a2;
267    outVec[1] = m[1][0]*a0 + m[1][1]*a1 + m[1][2]*a2;
268    outVec[2] = m[2][0]*a0 + m[2][1]*a1 + m[2][2]*a2;
269 + }
270 +
271 + void SimInfo::transposeMat3(double in[3][3], double out[3][3]) {
272 +  double temp[3][3];
273 +  int i, j;
274 +
275 +  for (i = 0; i < 3; i++) {
276 +    for (j = 0; j < 3; j++) {
277 +      temp[j][i] = in[i][j];
278 +    }
279 +  }
280 +  for (i = 0; i < 3; i++) {
281 +    for (j = 0; j < 3; j++) {
282 +      out[i][j] = temp[i][j];
283 +    }
284 +  }
285   }
286    
287 + void SimInfo::printMat3(double A[3][3] ){
288 +
289 +  std::cerr
290 +            << "[ " << A[0][0] << ", " << A[0][1] << ", " << A[0][2] << " ]\n"
291 +            << "[ " << A[1][0] << ", " << A[1][1] << ", " << A[1][2] << " ]\n"
292 +            << "[ " << A[2][0] << ", " << A[2][1] << ", " << A[2][2] << " ]\n";
293 + }
294 +
295 + void SimInfo::printMat9(double A[9] ){
296 +
297 +  std::cerr
298 +            << "[ " << A[0] << ", " << A[1] << ", " << A[2] << " ]\n"
299 +            << "[ " << A[3] << ", " << A[4] << ", " << A[5] << " ]\n"
300 +            << "[ " << A[6] << ", " << A[7] << ", " << A[8] << " ]\n";
301 + }
302 +
303   void SimInfo::calcBoxL( void ){
304  
305    double dx, dy, dz, dsq;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines