--- trunk/mdtools/md_code/AllLong.cpp 2002/07/09 18:40:59 11 +++ trunk/mdtools/md_code/AllLong.cpp 2003/01/27 19:28:21 248 @@ -2,8 +2,8 @@ #include #include "LRI.hpp" +#include "simError.h" - extern "C" { @@ -186,13 +186,15 @@ AllLong::AllLong( SimInfo* entry_plug ){ if( isLJ[i] && isVDW[i+1] ) error = 1; if( error ){ - std::cerr << "longRange force error: You cannot mix Lenard-Jones and" - << " \"Exp - r^6\" type interactions\n"; - exit(8); + sprintf(painCave.errMsg, + "longRange force error: You cannot mix Lenard-Jones and" + " \"Exp - r^6\" type interactions\n"); + painCave.isFatal = 1; + simError(); } } - /* a little routine to set the rCut, should not exceed half of any + /* a little routine to set the rCut, should not exrListceed half of any box length */ rCut = 0.0; @@ -233,6 +235,7 @@ AllLong::AllLong( SimInfo* entry_plug ){ if( entry_plug->longRange != NULL ) delete entry_plug->longRange; entry_plug->longRange = this; + } AllLong::~AllLong(){ @@ -303,12 +306,14 @@ void AllLong::calc_forces( void ){ if( isDipole[i] ){ if( !(atoms[i]->isDirectional()) ){ - std::cerr << "Something went Horribly wrong!!!!\n" - << "We're all gonna die in here!!!!!!!\n" - << "Oh yeah, by the way, atom " << i - << " somehow thinks it has a dipole,\n" - << "but it isn't a directional atom type.\n"; - exit(8); + sprintf( painCave.errMsg, + "Something went Horribly wrong!!!!\n" + "We're all gonna die in here!!!!!!!\n" + "Oh yeah, by the way, atom %d" + " somehow thinks it has a dipole,\n" + "but it isn't a directional atom type.\n", i); + painCave.isFatal = 1; + simError(); } dAtom = ( DirectionalAtom* )atoms[i];