51#include "brains/Register.hpp"
55#include "selection/SelectionEvaluator.hpp"
56#include "selection/SelectionManager.hpp"
57#include "utils/simError.h"
58#include "visitors/AtomNameVisitor.hpp"
59#include "visitors/AtomVisitor.hpp"
60#include "visitors/CompositeVisitor.hpp"
61#include "visitors/LipidTransVisitor.hpp"
62#include "visitors/OtherVisitor.hpp"
63#include "visitors/ReplacementVisitor.hpp"
64#include "visitors/RigidBodyVisitor.hpp"
65#include "visitors/ZconsVisitor.hpp"
70int main(
int argc,
char* argv[]) {
78 bool printChrg(
false);
79 bool printField(
false);
80 bool printGlobalID(
false);
83 if (cmdline_parser(argc, argv, &args_info) != 0) { exit(1); }
89 strcpy(painCave.errMsg,
"No input file name was specified.\n");
97 xyzFileName = dumpFileName;
98 xyzFileName = xyzFileName.substr(0, xyzFileName.rfind(
".")) +
".xyz";
112 compositeVisitor->addVisitor(rbCOMVisitor, 900);
117 compositeVisitor->addVisitor(ssdVisitor, 800);
121 compositeVisitor->addVisitor(gbtVisitor, 790);
125 compositeVisitor->addVisitor(gbhVisitor, 789);
129 compositeVisitor->addVisitor(defaultAtomVisitor, 700);
136 compositeVisitor->addVisitor(waterTypeVisitor, 600);
142 compositeVisitor->addVisitor(atomNameVisitor, 550);
151 if (zconsVisitor->haveZconsMol()) {
152 compositeVisitor->addVisitor(zconsVisitor, 500);
172 compositeVisitor->addVisitor(replicateVisitor, 300);
177 compositeVisitor->addVisitor(
184 "The --refsele and --originsele arguments should appear together.\n");
185 painCave.isFatal = 1;
200 xyzVisitor->doVelocities(printVel);
204 xyzVisitor->doForces(printFrc);
208 xyzVisitor->doVectors(printVec);
212 xyzVisitor->doCharges(printChrg);
216 xyzVisitor->doElectricFields(printField);
219 printGlobalID =
true;
220 xyzVisitor->doGlobalIDs(printGlobalID);
223 compositeVisitor->addVisitor(xyzVisitor, 200);
232 ofstream xyzStream(xyzFileName.c_str());
234 SimInfo::MoleculeIterator miter;
235 Molecule::IntegrableObjectIterator iiter;
236 Molecule::RigidBodyIterator rbIter;
246 for (
int i = 0; i < nframes; i += args_info.
frame_arg) {
247 dumpReader->readFrame(i);
249 if (printFrc) forceMan->calcForces();
259 displacement = newMolCom - molCom;
261 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
262 sd = mol->nextIntegrableObject(iiter)) {
272 for (rb = mol->beginRigidBody(rbIter); rb != NULL;
273 rb = mol->nextRigidBody(rbIter)) {
275 if (printVel) rb->updateAtomVel();
282 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
283 sd = mol->nextIntegrableObject(iiter)) {
284 sd->
accept(prepareVisitor);
289 compositeVisitor->update();
294 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
295 sd = mol->nextIntegrableObject(iiter)) {
296 sd->
accept(compositeVisitor);
300 xyzVisitor->writeFrame(xyzStream);
308 delete compositeVisitor;
309 delete prepareVisitor;
The header file for the command line option parser generated by GNU Gengetopt version 2....
int getNFrames()
Returns the number of frames in the dump file.
ForceManager is responsible for calculating both the short range (bonded) interactions and long range...
Vector3d getCom()
Returns the current center of mass position of this molecule.
void updateAtoms()
update the positions of atoms belong to this rigidbody
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.
SnapshotManager * getSnapshotManager()
Returns the snapshot manager.
The Snapshot class is a repository storing dynamic data during a Simulation.
void wrapVector(Vector3d &v)
Wrapping the vector according to periodic boundary condition.
Snapshot * getCurrentSnapshot()
Returns the pointer of current snapshot.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
virtual void accept(BaseVisitor *v)=0
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.
Where the command line options are stored.
int repeatY_arg
The number of images to repeat in the y direction (default='0').
unsigned int output_given
Whether output was given.
int vectors_flag
Print vectors (dipoles, etc) in xyz file (default=off).
int rigidbody_flag
add a pseudo COM atom to rigidbody (default=off).
unsigned int repeatY_given
Whether repeatY was given.
int watertype_flag
replace the atom type of water model (default=on).
unsigned int repeatX_given
Whether repeatX was given.
int repeatX_arg
The number of images to repeat in the x direction (default='0').
int charges_flag
Print charges in xyz file (default=off).
int periodicBox_flag
map to the periodic box (default=off).
unsigned int refsele_given
Whether refsele was given.
int basetype_flag
Convert to base atom type (default=off).
char * output_arg
output file name.
char * input_arg
input dump file.
int velocities_flag
Print velocities in xyz file (default=off).
int repeatZ_arg
The number of images to repeat in the z direction (default='0').
unsigned int repeatZ_given
Whether repeatZ was given.
unsigned int selection_given
Whether selection was given.
char * refsele_arg
select reference.
int forces_flag
Print forces xyz file (default=off).
int globalID_flag
Print global ID in xyz file (default=off).
unsigned int water_given
Whether water was given.
int frame_arg
print every n frame (default='1').
unsigned int input_given
Whether input was given.
unsigned int originsele_given
Whether originsele was given.
char * originsele_arg
select origin.
int efield_flag
Print electric field vector in xyz file (default=off).
int zconstraint_flag
replace the atom types of zconstraint molecules (default=off).
char * selection_arg
general selection syntax.