--- trunk/OOPSE/libmdtools/SimInfo.cpp 2004/06/01 18:42:58 1214 +++ trunk/OOPSE/libmdtools/SimInfo.cpp 2004/06/04 03:15:31 1234 @@ -14,6 +14,8 @@ using namespace std; #include "MatVec3.h" +#include "ConstraintManager.hpp" + #ifdef IS_MPI #include "mpiSimulation.hpp" #endif @@ -76,6 +78,8 @@ SimInfo::SimInfo(){ ngroup = 0; + consMan = NULL; + wrapMeSimInfo( this ); } @@ -88,7 +92,9 @@ SimInfo::~SimInfo(){ for(i = properties.begin(); i != properties.end(); i++) delete (*i).second; - + + if (!consMan) + delete consMan; } void SimInfo::setBox(double newBox[3]) { @@ -191,7 +197,7 @@ void SimInfo::calcHmatInv( void ) { if( oldOrtho != orthoRhombic ){ - if( orthoRhombic ){ + if( orthoRhombic ) { sprintf( painCave.errMsg, "OOPSE is switching from the default Non-Orthorhombic\n" "\tto the faster Orthorhombic periodic boundary computations.\n" @@ -199,6 +205,7 @@ void SimInfo::calcHmatInv( void ) { "\tNon-Orthorhombic computations, make the orthoBoxTolerance\n" "\tvariable ( currently set to %G ) smaller.\n", orthoTolerance); + painCave.severity = OOPSE_INFO; simError(); } else { @@ -210,6 +217,7 @@ void SimInfo::calcHmatInv( void ) { "\tthe Orthorhombic computations, make the orthoBoxTolerance\n" "\tvariable ( currently set to %G ) larger.\n", orthoTolerance); + painCave.severity = OOPSE_WARNING; simError(); } } @@ -459,13 +467,14 @@ void SimInfo::refreshSim(){ //Most of the compilers will organize the memory of vector continuously setFsimulation( &fInfo, &n_global, &n_atoms, identArray, &n_exclude, excl, &nGlobalExcludes, globalExcludes, molMembershipArray, - &mfact[0], &ngroup, &FglobalGroupMembership[0], &isError); - + &mfact[0], &ngroup, &FglobalGroupMembership[0], &isError); + if( isError ){ sprintf( painCave.errMsg, "There was an error setting the simulation information in fortran.\n" ); painCave.isFatal = 1; + painCave.severity = OOPSE_ERROR; simError(); } @@ -516,6 +525,7 @@ void SimInfo::checkCutOffs( void ){ Hmat[0][0], Hmat[0][1], Hmat[0][2], Hmat[1][0], Hmat[1][1], Hmat[1][2], Hmat[2][0], Hmat[2][1], Hmat[2][2]); + painCave.severity = OOPSE_ERROR; painCave.isFatal = 1; simError(); } @@ -524,6 +534,7 @@ void SimInfo::checkCutOffs( void ){ sprintf( painCave.errMsg, "Trying to check cutoffs without a box.\n" "\tOOPSE should have better programmers than that.\n" ); + painCave.severity = OOPSE_ERROR; painCave.isFatal = 1; simError(); } @@ -596,6 +607,7 @@ void SimInfo::getFortranGroupArrays(SimInfo* info, #endif for (int i = 0; i < numAtom; i++) FglobalGroupMembership.push_back(globalGroupMembership[i] + 1); + myMols = info->molecules; numMol = info->n_mol;