35 |
|
* |
36 |
|
* [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
37 |
|
* [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
38 |
< |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
38 |
> |
* [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 234107 (2008). |
39 |
|
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
40 |
|
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
41 |
|
*/ |
77 |
|
#include "applications/staticProps/AngleR.hpp" |
78 |
|
#include "applications/staticProps/TetrahedralityParam.hpp" |
79 |
|
#include "applications/staticProps/TetrahedralityParamZ.hpp" |
80 |
+ |
#include "applications/staticProps/TetrahedralityParamXYZ.hpp" |
81 |
+ |
#include "applications/staticProps/RNEMDStats.hpp" |
82 |
+ |
#include "applications/staticProps/NitrileFrequencyMap.hpp" |
83 |
+ |
#include "applications/staticProps/MultipoleSum.hpp" |
84 |
+ |
|
85 |
|
using namespace OpenMD; |
86 |
|
|
87 |
|
int main(int argc, char* argv[]){ |
114 |
|
} |
115 |
|
|
116 |
|
// check the second selection argument, or set it to the environment |
117 |
< |
// variable, or failing that, set it to "select all" |
117 |
> |
// variable, or failing that, set it to the first selection |
118 |
|
|
119 |
|
if (args_info.sele2_given) { |
120 |
|
sele2 = args_info.sele2_arg; |
121 |
|
} else { |
122 |
< |
char* sele2Env = getenv("SELECTION1"); |
122 |
> |
char* sele2Env = getenv("SELECTION2"); |
123 |
|
if (sele2Env) { |
124 |
|
sele2 = sele2Env; |
125 |
|
} else { |
126 |
< |
//It seems likely (from previous discussions) that if sele2 is not specified, then the default behavior |
127 |
< |
//should not be 'select all' but rather what is already intended for sele1 |
123 |
< |
//JRM 8/22/12 |
126 |
> |
//If sele2 is not specified, then the default behavior |
127 |
> |
//should be what is already intended for sele1 |
128 |
|
sele2 = sele1; |
125 |
– |
//sele2 = "select all"; |
129 |
|
} |
130 |
|
} |
131 |
< |
|
129 |
< |
|
130 |
< |
// Problems if sele1 wasn't specified, but |
131 |
< |
// if (!args_info.scd_given) { |
132 |
< |
// sprintf( painCave.errMsg, |
133 |
< |
// "neither --sele1 option nor $SELECTION1 is set"); |
134 |
< |
// painCave.severity = OPENMD_ERROR; |
135 |
< |
// painCave.isFatal = 1; |
136 |
< |
// simError(); |
137 |
< |
// } |
138 |
< |
// } |
139 |
< |
|
140 |
< |
// Problems if sele1 wasn't specified |
141 |
< |
|
142 |
< |
// if(!args_info.scd_given && !args_info.density_given && !args_info.slab_density_given) { |
143 |
< |
// sprintf( painCave.errMsg, |
144 |
< |
// "neither --sele2 option nor $SELECTION1 is set"); |
145 |
< |
// painCave.severity = OPENMD_ERROR; |
146 |
< |
// painCave.isFatal = 1; |
147 |
< |
// simError(); |
148 |
< |
// } |
149 |
< |
// } |
150 |
< |
|
131 |
> |
|
132 |
|
bool batchMode; |
133 |
|
if (args_info.scd_given){ |
134 |
< |
if (args_info.sele1_given && args_info.sele2_given && args_info.sele3_given) { |
134 |
> |
if (args_info.sele1_given && |
135 |
> |
args_info.sele2_given && args_info.sele3_given) { |
136 |
|
batchMode = false; |
137 |
< |
} else if (args_info.molname_given && args_info.begin_given && args_info.end_given) { |
138 |
< |
if (args_info.begin_arg < 0 || args_info.end_arg < 0 || args_info.begin_arg > args_info.end_arg-2) { |
137 |
> |
} else if (args_info.molname_given && |
138 |
> |
args_info.begin_given && args_info.end_given) { |
139 |
> |
if (args_info.begin_arg < 0 || |
140 |
> |
args_info.end_arg < 0 || args_info.begin_arg > args_info.end_arg-2) { |
141 |
|
sprintf( painCave.errMsg, |
142 |
|
"below conditions are not satisfied:\n" |
143 |
|
"0 <= begin && 0<= end && begin <= end-2\n"); |
152 |
|
" or --molname, --begin, --end are specified\n"); |
153 |
|
painCave.severity = OPENMD_ERROR; |
154 |
|
painCave.isFatal = 1; |
155 |
< |
simError(); |
172 |
< |
|
155 |
> |
simError(); |
156 |
|
} |
157 |
|
} |
158 |
|
|
159 |
|
//parse md file and set up the system |
160 |
|
SimCreator creator; |
178 |
– |
std::cout << "dumpFile = " << dumpFileName << "\n"; |
161 |
|
SimInfo* info = creator.createSim(dumpFileName); |
162 |
|
|
163 |
|
RealType maxLen; |
194 |
|
args_info.nanglebins_arg); |
195 |
|
} else if (args_info.gxyz_given) { |
196 |
|
if (args_info.refsele_given) { |
197 |
< |
analyser= new GofXyz(info, dumpFileName, sele1, sele2,args_info.refsele_arg, |
198 |
< |
maxLen, args_info.nbins_arg); |
197 |
> |
analyser= new GofXyz(info, dumpFileName, sele1, sele2, |
198 |
> |
args_info.refsele_arg, maxLen, args_info.nbins_arg); |
199 |
|
} else { |
200 |
|
sprintf( painCave.errMsg, |
201 |
|
"--refsele must set when --gxyz is used"); |
219 |
|
if (args_info.sele2_given) |
220 |
|
analyser = new P2OrderParameter(info, dumpFileName, sele1, sele2); |
221 |
|
else |
222 |
< |
analyser = new P2OrderParameter(info, dumpFileName, sele1); |
222 |
> |
if (args_info.seleoffset_given) |
223 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1, |
224 |
> |
args_info.seleoffset_arg); |
225 |
> |
else |
226 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1); |
227 |
|
} else { |
228 |
|
sprintf( painCave.errMsg, |
229 |
|
"At least one selection script (--sele1) must be specified when calculating P2 order parameters"); |
245 |
|
painCave.isFatal = 1; |
246 |
|
simError(); |
247 |
|
} |
248 |
< |
|
248 |
> |
} else if (args_info.multipole_given){ |
249 |
> |
analyser = new MultipoleSum(info, dumpFileName, sele1, |
250 |
> |
maxLen, args_info.nbins_arg); |
251 |
|
} else if (args_info.tet_param_given) { |
252 |
|
if (args_info.rcut_given) { |
253 |
|
analyser = new TetrahedralityParam(info, dumpFileName, sele1, |
262 |
|
} |
263 |
|
} else if (args_info.tet_param_z_given) { |
264 |
|
if (args_info.rcut_given) { |
265 |
< |
analyser = new TetrahedralityParamZ(info, dumpFileName, sele1, |
266 |
< |
args_info.rcut_arg, |
267 |
< |
args_info.nbins_arg); |
265 |
> |
analyser = new TetrahedralityParamZ(info, dumpFileName, sele1, sele2, |
266 |
> |
args_info.rcut_arg, |
267 |
> |
args_info.nbins_arg); |
268 |
|
} else { |
269 |
|
sprintf( painCave.errMsg, |
270 |
|
"A cutoff radius (rcut) must be specified when calculating Tetrahedrality Parameters"); |
272 |
|
painCave.isFatal = 1; |
273 |
|
simError(); |
274 |
|
} |
275 |
< |
} else if (args_info.bor_given){ |
275 |
> |
} else if (args_info.tet_param_xyz_given) { |
276 |
> |
if (!args_info.rcut_given) { |
277 |
> |
sprintf( painCave.errMsg, |
278 |
> |
"A cutoff radius (rcut) must be specified when calculating" |
279 |
> |
" Tetrahedrality Parameters"); |
280 |
> |
painCave.severity = OPENMD_ERROR; |
281 |
> |
painCave.isFatal = 1; |
282 |
> |
simError(); |
283 |
> |
} |
284 |
> |
if (!args_info.voxelSize_given) { |
285 |
> |
sprintf( painCave.errMsg, |
286 |
> |
"A voxel size must be specified when calculating" |
287 |
> |
" volume-resolved Tetrahedrality Parameters"); |
288 |
> |
painCave.severity = OPENMD_ERROR; |
289 |
> |
painCave.isFatal = 1; |
290 |
> |
simError(); |
291 |
> |
} |
292 |
> |
if (!args_info.gaussWidth_given) { |
293 |
> |
sprintf( painCave.errMsg, |
294 |
> |
"A gaussian width must be specified when calculating" |
295 |
> |
" volume-resolved Tetrahedrality Parameters"); |
296 |
> |
painCave.severity = OPENMD_ERROR; |
297 |
> |
painCave.isFatal = 1; |
298 |
> |
simError(); |
299 |
> |
} |
300 |
> |
analyser = new TetrahedralityParamXYZ(info, dumpFileName, sele1, sele2, |
301 |
> |
args_info.rcut_arg, |
302 |
> |
args_info.voxelSize_arg, |
303 |
> |
args_info.gaussWidth_arg); |
304 |
> |
} else if (args_info.ior_given){ |
305 |
|
if (args_info.rcut_given) { |
306 |
< |
analyser = new BOPofR(info, dumpFileName, sele1, args_info.rcut_arg, |
306 |
> |
analyser = new IcosahedralOfR(info, dumpFileName, sele1, |
307 |
> |
args_info.rcut_arg, |
308 |
> |
args_info.nbins_arg, maxLen); |
309 |
> |
} else { |
310 |
> |
sprintf( painCave.errMsg, |
311 |
> |
"A cutoff radius (rcut) must be specified when calculating Bond Order Parameters"); |
312 |
> |
painCave.severity = OPENMD_ERROR; |
313 |
> |
painCave.isFatal = 1; |
314 |
> |
simError(); |
315 |
> |
} |
316 |
> |
} else if (args_info.for_given){ |
317 |
> |
if (args_info.rcut_given) { |
318 |
> |
analyser = new FCCOfR(info, dumpFileName, sele1, args_info.rcut_arg, |
319 |
|
args_info.nbins_arg, maxLen); |
320 |
|
} else { |
321 |
|
sprintf( painCave.errMsg, |
326 |
|
} |
327 |
|
} else if (args_info.bad_given){ |
328 |
|
if (args_info.rcut_given) { |
329 |
< |
analyser = new BondAngleDistribution(info, dumpFileName, sele1, args_info.rcut_arg, |
329 |
> |
analyser = new BondAngleDistribution(info, dumpFileName, sele1, |
330 |
> |
args_info.rcut_arg, |
331 |
|
args_info.nbins_arg); |
332 |
|
} else { |
333 |
|
sprintf( painCave.errMsg, |
335 |
|
painCave.severity = OPENMD_ERROR; |
336 |
|
painCave.isFatal = 1; |
337 |
|
simError(); |
338 |
< |
} |
338 |
> |
} |
339 |
|
} else if (args_info.scd_given) { |
340 |
|
if (batchMode) { |
341 |
< |
analyser = new SCDOrderParameter(info, dumpFileName, args_info.molname_arg, |
341 |
> |
analyser = new SCDOrderParameter(info, dumpFileName, |
342 |
> |
args_info.molname_arg, |
343 |
|
args_info.begin_arg, args_info.end_arg); |
344 |
|
} else{ |
345 |
|
std::string sele3 = args_info.sele3_arg; |
346 |
< |
analyser = new SCDOrderParameter(info, dumpFileName, sele1, sele2, sele3); |
346 |
> |
analyser = new SCDOrderParameter(info, dumpFileName, |
347 |
> |
sele1, sele2, sele3); |
348 |
|
} |
349 |
|
}else if (args_info.density_given) { |
350 |
|
analyser= new DensityPlot(info, dumpFileName, sele1, sele2, maxLen, |
353 |
|
analyser = new ObjectCount(info, dumpFileName, sele1 ); |
354 |
|
} else if (args_info.slab_density_given) { |
355 |
|
analyser = new RhoZ(info, dumpFileName, sele1, args_info.nbins_arg); |
356 |
+ |
} else if (args_info.rnemdz_given) { |
357 |
+ |
analyser = new RNEMDZ(info, dumpFileName, sele1, args_info.nbins_arg); |
358 |
+ |
} else if (args_info.rnemdr_given) { |
359 |
+ |
analyser = new RNEMDR(info, dumpFileName, sele1, args_info.nbins_arg); |
360 |
+ |
} else if (args_info.rnemdrt_given) { |
361 |
+ |
analyser = new RNEMDRTheta(info, dumpFileName, sele1, |
362 |
+ |
args_info.nbins_arg, args_info.nanglebins_arg); |
363 |
+ |
} else if (args_info.nitrile_given) { |
364 |
+ |
analyser = new NitrileFrequencyMap(info, dumpFileName, sele1, |
365 |
+ |
args_info.nbins_arg); |
366 |
|
} else if (args_info.p_angle_given) { |
367 |
< |
analyser = new pAngle(info, dumpFileName, sele1, args_info.nbins_arg); |
367 |
> |
if (args_info.sele1_given) { |
368 |
> |
if (args_info.sele2_given) |
369 |
> |
analyser = new pAngle(info, dumpFileName, sele1, sele2, |
370 |
> |
args_info.nbins_arg); |
371 |
> |
else |
372 |
> |
if (args_info.seleoffset_given) { |
373 |
> |
if (args_info.seleoffset2_given) { |
374 |
> |
analyser = new pAngle(info, dumpFileName, sele1, |
375 |
> |
args_info.seleoffset_arg, |
376 |
> |
args_info.seleoffset2_arg, |
377 |
> |
args_info.nbins_arg); |
378 |
> |
} else { |
379 |
> |
analyser = new pAngle(info, dumpFileName, sele1, |
380 |
> |
args_info.seleoffset_arg, |
381 |
> |
args_info.nbins_arg); |
382 |
> |
} |
383 |
> |
} else |
384 |
> |
analyser = new pAngle(info, dumpFileName, sele1, |
385 |
> |
args_info.nbins_arg); |
386 |
> |
} else { |
387 |
> |
sprintf( painCave.errMsg, |
388 |
> |
"At least one selection script (--sele1) must be specified when " |
389 |
> |
"calculating P(angle) distributions"); |
390 |
> |
painCave.severity = OPENMD_ERROR; |
391 |
> |
painCave.isFatal = 1; |
392 |
> |
simError(); |
393 |
> |
} |
394 |
|
#if defined(HAVE_FFTW_H) || defined(HAVE_DFFTW_H) || defined(HAVE_FFTW3_H) |
395 |
|
}else if (args_info.hxy_given) { |
396 |
|
analyser = new Hxy(info, dumpFileName, sele1, args_info.nbins_x_arg, |
413 |
|
} else if (args_info.angle_r_given) { |
414 |
|
analyser = new AngleR(info, dumpFileName, sele1, maxLen,args_info.nbins_arg); |
415 |
|
} |
416 |
< |
|
416 |
> |
|
417 |
|
if (args_info.output_given) { |
418 |
|
analyser->setOutputName(args_info.output_arg); |
419 |
|
} |
420 |
|
if (args_info.step_given) { |
421 |
|
analyser->setStep(args_info.step_arg); |
422 |
|
} |
423 |
< |
|
423 |
> |
|
424 |
|
analyser->process(); |
425 |
|
|
426 |
|
delete analyser; |
427 |
|
delete info; |
428 |
< |
|
428 |
> |
|
429 |
|
return 0; |
430 |
|
} |
363 |
– |
|