ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new-templateless/OOPSE/libmdtools/NPTi.cpp
(Generate patch)

Comparing branches/new-templateless/OOPSE/libmdtools/NPTi.cpp (file contents):
Revision 849 by mmeineke, Fri Oct 31 21:06:47 2003 UTC vs.
Revision 850 by mmeineke, Mon Nov 3 22:07:17 2003 UTC

# Line 24 | Line 24 | NPTi::NPTi ( SimInfo *theInfo, ForceFields* the_ff):
24   //    Hoover, W. G., 1986, Phys. Rev. A, 34, 2499.
25  
26   NPTi::NPTi ( SimInfo *theInfo, ForceFields* the_ff):
27 <  Integrator( theInfo, the_ff )
27 >  NPT( theInfo, the_ff )
28   {
29    GenericData* data;
30 <  DoubleArrayData * etaValue;
31 <  vector<double> etaArray;
30 >  double *etaArray;
31  
32    eta = 0.0;
33    oldEta = 0.0;
34  
35 <  // retrieve eta from simInfo if
35 >  // retrieve eta array from simInfo if it exists
36    data = info->getProperty(ETAVALUE_ID);
37 <  if(data){
38 <    etaValue = dynamic_cast<DoubleArrayData*>(data);
39 <
40 <    if(etaValue){
41 <      etaArray = etaValue->getData();
37 >  if(data != NULL){
38 >    
39 >    int test = data->getDarray(etaArray);
40 >    
41 >    if( test == 9 ){
42 >      
43        eta = etaArray[0];
44 <      oldEta = eta;
44 >      }    
45 >      delete[] etaArray;
46      }
47 +    else
48 +      std::cerr << "NPTi error: etaArray is not length 9 (actual = " << test
49 +                << ").\n"
50 +                << "            Simulation wil proceed with eta = 0;\n";
51    }
47
52   }
53  
54   NPTi::~NPTi() {
# Line 53 | Line 57 | void NPTi::resetIntegrator() {
57  
58   void NPTi::resetIntegrator() {
59    eta = 0.0;
60 <  Integrator::resetIntegrator();
60 >  NPT::resetIntegrator();
61   }
62  
63   void NPTi::evolveEtaA() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines