--- trunk/OOPSE/libmdtools/Thermo.cpp 2003/07/15 17:10:50 611 +++ trunk/OOPSE/libmdtools/Thermo.cpp 2003/07/15 17:57:04 614 @@ -19,8 +19,8 @@ Thermo::Thermo( SimInfo* the_entry_plug ) { #define BASE_SEED 123456789 -Thermo::Thermo( SimInfo* the_entry_plug ) { - entry_plug = the_entry_plug; +Thermo::Thermo( SimInfo* the_info ) { + info = the_info; int baseSeed = BASE_SEED; gaussStream = new gaussianSPRNG( baseSeed ); @@ -45,8 +45,8 @@ double Thermo::getKinetic(){ Atom** atoms; - n_atoms = entry_plug->n_atoms; - atoms = entry_plug->atoms; + n_atoms = info->n_atoms; + atoms = info->atoms; kinetic = 0.0; kinetic_global = 0.0; @@ -88,14 +88,14 @@ double Thermo::getPotential(){ int el, nSRI; Molecule* molecules; - molecules = entry_plug->molecules; - nSRI = entry_plug->n_SRI; + molecules = info->molecules; + nSRI = info->n_SRI; potential_local = 0.0; potential = 0.0; - potential_local += entry_plug->lrPot; + potential_local += info->lrPot; - for( el=0; eln_mol; el++ ){ + for( el=0; eln_mol; el++ ){ potential_local += molecules[el].getPotential(); } @@ -129,7 +129,7 @@ double Thermo::getTemperature(){ const double kb = 1.9872179E-3; // boltzman's constant in kcal/(mol K) double temperature; - temperature = ( 2.0 * this->getKinetic() ) / ((double)entry_plug->ndf * kb ); + temperature = ( 2.0 * this->getKinetic() ) / ((double)info->ndf * kb ); return temperature; } @@ -151,7 +151,7 @@ double Thermo::getVolume() { double Thermo::getVolume() { - return entry_plug->boxVol; + return info->boxVol; } double Thermo::getPressure() { @@ -180,12 +180,12 @@ void Thermo::getPressureTensor(double press[3][3]){ double molmass, volume; double vcom[3]; double p_local[9], p_global[9]; - int i, j, k, l, nMols; + int i, j, k, nMols; Molecule* molecules; - nMols = entry_plug->n_mol; - molecules = entry_plug->molecules; - //tau = entry_plug->tau; + nMols = info->n_mol; + molecules = info->molecules; + //tau = info->tau; // use velocities of molecular centers of mass and molecular masses: for (i=0; i < 9; i++) { @@ -222,7 +222,8 @@ void Thermo::getPressureTensor(double press[3][3]){ for(i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { k = 3*i + j; - press[i][j] = (p_global[k] + entry_plug->tau[k]*e_convert) / volume; + press[i][j] = (p_global[k] + info->tau[k]*e_convert) / volume; + } } } @@ -244,14 +245,14 @@ void Thermo::velocitize() { int n_oriented; int n_constraints; - atoms = entry_plug->atoms; - n_atoms = entry_plug->n_atoms; - temperature = entry_plug->target_temp; - n_oriented = entry_plug->n_oriented; - n_constraints = entry_plug->n_constraints; + atoms = info->atoms; + n_atoms = info->n_atoms; + temperature = info->target_temp; + n_oriented = info->n_oriented; + n_constraints = info->n_constraints; - kebar = kb * temperature * (double)entry_plug->ndf / - ( 2.0 * (double)entry_plug->ndfRaw ); + kebar = kb * temperature * (double)info->ndf / + ( 2.0 * (double)info->ndfRaw ); for(vr = 0; vr < n_atoms; vr++){ @@ -322,8 +323,8 @@ void Thermo::getCOMVel(double vdrift[3]){ // We are very careless here with the distinction between n_atoms and n_local // We should really fix this before someone pokes an eye out. - n_atoms = entry_plug->n_atoms; - atoms = entry_plug->atoms; + n_atoms = info->n_atoms; + atoms = info->atoms; mtot_local = 0.0; vdrift_local[0] = 0.0;