--- trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/15 18:52:16 616 +++ trunk/OOPSE/libmdtools/SimSetup.cpp 2003/07/22 16:41:08 644 @@ -398,9 +398,9 @@ void SimSetup::initFromBass( void ){ have_extra =1; n_cells = (int)temp3 - 1; - cellx = info->boxLx / temp3; - celly = info->boxLy / temp3; - cellz = info->boxLz / temp3; + cellx = info->boxL[0] / temp3; + celly = info->boxL[1] / temp3; + cellz = info->boxL[2] / temp3; n_extra = tot_nmol - ( 4 * n_cells * n_cells * n_cells ); temp1 = ((double)n_extra) / ( pow( temp3, 3.0 ) - pow( n_cells, 3.0 ) ); n_per_extra = (int)ceil( temp1 ); @@ -415,9 +415,9 @@ void SimSetup::initFromBass( void ){ } else{ n_cells = (int)temp3; - cellx = info->boxLx / temp3; - celly = info->boxLy / temp3; - cellz = info->boxLz / temp3; + cellx = info->boxL[0] / temp3; + celly = info->boxL[1] / temp3; + cellz = info->boxL[2] / temp3; } current_mol = 0; @@ -762,6 +762,7 @@ void SimSetup::finalInfoCheck( void ){ MPI_Allreduce( &myUse, &usesDipoles, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD ); #endif //is_mpi + double theEcr, theEst; if (globals->getUseRF() ) { info->useReactionField = 1; @@ -774,12 +775,12 @@ void SimSetup::finalInfoCheck( void ){ painCave.isFatal = 0; simError(); double smallest; - smallest = info->boxLx; - if (info->boxLy <= smallest) smallest = info->boxLy; - if (info->boxLz <= smallest) smallest = info->boxLz; - info->ecr = 0.5 * smallest; + smallest = info->boxL[0]; + if (info->boxL[1] <= smallest) smallest = info->boxL[1]; + if (info->boxL[2] <= smallest) smallest = info->boxL[2]; + theEcr = 0.5 * smallest; } else { - info->ecr = globals->getECR(); + theEcr = globals->getECR(); } if( !globals->haveEST() ){ @@ -789,10 +790,12 @@ void SimSetup::finalInfoCheck( void ){ ); painCave.isFatal = 0; simError(); - info->est = 0.05 * info->ecr; + theEst = 0.05 * theEcr; } else { - info->est = globals->getEST(); + theEst= globals->getEST(); } + + info->setEcr( theEcr, theEst ); if(!globals->haveDielectric() ){ sprintf( painCave.errMsg, @@ -808,33 +811,35 @@ void SimSetup::finalInfoCheck( void ){ if (usesDipoles) { if( !globals->haveECR() ){ - sprintf( painCave.errMsg, - "SimSetup Warning: using default value of 1/2 the smallest " - "box length for the electrostaticCutoffRadius.\n" - "I hope you have a very fast processor!\n"); - painCave.isFatal = 0; - simError(); - double smallest; - smallest = info->boxLx; - if (info->boxLy <= smallest) smallest = info->boxLy; - if (info->boxLz <= smallest) smallest = info->boxLz; - info->ecr = 0.5 * smallest; + sprintf( painCave.errMsg, + "SimSetup Warning: using default value of 1/2 the smallest " + "box length for the electrostaticCutoffRadius.\n" + "I hope you have a very fast processor!\n"); + painCave.isFatal = 0; + simError(); + double smallest; + smallest = info->boxL[0]; + if (info->boxL[1] <= smallest) smallest = info->boxL[1]; + if (info->boxL[2] <= smallest) smallest = info->boxL[2]; + theEcr = 0.5 * smallest; } else { - info->ecr = globals->getECR(); + theEcr = globals->getECR(); } if( !globals->haveEST() ){ - sprintf( painCave.errMsg, - "SimSetup Warning: using default value of 5%% of the " - "electrostaticCutoffRadius for the " - "electrostaticSkinThickness\n" - ); - painCave.isFatal = 0; - simError(); - info->est = 0.05 * info->ecr; - } else { - info->est = globals->getEST(); + sprintf( painCave.errMsg, + "SimSetup Warning: using default value of 0.05 * the " + "electrostaticCutoffRadius for the " + "electrostaticSkinThickness\n" + ); + painCave.isFatal = 0; + simError(); + theEst = 0.05 * theEcr; + } else { + theEst= globals->getEST(); } + + info->setEcr( theEcr, theEst ); } } @@ -857,7 +862,7 @@ void SimSetup::initSystemCoords( void ){ #ifdef IS_MPI }else fileInit = new InitializeFromFile( NULL ); #endif - fileInit->read_xyz( info ); // default velocities on + fileInit->readInit( info ); // default velocities on delete fileInit; }