--- trunk/OOPSE/libmdtools/SimState.cpp 2003/08/20 19:42:31 707 +++ trunk/OOPSE/libmdtools/SimState.cpp 2004/08/23 15:11:36 1452 @@ -1,7 +1,7 @@ #include -#include -#include +#include +#include #include "simError.h" #include "SimState.hpp" @@ -56,6 +56,7 @@ void SimState::createArrays (int the_nElements) { Amat = new double[nElements*9]; mu = new double[nElements]; ul = new double[nElements*3]; + quat = new double[nElements*4]; // init directional values to zero @@ -84,6 +85,12 @@ void SimState::createArrays (int the_nElements) { ul[index3+0] = 1.0; ul[index3+1] = 0.0; ul[index3+2] = 0.0; + + quat[i*4] = 1.0; + quat[i*4+1] = 0.0; + quat[i*4+2] = 0.0; + quat[i*4+3] = 0.0; + } arraysAllocated = true; @@ -106,7 +113,9 @@ void SimState::destroyArrays( void ){ Amat = NULL; mu = NULL; ul = NULL; + quat = NULL; + arraysAllocated = false; nElements = 0; } @@ -118,7 +127,8 @@ void SimState::getAtomPointers( int index, double** the_trq, double** the_Amat, double** the_mu, - double** the_ul ){ + double** the_ul, + double** the_quat){ int index3, index9; if( arraysAllocated ){ @@ -133,6 +143,7 @@ void SimState::getAtomPointers( int index, *the_Amat = &(Amat[index9]); *the_mu = &(mu[index]); *the_ul = &(ul[index3]); + *the_quat = &(quat[index*4]); } else{