54#include "brains/Register.hpp"
58#include "selection/SelectionEvaluator.hpp"
59#include "selection/SelectionManager.hpp"
60#include "utils/simError.h"
61#include "visitors/AtomNameVisitor.hpp"
62#include "visitors/AtomVisitor.hpp"
63#include "visitors/CompositeVisitor.hpp"
64#include "visitors/LipidTransVisitor.hpp"
65#include "visitors/OtherVisitor.hpp"
66#include "visitors/ReplacementVisitor.hpp"
67#include "visitors/RigidBodyVisitor.hpp"
68#include "visitors/ZconsVisitor.hpp"
73int main(
int argc,
char* argv[]) {
81 bool printChrg(
false);
82 bool printField(
false);
83 bool printGlobalID(
false);
86 if (cmdline_parser(argc, argv, &args_info) != 0) { exit(1); }
92 strcpy(painCave.errMsg,
"No input file name was specified.\n");
100 xyzFileName = dumpFileName;
101 xyzFileName = xyzFileName.substr(0, xyzFileName.rfind(
".")) +
".xyz";
115 compositeVisitor->addVisitor(rbCOMVisitor, 900);
120 compositeVisitor->addVisitor(ssdVisitor, 800);
124 compositeVisitor->addVisitor(gbtVisitor, 790);
128 compositeVisitor->addVisitor(gbhVisitor, 789);
132 compositeVisitor->addVisitor(defaultAtomVisitor, 700);
139 compositeVisitor->addVisitor(waterTypeVisitor, 600);
145 compositeVisitor->addVisitor(atomNameVisitor, 550);
154 if (zconsVisitor->haveZconsMol()) {
155 compositeVisitor->addVisitor(zconsVisitor, 500);
175 compositeVisitor->addVisitor(replicateVisitor, 300);
180 compositeVisitor->addVisitor(
187 "The --refsele and --originsele arguments should appear together.\n");
188 painCave.isFatal = 1;
203 xyzVisitor->doVelocities(printVel);
207 xyzVisitor->doForces(printFrc);
211 xyzVisitor->doVectors(printVec);
215 xyzVisitor->doCharges(printChrg);
219 xyzVisitor->doElectricFields(printField);
222 printGlobalID =
true;
223 xyzVisitor->doGlobalIDs(printGlobalID);
226 compositeVisitor->addVisitor(xyzVisitor, 200);
235 ofstream xyzStream(xyzFileName.c_str());
237 SimInfo::MoleculeIterator miter;
238 Molecule::IntegrableObjectIterator iiter;
239 Molecule::RigidBodyIterator rbIter;
245 Vector3d displacement;
249 for (
int i = 0; i < nframes; i += args_info.
frame_arg) {
250 dumpReader->readFrame(i);
252 if (printFrc) forceMan->calcForces();
262 displacement = newMolCom - molCom;
264 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
265 sd = mol->nextIntegrableObject(iiter)) {
275 for (rb = mol->beginRigidBody(rbIter); rb != NULL;
276 rb = mol->nextRigidBody(rbIter)) {
278 if (printVel) rb->updateAtomVel();
285 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
286 sd = mol->nextIntegrableObject(iiter)) {
287 sd->
accept(prepareVisitor);
292 compositeVisitor->update();
297 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
298 sd = mol->nextIntegrableObject(iiter)) {
299 sd->
accept(compositeVisitor);
303 xyzVisitor->writeFrame(xyzStream);
311 delete compositeVisitor;
312 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.