51#include "applications/dynamicProps/AngularVelVelOutProdCorrFunc.hpp"
52#include "applications/dynamicProps/AngularVelocityAutoOutProductCorrFunc.hpp"
53#include "applications/dynamicProps/BondCorrFunc.hpp"
54#include "applications/dynamicProps/ChargeKineticCorrFunc.hpp"
55#include "applications/dynamicProps/ChargeOrientationCorrFunc.hpp"
56#include "applications/dynamicProps/CollectiveDipoleDisplacement.hpp"
57#include "applications/dynamicProps/CurrentDensityAutoCorrFunc.hpp"
58#include "applications/dynamicProps/DipoleCorrFunc.hpp"
59#include "applications/dynamicProps/DirectionalRCorrFunc.hpp"
60#include "applications/dynamicProps/Displacement.hpp"
61#include "applications/dynamicProps/ForTorCorrFunc.hpp"
62#include "applications/dynamicProps/ForceAutoCorrFunc.hpp"
64#include "applications/dynamicProps/HBondJump.hpp"
65#include "applications/dynamicProps/HBondPersistence.hpp"
66#include "applications/dynamicProps/LegendreCorrFunc.hpp"
67#include "applications/dynamicProps/LegendreCorrFuncZ.hpp"
68#include "applications/dynamicProps/MomAngMomCorrFunc.hpp"
69#include "applications/dynamicProps/OnsagerCorrFunc.hpp"
70#include "applications/dynamicProps/RCorrFunc.hpp"
71#include "applications/dynamicProps/RotAngleDisplacement.hpp"
72#include "applications/dynamicProps/SelectionCorrFunc.hpp"
73#include "applications/dynamicProps/StressCorrFunc.hpp"
74#include "applications/dynamicProps/SystemDipoleCorrFunc.hpp"
75#include "applications/dynamicProps/ThetaCorrFunc.hpp"
76#include "applications/dynamicProps/TorForCorrFunc.hpp"
77#include "applications/dynamicProps/TorqueAutoCorrFunc.hpp"
78#include "applications/dynamicProps/VCorrFunc.hpp"
79#include "applications/dynamicProps/VelAngularVelOutProdCorrFunc.hpp"
80#include "applications/dynamicProps/VelocityAutoOutProductCorrFunc.hpp"
81#include "applications/dynamicProps/WCorrFunc.hpp"
82#include "applications/dynamicProps/cOHz.hpp"
85#include "utils/Revision.hpp"
87#include "utils/simError.h"
91int main(
int argc,
char* argv[]) {
102 std::string dumpFileName = args_info.input_arg;
110 if (args_info.sele1_given) {
111 sele1 = args_info.sele1_arg;
113 char* sele1Env = getenv(
"SELECTION1");
117 sele1 =
"select all";
124 if (args_info.sele2_given) {
125 sele2 = args_info.sele2_arg;
127 char* sele2Env = getenv(
"SELECTION2");
143 switch (args_info.privilegedAxis_arg) {
144 case privilegedAxis_arg_x:
147 case privilegedAxis_arg_y:
150 case privilegedAxis_arg_z:
169 SimInfo* info = creator.createSim(dumpFileName,
false);
172 if (args_info.length_given) {
173 maxLen = args_info.length_arg;
178 std::unique_ptr<DynamicProperty> corrFunc {
nullptr};
180 if (args_info.sdcorr_given) {
181 corrFunc = std::make_unique<SystemDipoleCorrFunc>(info, dumpFileName, sele1,
183 }
else if (args_info.selecorr_given) {
185 std::make_unique<SelectionCorrFunc>(info, dumpFileName, sele1, sele2);
186 }
else if (args_info.dcorr_given) {
188 std::make_unique<DipoleCorrFunc>(info, dumpFileName, sele1, sele2);
189 }
else if (args_info.rcorr_given) {
190 corrFunc = std::make_unique<RCorrFunc>(info, dumpFileName, sele1, sele2);
191 }
else if (args_info.r_rcorr_given) {
192 corrFunc = std::make_unique<RCorrFuncR>(info, dumpFileName, sele1, sele2);
193 }
else if (args_info.thetacorr_given) {
195 std::make_unique<ThetaCorrFunc>(info, dumpFileName, sele1, sele2);
196 }
else if (args_info.drcorr_given) {
197 corrFunc = std::make_unique<DirectionalRCorrFunc>(info, dumpFileName, sele1,
199 }
else if (args_info.rcorrZ_given) {
200 corrFunc = std::make_unique<RCorrFuncZ>(
201 info, dumpFileName, sele1, sele2, args_info.nzbins_arg, privilegedAxis);
202 }
else if (args_info.vcorr_given) {
203 corrFunc = std::make_unique<VCorrFunc>(info, dumpFileName, sele1, sele2);
204 }
else if (args_info.vcorrZ_given) {
205 corrFunc = std::make_unique<VCorrFuncZ>(info, dumpFileName, sele1, sele2);
206 }
else if (args_info.vcorrR_given) {
207 corrFunc = std::make_unique<VCorrFuncR>(info, dumpFileName, sele1, sele2);
208 }
else if (args_info.wcorr_given) {
209 corrFunc = std::make_unique<WCorrFunc>(info, dumpFileName, sele1, sele2);
210 }
else if (args_info.pjcorr_given) {
212 std::make_unique<MomAngMomCorrFunc>(info, dumpFileName, sele1, sele2);
213 }
else if (args_info.ftcorr_given) {
215 std::make_unique<ForTorCorrFunc>(info, dumpFileName, sele1, sele2);
216 }
else if (args_info.ckcorr_given) {
217 corrFunc = std::make_unique<ChargeKineticCorrFunc>(
218 info, dumpFileName, sele1, sele2, args_info.rcut_arg);
219 }
else if (args_info.cscorr_given) {
220 if (args_info.dipoleX_given && args_info.dipoleY_given &&
221 args_info.dipoleZ_given) {
222 corrFunc = std::make_unique<ChargeOrientationCorrFunc>(
223 info, dumpFileName, sele1, sele2, args_info.dipoleX_arg,
224 args_info.dipoleY_arg, args_info.dipoleZ_arg, args_info.rcut_arg);
226 }
else if (args_info.facorr_given) {
228 std::make_unique<ForceAutoCorrFunc>(info, dumpFileName, sele1, sele2);
229 }
else if (args_info.tfcorr_given) {
231 std::make_unique<TorForCorrFunc>(info, dumpFileName, sele1, sele2);
232 }
else if (args_info.tacorr_given) {
234 std::make_unique<TorqueAutoCorrFunc>(info, dumpFileName, sele1, sele2);
235 }
else if (args_info.bondcorr_given) {
236 corrFunc = std::make_unique<BondCorrFunc>(info, dumpFileName, sele1, sele2);
237 }
else if (args_info.stresscorr_given) {
239 std::make_unique<StressCorrFunc>(info, dumpFileName, sele1, sele2);
240 }
else if (args_info.freqfluccorr_given) {
242 std::make_unique<FreqFlucCorrFunc>(info, dumpFileName, sele1, sele2);
243 }
else if (args_info.lcorr_given) {
245 if (args_info.order_given)
246 order = args_info.order_arg;
248 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
249 "--order must be set if --lcorr is set\n");
250 painCave.severity = OPENMD_ERROR;
251 painCave.isFatal = 1;
255 corrFunc = std::make_unique<LegendreCorrFunc>(info, dumpFileName, sele1,
257 }
else if (args_info.lcorrZ_given) {
259 if (args_info.order_given)
260 order = args_info.order_arg;
262 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
263 "--order must be set if --lcorrZ is set\n");
264 painCave.severity = OPENMD_ERROR;
265 painCave.isFatal = 1;
269 corrFunc = std::make_unique<LegendreCorrFuncZ>(
270 info, dumpFileName, sele1, sele2, order, args_info.nzbins_arg,
273 }
else if (args_info.cohZ_given) {
275 if (args_info.order_given)
276 order = args_info.order_arg;
278 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
279 "--order must be set if --cohZ is set\n");
280 painCave.severity = OPENMD_ERROR;
281 painCave.isFatal = 1;
285 corrFunc = std::make_unique<COHZ>(info, dumpFileName, sele1, sele2, order,
286 args_info.nzbins_arg, privilegedAxis);
288 }
else if (args_info.jumptime_given) {
289 corrFunc = std::make_unique<HBondJump>(
290 info, dumpFileName, sele1, sele2, args_info.OOcut_arg,
291 args_info.thetacut_arg, args_info.OHcut_arg);
292 }
else if (args_info.jumptimeZ_given) {
293 corrFunc = std::make_unique<HBondJumpZ>(
294 info, dumpFileName, sele1, sele2, args_info.OOcut_arg,
295 args_info.thetacut_arg, args_info.OHcut_arg, args_info.nzbins_arg,
297 }
else if (args_info.jumptimeR_given) {
298 if (args_info.sele3_given) {
299 corrFunc = std::make_unique<HBondJumpR>(
300 info, dumpFileName, sele1, sele2, args_info.sele3_arg,
301 args_info.OOcut_arg, args_info.thetacut_arg, args_info.OHcut_arg,
302 maxLen, args_info.nbins_arg);
304 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
305 "--sele3 must be set if --jumptimeR is set\n");
306 painCave.severity = OPENMD_ERROR;
307 painCave.isFatal = 1;
310 }
else if (args_info.persistence_given) {
311 corrFunc = std::make_unique<HBondPersistence>(
312 info, dumpFileName, sele1, sele2, args_info.OOcut_arg,
313 args_info.thetacut_arg, args_info.OHcut_arg);
314 }
else if (args_info.disp_given) {
315 corrFunc = std::make_unique<Displacement>(info, dumpFileName, sele1, sele2);
316 }
else if (args_info.dispZ_given) {
317 corrFunc = std::make_unique<DisplacementZ>(
318 info, dumpFileName, sele1, sele2, args_info.nzbins_arg, privilegedAxis);
319 }
else if (args_info.current_given) {
320 corrFunc = std::make_unique<CurrentDensityAutoCorrFunc>(info, dumpFileName,
322 }
else if (args_info.onsager_given) {
323 if (args_info.sele1_given) {
325 std::make_unique<OnsagerCorrFunc>(info, dumpFileName, sele1, sele2);
327 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
328 "--sele1 must be set for Center of Mass Rcorr\n");
329 painCave.severity = OPENMD_ERROR;
330 painCave.isFatal = 1;
333 }
else if (args_info.ddisp_given) {
334 corrFunc = std::make_unique<CollectiveDipoleDisplacement>(
335 info, dumpFileName, sele1, sele2);
336 }
else if (args_info.vaOutProdcorr_given) {
337 corrFunc = std::make_unique<VelocityAutoOutProductCorrFunc>(
338 info, dumpFileName, sele1, sele2);
339 }
else if (args_info.waOutProdcorr_given) {
340 corrFunc = std::make_unique<AngularVelocityAutoOutProductCorrFunc>(
341 info, dumpFileName, sele1, sele2);
342 }
else if (args_info.vwOutProdcorr_given) {
343 corrFunc = std::make_unique<VelAngularVelOutProdCorrFunc>(
344 info, dumpFileName, sele1, sele2);
345 }
else if (args_info.wvOutProdcorr_given) {
346 corrFunc = std::make_unique<AngularVelVelOutProdCorrFunc>(
347 info, dumpFileName, sele1, sele2);
348 }
else if (args_info.rotAngleDisp_given) {
349 corrFunc = std::make_unique<RotAngleDisplacement>(info, dumpFileName, sele1,
353 if (args_info.output_given) { corrFunc->setOutputName(args_info.output_arg); }
355 corrFunc->doCorrelate();
The header file for the command line option parser generated by GNU Gengetopt version 2....
Frequency Fluctuation Correlation Function.
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.
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
The command line parser.
void cmdline_parser_print_help(void)
Print the help.