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 670 by mmeineke, Thu Aug 7 21:47:18 2003 UTC vs.
Revision 1150 by gezelter, Fri May 7 21:35:05 2004 UTC

# Line 1 | Line 1
1 < #include <cstdlib>
2 < #include <cstdio>
1 > #include <iostream>
2  
3 + #include <stdlib.h>
4 + #include <stdio.h>
5 +
6   #include "simError.h"
7   #include "SimState.hpp"
8  
# Line 17 | Line 19 | SimState::SimState(){
19    Amat = NULL;
20    mu   = NULL;
21    ul   = NULL;
22 +  rc   = NULL;
23 +  massRatio = NULL;
24   }
25  
26  
# Line 29 | Line 33 | SimState::~SimState(){
33    if(Amat != NULL) delete[] Amat;
34    if(mu   != NULL) delete[] mu;
35    if(ul   != NULL) delete[] ul;  
36 +  if(rc   != NULL) delete[] rc;  
37 +  if(massRatio != NULL) delete[] massRatio;  
38  
39   }
40  
41  
42   void SimState::createArrays (int the_nElements) {
43    int i, index3, index9;
44 <  
44 >
45    if( arraysAllocated ){
46  
47      sprintf( painCave.errMsg,
# Line 54 | Line 60 | void SimState::createArrays (int the_nElements) {
60    Amat = new double[nElements*9];
61    mu   = new double[nElements];
62    ul   = new double[nElements*3];
63 +  rc   = new double[nElements*3];
64 +  massRatio = new double[nElements];
65    
66    // init directional values to zero
67    
# Line 96 | Line 104 | void SimState::destroyArrays( void ){
104    if(Amat != NULL) delete[] Amat;
105    if(mu   != NULL) delete[] mu;
106    if(ul   != NULL) delete[] ul;  
107 +  if(rc   != NULL) delete[] rc;
108 +  if(massRatio != NULL) delete[] massRatio;
109  
110    pos  = NULL;
111    vel  = NULL;
# Line 104 | Line 114 | void SimState::destroyArrays( void ){
114    Amat = NULL;
115    mu   = NULL;
116    ul   = NULL;
117 +  rc   = NULL;
118 +  massRatio = NULL;
119  
120    arraysAllocated = false;
121    nElements = 0;
# Line 116 | Line 128 | void SimState::getAtomPointers( int index,
128                                  double** the_trq,
129                                  double** the_Amat,
130                                  double** the_mu,
131 <                                double** the_ul ){
131 >                                double** the_ul,
132 >                                double** the_rc,
133 >                                double** the_massRatio){
134    int index3, index9;
135  
136    if( arraysAllocated ){
# Line 131 | Line 145 | void SimState::getAtomPointers( int index,
145      *the_Amat = &(Amat[index9]);
146      *the_mu   = &(mu[index]);
147      *the_ul   = &(ul[index3]);
148 +    *the_rc   = &(rc[index3]);
149 +    *the_massRatio = &(massRatio[index]);
150    }
151    else{
152  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines