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

Comparing branches/new-templateless/OOPSE/libmdtools/NPTxyz.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 | NPTxyz::NPTxyz ( SimInfo *theInfo, ForceFields* the_ff
24   //    Hoover, W. G., 1986, Phys. Rev. A, 34, 2499.
25  
26   NPTxyz::NPTxyz ( 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    int i,j;
32  
33    for(i = 0; i < 3; i++){
# Line 41 | Line 40 | NPTxyz::NPTxyz ( SimInfo *theInfo, ForceFields* the_ff
40  
41    // retrieve eta array from simInfo if it exists
42    data = info->getProperty(ETAVALUE_ID);
43 <  if(data){
44 <    etaValue = dynamic_cast<DoubleArrayData*>(data);
45 <
46 <    if(etaValue){
47 <      etaArray = etaValue->getData();
48 <
49 <      for(i = 0; i < 3; i++){
50 <        for (j = 0; j < 3; j++){
51 <          eta[i][j] = etaArray[3*i+j];
52 <          oldEta[i][j] = eta[i][j];
53 <        }
54 <      }
43 >  if(data != NULL){
44 >    
45 >    int test = data->getDarray(etaArray);
46 >    
47 >    if( test == 9 ){
48 >      
49 >      for(i = 0; i < 3; i++){
50 >        for (j = 0; j < 3; j++){
51 >          eta[i][j] = etaArray[3*i+j];
52 >          oldEta[i][j] = eta[i][j];
53 >        }
54 >      }    
55 >      delete[] etaArray;
56      }
57 +    else
58 +      std::cerr << "NPTxyz error: etaArray is not length 9 (actual = " << test
59 +                << ").\n"
60 +                << "            Simulation wil proceed with eta = 0;\n";
61    }
58
62   }
63  
64   NPTxyz::~NPTxyz() {
# Line 71 | Line 74 | void NPTxyz::resetIntegrator() {
74      for (j = 0; j < 3; j++)
75        eta[i][j] = 0.0;
76  
77 <  Integrator::resetIntegrator();
77 >  NPT::resetIntegrator();
78   }
79  
80   void NPTxyz::evolveEtaA() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines