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

Comparing trunk/OOPSE/libmdtools/Thermo.cpp (file contents):
Revision 611 by gezelter, Tue Jul 15 17:10:50 2003 UTC vs.
Revision 614 by mmeineke, Tue Jul 15 17:57:04 2003 UTC

# Line 19 | Line 19 | Thermo::Thermo( SimInfo* the_entry_plug ) {
19  
20   #define BASE_SEED 123456789
21  
22 < Thermo::Thermo( SimInfo* the_entry_plug ) {
23 <  entry_plug = the_entry_plug;
22 > Thermo::Thermo( SimInfo* the_info ) {
23 >  info = the_info;
24    int baseSeed = BASE_SEED;
25    
26    gaussStream = new gaussianSPRNG( baseSeed );
# Line 45 | Line 45 | double Thermo::getKinetic(){
45    Atom** atoms;
46  
47    
48 <  n_atoms = entry_plug->n_atoms;
49 <  atoms = entry_plug->atoms;
48 >  n_atoms = info->n_atoms;
49 >  atoms = info->atoms;
50  
51    kinetic = 0.0;
52    kinetic_global = 0.0;
# Line 88 | Line 88 | double Thermo::getPotential(){
88    int el, nSRI;
89    Molecule* molecules;
90  
91 <  molecules = entry_plug->molecules;
92 <  nSRI = entry_plug->n_SRI;
91 >  molecules = info->molecules;
92 >  nSRI = info->n_SRI;
93  
94    potential_local = 0.0;
95    potential = 0.0;
96 <  potential_local += entry_plug->lrPot;
96 >  potential_local += info->lrPot;
97  
98 <  for( el=0; el<entry_plug->n_mol; el++ ){    
98 >  for( el=0; el<info->n_mol; el++ ){    
99      potential_local += molecules[el].getPotential();
100    }
101  
# Line 129 | Line 129 | double Thermo::getTemperature(){
129    const double kb = 1.9872179E-3; // boltzman's constant in kcal/(mol K)
130    double temperature;
131    
132 <  temperature = ( 2.0 * this->getKinetic() ) / ((double)entry_plug->ndf * kb );
132 >  temperature = ( 2.0 * this->getKinetic() ) / ((double)info->ndf * kb );
133    return temperature;
134   }
135  
# Line 151 | Line 151 | double Thermo::getVolume() {
151  
152   double Thermo::getVolume() {
153  
154 <  return entry_plug->boxVol;
154 >  return info->boxVol;
155   }
156  
157   double Thermo::getPressure() {
# Line 180 | Line 180 | void Thermo::getPressureTensor(double press[3][3]){
180    double molmass, volume;
181    double vcom[3];
182    double p_local[9], p_global[9];
183 <  int i, j, k, l, nMols;
183 >  int i, j, k, nMols;
184    Molecule* molecules;
185  
186 <  nMols = entry_plug->n_mol;
187 <  molecules = entry_plug->molecules;
188 <  //tau = entry_plug->tau;
186 >  nMols = info->n_mol;
187 >  molecules = info->molecules;
188 >  //tau = info->tau;
189  
190    // use velocities of molecular centers of mass and molecular masses:
191    for (i=0; i < 9; i++) {    
# Line 222 | Line 222 | void Thermo::getPressureTensor(double press[3][3]){
222    for(i = 0; i < 3; i++) {
223      for (j = 0; j < 3; j++) {
224        k = 3*i + j;
225 <      press[i][j] = (p_global[k] + entry_plug->tau[k]*e_convert) / volume;
225 >      press[i][j] = (p_global[k] + info->tau[k]*e_convert) / volume;
226 >
227      }
228    }
229   }
# Line 244 | Line 245 | void Thermo::velocitize() {
245    int n_oriented;
246    int n_constraints;
247  
248 <  atoms         = entry_plug->atoms;
249 <  n_atoms       = entry_plug->n_atoms;
250 <  temperature   = entry_plug->target_temp;
251 <  n_oriented    = entry_plug->n_oriented;
252 <  n_constraints = entry_plug->n_constraints;
248 >  atoms         = info->atoms;
249 >  n_atoms       = info->n_atoms;
250 >  temperature   = info->target_temp;
251 >  n_oriented    = info->n_oriented;
252 >  n_constraints = info->n_constraints;
253    
254 <  kebar = kb * temperature * (double)entry_plug->ndf /
255 <    ( 2.0 * (double)entry_plug->ndfRaw );
254 >  kebar = kb * temperature * (double)info->ndf /
255 >    ( 2.0 * (double)info->ndfRaw );
256    
257    for(vr = 0; vr < n_atoms; vr++){
258      
# Line 322 | Line 323 | void Thermo::getCOMVel(double vdrift[3]){
323    // We are very careless here with the distinction between n_atoms and n_local
324    // We should really fix this before someone pokes an eye out.
325  
326 <  n_atoms = entry_plug->n_atoms;  
327 <  atoms   = entry_plug->atoms;
326 >  n_atoms = info->n_atoms;  
327 >  atoms   = info->atoms;
328  
329    mtot_local = 0.0;
330    vdrift_local[0] = 0.0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines