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/RNEMDStats.hpp" |
81 |
+ |
#include "applications/staticProps/NitrileFrequencyMap.hpp" |
82 |
+ |
#include "applications/staticProps/MultipoleSum.hpp" |
83 |
+ |
|
84 |
|
using namespace OpenMD; |
85 |
|
|
86 |
|
int main(int argc, char* argv[]){ |
113 |
|
} |
114 |
|
|
115 |
|
// check the second selection argument, or set it to the environment |
116 |
< |
// variable, or failing that, set it to "select all" |
116 |
> |
// variable, or failing that, set it to the first selection |
117 |
|
|
118 |
|
if (args_info.sele2_given) { |
119 |
|
sele2 = args_info.sele2_arg; |
120 |
|
} else { |
121 |
< |
char* sele2Env = getenv("SELECTION1"); |
121 |
> |
char* sele2Env = getenv("SELECTION2"); |
122 |
|
if (sele2Env) { |
123 |
|
sele2 = sele2Env; |
124 |
|
} else { |
125 |
< |
//It seems likely (from previous discussions) that if sele2 is not specified, then the default behavior |
126 |
< |
//should not be 'select all' but rather what is already intended for sele1 |
123 |
< |
//JRM 8/22/12 |
125 |
> |
//If sele2 is not specified, then the default behavior |
126 |
> |
//should be what is already intended for sele1 |
127 |
|
sele2 = sele1; |
125 |
– |
//sele2 = "select all"; |
128 |
|
} |
129 |
|
} |
130 |
< |
|
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 |
< |
|
130 |
> |
|
131 |
|
bool batchMode; |
132 |
|
if (args_info.scd_given){ |
133 |
< |
if (args_info.sele1_given && args_info.sele2_given && args_info.sele3_given) { |
133 |
> |
if (args_info.sele1_given && |
134 |
> |
args_info.sele2_given && args_info.sele3_given) { |
135 |
|
batchMode = false; |
136 |
< |
} else if (args_info.molname_given && args_info.begin_given && args_info.end_given) { |
137 |
< |
if (args_info.begin_arg < 0 || args_info.end_arg < 0 || args_info.begin_arg > args_info.end_arg-2) { |
136 |
> |
} else if (args_info.molname_given && |
137 |
> |
args_info.begin_given && args_info.end_given) { |
138 |
> |
if (args_info.begin_arg < 0 || |
139 |
> |
args_info.end_arg < 0 || args_info.begin_arg > args_info.end_arg-2) { |
140 |
|
sprintf( painCave.errMsg, |
141 |
|
"below conditions are not satisfied:\n" |
142 |
|
"0 <= begin && 0<= end && begin <= end-2\n"); |
151 |
|
" or --molname, --begin, --end are specified\n"); |
152 |
|
painCave.severity = OPENMD_ERROR; |
153 |
|
painCave.isFatal = 1; |
154 |
< |
simError(); |
172 |
< |
|
154 |
> |
simError(); |
155 |
|
} |
156 |
|
} |
157 |
|
|
158 |
|
//parse md file and set up the system |
159 |
|
SimCreator creator; |
178 |
– |
std::cout << "dumpFile = " << dumpFileName << "\n"; |
160 |
|
SimInfo* info = creator.createSim(dumpFileName); |
161 |
|
|
162 |
|
RealType maxLen; |
193 |
|
args_info.nanglebins_arg); |
194 |
|
} else if (args_info.gxyz_given) { |
195 |
|
if (args_info.refsele_given) { |
196 |
< |
analyser= new GofXyz(info, dumpFileName, sele1, sele2,args_info.refsele_arg, |
197 |
< |
maxLen, args_info.nbins_arg); |
196 |
> |
analyser= new GofXyz(info, dumpFileName, sele1, sele2, |
197 |
> |
args_info.refsele_arg, maxLen, args_info.nbins_arg); |
198 |
|
} else { |
199 |
|
sprintf( painCave.errMsg, |
200 |
|
"--refsele must set when --gxyz is used"); |
218 |
|
if (args_info.sele2_given) |
219 |
|
analyser = new P2OrderParameter(info, dumpFileName, sele1, sele2); |
220 |
|
else |
221 |
< |
analyser = new P2OrderParameter(info, dumpFileName, sele1); |
221 |
> |
if (args_info.seleoffset_given) |
222 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1, |
223 |
> |
args_info.seleoffset_arg); |
224 |
> |
else |
225 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1); |
226 |
|
} else { |
227 |
|
sprintf( painCave.errMsg, |
228 |
|
"At least one selection script (--sele1) must be specified when calculating P2 order parameters"); |
244 |
|
painCave.isFatal = 1; |
245 |
|
simError(); |
246 |
|
} |
247 |
< |
|
247 |
> |
} else if (args_info.multipole_given){ |
248 |
> |
analyser = new MultipoleSum(info, dumpFileName, sele1, |
249 |
> |
maxLen, args_info.nbins_arg); |
250 |
|
} else if (args_info.tet_param_given) { |
251 |
|
if (args_info.rcut_given) { |
252 |
|
analyser = new TetrahedralityParam(info, dumpFileName, sele1, |
261 |
|
} |
262 |
|
} else if (args_info.tet_param_z_given) { |
263 |
|
if (args_info.rcut_given) { |
264 |
< |
analyser = new TetrahedralityParamZ(info, dumpFileName, sele1, |
265 |
< |
args_info.rcut_arg, |
266 |
< |
args_info.nbins_arg); |
264 |
> |
analyser = new TetrahedralityParamZ(info, dumpFileName, sele1, sele2, |
265 |
> |
args_info.rcut_arg, |
266 |
> |
args_info.nbins_arg); |
267 |
|
} else { |
268 |
|
sprintf( painCave.errMsg, |
269 |
|
"A cutoff radius (rcut) must be specified when calculating Tetrahedrality Parameters"); |
271 |
|
painCave.isFatal = 1; |
272 |
|
simError(); |
273 |
|
} |
274 |
< |
} else if (args_info.bor_given){ |
274 |
> |
} else if (args_info.ior_given){ |
275 |
|
if (args_info.rcut_given) { |
276 |
< |
analyser = new BOPofR(info, dumpFileName, sele1, args_info.rcut_arg, |
276 |
> |
analyser = new IcosahedralOfR(info, dumpFileName, sele1, |
277 |
> |
args_info.rcut_arg, |
278 |
> |
args_info.nbins_arg, maxLen); |
279 |
> |
} else { |
280 |
> |
sprintf( painCave.errMsg, |
281 |
> |
"A cutoff radius (rcut) must be specified when calculating Bond Order Parameters"); |
282 |
> |
painCave.severity = OPENMD_ERROR; |
283 |
> |
painCave.isFatal = 1; |
284 |
> |
simError(); |
285 |
> |
} |
286 |
> |
} else if (args_info.for_given){ |
287 |
> |
if (args_info.rcut_given) { |
288 |
> |
analyser = new FCCOfR(info, dumpFileName, sele1, args_info.rcut_arg, |
289 |
|
args_info.nbins_arg, maxLen); |
290 |
|
} else { |
291 |
|
sprintf( painCave.errMsg, |
296 |
|
} |
297 |
|
} else if (args_info.bad_given){ |
298 |
|
if (args_info.rcut_given) { |
299 |
< |
analyser = new BondAngleDistribution(info, dumpFileName, sele1, args_info.rcut_arg, |
299 |
> |
analyser = new BondAngleDistribution(info, dumpFileName, sele1, |
300 |
> |
args_info.rcut_arg, |
301 |
|
args_info.nbins_arg); |
302 |
|
} else { |
303 |
|
sprintf( painCave.errMsg, |
305 |
|
painCave.severity = OPENMD_ERROR; |
306 |
|
painCave.isFatal = 1; |
307 |
|
simError(); |
308 |
< |
} |
308 |
> |
} |
309 |
|
} else if (args_info.scd_given) { |
310 |
|
if (batchMode) { |
311 |
< |
analyser = new SCDOrderParameter(info, dumpFileName, args_info.molname_arg, |
311 |
> |
analyser = new SCDOrderParameter(info, dumpFileName, |
312 |
> |
args_info.molname_arg, |
313 |
|
args_info.begin_arg, args_info.end_arg); |
314 |
|
} else{ |
315 |
|
std::string sele3 = args_info.sele3_arg; |
316 |
< |
analyser = new SCDOrderParameter(info, dumpFileName, sele1, sele2, sele3); |
316 |
> |
analyser = new SCDOrderParameter(info, dumpFileName, |
317 |
> |
sele1, sele2, sele3); |
318 |
|
} |
319 |
|
}else if (args_info.density_given) { |
320 |
|
analyser= new DensityPlot(info, dumpFileName, sele1, sele2, maxLen, |
323 |
|
analyser = new ObjectCount(info, dumpFileName, sele1 ); |
324 |
|
} else if (args_info.slab_density_given) { |
325 |
|
analyser = new RhoZ(info, dumpFileName, sele1, args_info.nbins_arg); |
326 |
+ |
} else if (args_info.rnemdz_given) { |
327 |
+ |
analyser = new RNEMDZ(info, dumpFileName, sele1, args_info.nbins_arg); |
328 |
+ |
} else if (args_info.rnemdr_given) { |
329 |
+ |
analyser = new RNEMDR(info, dumpFileName, sele1, args_info.nbins_arg); |
330 |
+ |
} else if (args_info.rnemdrt_given) { |
331 |
+ |
analyser = new RNEMDRTheta(info, dumpFileName, sele1, |
332 |
+ |
args_info.nbins_arg, args_info.nanglebins_arg); |
333 |
+ |
} else if (args_info.nitrile_given) { |
334 |
+ |
analyser = new NitrileFrequencyMap(info, dumpFileName, sele1, |
335 |
+ |
args_info.nbins_arg); |
336 |
|
} else if (args_info.p_angle_given) { |
337 |
< |
analyser = new pAngle(info, dumpFileName, sele1, args_info.nbins_arg); |
337 |
> |
if (args_info.sele1_given) { |
338 |
> |
if (args_info.sele2_given) |
339 |
> |
analyser = new pAngle(info, dumpFileName, sele1, sele2, |
340 |
> |
args_info.nbins_arg); |
341 |
> |
else |
342 |
> |
if (args_info.seleoffset_given) { |
343 |
> |
if (args_info.seleoffset2_given) { |
344 |
> |
analyser = new pAngle(info, dumpFileName, sele1, |
345 |
> |
args_info.seleoffset_arg, |
346 |
> |
args_info.seleoffset2_arg, |
347 |
> |
args_info.nbins_arg); |
348 |
> |
} else { |
349 |
> |
analyser = new pAngle(info, dumpFileName, sele1, |
350 |
> |
args_info.seleoffset_arg, |
351 |
> |
args_info.nbins_arg); |
352 |
> |
} |
353 |
> |
} else |
354 |
> |
analyser = new pAngle(info, dumpFileName, sele1, |
355 |
> |
args_info.nbins_arg); |
356 |
> |
} else { |
357 |
> |
sprintf( painCave.errMsg, |
358 |
> |
"At least one selection script (--sele1) must be specified when " |
359 |
> |
"calculating P(angle) distributions"); |
360 |
> |
painCave.severity = OPENMD_ERROR; |
361 |
> |
painCave.isFatal = 1; |
362 |
> |
simError(); |
363 |
> |
} |
364 |
|
#if defined(HAVE_FFTW_H) || defined(HAVE_DFFTW_H) || defined(HAVE_FFTW3_H) |
365 |
|
}else if (args_info.hxy_given) { |
366 |
|
analyser = new Hxy(info, dumpFileName, sele1, args_info.nbins_x_arg, |
383 |
|
} else if (args_info.angle_r_given) { |
384 |
|
analyser = new AngleR(info, dumpFileName, sele1, maxLen,args_info.nbins_arg); |
385 |
|
} |
386 |
< |
|
386 |
> |
|
387 |
|
if (args_info.output_given) { |
388 |
|
analyser->setOutputName(args_info.output_arg); |
389 |
|
} |
390 |
|
if (args_info.step_given) { |
391 |
|
analyser->setStep(args_info.step_arg); |
392 |
|
} |
393 |
< |
|
393 |
> |
|
394 |
|
analyser->process(); |
395 |
|
|
396 |
|
delete analyser; |
397 |
|
delete info; |
398 |
< |
|
398 |
> |
|
399 |
|
return 0; |
400 |
|
} |
363 |
– |
|