24 |
|
|
25 |
|
#define FF_DUFF 0 |
26 |
|
#define FF_LJ 1 |
27 |
< |
|
27 |
> |
#define FF_EAM 2 |
28 |
|
|
29 |
|
SimSetup::SimSetup(){ |
30 |
|
stamps = new MakeStamps(); |
398 |
|
have_extra =1; |
399 |
|
|
400 |
|
n_cells = (int)temp3 - 1; |
401 |
< |
cellx = info->boxLx / temp3; |
402 |
< |
celly = info->boxLy / temp3; |
403 |
< |
cellz = info->boxLz / temp3; |
401 |
> |
cellx = info->boxL[0] / temp3; |
402 |
> |
celly = info->boxL[1] / temp3; |
403 |
> |
cellz = info->boxL[2] / temp3; |
404 |
|
n_extra = tot_nmol - ( 4 * n_cells * n_cells * n_cells ); |
405 |
|
temp1 = ((double)n_extra) / ( pow( temp3, 3.0 ) - pow( n_cells, 3.0 ) ); |
406 |
|
n_per_extra = (int)ceil( temp1 ); |
415 |
|
} |
416 |
|
else{ |
417 |
|
n_cells = (int)temp3; |
418 |
< |
cellx = info->boxLx / temp3; |
419 |
< |
celly = info->boxLy / temp3; |
420 |
< |
cellz = info->boxLz / temp3; |
418 |
> |
cellx = info->boxL[0] / temp3; |
419 |
> |
celly = info->boxL[1] / temp3; |
420 |
> |
cellz = info->boxL[2] / temp3; |
421 |
|
} |
422 |
|
|
423 |
|
current_mol = 0; |
586 |
|
|
587 |
|
if( !strcasecmp( force_field, "DUFF" )) ffCase = FF_DUFF; |
588 |
|
else if( !strcasecmp( force_field, "LJ" )) ffCase = FF_LJ; |
589 |
+ |
else if( !strcasecmp( force_field, "EAM" )) ffCase = FF_EAM; |
590 |
|
else{ |
591 |
|
sprintf( painCave.errMsg, |
592 |
|
"SimSetup Error. Unrecognized force field -> %s\n", |
763 |
|
MPI_Allreduce( &myUse, &usesDipoles, 1, MPI_INT, MPI_LOR, MPI_COMM_WORLD ); |
764 |
|
#endif //is_mpi |
765 |
|
|
766 |
+ |
double theEcr, theEst; |
767 |
|
|
768 |
|
if (globals->getUseRF() ) { |
769 |
|
info->useReactionField = 1; |
776 |
|
painCave.isFatal = 0; |
777 |
|
simError(); |
778 |
|
double smallest; |
779 |
< |
smallest = info->boxLx; |
780 |
< |
if (info->boxLy <= smallest) smallest = info->boxLy; |
781 |
< |
if (info->boxLz <= smallest) smallest = info->boxLz; |
782 |
< |
info->ecr = 0.5 * smallest; |
779 |
> |
smallest = info->boxL[0]; |
780 |
> |
if (info->boxL[1] <= smallest) smallest = info->boxL[1]; |
781 |
> |
if (info->boxL[2] <= smallest) smallest = info->boxL[2]; |
782 |
> |
theEcr = 0.5 * smallest; |
783 |
|
} else { |
784 |
< |
info->ecr = globals->getECR(); |
784 |
> |
theEcr = globals->getECR(); |
785 |
|
} |
786 |
|
|
787 |
|
if( !globals->haveEST() ){ |
791 |
|
); |
792 |
|
painCave.isFatal = 0; |
793 |
|
simError(); |
794 |
< |
info->est = 0.05 * info->ecr; |
794 |
> |
theEst = 0.05 * theEcr; |
795 |
|
} else { |
796 |
< |
info->est = globals->getEST(); |
796 |
> |
theEst= globals->getEST(); |
797 |
|
} |
798 |
+ |
|
799 |
+ |
info->setEcr( theEcr, theEst ); |
800 |
|
|
801 |
|
if(!globals->haveDielectric() ){ |
802 |
|
sprintf( painCave.errMsg, |
812 |
|
if (usesDipoles) { |
813 |
|
|
814 |
|
if( !globals->haveECR() ){ |
815 |
< |
sprintf( painCave.errMsg, |
816 |
< |
"SimSetup Warning: using default value of 1/2 the smallest " |
817 |
< |
"box length for the electrostaticCutoffRadius.\n" |
818 |
< |
"I hope you have a very fast processor!\n"); |
819 |
< |
painCave.isFatal = 0; |
820 |
< |
simError(); |
821 |
< |
double smallest; |
822 |
< |
smallest = info->boxLx; |
823 |
< |
if (info->boxLy <= smallest) smallest = info->boxLy; |
824 |
< |
if (info->boxLz <= smallest) smallest = info->boxLz; |
825 |
< |
info->ecr = 0.5 * smallest; |
815 |
> |
sprintf( painCave.errMsg, |
816 |
> |
"SimSetup Warning: using default value of 1/2 the smallest " |
817 |
> |
"box length for the electrostaticCutoffRadius.\n" |
818 |
> |
"I hope you have a very fast processor!\n"); |
819 |
> |
painCave.isFatal = 0; |
820 |
> |
simError(); |
821 |
> |
double smallest; |
822 |
> |
smallest = info->boxL[0]; |
823 |
> |
if (info->boxL[1] <= smallest) smallest = info->boxL[1]; |
824 |
> |
if (info->boxL[2] <= smallest) smallest = info->boxL[2]; |
825 |
> |
theEcr = 0.5 * smallest; |
826 |
|
} else { |
827 |
< |
info->ecr = globals->getECR(); |
827 |
> |
theEcr = globals->getECR(); |
828 |
|
} |
829 |
|
|
830 |
|
if( !globals->haveEST() ){ |
831 |
< |
sprintf( painCave.errMsg, |
832 |
< |
"SimSetup Warning: using default value of 5%% of the " |
833 |
< |
"electrostaticCutoffRadius for the " |
834 |
< |
"electrostaticSkinThickness\n" |
835 |
< |
); |
836 |
< |
painCave.isFatal = 0; |
837 |
< |
simError(); |
838 |
< |
info->est = 0.05 * info->ecr; |
831 |
> |
sprintf( painCave.errMsg, |
832 |
> |
"SimSetup Warning: using default value of 0.05 * the " |
833 |
> |
"electrostaticCutoffRadius for the " |
834 |
> |
"electrostaticSkinThickness\n" |
835 |
> |
); |
836 |
> |
painCave.isFatal = 0; |
837 |
> |
simError(); |
838 |
> |
theEst = 0.05 * theEcr; |
839 |
|
} else { |
840 |
< |
info->est = globals->getEST(); |
840 |
> |
theEst= globals->getEST(); |
841 |
|
} |
842 |
+ |
|
843 |
+ |
info->setEcr( theEcr, theEst ); |
844 |
|
} |
845 |
|
} |
846 |
|
|
863 |
|
#ifdef IS_MPI |
864 |
|
}else fileInit = new InitializeFromFile( NULL ); |
865 |
|
#endif |
866 |
< |
fileInit->read_xyz( info ); // default velocities on |
866 |
> |
fileInit->readInit( info ); // default velocities on |
867 |
|
|
868 |
|
delete fileInit; |
869 |
|
} |
1031 |
|
|
1032 |
|
case FF_LJ: |
1033 |
|
the_ff = new LJFF(); |
1034 |
+ |
break; |
1035 |
+ |
|
1036 |
+ |
case FF_EAM: |
1037 |
+ |
the_ff = new EAM_FF(); |
1038 |
|
break; |
1039 |
|
|
1040 |
|
default: |
1286 |
|
|
1287 |
|
void SimSetup::makeIntegrator( void ){ |
1288 |
|
|
1289 |
< |
NVT* myNVT = NULL; |
1290 |
< |
NPTi* myNPTi = NULL; |
1291 |
< |
NPTf* myNPTf = NULL; |
1292 |
< |
NPTim* myNPTim = NULL; |
1293 |
< |
NPTfm* myNPTfm = NULL; |
1289 |
> |
NVT<RealIntegrator>* myNVT = NULL; |
1290 |
> |
NPTi<RealIntegrator>* myNPTi = NULL; |
1291 |
> |
NPTf<RealIntegrator>* myNPTf = NULL; |
1292 |
> |
NPTim<RealIntegrator>* myNPTim = NULL; |
1293 |
> |
NPTfm<RealIntegrator>* myNPTfm = NULL; |
1294 |
|
|
1295 |
|
switch( ensembleCase ){ |
1296 |
|
|
1297 |
|
case NVE_ENS: |
1298 |
< |
new NVE( info, the_ff ); |
1298 |
> |
new NVE<RealIntegrator>( info, the_ff ); |
1299 |
|
break; |
1300 |
|
|
1301 |
|
case NVT_ENS: |
1302 |
< |
myNVT = new NVT( info, the_ff ); |
1302 |
> |
myNVT = new NVT<RealIntegrator>( info, the_ff ); |
1303 |
|
myNVT->setTargetTemp(globals->getTargetTemp()); |
1304 |
|
|
1305 |
|
if (globals->haveTauThermostat()) |
1315 |
|
break; |
1316 |
|
|
1317 |
|
case NPTi_ENS: |
1318 |
< |
myNPTi = new NPTi( info, the_ff ); |
1318 |
> |
myNPTi = new NPTi<RealIntegrator>( info, the_ff ); |
1319 |
|
myNPTi->setTargetTemp( globals->getTargetTemp() ); |
1320 |
|
|
1321 |
|
if (globals->haveTargetPressure()) |
1350 |
|
break; |
1351 |
|
|
1352 |
|
case NPTf_ENS: |
1353 |
< |
myNPTf = new NPTf( info, the_ff ); |
1353 |
> |
myNPTf = new NPTf<RealIntegrator>( info, the_ff ); |
1354 |
|
myNPTf->setTargetTemp( globals->getTargetTemp()); |
1355 |
|
|
1356 |
|
if (globals->haveTargetPressure()) |
1385 |
|
break; |
1386 |
|
|
1387 |
|
case NPTim_ENS: |
1388 |
< |
myNPTim = new NPTim( info, the_ff ); |
1388 |
> |
myNPTim = new NPTim<RealIntegrator>( info, the_ff ); |
1389 |
|
myNPTim->setTargetTemp( globals->getTargetTemp()); |
1390 |
|
|
1391 |
|
if (globals->haveTargetPressure()) |
1420 |
|
break; |
1421 |
|
|
1422 |
|
case NPTfm_ENS: |
1423 |
< |
myNPTfm = new NPTfm( info, the_ff ); |
1423 |
> |
myNPTfm = new NPTfm<RealIntegrator>( info, the_ff ); |
1424 |
|
myNPTfm->setTargetTemp( globals->getTargetTemp()); |
1425 |
|
|
1426 |
|
if (globals->haveTargetPressure()) |