Simpatico  v1.10
mdSim.cpp
1 /*
2 * Simpatico - Simulation Package for Polymeric and Molecular Liquids
3 *
4 * Copyright 2010 - 2017, The Regents of the University of Minnesota
5 * Distributed under the terms of the GNU General Public License.
6 */
7 
8 #include <mcMd/mdSimulation/MdSimulation.h>
9 
10 /*
11 * Main single-processor molecular dynamics program (mdSim).
12 *
13 * See file mdSim.dox for explanation of usage.
14 */
15 int main(int argc, char **argv)
16 {
17  #ifdef UTIL_MPI
18  MPI::Init();
19  McMd::MdSimulation simulation(MPI::COMM_WORLD);
20  #else
21  McMd::MdSimulation simulation;
22  #endif
23 
24  // Process command line options
25  simulation.setOptions(argc, argv);
26 
27  // Read parameters from default parameter file
28  simulation.readParam();
29 
30  // Read command script to run simulation
31  simulation.readCommands();
32 
33  #ifdef UTIL_MPI
34  if (MPI::Is_initialized()) {
35  MPI::Finalize();
36  }
37  #endif
38 
39  return 0;
40 }
void readCommands()
Read and execute commands from a default command file.
void readParam()
Read parameters from the default parameter istream.
void setOptions(int argc, char **argv)
Process command line options.
A molecular dynamics simulation of a single MdSystem.
Definition: MdSimulation.h:26