ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-2.0/src/integrators/NPTi.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-2.0/src/integrators/NPTi.cpp (file contents):
Revision 1865 by tim, Tue Dec 7 05:12:41 2004 UTC vs.
Revision 1867 by tim, Tue Dec 7 23:08:14 2004 UTC

# Line 87 | Line 87 | double NPTi::calcConservedQuantity(){
87  
88   double NPTi::calcConservedQuantity(){
89  
90 +    chi= currentSnapshot_->getChi();
91 +    integralOfChidt = currentSnapshot_->getIntegralOfChiDt();
92 +    loadEta();
93 +    // We need NkBT a lot, so just set it here: This is the RAW number
94 +    // of integrableObjects, so no subtraction or addition of constraints or
95 +    // orientational degrees of freedom:
96 +    NkBT = info_->getNGlobalIntegrableObjects()*OOPSEConstant::kB *targetTemp;
97 +
98 +    // fkBT is used because the thermostat operates on more degrees of freedom
99 +    // than the barostat (when there are particles with orientational degrees
100 +    // of freedom).  
101 +    fkBT = info_->getNdf()*OOPSEConstant::kB *targetTemp;    
102 +    
103      double conservedQuantity;
104      double Energy;
105      double thermostat_kinetic;
# Line 109 | Line 122 | double NPTi::calcConservedQuantity(){
122      conservedQuantity = Energy + thermostat_kinetic + thermostat_potential +
123          barostat_kinetic + barostat_potential;
124  
125 +    std::cout << "--------------------------------------------------------------" << std::endl;
126 +    std::cout << "time: " << currentSnapshot_->getTime() << std:: endl;
127 +    std::cout << "chi : " << chi << std::endl;
128 +    std::cout << "integralOfChidt : " << integralOfChidt << std::endl;
129 +    std::cout << "eta : " << eta << std::endl;    
130 +    std::cout << "NkBT: " << NkBT << std::endl;
131 +    std::cout << "fkBT: " << fkBT << std::endl;    
132 +    std::cout << "thermostat_kinetic : " << thermostat_kinetic<< std::endl;
133 +    std::cout << "thermostat_potential : " << thermostat_potential << std::endl;
134 +    std::cout << "barostat_kinetic : " << barostat_kinetic << std::endl;
135 +    std::cout << "barostat_potential : " << barostat_potential << std::endl;
136 +    std::cout << "Total Energy: " << Energy << std::endl;
137 +    std::cout << "Conserved Quantity: " << conservedQuantity <<std::endl;
138 +    std::cout << "--------------------------------------------------------------" << std::endl;
139      return conservedQuantity;
140   }
141  
142   void NPTi::loadEta() {
143      Mat3x3d etaMat = currentSnapshot_->getEta();
144      eta = etaMat(0,0);
145 <    if (fabs(etaMat(1,1) - eta) >= oopse::epsilon || fabs(etaMat(1,1) - eta) >= oopse::epsilon || etaMat.isDiagonal()) {
145 >    if (fabs(etaMat(1,1) - eta) >= oopse::epsilon || fabs(etaMat(1,1) - eta) >= oopse::epsilon || !etaMat.isDiagonal()) {
146          sprintf( painCave.errMsg,
147                   "NPTi error: the diagonal elements of are eta matrix is not same or etaMat is not a diagonal matrix");
148          painCave.isFatal = 1;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines