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); }
79 strcpy(painCave.errMsg,
"No input file name was specified.\n");
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;
96 RealType affine_step = (end_affine - start_affine) / (number + 1);
100 SimInfo::MoleculeIterator miter;
101 Molecule::IntegrableObjectIterator iiter;
102 Molecule::RigidBodyIterator rbIter;
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;
143 newHmat = scaleMatrix * oldHmat;
149 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
150 sd = mol->nextIntegrableObject(iiter)) {
153 newPos = scaleMatrix * oldPos;
158 atype =
static_cast<Atom*
>(sd)->getAtomType();
160 if (fqa.isFluctuatingCharge()) {
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...
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.
StuntDouble * getIOIndexToIntegrableObject(int index)
return an integral objects by its global index.
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.
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!"
void setFlucQVel(RealType cvel)
Sets the current charge velocity of this stuntDouble.
Vector3d getVel()
Returns the current velocity of this stuntDouble.
void setFlucQPos(RealType charge)
Sets the current fluctuating charge of this stuntDouble.
Vector3d getPos()
Returns the current position of this stuntDouble.
RealType getFlucQPos()
Returns the current fluctuating charge of this stuntDouble.
void setPos(const Vector3d &pos)
Sets the current position of this stuntDouble.
void setVel(const Vector3d &vel)
Sets the current velocity 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.
unsigned int output_given
Whether output was given.
char * output_arg
output file name.
int number_arg
number of data points (default='50').
char * input_arg
input dump file.
double start_arg
starting affine scale (default='0.8').
unsigned int input_given
Whether input was given.
double end_arg
ending affine scale (default='1.2').