| 4 |
|
#include <math.h> |
| 5 |
|
#include <string> |
| 6 |
|
#include <sprng.h> |
| 7 |
< |
#include "SimSetup.hpp" |
| 8 |
< |
#include "ReadWrite.hpp" |
| 9 |
< |
#include "parse_me.h" |
| 10 |
< |
#include "Integrator.hpp" |
| 11 |
< |
#include "simError.h" |
| 12 |
< |
#include "RigidBody.hpp" |
| 13 |
< |
#include "OOPSEMinimizer.hpp" |
| 7 |
> |
#include "brains/SimSetup.hpp" |
| 8 |
> |
#include "io/ReadWrite.hpp" |
| 9 |
> |
#include "io/parse_me.h" |
| 10 |
> |
#include "integrators/Integrator.hpp" |
| 11 |
> |
#include "utils/simError.h" |
| 12 |
> |
#include "primitives/RigidBody.hpp" |
| 13 |
> |
#include "minimizers/OOPSEMinimizer.hpp" |
| 14 |
|
|
| 15 |
|
#ifdef IS_MPI |
| 16 |
< |
#include "mpiBASS.h" |
| 17 |
< |
#include "mpiSimulation.hpp" |
| 16 |
> |
#include "io/mpiBASS.h" |
| 17 |
> |
#include "brains/mpiSimulation.hpp" |
| 18 |
|
#endif |
| 19 |
|
|
| 20 |
|
// some defines for ensemble and Forcefield cases |
| 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; |
| 37 |
|
|
| 38 |
|
/** |
| 39 |
|
* Check whether dividend is divisble by divisor or not |
| 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()); |
| 913 |
|
} |
| 914 |
|
|
| 915 |
|
for (i = 0; i < nInfo; i++) { |
| 911 |
– |
// get the mixing rule |
| 912 |
– |
|
| 913 |
– |
strcpy(info[i].mixingRule, globals->getMixingRule()); |
| 916 |
|
info[i].usePBC = globals->getPBC(); |
| 917 |
|
} |
| 918 |
|
|
| 1261 |
|
|
| 1262 |
|
case FF_H2O: |
| 1263 |
|
the_ff = new WATER(); |
| 1264 |
+ |
break; |
| 1265 |
+ |
|
| 1266 |
+ |
case FF_SHAPES: |
| 1267 |
+ |
the_ff = new Shapes_FF(); |
| 1268 |
|
break; |
| 1269 |
|
|
| 1270 |
|
default: |
| 1770 |
|
void SimSetup::initFortran(void){ |
| 1771 |
|
info[0].refreshSim(); |
| 1772 |
|
|
| 1773 |
< |
if (!strcmp(info[0].mixingRule, "standard")){ |
| 1768 |
< |
the_ff->initForceField(LB_MIXING_RULE); |
| 1769 |
< |
} |
| 1770 |
< |
else if (!strcmp(info[0].mixingRule, "explicit")){ |
| 1771 |
< |
the_ff->initForceField(EXPLICIT_MIXING_RULE); |
| 1772 |
< |
} |
| 1773 |
< |
else{ |
| 1774 |
< |
sprintf(painCave.errMsg, "SimSetup Error: unknown mixing rule -> \"%s\"\n", |
| 1775 |
< |
info[0].mixingRule); |
| 1776 |
< |
painCave.isFatal = 1; |
| 1777 |
< |
simError(); |
| 1778 |
< |
} |
| 1779 |
< |
|
| 1773 |
> |
the_ff->initForceField(); |
| 1774 |
|
|
| 1775 |
|
#ifdef IS_MPI |
| 1776 |
< |
strcpy(checkPointMsg, "Successfully intialized the mixingRule for Fortran."); |
| 1776 |
> |
strcpy(checkPointMsg, "Successfully intialized the fortran portion of the force field."); |
| 1777 |
|
MPIcheckPoint(); |
| 1778 |
|
#endif // is_mpi |
| 1779 |
|
} |
| 1784 |
|
|
| 1785 |
|
if (globals->haveZconstraintTime()){ |
| 1786 |
|
//add sample time of z-constraint into SimInfo's property list |
| 1787 |
< |
DoubleData* zconsTimeProp = new DoubleData(); |
| 1787 |
> |
DoubleGenericData* zconsTimeProp = new DoubleGenericData(); |
| 1788 |
|
zconsTimeProp->setID(ZCONSTIME_ID); |
| 1789 |
|
zconsTimeProp->setData(globals->getZconsTime()); |
| 1790 |
|
theInfo.addProperty(zconsTimeProp); |
| 1799 |
|
|
| 1800 |
|
//push zconsTol into siminfo, if user does not specify |
| 1801 |
|
//value for zconsTol, a default value will be used |
| 1802 |
< |
DoubleData* zconsTol = new DoubleData(); |
| 1802 |
> |
DoubleGenericData* zconsTol = new DoubleGenericData(); |
| 1803 |
|
zconsTol->setID(ZCONSTOL_ID); |
| 1804 |
|
if (globals->haveZconsTol()){ |
| 1805 |
|
zconsTol->setData(globals->getZconsTol()); |
| 1819 |
|
theInfo.addProperty(zconsTol); |
| 1820 |
|
|
| 1821 |
|
//set Force Subtraction Policy |
| 1822 |
< |
StringData* zconsForcePolicy = new StringData(); |
| 1822 |
> |
StringGenericData* zconsForcePolicy = new StringGenericData(); |
| 1823 |
|
zconsForcePolicy->setID(ZCONSFORCEPOLICY_ID); |
| 1824 |
|
|
| 1825 |
|
if (globals->haveZconsForcePolicy()){ |
| 1838 |
|
theInfo.addProperty(zconsForcePolicy); |
| 1839 |
|
|
| 1840 |
|
//set zcons gap |
| 1841 |
< |
DoubleData* zconsGap = new DoubleData(); |
| 1841 |
> |
DoubleGenericData* zconsGap = new DoubleGenericData(); |
| 1842 |
|
zconsGap->setID(ZCONSGAP_ID); |
| 1843 |
|
|
| 1844 |
|
if (globals->haveZConsGap()){ |
| 1847 |
|
} |
| 1848 |
|
|
| 1849 |
|
//set zcons fixtime |
| 1850 |
< |
DoubleData* zconsFixtime = new DoubleData(); |
| 1850 |
> |
DoubleGenericData* zconsFixtime = new DoubleGenericData(); |
| 1851 |
|
zconsFixtime->setID(ZCONSFIXTIME_ID); |
| 1852 |
|
|
| 1853 |
|
if (globals->haveZConsFixTime()){ |
| 1856 |
|
} |
| 1857 |
|
|
| 1858 |
|
//set zconsUsingSMD |
| 1859 |
< |
IntData* zconsUsingSMD = new IntData(); |
| 1859 |
> |
IntGenericData* zconsUsingSMD = new IntGenericData(); |
| 1860 |
|
zconsUsingSMD->setID(ZCONSUSINGSMD_ID); |
| 1861 |
|
|
| 1862 |
|
if (globals->haveZConsUsingSMD()){ |
| 1872 |
|
|
| 1873 |
|
zconsOutput = zconsOutput.substr(0, zconsOutput.rfind(".")) + ".fz"; |
| 1874 |
|
|
| 1875 |
< |
StringData* zconsFilename = new StringData(); |
| 1875 |
> |
StringGenericData* zconsFilename = new StringGenericData(); |
| 1876 |
|
zconsFilename->setID(ZCONSFILENAME_ID); |
| 1877 |
|
zconsFilename->setData(zconsOutput); |
| 1878 |
|
|