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 1167 by tim, Wed May 12 16:38:45 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];
63  rc   = new double[nElements*3];
64  massRatio = new double[nElements];
59    
60    // init directional values to zero
61    
# Line 104 | Line 98 | void SimState::destroyArrays( void ){
98    if(Amat != NULL) delete[] Amat;
99    if(mu   != NULL) delete[] mu;
100    if(ul   != NULL) delete[] ul;  
107  if(rc   != NULL) delete[] rc;
108  if(massRatio != NULL) delete[] massRatio;
101  
102    pos  = NULL;
103    vel  = NULL;
# Line 114 | Line 106 | void SimState::destroyArrays( void ){
106    Amat = NULL;
107    mu   = NULL;
108    ul   = NULL;
117  rc   = NULL;
118  massRatio = NULL;
109  
110 +
111    arraysAllocated = false;
112    nElements = 0;
113   }
# Line 128 | Line 119 | void SimState::getAtomPointers( int index,
119                                  double** the_trq,
120                                  double** the_Amat,
121                                  double** the_mu,
122 <                                double** the_ul,
132 <                                double** the_rc,
133 <                                double** the_massRatio){
122 >                                double** the_ul){
123    int index3, index9;
124  
125    if( arraysAllocated ){
# Line 145 | Line 134 | void SimState::getAtomPointers( int index,
134      *the_Amat = &(Amat[index9]);
135      *the_mu   = &(mu[index]);
136      *the_ul   = &(ul[index3]);
148    *the_rc   = &(rc[index3]);
149    *the_massRatio = &(massRatio[index]);
137    }
138    else{
139  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines