97 |
|
n_components = the_globals->getNComponents(); |
98 |
|
strcpy( force_field, the_globals->getForceField() ); |
99 |
|
|
100 |
< |
if( !strcasecmp( force_field, "DUFF" )) ffCase = FF_DUFF; |
100 |
> |
if( !strcasecmp( force_field, "DUFF" )) ffCase = FF_DUFF; |
101 |
|
else if( !strcasecmp( force_field, "LJ" )) ffCase = FF_LJ; |
102 |
|
else{ |
103 |
|
sprintf( painCave.errMsg, |
110 |
|
// get the ensemble: |
111 |
|
strcpy( ensemble, the_globals->getEnsemble() ); |
112 |
|
|
113 |
< |
if( !strcasecmp( ensemble, "NVE" )) ffCase = NVE_ENS; |
114 |
< |
else if( !strcasecmp( ensemble, "NVT" )) ffCase = NVT_ENS; |
115 |
< |
else if( !strcasecmp( ensemble, "NPT" )) ffCase = NPT_ENS; |
113 |
> |
if( !strcasecmp( ensemble, "NVE" )) ensembleCase = NVE_ENS; |
114 |
> |
else if( !strcasecmp( ensemble, "NVT" )) ensembleCase = NVT_ENS; |
115 |
> |
else if( !strcasecmp( ensemble, "NPT" )) ensembleCase = NPT_ENS; |
116 |
|
else{ |
117 |
|
sprintf( painCave.errMsg, |
118 |
|
"SimSetup Warning. Unrecognized Ensemble -> %s, " |
193 |
|
break; |
194 |
|
|
195 |
|
case FF_LJ: |
196 |
< |
the_ff = LJFF(); |
196 |
> |
the_ff = new LJFF(); |
197 |
|
break; |
198 |
|
|
199 |
|
default: |
768 |
|
|
769 |
|
|
770 |
|
// make the integrator |
771 |
+ |
|
772 |
+ |
|
773 |
+ |
NVT* myNVT = NULL; |
774 |
+ |
switch( ensembleCase ){ |
775 |
|
|
776 |
+ |
case NVE_ENS: |
777 |
+ |
new NVE( simnfo, the_ff ); |
778 |
+ |
break; |
779 |
|
|
780 |
< |
if( !strcmp( ensemble, "TraPPE_Ex" ) ){ |
781 |
< |
new Symplectic(simnfo, the_ff, the_extendedsystem); |
782 |
< |
} |
783 |
< |
else if( !strcmp( force_field, "LJ" ) ){ |
784 |
< |
new Verlet( *simnfo, the_ff, the_extendedsystem ); |
780 |
> |
case NVT_ENS: |
781 |
> |
myNVT = new NVT( simnfo, the_ff ); |
782 |
> |
myNVT->setTargetTemp(the_globals->getTargetTemp()); |
783 |
> |
|
784 |
> |
if (the_globals->haveTauThermostat()) |
785 |
> |
myNVT->setTauThermostat(the_globals->getTauThermostat()); |
786 |
> |
else if (the_globals->haveQmass()) |
787 |
> |
myNVT->setQmass(the_globals->getQmass()); |
788 |
> |
else { |
789 |
> |
sprintf( painCave.errMsg, |
790 |
> |
"SimSetup error: If you use the NVT\n" |
791 |
> |
" ensemble, you must set either tauThermostat or qMass.\n" |
792 |
> |
" Neither of these was found in the BASS file.\n"); |
793 |
> |
painCave.isFatal = 1; |
794 |
> |
simError(); |
795 |
> |
} |
796 |
> |
break; |
797 |
> |
|
798 |
> |
default: |
799 |
> |
sprintf( painCave.errMsg, |
800 |
> |
"SimSetup Error. Unrecognized ensemble in case statement.\n"); |
801 |
> |
painCave.isFatal = 1; |
802 |
> |
simError(); |
803 |
|
} |
804 |
|
|
805 |
+ |
|
806 |
|
#ifdef IS_MPI |
807 |
|
mpiSim->mpiRefresh(); |
808 |
|
#endif |