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 619 by mmeineke, Tue Jul 15 22:22:41 2003 UTC vs.
Revision 621 by gezelter, Wed Jul 16 02:11:02 2003 UTC

# Line 97 | Line 97 | void SimInfo::setBoxM( double theBox[3][3] ){
97  
98    setFortranBoxSize(FortranHmat, FortranHmatInv, &orthoRhombic);
99  
100 <  smallestBoxL = boxLx;
101 <  if (boxLy < smallestBoxL) smallestBoxL = boxLy;
102 <  if (boxLz < smallestBoxL) smallestBoxL = boxLz;
100 >  smallestBoxL = boxL[0];
101 >  if (boxL[1] < smallestBoxL) smallestBoxL = boxL[1];
102 >  if (boxL[2] > smallestBoxL) smallestBoxL = boxL[2];
103  
104    maxCutoff = smallestBoxL / 2.0;
105  
# Line 109 | Line 109 | void SimInfo::setBoxM( double theBox[3][3] ){
109               maxCutoff );
110      painCave.isFatal = 0;
111      simError();
112
112      rList = maxCutoff;
113  
114 <    sprintf( painCave.errMsg,
115 <             "New Box size is forcing cutoff radius down to %lf\n",
116 <             maxCutoff - 1.0 );
117 <    painCave.isFatal = 0;
118 <    simError();
119 <
120 <    rCut = rList - 1.0;
121 <
123 <    // list radius changed so we have to refresh the simulation structure.
124 <    refreshSim();
125 <  }
126 <
127 <  if( ecr > maxCutoff ){
128 <
129 <    sprintf( painCave.errMsg,
130 <             "New Box size is forcing electrostatic cutoff radius "
131 <             "down to %lf\n",
132 <             maxCutoff );
133 <    painCave.isFatal = 0;
134 <    simError();
114 >    if (rCut > (rList - 1.0)) {
115 >      sprintf( painCave.errMsg,
116 >               "New Box size is forcing LJ cutoff radius down to %lf\n",
117 >               rList - 1.0 );
118 >      painCave.isFatal = 0;
119 >      simError();
120 >      rCut = rList - 1.0;
121 >    }
122  
123 <    ecr = maxCutoff;
124 <    est = 0.05 * ecr;
123 >    if( ecr > (rList - 1.0) ){
124 >      sprintf( painCave.errMsg,
125 >               "New Box size is forcing electrostaticCutoffRadius "
126 >               "down to %lf\n"
127 >               "electrostaticSkinThickness is now %lf\n",
128 >               rList - 1.0, 0.05*(rList-1.0) );
129 >      painCave.isFatal = 0;
130 >      simError();      
131 >      ecr = maxCutoff;
132 >      est = 0.05 * ecr;
133 >    }
134  
135 +    // At least one of the radii changed, so we need a refresh:
136      refreshSim();
137 <  }
141 <    
137 >  }    
138   }
139  
140  
# Line 313 | Line 309 | void SimInfo::calcBoxL( void ){
309    
310    dx = Hmat[0][0]; dy = Hmat[1][0]; dz = Hmat[2][0];
311    dsq = dx*dx + dy*dy + dz*dz;
312 <  boxLx = sqrt( dsq );
312 >  boxL[0] = sqrt( dsq );
313  
314    // boxLy
315    
316    dx = Hmat[0][1]; dy = Hmat[1][1]; dz = Hmat[2][1];
317    dsq = dx*dx + dy*dy + dz*dz;
318 <  boxLy = sqrt( dsq );
318 >  boxL[1] = sqrt( dsq );
319  
320    // boxLz
321    
322    dx = Hmat[0][2]; dy = Hmat[1][2]; dz = Hmat[2][2];
323    dsq = dx*dx + dy*dy + dz*dz;
324 <  boxLz = sqrt( dsq );
324 >  boxL[2] = sqrt( dsq );
325    
326   }
327  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines