--- trunk/OOPSE/libmdtools/SimState.cpp 2003/08/07 21:47:18 670 +++ trunk/OOPSE/libmdtools/SimState.cpp 2004/05/07 21:35:05 1150 @@ -1,6 +1,8 @@ -#include -#include +#include +#include +#include + #include "simError.h" #include "SimState.hpp" @@ -17,6 +19,8 @@ SimState::SimState(){ Amat = NULL; mu = NULL; ul = NULL; + rc = NULL; + massRatio = NULL; } @@ -29,13 +33,15 @@ SimState::~SimState(){ if(Amat != NULL) delete[] Amat; if(mu != NULL) delete[] mu; if(ul != NULL) delete[] ul; + if(rc != NULL) delete[] rc; + if(massRatio != NULL) delete[] massRatio; } void SimState::createArrays (int the_nElements) { int i, index3, index9; - + if( arraysAllocated ){ sprintf( painCave.errMsg, @@ -54,6 +60,8 @@ void SimState::createArrays (int the_nElements) { Amat = new double[nElements*9]; mu = new double[nElements]; ul = new double[nElements*3]; + rc = new double[nElements*3]; + massRatio = new double[nElements]; // init directional values to zero @@ -96,6 +104,8 @@ void SimState::destroyArrays( void ){ if(Amat != NULL) delete[] Amat; if(mu != NULL) delete[] mu; if(ul != NULL) delete[] ul; + if(rc != NULL) delete[] rc; + if(massRatio != NULL) delete[] massRatio; pos = NULL; vel = NULL; @@ -104,6 +114,8 @@ void SimState::destroyArrays( void ){ Amat = NULL; mu = NULL; ul = NULL; + rc = NULL; + massRatio = NULL; arraysAllocated = false; nElements = 0; @@ -116,7 +128,9 @@ void SimState::getAtomPointers( int index, double** the_trq, double** the_Amat, double** the_mu, - double** the_ul ){ + double** the_ul, + double** the_rc, + double** the_massRatio){ int index3, index9; if( arraysAllocated ){ @@ -131,6 +145,8 @@ void SimState::getAtomPointers( int index, *the_Amat = &(Amat[index9]); *the_mu = &(mu[index]); *the_ul = &(ul[index3]); + *the_rc = &(rc[index3]); + *the_massRatio = &(massRatio[index]); } else{