# | Line 9 | Line 9 | |
---|---|---|
9 | #include "parse_me.h" | |
10 | #include "Integrator.hpp" | |
11 | #include "simError.h" | |
12 | + | //#include "ConjugateMinimizer.hpp" |
13 | + | #include "OOPSEMinimizer.hpp" |
14 | ||
15 | #ifdef IS_MPI | |
16 | #include "mpiBASS.h" | |
# | Line 27 | Line 29 | |
29 | #define FF_DUFF 0 | |
30 | #define FF_LJ 1 | |
31 | #define FF_EAM 2 | |
32 | < | #define FF_H2O 3 |
32 | > | #define FF_H2O 3 |
33 | ||
34 | using namespace std; | |
35 | ||
# | Line 145 | Line 147 | void SimSetup::createSim(void){ | |
147 | ||
148 | makeOutNames(); | |
149 | ||
150 | < | // make the integrator |
151 | < | |
152 | < | makeIntegrator(); |
153 | < | |
150 | > | if (globals->haveMinimizer()) |
151 | > | // make minimizer |
152 | > | makeMinimizer(); |
153 | > | else |
154 | > | // make the integrator |
155 | > | makeIntegrator(); |
156 | > | |
157 | #ifdef IS_MPI | |
158 | mpiSim->mpiRefresh(); | |
159 | #endif | |
# | Line 841 | Line 846 | void SimSetup::gatherInfo(void){ | |
846 | for (int i = 0; i < nInfo; i++){ | |
847 | info[i].setSeed(seedValue); | |
848 | } | |
849 | < | |
849 | > | |
850 | #ifdef IS_MPI | |
851 | strcpy(checkPointMsg, "Successfully gathered all information from Bass\n"); | |
852 | MPIcheckPoint(); | |
# | Line 1706 | Line 1711 | void SimSetup::setupZConstraint(SimInfo& theInfo){ | |
1711 | //push data into siminfo, therefore, we can retrieve later | |
1712 | theInfo.addProperty(zconsParaData); | |
1713 | } | |
1714 | + | |
1715 | + | void SimSetup::makeMinimizer(){ |
1716 | + | |
1717 | + | OOPSEMinimizer* myOOPSEMinimizer; |
1718 | + | MinimizerParameterSet* param; |
1719 | + | char minimizerName[100]; |
1720 | + | |
1721 | + | for (int i = 0; i < nInfo; i++){ |
1722 | + | |
1723 | + | //prepare parameter set for minimizer |
1724 | + | param = new MinimizerParameterSet(); |
1725 | + | param->setDefaultParameter(); |
1726 | + | |
1727 | + | if (globals->haveMinimizer()){ |
1728 | + | param->setFTol(globals->getMinFTol()); |
1729 | + | } |
1730 | + | |
1731 | + | if (globals->haveMinGTol()){ |
1732 | + | param->setGTol(globals->getMinGTol()); |
1733 | + | } |
1734 | + | |
1735 | + | if (globals->haveMinMaxIter()){ |
1736 | + | param->setMaxIteration(globals->getMinMaxIter()); |
1737 | + | } |
1738 | + | |
1739 | + | if (globals->haveMinWriteFrq()){ |
1740 | + | param->setMaxIteration(globals->getMinMaxIter()); |
1741 | + | } |
1742 | + | |
1743 | + | if (globals->haveMinWriteFrq()){ |
1744 | + | param->setWriteFrq(globals->getMinWriteFrq()); |
1745 | + | } |
1746 | + | |
1747 | + | if (globals->haveMinStepSize()){ |
1748 | + | param->setStepSize(globals->getMinStepSize()); |
1749 | + | } |
1750 | + | |
1751 | + | if (globals->haveMinLSMaxIter()){ |
1752 | + | param->setLineSearchMaxIteration(globals->getMinLSMaxIter()); |
1753 | + | } |
1754 | + | |
1755 | + | if (globals->haveMinLSTol()){ |
1756 | + | param->setLineSearchTol(globals->getMinLSTol()); |
1757 | + | } |
1758 | + | |
1759 | + | strcpy(ensemble, globals->getMinimizer()); |
1760 | + | |
1761 | + | if (!strcasecmp(minimizerName, "CG")){ |
1762 | + | myOOPSEMinimizer = new PRCGMinimizer(&(info[i]), the_ff, param); |
1763 | + | } |
1764 | + | else if (!strcasecmp(minimizerName, "SD")){ |
1765 | + | //myOOPSEMinimizer = MinimizerFactory.creatMinimizer("", &(info[i]), the_ff, param); |
1766 | + | myOOPSEMinimizer = new SDMinimizer(&(info[i]), the_ff, param); |
1767 | + | } |
1768 | + | else{ |
1769 | + | info[i].the_integrator = myOOPSEMinimizer; |
1770 | + | } |
1771 | + | |
1772 | + | //store the minimizer into simInfo |
1773 | + | info[i].the_minimizer = myOOPSEMinimizer; |
1774 | + | info[i].has_minimizer = true; |
1775 | + | } |
1776 | + | |
1777 | + | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |