--- trunk/OOPSE/libmdtools/Verlet.cpp 2003/04/14 21:16:37 497 +++ trunk/OOPSE/libmdtools/Verlet.cpp 2003/05/30 21:31:48 542 @@ -9,6 +9,8 @@ extern "C"{ #include "ReadWrite.hpp" #include "ExtendedSystem.hpp" +#include "simError.h" + extern "C"{ void v_constrain_a_( double &dt, int &n_atoms, double* mass, @@ -17,7 +19,8 @@ extern "C"{ double* Fx, double* Fy, double* Fz, int &n_constrained, double *constr_sqr, int* constr_i, int* constr_j, - double &box_x, double &box_y, double &box_z ); + double &box_x, double &box_y, double &box_z, + int &isError ); void v_constrain_b_( double &dt, int &n_atoms, double* mass, double* Rx, double* Ry, double* Rz, @@ -26,7 +29,8 @@ extern "C"{ double &Kinetic, int &n_constrained, double *constr_sqr, int* constr_i, int* constr_j, - double &box_x, double &box_y, double &box_z ); + double &box_x, double &box_y, double &box_z, + int &isError); } @@ -198,6 +202,8 @@ void Verlet::integrate( void ){ int status_n = (int)( statusTime / dt ); int vel_n = (int)( thermalTime / dt ); + int isError; + Thermo *tStats = new Thermo( entry_plug ); StatWriter* e_out = new StatWriter( entry_plug ); @@ -245,12 +251,29 @@ void Verlet::integrate( void ){ } + isError = 0; v_constrain_a_( dt, c_natoms, c_mass, Rx, Ry, Rz, Vx, Vy, Vz, Fx, Fy, Fz, c_n_constrained, c_constrained_dsqr, c_constrained_i, c_constrained_j, - c_box_x, c_box_y, c_box_z ); + c_box_x, c_box_y, c_box_z, + isError); + + if( isError ){ + + sprintf( painCave.errMsg, + "Constraint Failure in Fortran move A\n" ); + painCave.isFatal = 1; + simError(); + } + +#ifdef IS_MPI + sprintf( checkPointMsg, + "succesful return from move a.\n" ); + MPIcheckPoint(); +#endif //is_mpi + for( j=0; jsetX(Rx[j]); @@ -287,12 +310,29 @@ void Verlet::integrate( void ){ } + isError = 0; v_constrain_b_( dt, c_natoms, c_mass, Rx, Ry, Rz, Vx, Vy, Vz, Fx, Fy, Fz, kE, c_n_constrained, c_constrained_dsqr, c_constrained_i, c_constrained_j, - c_box_x, c_box_y, c_box_z ); - + c_box_x, c_box_y, c_box_z, isError ); + + if( isError ){ + + sprintf( painCave.errMsg, + "Constraint Failure in Fortran move B\n" ); + painCave.isFatal = 1; + simError(); + } + +#ifdef IS_MPI + sprintf( checkPointMsg, + "succesful return from move B.\n" ); + MPIcheckPoint(); + +#endif //is_mpi + + for( j=0; jsetX(Rx[j]);