54#include "brains/Register.hpp"
57#include "brains/Thermo.hpp"
59#include "flucq/FluctuatingChargeDamped.hpp"
61#include "io/DumpWriter.hpp"
62#include "types/FluctuatingChargeAdapter.hpp"
63#include "utils/Constants.hpp"
64#include "utils/ProgressBar.hpp"
65#include "utils/simError.h"
70int main(
int argc,
char* argv[]) {
76 if (cmdline_parser(argc, argv, &args_info) != 0) { exit(1); }
82 strcpy(painCave.errMsg,
"No input file name was specified.\n");
90 strcpy(painCave.errMsg,
"No output file name was specified.\n");
95 double start_affine = args_info.
start_arg;
96 double end_affine = args_info.
end_arg;
99 RealType affine_step = (end_affine - start_affine) / (number + 1);
103 SimInfo::MoleculeIterator miter;
104 Molecule::IntegrableObjectIterator iiter;
105 Molecule::RigidBodyIterator rbIter;
128 eos.open(outFileName.c_str());
130 RealType current_affine = start_affine;
132 std::cout <<
"Calculation for EOS started." << std::endl;
133 while (current_affine <= end_affine) {
137 RealType scaling = std::cbrt(current_affine);
138 Mat3x3d scaleMatrix = Mat3x3d(0.0);
139 scaleMatrix(0, 0) = scaling;
140 scaleMatrix(1, 1) = scaling;
141 scaleMatrix(2, 2) = scaling;
146 newHmat = scaleMatrix * oldHmat;
152 for (sd = mol->beginIntegrableObject(iiter); sd != NULL;
153 sd = mol->nextIntegrableObject(iiter)) {
156 newPos = scaleMatrix * oldPos;
161 atype =
static_cast<Atom*
>(sd)->getAtomType();
163 if (fqa.isFluctuatingCharge()) {
178 for (rb = mol->beginRigidBody(rbIter); rb != NULL;
179 rb = mol->nextRigidBody(rbIter)) {
189 flucQ->setForceManager(fman);
194 RealType totalEnergy(0);
195 totalEnergy = thermo.getTotalEnergy();
196 eos << current_affine <<
"\t" << totalEnergy <<
"\n";
198 std::cout << countStep <<
" data generated." << std::endl;
200 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').