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 617 by gezelter, Tue Jul 15 19:56:08 2003 UTC vs.
Revision 621 by gezelter, Wed Jul 16 02:11:02 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 95 | 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 107 | Line 109 | void SimInfo::setBoxM( double theBox[3][3] ){
109               maxCutoff );
110      painCave.isFatal = 0;
111      simError();
110
112      rList = maxCutoff;
113  
114 <    sprintf( painCave.errMsg,
114 <             "New Box size is forcing cutoff radius down to %lf\n",
115 <             maxCutoff - 1.0 );
116 <    painCave.isFatal = 0;
117 <    simError();
118 <
119 <    rCut = rList - 1.0;
120 <
121 <    // list radius changed so we have to refresh the simulation structure.
122 <    refreshSim();
123 <  }
124 <
125 <  if (rCut > maxCutoff) {
126 <    sprintf( painCave.errMsg,
127 <             "New Box size is forcing cutoff radius down to %lf\n",
128 <             maxCutoff );
129 <    painCave.isFatal = 0;
130 <    simError();
131 <
132 <    status = 0;
133 <    LJ_new_rcut(&rCut, &status);
134 <    if (status != 0) {
114 >    if (rCut > (rList - 1.0)) {
115        sprintf( painCave.errMsg,
116 <               "Error in recomputing LJ shifts based on new rcut\n");
117 <      painCave.isFatal = 1;
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 <  }
122 >
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 >  }    
138   }
139  
140  
# Line 312 | 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