| 14 | 
  | 
 | 
| 15 | 
  | 
// some defines for ensemble and Forcefield  cases | 
| 16 | 
  | 
 | 
| 17 | 
< | 
#define NVE_ENS 0 | 
| 18 | 
< | 
#define NVT_ENS 1 | 
| 19 | 
< | 
#define NPTi_ENS 2 | 
| 20 | 
< | 
#define NPTf_ENS 3 | 
| 17 | 
> | 
#define NVE_ENS   0  | 
| 18 | 
> | 
#define NVT_ENS   1 | 
| 19 | 
> | 
#define NPTi_ENS  2 | 
| 20 | 
> | 
#define NPTf_ENS  3 | 
| 21 | 
> | 
#define NPTim_ENS 4 | 
| 22 | 
> | 
#define NPTfm_ENS 5 | 
| 23 | 
  | 
 | 
| 24 | 
+ | 
 | 
| 25 | 
  | 
#define FF_DUFF 0 | 
| 26 | 
  | 
#define FF_LJ   1 | 
| 27 | 
  | 
 | 
| 119 | 
  | 
  else if( !strcasecmp( ensemble, "NPTi" ) || !strcasecmp( ensemble, "NPT") )  | 
| 120 | 
  | 
    ensembleCase = NPTi_ENS; | 
| 121 | 
  | 
  else if( !strcasecmp( ensemble, "NPTf" )) ensembleCase = NPTf_ENS; | 
| 122 | 
+ | 
  else if( !strcasecmp( ensemble, "NPTim" )) ensembleCase = NPTim_ENS; | 
| 123 | 
+ | 
  else if( !strcasecmp( ensemble, "NPTfm" )) ensembleCase = NPTfm_ENS; | 
| 124 | 
  | 
  else{ | 
| 125 | 
  | 
    sprintf( painCave.errMsg, | 
| 126 | 
  | 
             "SimSetup Warning. Unrecognized Ensemble -> %s, " | 
| 784 | 
  | 
  // make the integrator | 
| 785 | 
  | 
   | 
| 786 | 
  | 
   | 
| 787 | 
< | 
  NVT* myNVT = NULL; | 
| 787 | 
> | 
  NVT*  myNVT = NULL; | 
| 788 | 
> | 
  NPTi* myNPTi = NULL; | 
| 789 | 
> | 
  NPTf* myNPTf = NULL; | 
| 790 | 
> | 
  NPTim* myNPTim = NULL; | 
| 791 | 
> | 
  NPTfm* myNPTfm = NULL; | 
| 792 | 
> | 
 | 
| 793 | 
  | 
  switch( ensembleCase ){ | 
| 794 | 
  | 
 | 
| 795 | 
  | 
  case NVE_ENS: | 
| 802 | 
  | 
 | 
| 803 | 
  | 
    if (the_globals->haveTauThermostat())  | 
| 804 | 
  | 
      myNVT->setTauThermostat(the_globals->getTauThermostat()); | 
| 805 | 
< | 
//     else if (the_globals->haveQmass()) | 
| 796 | 
< | 
//       myNVT->setQmass(the_globals->getQmass()); | 
| 805 | 
> | 
 | 
| 806 | 
  | 
    else { | 
| 807 | 
  | 
      sprintf( painCave.errMsg, | 
| 808 | 
  | 
               "SimSetup error: If you use the NVT\n" | 
| 809 | 
< | 
               "    ensemble, you must set either tauThermostat or qMass.\n" | 
| 810 | 
< | 
               "    Neither of these was found in the BASS file.\n"); | 
| 809 | 
> | 
               "    ensemble, you must set tauThermostat.\n"); | 
| 810 | 
> | 
      painCave.isFatal = 1; | 
| 811 | 
> | 
      simError(); | 
| 812 | 
> | 
    } | 
| 813 | 
> | 
    break; | 
| 814 | 
> | 
 | 
| 815 | 
> | 
  case NPTi_ENS: | 
| 816 | 
> | 
    myNPTi = new NPTi( simnfo, the_ff ); | 
| 817 | 
> | 
    myNPTi->setTargetTemp( the_globals->getTargetTemp()); | 
| 818 | 
> | 
 | 
| 819 | 
> | 
    if (the_globals->haveTargetPressure()) | 
| 820 | 
> | 
      myNPTi->setTargetPressure(the_globals->getTargetPressure()); | 
| 821 | 
> | 
    else { | 
| 822 | 
> | 
      sprintf( painCave.errMsg, | 
| 823 | 
> | 
               "SimSetup error: If you use a constant pressure\n" | 
| 824 | 
> | 
               "    ensemble, you must set targetPressure in the BASS file.\n"); | 
| 825 | 
> | 
      painCave.isFatal = 1; | 
| 826 | 
> | 
      simError(); | 
| 827 | 
> | 
    } | 
| 828 | 
> | 
     | 
| 829 | 
> | 
    if( the_globals->haveTauThermostat() ) | 
| 830 | 
> | 
      myNPTi->setTauThermostat( the_globals->getTauThermostat() ); | 
| 831 | 
> | 
    else{ | 
| 832 | 
> | 
      sprintf( painCave.errMsg, | 
| 833 | 
> | 
               "SimSetup error: If you use an NPT\n" | 
| 834 | 
> | 
               "    ensemble, you must set tauThermostat.\n"); | 
| 835 | 
> | 
      painCave.isFatal = 1; | 
| 836 | 
> | 
      simError(); | 
| 837 | 
> | 
    } | 
| 838 | 
> | 
 | 
| 839 | 
> | 
    if( the_globals->haveTauBarostat() ) | 
| 840 | 
> | 
      myNPTi->setTauBarostat( the_globals->getTauBarostat() ); | 
| 841 | 
> | 
    else{ | 
| 842 | 
> | 
      sprintf( painCave.errMsg, | 
| 843 | 
> | 
               "SimSetup error: If you use an NPT\n" | 
| 844 | 
> | 
               "    ensemble, you must set tauBarostat.\n"); | 
| 845 | 
> | 
      painCave.isFatal = 1; | 
| 846 | 
> | 
      simError(); | 
| 847 | 
> | 
    } | 
| 848 | 
> | 
    break; | 
| 849 | 
> | 
 | 
| 850 | 
> | 
  case NPTf_ENS: | 
| 851 | 
> | 
    myNPTf = new NPTf( simnfo, the_ff ); | 
| 852 | 
> | 
    myNPTf->setTargetTemp( the_globals->getTargetTemp()); | 
| 853 | 
> | 
 | 
| 854 | 
> | 
    if (the_globals->haveTargetPressure()) | 
| 855 | 
> | 
      myNPTf->setTargetPressure(the_globals->getTargetPressure()); | 
| 856 | 
> | 
    else { | 
| 857 | 
> | 
      sprintf( painCave.errMsg, | 
| 858 | 
> | 
               "SimSetup error: If you use a constant pressure\n" | 
| 859 | 
> | 
               "    ensemble, you must set targetPressure in the BASS file.\n"); | 
| 860 | 
> | 
      painCave.isFatal = 1; | 
| 861 | 
> | 
      simError(); | 
| 862 | 
> | 
    }     | 
| 863 | 
> | 
 | 
| 864 | 
> | 
    if( the_globals->haveTauThermostat() ) | 
| 865 | 
> | 
      myNPTf->setTauThermostat( the_globals->getTauThermostat() ); | 
| 866 | 
> | 
    else{ | 
| 867 | 
> | 
      sprintf( painCave.errMsg, | 
| 868 | 
> | 
               "SimSetup error: If you use an NPT\n" | 
| 869 | 
> | 
               "    ensemble, you must set tauThermostat.\n"); | 
| 870 | 
> | 
      painCave.isFatal = 1; | 
| 871 | 
> | 
      simError(); | 
| 872 | 
> | 
    } | 
| 873 | 
> | 
 | 
| 874 | 
> | 
    if( the_globals->haveTauBarostat() ) | 
| 875 | 
> | 
      myNPTf->setTauBarostat( the_globals->getTauBarostat() ); | 
| 876 | 
> | 
    else{ | 
| 877 | 
> | 
      sprintf( painCave.errMsg, | 
| 878 | 
> | 
               "SimSetup error: If you use an NPT\n" | 
| 879 | 
> | 
               "    ensemble, you must set tauBarostat.\n"); | 
| 880 | 
> | 
      painCave.isFatal = 1; | 
| 881 | 
> | 
      simError(); | 
| 882 | 
> | 
    } | 
| 883 | 
> | 
    break; | 
| 884 | 
> | 
     | 
| 885 | 
> | 
  case NPTim_ENS: | 
| 886 | 
> | 
    myNPTim = new NPTim( simnfo, the_ff ); | 
| 887 | 
> | 
    myNPTim->setTargetTemp( the_globals->getTargetTemp()); | 
| 888 | 
> | 
 | 
| 889 | 
> | 
    if (the_globals->haveTargetPressure()) | 
| 890 | 
> | 
      myNPTim->setTargetPressure(the_globals->getTargetPressure()); | 
| 891 | 
> | 
    else { | 
| 892 | 
> | 
      sprintf( painCave.errMsg, | 
| 893 | 
> | 
               "SimSetup error: If you use a constant pressure\n" | 
| 894 | 
> | 
               "    ensemble, you must set targetPressure in the BASS file.\n"); | 
| 895 | 
> | 
      painCave.isFatal = 1; | 
| 896 | 
> | 
      simError(); | 
| 897 | 
> | 
    } | 
| 898 | 
> | 
     | 
| 899 | 
> | 
    if( the_globals->haveTauThermostat() ) | 
| 900 | 
> | 
      myNPTim->setTauThermostat( the_globals->getTauThermostat() ); | 
| 901 | 
> | 
    else{ | 
| 902 | 
> | 
      sprintf( painCave.errMsg, | 
| 903 | 
> | 
               "SimSetup error: If you use an NPT\n" | 
| 904 | 
> | 
               "    ensemble, you must set tauThermostat.\n"); | 
| 905 | 
> | 
      painCave.isFatal = 1; | 
| 906 | 
> | 
      simError(); | 
| 907 | 
> | 
    } | 
| 908 | 
> | 
 | 
| 909 | 
> | 
    if( the_globals->haveTauBarostat() ) | 
| 910 | 
> | 
      myNPTim->setTauBarostat( the_globals->getTauBarostat() ); | 
| 911 | 
> | 
    else{ | 
| 912 | 
> | 
      sprintf( painCave.errMsg, | 
| 913 | 
> | 
               "SimSetup error: If you use an NPT\n" | 
| 914 | 
> | 
               "    ensemble, you must set tauBarostat.\n"); | 
| 915 | 
> | 
      painCave.isFatal = 1; | 
| 916 | 
> | 
      simError(); | 
| 917 | 
> | 
    } | 
| 918 | 
> | 
    break; | 
| 919 | 
> | 
 | 
| 920 | 
> | 
  case NPTfm_ENS: | 
| 921 | 
> | 
    myNPTfm = new NPTfm( simnfo, the_ff ); | 
| 922 | 
> | 
    myNPTfm->setTargetTemp( the_globals->getTargetTemp()); | 
| 923 | 
> | 
 | 
| 924 | 
> | 
    if (the_globals->haveTargetPressure()) | 
| 925 | 
> | 
      myNPTfm->setTargetPressure(the_globals->getTargetPressure()); | 
| 926 | 
> | 
    else { | 
| 927 | 
> | 
      sprintf( painCave.errMsg, | 
| 928 | 
> | 
               "SimSetup error: If you use a constant pressure\n" | 
| 929 | 
> | 
               "    ensemble, you must set targetPressure in the BASS file.\n"); | 
| 930 | 
> | 
      painCave.isFatal = 1; | 
| 931 | 
> | 
      simError(); | 
| 932 | 
> | 
    } | 
| 933 | 
> | 
     | 
| 934 | 
> | 
    if( the_globals->haveTauThermostat() ) | 
| 935 | 
> | 
      myNPTfm->setTauThermostat( the_globals->getTauThermostat() ); | 
| 936 | 
> | 
    else{ | 
| 937 | 
> | 
      sprintf( painCave.errMsg, | 
| 938 | 
> | 
               "SimSetup error: If you use an NPT\n" | 
| 939 | 
> | 
               "    ensemble, you must set tauThermostat.\n"); | 
| 940 | 
  | 
      painCave.isFatal = 1; | 
| 941 | 
  | 
      simError(); | 
| 942 | 
  | 
    } | 
| 943 | 
+ | 
 | 
| 944 | 
+ | 
    if( the_globals->haveTauBarostat() ) | 
| 945 | 
+ | 
      myNPTfm->setTauBarostat( the_globals->getTauBarostat() ); | 
| 946 | 
+ | 
    else{ | 
| 947 | 
+ | 
      sprintf( painCave.errMsg, | 
| 948 | 
+ | 
               "SimSetup error: If you use an NPT\n" | 
| 949 | 
+ | 
               "    ensemble, you must set tauBarostat.\n"); | 
| 950 | 
+ | 
      painCave.isFatal = 1; | 
| 951 | 
+ | 
      simError(); | 
| 952 | 
+ | 
    } | 
| 953 | 
  | 
    break; | 
| 954 | 
  | 
 | 
| 955 | 
  | 
  default: |