ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/brains/Snapshot.cpp
(Generate patch)

Comparing trunk/src/brains/Snapshot.cpp (file contents):
Revision 1895 by gezelter, Mon Jul 1 21:09:37 2013 UTC vs.
Revision 2022 by gezelter, Fri Sep 26 22:22:28 2014 UTC

# Line 70 | Line 70 | namespace OpenMD {
70      frameData.torsionPotential = 0.0;  
71      frameData.inversionPotential = 0.0;
72      frameData.lrPotentials = potVec(0.0);
73 +    frameData.reciprocalPotential = 0.0;
74      frameData.excludedPotentials = potVec(0.0);
75      frameData.restraintPotential = 0.0;
76      frameData.rawPotential = 0.0;  
# Line 103 | Line 104 | namespace OpenMD {
104      frameData.torsionPotential = 0.0;  
105      frameData.inversionPotential = 0.0;
106      frameData.lrPotentials = potVec(0.0);
107 +    frameData.reciprocalPotential = 0.0;
108      frameData.excludedPotentials = potVec(0.0);
109      frameData.restraintPotential = 0.0;
110      frameData.rawPotential = 0.0;      
# Line 128 | Line 130 | namespace OpenMD {
130      frameData.pressure = 0.0;        
131      frameData.temperature = 0.0;
132      frameData.pressureTensor = Mat3x3d(0.0);  
133 <    frameData.systemDipole = Vector3d(0.0);            
133 >    frameData.systemDipole = Vector3d(0.0);
134 >    frameData.systemQuadrupole = Mat3x3d(0.0);
135      frameData.convectiveHeatFlux = Vector3d(0.0, 0.0, 0.0);
136      frameData.electronicTemperature = 0.0;
137      frameData.COM = V3Zero;            
# Line 152 | Line 155 | namespace OpenMD {
155      hasCOMw = false;
156      hasPressureTensor = false;    
157      hasSystemDipole = false;      
158 +    hasSystemQuadrupole = false;
159      hasConvectiveHeatFlux = false;  
160      hasInertiaTensor = false;
161      hasGyrationalVolume = false;  
# Line 187 | Line 191 | namespace OpenMD {
191    /** Returns the number of rigid bodies */
192    int Snapshot::getNumberOfCutoffGroups() {
193      return cgData.getSize();
194 +  }
195 +
196 +    /** Returns the number of bytes in a FrameData structure */
197 +  int Snapshot::getFrameDataSize() {
198 +    return sizeof(FrameData);
199    }
200    
201    /** Returns the H-Matrix */
# Line 297 | Line 306 | namespace OpenMD {
306      frameData.volume = vol;
307    }
308  
309 +
310    /** Wrap a vector according to periodic boundary conditions */
311    void Snapshot::wrapVector(Vector3d& pos) {
312      
313      if( !frameData.orthoRhombic ) {
314        Vector3d scaled = frameData.invHmat * pos;
315 <      for (int i = 0; i < 3; i++)
316 <        scaled[i] -= roundMe(scaled[i]);
315 >      for (int i = 0; i < 3; i++) {
316 >        scaled[i] -= roundMe( scaled[i] );        
317 >      }
318        // calc the wrapped real coordinates from the wrapped scaled coordinates
319        pos = frameData.hmat * scaled;
320      } else {
310      // calc the scaled coordinates.
321        RealType scaled;
322 <      for (int i=0; i<3; i++) {
323 <        scaled = pos[i] * frameData.invHmat(i, i);
324 <        scaled -= roundMe(scaled);
325 <        pos[i] = scaled * frameData.hmat(i, i);
322 >      for (int i=0; i<3; i++) {      
323 >        scaled = pos[i] * frameData.invHmat(i,i);
324 >        scaled -= roundMe( scaled );
325 >        pos[i] = scaled * frameData.hmat(i,i);
326        }
327      }
328    }
329  
320
330    /** Scaling a vector to multiples of the periodic box */
331    inline Vector3d Snapshot::scaleVector(Vector3d& pos) {  
332      
# Line 412 | Line 421 | namespace OpenMD {
421        hasShortRangePotential = true;
422      }
423      return frameData.shortRangePotential;
424 +  }
425 +
426 +  void Snapshot::setReciprocalPotential(RealType rp){
427 +    frameData.reciprocalPotential = rp;
428 +  }
429 +
430 +  RealType Snapshot::getReciprocalPotential() {
431 +    return frameData.reciprocalPotential;
432    }
433  
434    void Snapshot::setLongRangePotential(potVec lrPot) {
# Line 423 | Line 440 | namespace OpenMD {
440        for (int i = 0; i < N_INTERACTION_FAMILIES; i++) {
441          frameData.longRangePotential += frameData.lrPotentials[i];
442        }
443 +      frameData.longRangePotential += frameData.reciprocalPotential;
444        hasLongRangePotential = true;
445      }  
446      return frameData.longRangePotential;
# Line 586 | Line 604 | namespace OpenMD {
604      frameData.systemDipole = bd;
605    }
606  
607 +  Mat3x3d Snapshot::getSystemQuadrupole() {
608 +    return frameData.systemQuadrupole;
609 +  }
610 +
611 +  void Snapshot::setSystemQuadrupole(const Mat3x3d& bq) {    
612 +    hasSystemQuadrupole = true;
613 +    frameData.systemQuadrupole = bq;
614 +  }
615 +
616    void Snapshot::setThermostat(const pair<RealType, RealType>& thermostat) {
617      frameData.thermostat = thermostat;
618    }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines