55#include "brains/Register.hpp"
58#include "brains/Thermo.hpp"
60#include "io/DumpWriter.hpp"
66int main(
int argc,
char* argv[]) {
71 std::string inputFileName;
72 std::string outputFileName;
75 if (cmdline_parser(argc, argv, &args_info) != 0) exit(1);
79 inputFileName = args_info.
inputs[0];
81 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
82 "No input file name was specified "
83 "on the command line");
84 painCave.severity = OPENMD_ERROR;
99 if (!outputFileName.compare(inputFileName)) {
100 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
101 "Input and Output File names should be different!");
102 painCave.severity = OPENMD_ERROR;
103 painCave.isFatal = 1;
109 if (writer == NULL) {
110 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
111 "error in creating DumpWriter");
112 painCave.severity = OPENMD_ERROR;
113 painCave.isFatal = 1;
117 int nFrames = reader.getNFrames();
120 SimInfo::MoleculeIterator i;
121 Molecule::IntegrableObjectIterator j;
126 for (
int istep = 0; istep < nFrames; istep++) {
127 reader.readFrame(istep);
128 COM = thermo.getCom();
131 for (sd = mol->beginIntegrableObject(j); sd != NULL;
132 sd = mol->nextIntegrableObject(j)) {
144 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
145 "A new OpenMD file called \"%s\" has been generated.\n",
146 outputFileName.c_str());
147 painCave.severity = OPENMD_INFO;
148 painCave.isFatal = 0;
The only responsibility of SimCreator is to parse the meta-data file and create a SimInfo instance ba...
SimInfo * createSim(const std::string &mdFileName, bool loadInitCoords=true)
Setup Simulation.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
Molecule * beginMolecule(MoleculeIterator &i)
Returns the first molecule in this SimInfo and intialize the iterator.
Molecule * nextMolecule(MoleculeIterator &i)
Returns the next avaliable Molecule based on the iterator.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
Vector3d getPos()
Returns the current position of this stuntDouble.
void setPos(const Vector3d &pos)
Sets the current position of this stuntDouble.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
void registerLattice()
Register all lattice.
The header file for the command line option parser generated by GNU Gengetopt version 2....
Where the command line options are stored.
unsigned inputs_num
unamed options number
char * output_arg
output file name.
char ** inputs
unamed options (options without names)