ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/applications/oopse/oopse.cpp
Revision: 1889
Committed: Wed Dec 15 19:40:16 2004 UTC (21 years, 5 months ago) by tim
File size: 4344 byte(s)
Log Message:
add more force fields

File Contents

# User Rev Content
1 tim 1501
2     #ifdef IS_MPI
3     #include <mpi.h>
4     #endif
5    
6     #include "utils/simError.h"
7 tim 1775 #include "brains/SimCreator.hpp"
8 tim 1501 #include "brains/SimInfo.hpp"
9 tim 1775 #include "integrators/IntegratorFactory.hpp"
10 tim 1843 #include "integrators/IntegratorCreator.hpp"
11 tim 1822 #include "integrators/Integrator.hpp"
12 tim 1843 #include "integrators/NVE.hpp"
13 tim 1852 #include "integrators/NVT.hpp"
14     #include "integrators/NPTi.hpp"
15     #include "integrators/NPTf.hpp"
16     #include "integrators/NPTxyz.hpp"
17 tim 1837 #include "UseTheForce/DUFF.hpp"
18 tim 1843 #include "UseTheForce/ForceFieldCreator.hpp"
19    
20 tim 1822 using namespace oopse;
21 tim 1501
22     int main(int argc,char* argv[]){
23    
24     // first things first, all of the initializations
25    
26     #ifdef IS_MPI
27     MPI_Init( &argc, &argv ); // the MPI communicators
28     #endif
29    
30     initSimError(); // the error handler
31     srand48( 1337 ); // the random number generator.
32    
33     #ifdef IS_MPI
34     if( worldRank == 0 ){
35     #endif
36     std::cerr <<
37     " +----------------------------------------------------------------------+\n" <<
38     " | ____ ____ ____ _____ ______ The OpenSource, Object-oriented |\n" <<
39     " | / __ \\/ __ \\/ __ \\/ ___// ____/ Parallel Simulation Engine. |\n" <<
40     " | / / / / / / / /_/ /\\__ \\/ __/ |\n" <<
41     " | / /_/ / /_/ / ____/___/ / /___ Copyright 2004 by the |\n" <<
42     " | \\____/\\____/_/ /____/_____/ University of Notre Dame. |\n" <<
43     " | http://www.oopse.org |\n" <<
44     " | |\n" <<
45     " | OOPSE is an OpenScience project. All source code is available for |\n" <<
46     " | any use subject to only one condition: |\n" <<
47     " | |\n" <<
48     " | Any published work resulting from the use of this code must cite the |\n" <<
49     " | following paper: M. A. Meineke, C. F. Vardeman II, T. Lin, |\n" <<
50     " | C. J. Fennell, and J. D. Gezelter, |\n" <<
51     " | J. Comp. Chem. XX, XXXX (2004). |\n" <<
52     " +----------------------------------------------------------------------+\n" <<
53     "\n";
54    
55     if( argc < 2 ){
56     strcpy( painCave.errMsg, "Error, a meta-data file is needed to run.\n" );
57     painCave.isFatal = 1;
58     simError();
59     }
60     #ifdef IS_MPI
61     }
62     #endif
63    
64     #ifdef IS_MPI
65     strcpy( checkPointMsg, "Successful number of arguments" );
66     MPIcheckPoint();
67     #endif
68 tim 1837
69 tim 1883 /** @todo move to a seperate initialization module */
70 tim 1852 ForceFieldBuilder<DUFF> DUFFCreator("DUFF");
71 tim 1883 ForceFieldBuilder<DUFF> WATERCreator("WATER");
72 tim 1889 ForceFieldBuilder<DUFF> LJCreator("LJ");
73     ForceFieldBuilder<DUFF> EAMCreator("EAM");
74    
75 tim 1852 IntegratorBuilder<NVE> NVECreator("NVE");
76     IntegratorBuilder<NVT> NVTCreator("NVT");
77     IntegratorBuilder<NPTi> NPTiCreator("NPTi");
78     IntegratorBuilder<NPTf> NPTfCreator("NPTf");
79     IntegratorBuilder<NPTxyz> NPTxyzCreator("NPTxyz");
80 tim 1843
81 tim 1775 //create simulation model
82     SimCreator creator;
83     SimInfo* info = creator.createSim(argv[1]);
84 tim 1501
85 tim 1775 //create Integrator
86 tim 1841 Globals* simParams = info->getSimParams();
87     if (simParams->haveEnsemble()) {
88     Integrator* myIntegrator = IntegratorFactory::getInstance()->createIntegrator(simParams->getEnsemble(), info);
89 tim 1822
90     //Thermodynamic Integration Method
91     //ForceManager* fman = new ThermodynamicForceManager(info);
92     //myIntegrator->setForceManager(fman);
93 tim 1501
94    
95 tim 1822 //Zconstraint-Method
96     //ForceManager* fman = new ZconstraintForceManager(info);
97     //myIntegrator->setForceManager(fman);
98 tim 1501
99 tim 1843 if (myIntegrator == NULL) {
100     sprintf(painCave.errMsg, "Integrator Factory can not create %s Integrator\n",
101     simParams->getEnsemble());
102     painCave.isFatal = 1;
103     simError();
104     }
105    
106 tim 1822 myIntegrator->integrate();
107     delete myIntegrator;
108     }
109 tim 1775 //minimizer
110     // Minimizer* minimizer = MinimizerFactory::getInstance()->createMininizer();
111     //minimizer->run();
112     //delete minimizer
113    
114     delete info;
115 tim 1501
116     #ifdef IS_MPI
117     strcpy( checkPointMsg, "Oh what a lovely Tea Party!" );
118     MPIcheckPoint();
119    
120 tim 1822 MPI_Finalize();
121 tim 1501 #endif
122    
123     return 0 ;
124     }