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

Comparing:
trunk/src/brains/Snapshot.hpp (file contents), Revision 316 by tim, Fri Feb 11 22:41:02 2005 UTC vs.
branches/development/src/brains/Snapshot.hpp (file contents), Revision 1764 by gezelter, Tue Jul 3 18:32:27 2012 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# Line 6 | Line 6
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
35 + *                                                                      
36 + * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37 + * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 + * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 + * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 + * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42    
42 /**
43  * @file Snapshot.hpp
44  * @author tlin
45  * @date 10/20/2004
46  * @time 23:56am
47  * @version 1.0
48  */
49  
43   #ifndef BRAINS_SNAPSHOT_HPP
44   #define BRAINS_SNAPSHOT_HPP
45  
46   #include <vector>
47  
48   #include "brains/DataStorage.hpp"
49 + #include "nonbonded/NonBondedInteraction.hpp"
50   #include "brains/Stats.hpp"
57 #include "UseTheForce/DarkSide/simulation_interface.h"
51  
52 < namespace oopse{
52 > using namespace std;
53 > namespace OpenMD{
54  
55 <    /**
56 <     * @class Snapshot Snapshot.hpp "brains/Snapshot.hpp"
57 <     * @brief Snapshot class is a repository class for storing dynamic data during
58 <     *  Simulation
59 <     * Every snapshot class will contain one DataStorage  for atoms and one DataStorage
60 <     *  for rigid bodies.
61 <     */
62 <    class Snapshot {
63 <        public:
64 <            
65 <            Snapshot(int nAtoms, int nRigidbodies) : atomData(nAtoms), rigidbodyData(nRigidbodies),
66 <                currentTime_(0), orthoRhombic_(0), chi_(0.0), integralOfChiDt_(0.0), eta_(0.0) {
55 >  /**
56 >   * FrameData is a structure for holding system-wide dynamic data
57 >   * about the simulation.
58 >   */
59 >  
60 >  struct FrameData {
61 >    int id;                       /**< identification number of the snapshot */
62 >    RealType currentTime;         /**< current time */
63 >    Mat3x3d  hmat;                /**< axes of the periodic box in matrix form */
64 >    Mat3x3d  invHmat;             /**< the inverse of the Hmat matrix */
65 >    bool     orthoRhombic;        /**< is this an orthorhombic periodic box? */
66 >    RealType totalEnergy;         /**< total energy of this frame */
67 >    RealType translationalKinetic; /**< translational kinetic energy of this frame */
68 >    RealType rotationalKinetic;   /**< rotational kinetic energy of this frame */
69 >    RealType kineticEnergy;       /**< kinetic energy of this frame */
70 >    RealType potentialEnergy;     /**< potential energy of this frame */
71 >    RealType shortRangePotential; /**< short-range contributions to the potential*/
72 >    RealType longRangePotential;  /**< long-range contributions to the potential */
73 >    RealType bondPotential;       /**< bonded contribution to the potential */
74 >    RealType bendPotential;       /**< angle-bending contribution to the potential */
75 >    RealType torsionPotential;    /**< dihedral (torsion angle) contribution to the potential */
76 >    RealType inversionPotential;  /**< inversion (planarity) contribution to the potential */
77 >    potVec   lrPotentials;        /**< breakdown of long-range potentials by family */
78 >    potVec   excludedPotentials;  /**< breakdown of excluded potentials by family */
79 >    RealType restraintPotential;  /**< potential energy of restraints */
80 >    RealType rawPotential;        /**< unrestrained potential energy (when restraints are applied) */
81 >    RealType volume;              /**< total volume of this frame */
82 >    RealType pressure;            /**< pressure of this frame */
83 >    RealType temperature;         /**< temperature of this frame */
84 >    pair<RealType, RealType> thermostat;    /**< thermostat variables */
85 >    RealType electronicTemperature; /**< temperature of the electronic degrees of freedom */
86 >    pair<RealType, RealType> electronicThermostat; /**< thermostat variables for electronic degrees of freedom */
87 >    Mat3x3d  barostat;            /**< barostat matrix */
88 >    Vector3d COM;                 /**< location of system center of mass */
89 >    Vector3d COMvel;              /**< system center of mass velocity */
90 >    Vector3d COMw;                /**< system center of mass angular velocity */
91 >    Mat3x3d  inertiaTensor;       /**< inertia tensor for entire system */
92 >    RealType gyrationalVolume;    /**< gyrational volume for entire system */
93 >    RealType hullVolume;          /**< hull volume for entire system */
94 >    Mat3x3d  stressTensor;        /**< stress tensor */
95 >    Mat3x3d  pressureTensor;      /**< pressure tensor */
96 >    Vector3d systemDipole;        /**< total system dipole moment */
97 >    Vector3d conductiveHeatFlux;  /**< heat flux vector (conductive only) */
98 >    Vector3d convectiveHeatFlux;  /**< heat flux vector (convective only) */
99 >    RealType conservedQuantity;   /**< anything conserved by the integrator */
100 >  };
101  
74            }
102  
103 <            Snapshot(int nAtoms, int nRigidbodies, int storageLayout)
104 <                : atomData(nAtoms, storageLayout), rigidbodyData(nRigidbodies, storageLayout),
105 <                currentTime_(0), orthoRhombic_(0), chi_(0.0), integralOfChiDt_(0.0), eta_(0.0) {
103 >  /**
104 >   * @class Snapshot
105 >   * @brief The Snapshot class is a repository storing dynamic data during a
106 >   * Simulation.  Every Snapshot contains FrameData (for global information)
107 >   * as well as DataStorage (one for Atoms, one for RigidBodies, and one for
108 >   * CutoffGroups).
109 >   */
110 >  class Snapshot {
111  
112 <            }
113 <            
114 <            /** Returns the id of this Snapshot */
115 <            int getID() {
116 <                return id_;
117 <            }
112 >  public:            
113 >    Snapshot(int nAtoms, int nRigidbodies, int nCutoffGroups);
114 >    Snapshot(int nAtoms, int nRigidbodies, int nCutoffGroups, int storageLayout);    
115 >    /** Returns the id of this Snapshot */
116 >    int      getID();
117 >    /** Sets the id of this Snapshot */
118 >    void     setID(int id);
119  
120 <            /** Sets the id of this Snapshot */
121 <            void setID(int id) {
89 <                id_ = id;
90 <            }
120 >    /** sets the state of the computed properties to false */
121 >    void     clearDerivedProperties();
122  
123 <            int getSize() {
124 <                return atomData.getSize() + rigidbodyData.getSize();
125 <            }
123 >    int      getSize();
124 >    /** Returns the number of atoms */
125 >    int      getNumberOfAtoms();
126 >    /** Returns the number of rigid bodies */
127 >    int      getNumberOfRigidBodies();
128 >    /** Returns the number of rigid bodies */
129 >    int      getNumberOfCutoffGroups();
130  
131 <            /** Returns the number of atoms */
132 <            int getNumberOfAtoms() {
133 <                return atomData.getSize();
134 <            }
131 >    /** Returns the H-Matrix */
132 >    Mat3x3d  getHmat();
133 >    /** Sets the H-Matrix */
134 >    void     setHmat(const Mat3x3d& m);
135 >    /** Returns the inverse H-Matrix */
136 >    Mat3x3d  getInvHmat();
137 >            
138 >    RealType getVolume();
139 >    void     setVolume(const RealType vol);
140  
141 <            /** Returns the number of rigid bodies */
142 <            int getNumberOfRigidBodies() {
103 <                return rigidbodyData.getSize();
104 <            }
141 >    /** Wrapping the vector according to periodic boundary condition*/
142 >    void     wrapVector(Vector3d& v);
143  
144 <            /** Returns the H-Matrix */
145 <            Mat3x3d getHmat() {
108 <                return hmat_;
109 <            }
144 >    /** Scaling a vector to multiples of the periodic box */
145 >    Vector3d scaleVector(Vector3d &v);
146  
147 <            /** Sets the H-Matrix */
148 <            void setHmat(const Mat3x3d& m);
147 >    void     setCOM(const Vector3d &com);
148 >    void     setCOMvel(const Vector3d &comVel);
149 >    void     setCOMw(const Vector3d &comw);
150 >
151 >    Vector3d getCOM();
152 >    Vector3d getCOMvel();
153 >    Vector3d getCOMw();
154              
155 <            double getVolume() {
156 <                return hmat_.determinant();
157 <            }
155 >    RealType getTime();
156 >    void     increaseTime(const RealType dt);
157 >    void     setTime(const RealType time);
158  
159 <            /** Returns the inverse H-Matrix */
160 <            Mat3x3d getInvHmat() {
161 <                return invHmat_;
162 <            }
159 >    void     setBondPotential(const RealType bp);
160 >    void     setBendPotential(const RealType bp);
161 >    void     setTorsionPotential(const RealType tp);
162 >    void     setInversionPotential(const RealType ip);
163 >    RealType getBondPotential();
164 >    RealType getBendPotential();
165 >    RealType getTorsionPotential();
166 >    RealType getInversionPotential();
167  
168 <            /** Wrapping the vector according to periodic boundary condition*/
124 <            void wrapVector(Vector3d& v);
168 >    RealType getShortRangePotential();
169  
170 <            
171 <            double getTime() {
172 <                return currentTime_;
129 <            }
170 >    void     setLongRangePotential(const potVec lrPot);
171 >    RealType getLongRangePotential();
172 >    potVec   getLongRangePotentials();
173  
174 <            void increaseTime(double dt) {
175 <                setTime(getTime() + dt);
176 <            }
174 >    void     setExcludedPotentials(const potVec exPot);
175 >    potVec   getExcludedPotentials();
176 >  
177 >    void     setRestraintPotential(const RealType rp);
178 >    RealType getRestraintPotential();
179  
180 <            void setTime(double time) {
181 <                currentTime_ =time;
137 <                //time at statData is redundant
138 <                statData[Stats::TIME] = currentTime_;
139 <            }
180 >    void     setRawPotential(const RealType rp);
181 >    RealType getRawPotential();
182  
183 <            double getChi() {
184 <                return chi_;
185 <            }
183 >    RealType getPotentialEnergy();
184 >    RealType getKineticEnergy();
185 >    RealType getTranslationalKineticEnergy();
186 >    RealType getRotationalKineticEnergy();
187 >    void     setKineticEnergy(const RealType ke);
188 >    void     setTranslationalKineticEnergy(const RealType tke);
189 >    void     setRotationalKineticEnergy(const RealType rke);
190 >    RealType getTotalEnergy();
191 >    void     setTotalEnergy(const RealType te);
192 >    RealType getConservedQuantity();
193 >    void     setConservedQuantity(const RealType cq);
194 >    RealType getTemperature();
195 >    void     setTemperature(const RealType temp);
196 >    RealType getElectronicTemperature();
197 >    void     setElectronicTemperature(const RealType eTemp);
198 >    RealType getPressure();
199 >    void     setPressure(const RealType pressure);
200  
201 <            void setChi(double chi) {
202 <                chi_ = chi;
147 <            }
201 >    Mat3x3d  getPressureTensor();
202 >    void     setPressureTensor(const Mat3x3d& pressureTensor);
203  
204 <            double getIntegralOfChiDt() {
205 <                return integralOfChiDt_;
151 <            }
204 >    Mat3x3d  getStressTensor();
205 >    void     setStressTensor(const Mat3x3d& stressTensor);
206  
207 <            void setIntegralOfChiDt(double integralOfChiDt) {
208 <                integralOfChiDt_ = integralOfChiDt;
155 <            }
156 <            
157 <            Mat3x3d getEta() {
158 <                return eta_;
159 <            }
207 >    Vector3d getConductiveHeatFlux();
208 >    void     setConductiveHeatFlux(const Vector3d& chf);
209  
210 <            void setEta(const Mat3x3d& eta) {
211 <                eta_ = eta;
163 <            }
164 <            
165 <            DataStorage atomData;
166 <            DataStorage rigidbodyData;
167 <            Stats statData;
168 <            
169 <        private:
170 <            double currentTime_;
210 >    Vector3d getConvectiveHeatFlux();
211 >    void     setConvectiveHeatFlux(const Vector3d& chf);
212  
213 <            Mat3x3d hmat_;
214 <            Mat3x3d invHmat_;
215 <            int orthoRhombic_;
213 >    Vector3d getHeatFlux();
214 >    
215 >    Vector3d getSystemDipole();
216 >    void     setSystemDipole(const Vector3d& bd);
217  
218 <            double chi_;
219 <            double integralOfChiDt_;
220 <            Mat3x3d eta_;
218 >    pair<RealType, RealType> getThermostat();
219 >    void setThermostat(const pair<RealType, RealType>& thermostat);
220 >
221 >    pair<RealType, RealType> getElectronicThermostat();
222 >    void setElectronicThermostat(const pair<RealType, RealType>& eThermostat);
223              
224 <            int id_; /**< identification number of the snapshot */
225 <    };
224 >    Mat3x3d  getBarostat();
225 >    void     setBarostat(const Mat3x3d& barostat);
226  
227 <    typedef DataStorage (Snapshot::*DataStoragePointer);
227 >    Mat3x3d  getInertiaTensor();
228 >    void     setInertiaTensor(const Mat3x3d& inertiaTensor);
229 >
230 >    RealType getGyrationalVolume();
231 >    void     setGyrationalVolume(const RealType gv);
232 >
233 >    RealType getHullVolume();
234 >    void     setHullVolume(const RealType hv);
235 >    
236 >    void     setOrthoTolerance(RealType orthoTolerance);
237 >
238 >    DataStorage atomData;
239 >    DataStorage rigidbodyData;
240 >    DataStorage cgData;
241 >    FrameData   frameData;
242 >
243 >    bool hasTotalEnergy;        
244 >    bool hasTranslationalKineticEnergy;    
245 >    bool hasRotationalKineticEnergy;    
246 >    bool hasKineticEnergy;    
247 >    bool hasShortRangePotential;
248 >    bool hasLongRangePotential;
249 >    bool hasPotentialEnergy;    
250 >    bool hasVolume;        
251 >    bool hasPressure;      
252 >    bool hasTemperature;    
253 >    bool hasElectronicTemperature;
254 >    bool hasCOM;            
255 >    bool hasCOMvel;
256 >    bool hasCOMw;
257 >    bool hasPressureTensor;    
258 >    bool hasSystemDipole;    
259 >    bool hasConvectiveHeatFlux;
260 >    bool hasInertiaTensor;
261 >    bool hasGyrationalVolume;
262 >    bool hasHullVolume;
263 >    bool hasConservedQuantity;
264 >
265 >  private:
266 >    RealType orthoTolerance_;
267 >    
268 >  };
269 >
270 >  typedef DataStorage (Snapshot::*DataStoragePointer);
271   }
272   #endif //BRAINS_SNAPSHOT_HPP

Comparing:
trunk/src/brains/Snapshot.hpp (property svn:keywords), Revision 316 by tim, Fri Feb 11 22:41:02 2005 UTC vs.
branches/development/src/brains/Snapshot.hpp (property svn:keywords), Revision 1764 by gezelter, Tue Jul 3 18:32:27 2012 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines