50#include "applications/sequentialProps/COMVel.hpp"
51#include "applications/sequentialProps/CenterOfMass.hpp"
52#include "applications/sequentialProps/ContactAngle1.hpp"
53#include "applications/sequentialProps/ContactAngle2.hpp"
54#include "applications/sequentialProps/GCNSeq.hpp"
55#include "applications/sequentialProps/SequentialAnalyzer.hpp"
56#include "applications/sequentialProps/equipartitionTest.hpp"
60#include "utils/simError.h"
64int main(
int argc,
char* argv[]) {
68 if (cmdline_parser(argc, argv, &args_info) != 0) { exit(1); }
71 std::string dumpFileName = args_info.input_arg;
79 if (args_info.sele1_given) {
80 sele1 = args_info.sele1_arg;
82 char* sele1Env = getenv(
"SELECTION1");
93 if (args_info.sele2_given) {
94 sele2 = args_info.sele2_arg;
96 char* sele2Env = getenv(
"SELECTION2");
108 SimInfo* info = creator.createSim(dumpFileName,
false);
111 if (args_info.com_given) {
112 analyzer =
new CenterOfMass(info, dumpFileName, sele1, sele2);
113 }
else if (args_info.comvel_given) {
114 analyzer =
new COMVel(info, dumpFileName, sele1, sele2);
115 }
else if (args_info.testequi_given) {
116 analyzer =
new Equipartition(info, dumpFileName, sele1, sele2);
117 }
else if (args_info.gcn_given) {
118 if (args_info.rcut_given) {
119 analyzer =
new GCNSeq(info, dumpFileName, sele1, sele2,
120 args_info.rcut_arg, args_info.nbins_arg);
122 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
123 "A cutoff radius (rcut) must be specified when calculating\n"
124 "\tGeneralized Coordinate Number");
125 painCave.severity = OPENMD_ERROR;
126 painCave.isFatal = 1;
129 }
else if (args_info.ca1_given) {
130 RealType solidZ(0.0);
131 if (args_info.referenceZ_given)
132 solidZ = args_info.referenceZ_arg;
134 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
135 "--referenceZ must be set if --ca1 is used\n");
136 painCave.severity = OPENMD_ERROR;
137 painCave.isFatal = 1;
140 RealType dropletR(0.0);
141 if (args_info.dropletR_given)
142 dropletR = args_info.dropletR_arg;
144 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
145 "--dropletR must be set if --ca1 is used\n");
146 painCave.severity = OPENMD_ERROR;
147 painCave.isFatal = 1;
152 new ContactAngle1(info, dumpFileName, sele1, sele2, solidZ, dropletR);
153 }
else if (args_info.ca2_given) {
154 RealType solidZ(0.0);
155 if (args_info.referenceZ_given)
156 solidZ = args_info.referenceZ_arg;
158 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
159 "--referenceZ must be set if --ca2 is used\n");
160 painCave.severity = OPENMD_ERROR;
161 painCave.isFatal = 1;
164 RealType centroidX(0.0);
165 if (args_info.centroidX_given)
166 centroidX = args_info.centroidX_arg;
168 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
169 "--centroidX must be set if --ca2 is used\n");
170 painCave.severity = OPENMD_ERROR;
171 painCave.isFatal = 1;
174 RealType centroidY(0.0);
175 if (args_info.centroidY_given)
176 centroidY = args_info.centroidY_arg;
178 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
179 "--centroidY must be set if --ca2 is used\n");
180 painCave.severity = OPENMD_ERROR;
181 painCave.isFatal = 1;
184 RealType threshDens(0.0);
185 if (args_info.threshDens_given)
186 threshDens = args_info.threshDens_arg;
188 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
189 "--threshDens must be set if --ca2 is used\n");
190 painCave.severity = OPENMD_ERROR;
191 painCave.isFatal = 1;
194 RealType bufferLength(0.0);
195 if (args_info.bufferLength_given)
196 bufferLength = args_info.bufferLength_arg;
198 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
199 "--bufferLength must be set if --ca2 is used\n");
200 painCave.severity = OPENMD_ERROR;
201 painCave.isFatal = 1;
205 analyzer =
new ContactAngle2(info, dumpFileName, sele1, sele2, solidZ,
206 centroidX, centroidY, threshDens, bufferLength,
207 args_info.nbins_arg, args_info.nbins_z_arg);
210 if (args_info.output_given) { analyzer->setOutputName(args_info.output_arg); }
212 analyzer->doSequence();
The header file for the command line option parser generated by GNU Gengetopt version 2....
Generalized Coordinate Number Sequence.
"applications/sequentialProps/SequentialAnalyzer"
The only responsibility of SimCreator is to parse the meta-data file and create a SimInfo instance ba...
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.
Where the command line options are stored.