51#include "brains/Register.hpp"
54#include "brains/Thermo.hpp"
56#include "flucq/FluctuatingChargeDamped.hpp"
58#include "io/DumpWriter.hpp"
59#include "types/FluctuatingChargeAdapter.hpp"
60#include "utils/Constants.hpp"
61#include "utils/ProgressBar.hpp"
62#include "utils/simError.h"
67int main(
int argc,
char* argv[]) {
73 if (cmdline_parser(argc, argv, &args_info) != 0) { exit(1); }
76 if (args_info.input_given) {
77 omdFileName = args_info.input_arg;
79 strcpy(painCave.errMsg,
"No input file name was specified.\n");
84 if (args_info.output_given) {
85 outFileName = args_info.output_arg;
87 strcpy(painCave.errMsg,
"No output file name was specified.\n");
92 double start_affine = args_info.start_arg;
93 double end_affine = args_info.end_arg;
94 int number = args_info.number_arg;
96 RealType affine_step = (end_affine - start_affine) / (number + 1);
100 SimInfo::MoleculeIterator miter;
101 Molecule::IntegrableObjectIterator iiter;
102 Molecule::RigidBodyIterator rbIter;
117 SimInfo* oldInfo = oldCreator.createSim(omdFileName);
125 eos.open(outFileName.c_str());
127 RealType current_affine = start_affine;
129 std::cout <<
"Calculation for EOS started." << std::endl;
130 while (current_affine <= end_affine) {
134 RealType scaling = std::cbrt(current_affine);
136 scaleMatrix(0, 0) = scaling;
137 scaleMatrix(1, 1) = scaling;
138 scaleMatrix(2, 2) = scaling;
140 SimInfo* newInfo = oldCreator.createSim(omdFileName);
143 newHmat = scaleMatrix * oldHmat;
147 for (mol = oldInfo->beginMolecule(miter); mol != NULL;
148 mol = oldInfo->nextMolecule(miter)) {
149 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
150 sd = mol->nextIntegrableObject(iiter)) {
152 oldSnap->wrapVector(oldPos);
153 newPos = scaleMatrix * oldPos;
154 sdNew = newInfo->getIOIndexToIntegrableObject(newIndex);
155 sdNew->setPos(newPos);
156 sdNew->setVel(sd->
getVel());
158 atype =
static_cast<Atom*
>(sd)->getAtomType();
160 if (fqa.isFluctuatingCharge()) {
162 sdNew->setFlucQPos(charge);
164 sdNew->setFlucQVel(cv);
172 for (mol = newInfo->beginMolecule(miter); mol != NULL;
173 mol = newInfo->nextMolecule(miter)) {
175 for (rb = mol->beginRigidBody(rbIter); rb != NULL;
176 rb = mol->nextRigidBody(rbIter)) {
186 flucQ->setForceManager(fman);
191 RealType totalEnergy(0);
192 totalEnergy = thermo.getTotalEnergy();
193 eos << current_affine <<
"\t" << totalEnergy <<
"\n";
195 std::cout << countStep <<
" data generated." << std::endl;
197 current_affine += affine_step;
AtomType is what OpenMD looks to for unchanging data about an atom.
abstract class for propagating fluctuating charge variables
ForceManager is responsible for calculating both the short range (bonded) interactions and long range...
The only responsibility of SimCreator is to parse the meta-data file and create a SimInfo instance ba...
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
SnapshotManager * getSnapshotManager()
Returns the snapshot manager.
The Snapshot class is a repository storing dynamic data during a Simulation.
Mat3x3d getHmat()
Returns the H-Matrix.
void setHmat(const Mat3x3d &m)
Sets the H-Matrix.
Snapshot * getCurrentSnapshot()
Returns the pointer of current snapshot.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
Vector3d getVel()
Returns the current velocity of this stuntDouble.
Vector3d getPos()
Returns the current position of this stuntDouble.
RealType getFlucQPos()
Returns the current fluctuating charge of this stuntDouble.
bool isAtom()
Tests if this stuntDouble is an atom.
RealType getFlucQVel()
Returns the current charge velocity of this stuntDouble.
The header file for the command line option parser generated by GNU Gengetopt version 2....
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
void registerAll()
register force fields, integrators and optimizers
Where the command line options are stored.