45#include "applications/staticProps/NanoVolume.hpp"
46#if defined(HAVE_QHULL)
47#include "math/AlphaHull.hpp"
48#include "math/ConvexHull.hpp"
52#include "utils/simError.h"
56NanoVolume::NanoVolume(
SimInfo* info,
const std::string& filename,
57 const std::string& sele) :
59 selectionScript_(sele), seleMan_(info), evaluator_(info) {
60 setOutputName(
getPrefix(filename) +
".avol");
62 osq.open(getOutputFileName().c_str());
64 evaluator_.loadScriptString(sele);
65 if (!evaluator_.isDynamic()) {
66 seleMan_.setSelectionSet(evaluator_.evaluate());
71void NanoVolume::process() {
72#if defined(HAVE_QHULL)
82 int nFrames = reader.getNFrames();
87 for (
int istep = 0; istep < nFrames; istep += step_) {
88 reader.readFrame(istep);
91 RealType time = currentSnapshot_->getTime();
97 seleMan_.setSelectionSet(evaluator_.evaluate());
104 theAtoms_.push_back(sd);
118 thishull->computeHull(theAtoms_);
119 RealType volume = thishull->getVolume();
120 RealType surfaceArea = thishull->getArea();
124 osq << time <<
"\t" << volume <<
"\t" << surfaceArea << std::endl;
130 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
131 "NanoVolume: qhull support was not compiled in!\n");
132 painCave.isFatal = 1;
bool isDynamic()
Tests if the result from evaluation of script is dynamic.
StuntDouble * nextSelected(int &i)
Finds the next selected StuntDouble in the selection.
StuntDouble * beginSelected(int &i)
Finds the first selected StuntDouble in the selection.
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
int getNGlobalAtoms()
Returns the total number of atoms in the system.
SnapshotManager * getSnapshotManager()
Returns the snapshot manager.
Snapshot * getCurrentSnapshot()
Returns the pointer of current snapshot.
"Don't move, or you're dead! Stand up! Captain, we've got them!"
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)