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

Comparing trunk/OOPSE/libmdtools/SimState.cpp (file contents):
Revision 1150 by gezelter, Fri May 7 21:35:05 2004 UTC vs.
Revision 1452 by tim, Mon Aug 23 15:11:36 2004 UTC

# Line 19 | Line 19 | SimState::SimState(){
19    Amat = NULL;
20    mu   = NULL;
21    ul   = NULL;
22  rc   = NULL;
23  massRatio = NULL;
22   }
23  
24  
# Line 33 | Line 31 | SimState::~SimState(){
31    if(Amat != NULL) delete[] Amat;
32    if(mu   != NULL) delete[] mu;
33    if(ul   != NULL) delete[] ul;  
36  if(rc   != NULL) delete[] rc;  
37  if(massRatio != NULL) delete[] massRatio;  
34  
35   }
36  
# Line 60 | Line 56 | void SimState::createArrays (int the_nElements) {
56    Amat = new double[nElements*9];
57    mu   = new double[nElements];
58    ul   = new double[nElements*3];
59 <  rc   = new double[nElements*3];
64 <  massRatio = new double[nElements];
59 >  quat = new double[nElements*4];
60    
61    // init directional values to zero
62    
# Line 90 | Line 85 | void SimState::createArrays (int the_nElements) {
85      ul[index3+0] = 1.0;
86      ul[index3+1] = 0.0;
87      ul[index3+2] = 0.0;
88 +
89 +    quat[i*4] = 1.0;
90 +    quat[i*4+1] = 0.0;
91 +    quat[i*4+2] = 0.0;
92 +    quat[i*4+3] = 0.0;
93 +    
94    }
95  
96    arraysAllocated = true;
# Line 104 | Line 105 | void SimState::destroyArrays( void ){
105    if(Amat != NULL) delete[] Amat;
106    if(mu   != NULL) delete[] mu;
107    if(ul   != NULL) delete[] ul;  
107  if(rc   != NULL) delete[] rc;
108  if(massRatio != NULL) delete[] massRatio;
108  
109    pos  = NULL;
110    vel  = NULL;
# Line 114 | Line 113 | void SimState::destroyArrays( void ){
113    Amat = NULL;
114    mu   = NULL;
115    ul   = NULL;
116 <  rc   = NULL;
118 <  massRatio = NULL;
116 >  quat = NULL;
117  
118 +
119    arraysAllocated = false;
120    nElements = 0;
121   }
# Line 128 | Line 127 | void SimState::getAtomPointers( int index,
127                                  double** the_trq,
128                                  double** the_Amat,
129                                  double** the_mu,
130 <                                double** the_ul,
131 <                                double** the_rc,
133 <                                double** the_massRatio){
130 >                                double** the_ul,
131 >                                double** the_quat){
132    int index3, index9;
133  
134    if( arraysAllocated ){
# Line 145 | Line 143 | void SimState::getAtomPointers( int index,
143      *the_Amat = &(Amat[index9]);
144      *the_mu   = &(mu[index]);
145      *the_ul   = &(ul[index3]);
146 <    *the_rc   = &(rc[index3]);
149 <    *the_massRatio = &(massRatio[index]);
146 >    *the_quat = &(quat[index*4]);
147    }
148    else{
149  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines