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"
83#include "applications/dynamicProps/MeanDisplacement.hpp"
86#include "utils/Revision.hpp"
88#include "utils/simError.h"
92int main(
int argc,
char* argv[]) {
103 std::string dumpFileName = args_info.input_arg;
111 if (args_info.sele1_given) {
112 sele1 = args_info.sele1_arg;
114 char* sele1Env = getenv(
"SELECTION1");
118 sele1 =
"select all";
125 if (args_info.sele2_given) {
126 sele2 = args_info.sele2_arg;
128 char* sele2Env = getenv(
"SELECTION2");
144 switch (args_info.privilegedAxis_arg) {
145 case privilegedAxis_arg_x:
148 case privilegedAxis_arg_y:
151 case privilegedAxis_arg_z:
173 if (args_info.length_given) {
174 maxLen = args_info.length_arg;
179 std::unique_ptr<DynamicProperty> corrFunc {
nullptr};
181 if (args_info.sdcorr_given) {
182 corrFunc = std::make_unique<SystemDipoleCorrFunc>(info, dumpFileName, sele1,
184 }
else if (args_info.selecorr_given) {
186 std::make_unique<SelectionCorrFunc>(info, dumpFileName, sele1, sele2);
187 }
else if (args_info.dcorr_given) {
189 std::make_unique<DipoleCorrFunc>(info, dumpFileName, sele1, sele2);
190 }
else if (args_info.rcorr_given) {
191 corrFunc = std::make_unique<RCorrFunc>(info, dumpFileName, sele1, sele2);
192 }
else if (args_info.r_rcorr_given) {
193 corrFunc = std::make_unique<RCorrFuncR>(info, dumpFileName, sele1, sele2);
194 }
else if (args_info.thetacorr_given) {
196 std::make_unique<ThetaCorrFunc>(info, dumpFileName, sele1, sele2);
197 }
else if (args_info.drcorr_given) {
198 corrFunc = std::make_unique<DirectionalRCorrFunc>(info, dumpFileName, sele1,
200 }
else if (args_info.rcorrZ_given) {
201 corrFunc = std::make_unique<RCorrFuncZ>(
202 info, dumpFileName, sele1, sele2, args_info.nzbins_arg, privilegedAxis);
203 }
else if (args_info.vcorr_given) {
204 corrFunc = std::make_unique<VCorrFunc>(info, dumpFileName, sele1, sele2);
205 }
else if (args_info.vcorrZ_given) {
206 corrFunc = std::make_unique<VCorrFuncZ>(info, dumpFileName, sele1, sele2);
207 }
else if (args_info.vcorrR_given) {
208 corrFunc = std::make_unique<VCorrFuncR>(info, dumpFileName, sele1, sele2);
209 }
else if (args_info.wcorr_given) {
210 corrFunc = std::make_unique<WCorrFunc>(info, dumpFileName, sele1, sele2);
211 }
else if (args_info.pjcorr_given) {
213 std::make_unique<MomAngMomCorrFunc>(info, dumpFileName, sele1, sele2);
214 }
else if (args_info.ftcorr_given) {
216 std::make_unique<ForTorCorrFunc>(info, dumpFileName, sele1, sele2);
217 }
else if (args_info.ckcorr_given) {
218 corrFunc = std::make_unique<ChargeKineticCorrFunc>(
219 info, dumpFileName, sele1, sele2, args_info.rcut_arg);
220 }
else if (args_info.cscorr_given) {
221 if (args_info.dipoleX_given && args_info.dipoleY_given &&
222 args_info.dipoleZ_given) {
223 corrFunc = std::make_unique<ChargeOrientationCorrFunc>(
224 info, dumpFileName, sele1, sele2, args_info.dipoleX_arg,
225 args_info.dipoleY_arg, args_info.dipoleZ_arg, args_info.rcut_arg);
227 }
else if (args_info.facorr_given) {
229 std::make_unique<ForceAutoCorrFunc>(info, dumpFileName, sele1, sele2);
230 }
else if (args_info.tfcorr_given) {
232 std::make_unique<TorForCorrFunc>(info, dumpFileName, sele1, sele2);
233 }
else if (args_info.tacorr_given) {
235 std::make_unique<TorqueAutoCorrFunc>(info, dumpFileName, sele1, sele2);
236 }
else if (args_info.bondcorr_given) {
237 corrFunc = std::make_unique<BondCorrFunc>(info, dumpFileName, sele1, sele2);
238 }
else if (args_info.stresscorr_given) {
240 std::make_unique<StressCorrFunc>(info, dumpFileName, sele1, sele2);
241 }
else if (args_info.freqfluccorr_given) {
243 std::make_unique<FreqFlucCorrFunc>(info, dumpFileName, sele1, sele2);
244 }
else if (args_info.lcorr_given) {
246 if (args_info.order_given)
247 order = args_info.order_arg;
249 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
250 "--order must be set if --lcorr is set\n");
251 painCave.severity = OPENMD_ERROR;
252 painCave.isFatal = 1;
256 corrFunc = std::make_unique<LegendreCorrFunc>(info, dumpFileName, sele1,
258 }
else if (args_info.lcorrZ_given) {
260 if (args_info.order_given)
261 order = args_info.order_arg;
263 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
264 "--order must be set if --lcorrZ is set\n");
265 painCave.severity = OPENMD_ERROR;
266 painCave.isFatal = 1;
270 corrFunc = std::make_unique<LegendreCorrFuncZ>(
271 info, dumpFileName, sele1, sele2, order, args_info.nzbins_arg,
274 }
else if (args_info.cohZ_given) {
276 if (args_info.order_given)
277 order = args_info.order_arg;
279 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
280 "--order must be set if --cohZ is set\n");
281 painCave.severity = OPENMD_ERROR;
282 painCave.isFatal = 1;
286 corrFunc = std::make_unique<COHZ>(info, dumpFileName, sele1, sele2, order,
287 args_info.nzbins_arg, privilegedAxis);
289 }
else if (args_info.jumptime_given) {
290 corrFunc = std::make_unique<HBondJump>(
291 info, dumpFileName, sele1, sele2, args_info.OOcut_arg,
292 args_info.thetacut_arg, args_info.OHcut_arg);
293 }
else if (args_info.jumptimeZ_given) {
294 corrFunc = std::make_unique<HBondJumpZ>(
295 info, dumpFileName, sele1, sele2, args_info.OOcut_arg,
296 args_info.thetacut_arg, args_info.OHcut_arg, args_info.nzbins_arg,
298 }
else if (args_info.jumptimeR_given) {
299 if (args_info.sele3_given) {
300 corrFunc = std::make_unique<HBondJumpR>(
301 info, dumpFileName, sele1, sele2, args_info.sele3_arg,
302 args_info.OOcut_arg, args_info.thetacut_arg, args_info.OHcut_arg,
303 maxLen, args_info.nbins_arg);
305 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
306 "--sele3 must be set if --jumptimeR is set\n");
307 painCave.severity = OPENMD_ERROR;
308 painCave.isFatal = 1;
311 }
else if (args_info.persistence_given) {
312 corrFunc = std::make_unique<HBondPersistence>(
313 info, dumpFileName, sele1, sele2, args_info.OOcut_arg,
314 args_info.thetacut_arg, args_info.OHcut_arg);
315 }
else if (args_info.disp_given) {
316 corrFunc = std::make_unique<Displacement>(info, dumpFileName, sele1, sele2);
317 }
else if (args_info.dispZ_given) {
318 corrFunc = std::make_unique<DisplacementZ>(
319 info, dumpFileName, sele1, sele2, args_info.nzbins_arg, privilegedAxis);
320 }
else if (args_info.current_given) {
321 corrFunc = std::make_unique<CurrentDensityAutoCorrFunc>(info, dumpFileName,
323 }
else if (args_info.onsager_given) {
324 if (args_info.sele1_given) {
326 std::make_unique<OnsagerCorrFunc>(info, dumpFileName, sele1, sele2);
328 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
329 "--sele1 must be set for Center of Mass Rcorr\n");
330 painCave.severity = OPENMD_ERROR;
331 painCave.isFatal = 1;
334 }
else if (args_info.ddisp_given) {
335 corrFunc = std::make_unique<CollectiveDipoleDisplacement>(
336 info, dumpFileName, sele1, sele2);
337 }
else if (args_info.vaOutProdcorr_given) {
338 corrFunc = std::make_unique<VelocityAutoOutProductCorrFunc>(
339 info, dumpFileName, sele1, sele2);
340 }
else if (args_info.waOutProdcorr_given) {
341 corrFunc = std::make_unique<AngularVelocityAutoOutProductCorrFunc>(
342 info, dumpFileName, sele1, sele2);
343 }
else if (args_info.vwOutProdcorr_given) {
344 corrFunc = std::make_unique<VelAngularVelOutProdCorrFunc>(
345 info, dumpFileName, sele1, sele2);
346 }
else if (args_info.wvOutProdcorr_given) {
347 corrFunc = std::make_unique<AngularVelVelOutProdCorrFunc>(
348 info, dumpFileName, sele1, sele2);
349 }
else if (args_info.rotAngleDisp_given) {
350 corrFunc = std::make_unique<RotAngleDisplacement>(info, dumpFileName, sele1,
352 }
else if (args_info.meandisp_given) {
353 corrFunc = std::make_unique<MeanDisplacement>(info, dumpFileName, sele1,
357 if (args_info.output_given) { corrFunc->setOutputName(args_info.output_arg); }
359 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...
SimInfo * createSim(const std::string &mdFileName, bool loadInitCoords=true)
Setup Simulation.
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.