48#include "applications/staticProps/NanoVolume.hpp"
49#if defined(HAVE_QHULL)
50#include "math/AlphaHull.hpp"
51#include "math/ConvexHull.hpp"
55#include "utils/simError.h"
59NanoVolume::NanoVolume(
SimInfo* info,
const std::string& filename,
60 const std::string& sele) :
62 selectionScript_(sele), seleMan_(info), evaluator_(info) {
63 setOutputName(
getPrefix(filename) +
".avol");
65 osq.open(getOutputFileName().c_str());
67 evaluator_.loadScriptString(sele);
68 if (!evaluator_.isDynamic()) {
69 seleMan_.setSelectionSet(evaluator_.evaluate());
74void NanoVolume::process() {
75#if defined(HAVE_QHULL)
82 ConvexHull* thishull =
new ConvexHull();
84 DumpReader reader(info_, dumpFilename_);
85 int nFrames = reader.getNFrames();
88 theAtoms_.reserve(info_->getNGlobalAtoms());
90 for (
int istep = 0; istep < nFrames; istep += step_) {
91 reader.readFrame(istep);
93 currentSnapshot_ = info_->getSnapshotManager()->getCurrentSnapshot();
94 RealType time = currentSnapshot_->getTime();
99 if (evaluator_.isDynamic()) {
100 seleMan_.setSelectionSet(evaluator_.evaluate());
105 for (sd = seleMan_.beginSelected(i); sd != NULL;
106 sd = seleMan_.nextSelected(i)) {
107 theAtoms_.push_back(sd);
121 thishull->computeHull(theAtoms_);
122 RealType volume = thishull->getVolume();
123 RealType surfaceArea = thishull->getArea();
127 osq << time <<
"\t" << volume <<
"\t" << surfaceArea << std::endl;
133 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
134 "NanoVolume: qhull support was not compiled in!\n");
135 painCave.isFatal = 1;
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)