45#include "applications/sequentialProps/ContactAngle1.hpp"
54#include "utils/Constants.hpp"
55#include "utils/simError.h"
59 ContactAngle1::ContactAngle1(
SimInfo* info,
const std::string& filename,
60 const std::string& sele1,
61 const std::string& sele2, RealType solidZ,
62 RealType dropletRadius) :
64 solidZ_(solidZ), dropletRadius_(dropletRadius) {
65 setOutputName(
getPrefix(filename) +
".ca1");
67 std::stringstream params;
68 params <<
" solid Z = " << solidZ_
69 <<
", droplet radius = " << dropletRadius_;
71 const std::string paramString = params.str();
72 setParameterString(paramString);
75 void ContactAngle1::doFrame(
int) {
80 seleMan1_.setSelectionSet(evaluator1_.evaluate());
91 com += sd->
getPos() * mass;
96 RealType dz = com.
z() - solidZ_;
99 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
100 "ContactAngle1: Z-center of mass of selection, %lf, was\n"
101 "\tlocated below the solid reference plane, %lf\n",
103 painCave.isFatal = 1;
104 painCave.severity = OPENMD_ERROR;
108 if (dz > dropletRadius_) {
109 values_.push_back(180.0);
111 RealType k = pow(2.0, -4.0 / 3.0) * dropletRadius_;
113 RealType z2 = dz * dz;
114 RealType z3 = z2 * dz;
116 RealType k3 = k2 * k;
124 vector<RealType> realRoots = poly.FindRealRoots();
128 vector<RealType>::iterator ri;
130 RealType maxct = -1.0;
131 for (ri = realRoots.begin(); ri != realRoots.end(); ++ri) {
133 if (ct > 1.0) ct = 1.0;
134 if (ct < -1.0) ct = -1.0;
137 if (ct > maxct) { maxct = ct; }
140 values_.push_back(acos(maxct) * (180.0 / Constants::PI));
A generic Polynomial class.
void setCoefficient(int exponent, const Real &coefficient)
Set the coefficent of the specified exponent, if the coefficient is already there,...
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.
"applications/sequentialProps/SequentialAnalyzer"
One of the heavy-weight classes of OpenMD, SimInfo maintains objects and variables relating to the cu...
"Don't move, or you're dead! Stand up! Captain, we've got them!"
RealType getMass()
Returns the mass of this stuntDouble.
Vector3d getPos()
Returns the current position of this stuntDouble.
Real & z()
Returns reference of the third element of Vector3.
This basic Periodic Table class was originally taken from the data.cpp file in OpenBabel.
std::string getPrefix(const std::string &str)