ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/brains/SimSetup.cpp
(Generate patch)

Comparing trunk/src/brains/SimSetup.cpp (file contents):
Revision 121 by gezelter, Wed Oct 20 04:55:21 2004 UTC vs.
Revision 221 by chrisfen, Tue Nov 23 22:48:31 2004 UTC

# Line 26 | Line 26
26   #define NPTxyz_ENS     4
27  
28  
29 < #define FF_DUFF  0
30 < #define FF_LJ    1
31 < #define FF_EAM   2
32 < #define FF_H2O   3
29 > #define FF_DUFF   0
30 > #define FF_LJ     1
31 > #define FF_EAM    2
32 > #define FF_H2O    3
33 > #define FF_SHAPES 4
34  
35   using namespace std;
36   using namespace oopse;
# Line 714 | Line 715 | void SimSetup::gatherInfo(void){
715    }
716    else if (!strcasecmp(force_field, "WATER")){
717      ffCase = FF_H2O;
718 +  }
719 +  else if (!strcasecmp(force_field, "SHAPES")){
720 +    ffCase = FF_SHAPES;
721    }
722    else{
723      sprintf(painCave.errMsg, "SimSetup Error. Unrecognized force field -> %s\n",
724              force_field);
725 <         painCave.isFatal = 1;
726 <         simError();
725 >    painCave.isFatal = 1;
726 >    simError();
727    }
728    if (globals->haveForceFieldVariant()) {
729 <    strcpy(forcefield_variant, globals->getForceFieldVariant());
729 >    forcefield_variant = globals->getForceFieldVariant();
730      has_forcefield_variant = 1;
731    }
732    
# Line 909 | Line 913 | void SimSetup::gatherInfo(void){
913    }
914    
915    for (i = 0; i < nInfo; i++) {
912    // get the mixing rule
913    
914    strcpy(info[i].mixingRule, globals->getMixingRule());
916      info[i].usePBC = globals->getPBC();
917    }
918    
# Line 1194 | Line 1195 | void SimSetup::makeOutNames(void){
1195        info[k].finalName = prefix + ".eor";      
1196        info[k].sampleName = prefix + ".dump";
1197        info[k].statusName = prefix + ".stat";
1198 +      
1199 +      if (info[k].useSolidThermInt && !info[k].useLiquidThermInt)
1200 +        info[k].zAngleName = prefix + ".ang";
1201  
1202   #ifdef IS_MPI
1203  
# Line 1260 | Line 1264 | void SimSetup::createFF(void){
1264  
1265      case FF_H2O:
1266        the_ff = new WATER();
1267 +      break;
1268 +
1269 +    case FF_SHAPES:
1270 +      the_ff = new Shapes_FF();
1271        break;
1272  
1273      default:
# Line 1765 | Line 1773 | void SimSetup::initFortran(void){
1773   void SimSetup::initFortran(void){
1774    info[0].refreshSim();
1775  
1776 <  if (!strcmp(info[0].mixingRule, "standard")){
1769 <    the_ff->initForceField(LB_MIXING_RULE);
1770 <  }
1771 <  else if (!strcmp(info[0].mixingRule, "explicit")){
1772 <    the_ff->initForceField(EXPLICIT_MIXING_RULE);
1773 <  }
1774 <  else{
1775 <    sprintf(painCave.errMsg, "SimSetup Error: unknown mixing rule -> \"%s\"\n",
1776 <            info[0].mixingRule);
1777 <    painCave.isFatal = 1;
1778 <    simError();
1779 <  }
1776 >  the_ff->initForceField();
1777  
1781
1778   #ifdef IS_MPI
1779 <  strcpy(checkPointMsg, "Successfully intialized the mixingRule for Fortran.");
1779 >  strcpy(checkPointMsg, "Successfully intialized the fortran portion of the force field.");
1780    MPIcheckPoint();
1781   #endif // is_mpi
1782   }
# Line 1791 | Line 1787 | void SimSetup::setupZConstraint(SimInfo& theInfo){
1787  
1788    if (globals->haveZconstraintTime()){
1789      //add sample time of z-constraint  into SimInfo's property list                    
1790 <    DoubleData* zconsTimeProp = new DoubleData();
1790 >    DoubleGenericData* zconsTimeProp = new DoubleGenericData();
1791      zconsTimeProp->setID(ZCONSTIME_ID);
1792      zconsTimeProp->setData(globals->getZconsTime());
1793      theInfo.addProperty(zconsTimeProp);
# Line 1806 | Line 1802 | void SimSetup::setupZConstraint(SimInfo& theInfo){
1802  
1803    //push zconsTol into siminfo, if user does not specify
1804    //value for zconsTol, a default value will be used
1805 <  DoubleData* zconsTol = new DoubleData();
1805 >  DoubleGenericData* zconsTol = new DoubleGenericData();
1806    zconsTol->setID(ZCONSTOL_ID);
1807    if (globals->haveZconsTol()){
1808      zconsTol->setData(globals->getZconsTol());
# Line 1826 | Line 1822 | void SimSetup::setupZConstraint(SimInfo& theInfo){
1822    theInfo.addProperty(zconsTol);
1823  
1824    //set Force Subtraction Policy
1825 <  StringData* zconsForcePolicy = new StringData();
1825 >  StringGenericData* zconsForcePolicy = new StringGenericData();
1826    zconsForcePolicy->setID(ZCONSFORCEPOLICY_ID);
1827  
1828    if (globals->haveZconsForcePolicy()){
# Line 1845 | Line 1841 | void SimSetup::setupZConstraint(SimInfo& theInfo){
1841    theInfo.addProperty(zconsForcePolicy);
1842  
1843    //set zcons gap
1844 <  DoubleData* zconsGap = new DoubleData();
1844 >  DoubleGenericData* zconsGap = new DoubleGenericData();
1845    zconsGap->setID(ZCONSGAP_ID);
1846  
1847    if (globals->haveZConsGap()){
# Line 1854 | Line 1850 | void SimSetup::setupZConstraint(SimInfo& theInfo){
1850    }
1851  
1852    //set zcons fixtime
1853 <  DoubleData* zconsFixtime = new DoubleData();
1853 >  DoubleGenericData* zconsFixtime = new DoubleGenericData();
1854    zconsFixtime->setID(ZCONSFIXTIME_ID);
1855  
1856    if (globals->haveZConsFixTime()){
# Line 1863 | Line 1859 | void SimSetup::setupZConstraint(SimInfo& theInfo){
1859    }
1860  
1861    //set zconsUsingSMD
1862 <  IntData* zconsUsingSMD = new IntData();
1862 >  IntGenericData* zconsUsingSMD = new IntGenericData();
1863    zconsUsingSMD->setID(ZCONSUSINGSMD_ID);
1864  
1865    if (globals->haveZConsUsingSMD()){
# Line 1879 | Line 1875 | void SimSetup::setupZConstraint(SimInfo& theInfo){
1875  
1876    zconsOutput = zconsOutput.substr(0, zconsOutput.rfind(".")) + ".fz";
1877  
1878 <  StringData* zconsFilename = new StringData();
1878 >  StringGenericData* zconsFilename = new StringGenericData();
1879    zconsFilename->setID(ZCONSFILENAME_ID);
1880    zconsFilename->setData(zconsOutput);
1881  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines