| 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). |
| 39 |
< |
* [4] Vardeman & Gezelter, in progress (2009). |
| 39 |
> |
* [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). |
| 40 |
> |
* [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). |
| 41 |
|
*/ |
| 42 |
|
|
| 43 |
|
#include <iostream> |
| 44 |
|
#include <fstream> |
| 45 |
|
#include <string> |
| 46 |
|
|
| 46 |
– |
#include "brains/Register.hpp" |
| 47 |
|
#include "brains/SimCreator.hpp" |
| 48 |
|
#include "brains/SimInfo.hpp" |
| 49 |
|
#include "io/DumpReader.hpp" |
| 69 |
|
#include "applications/staticProps/pAngle.hpp" |
| 70 |
|
#include "applications/staticProps/BondAngleDistribution.hpp" |
| 71 |
|
#include "applications/staticProps/NanoVolume.hpp" |
| 72 |
+ |
#include "applications/staticProps/NanoLength.hpp" |
| 73 |
|
#if defined(HAVE_FFTW_H) || defined(HAVE_DFFTW_H) || defined(HAVE_FFTW3_H) |
| 74 |
|
#include "applications/staticProps/Hxy.hpp" |
| 75 |
|
#endif |
| 76 |
|
#include "applications/staticProps/RhoR.hpp" |
| 77 |
< |
|
| 77 |
> |
#include "applications/staticProps/AngleR.hpp" |
| 78 |
> |
#include "applications/staticProps/TetrahedralityParam.hpp" |
| 79 |
> |
#include "applications/staticProps/TetrahedralityParamZ.hpp" |
| 80 |
|
using namespace OpenMD; |
| 81 |
|
|
| 82 |
|
int main(int argc, char* argv[]){ |
| 83 |
|
|
| 81 |
– |
//register force fields |
| 82 |
– |
registerForceFields(); |
| 84 |
|
|
| 85 |
|
gengetopt_args_info args_info; |
| 86 |
|
|
| 93 |
|
std::string dumpFileName = args_info.input_arg; |
| 94 |
|
std::string sele1; |
| 95 |
|
std::string sele2; |
| 95 |
– |
bool userSpecifiedSelect1; |
| 96 |
– |
bool userSpecifiedSelect2; |
| 96 |
|
|
| 97 |
|
// check the first selection argument, or set it to the environment |
| 98 |
|
// variable, or failing that, set it to "select all" |
| 186 |
|
maxLen = std::min(std::min(hmat(0, 0), hmat(1, 1)), hmat(2, 2)) /2.0; |
| 187 |
|
zmaxLen = hmat(2,2); |
| 188 |
|
} |
| 189 |
< |
|
| 189 |
> |
|
| 190 |
|
StaticAnalyser* analyser; |
| 191 |
|
if (args_info.gofr_given){ |
| 192 |
|
analyser= new GofR(info, dumpFileName, sele1, sele2, maxLen, |
| 193 |
< |
args_info.nbins_arg); |
| 193 |
> |
args_info.nbins_arg); |
| 194 |
|
} else if (args_info.gofz_given) { |
| 195 |
|
analyser= new GofZ(info, dumpFileName, sele1, sele2, maxLen, |
| 196 |
< |
args_info.nbins_arg); |
| 196 |
> |
args_info.nbins_arg); |
| 197 |
|
} else if (args_info.r_z_given) { |
| 198 |
|
analyser = new GofRZ(info, dumpFileName, sele1, sele2, maxLen, zmaxLen, |
| 199 |
< |
args_info.nbins_arg, args_info.nbins_z_arg); |
| 199 |
> |
args_info.nbins_arg, args_info.nbins_z_arg); |
| 200 |
|
} else if (args_info.r_theta_given) { |
| 201 |
|
analyser = new GofRTheta(info, dumpFileName, sele1, sele2, maxLen, |
| 202 |
< |
args_info.nbins_arg, args_info.nanglebins_arg); |
| 202 |
> |
args_info.nbins_arg, args_info.nanglebins_arg); |
| 203 |
|
} else if (args_info.r_omega_given) { |
| 204 |
|
analyser = new GofROmega(info, dumpFileName, sele1, sele2, maxLen, |
| 205 |
< |
args_info.nbins_arg, args_info.nanglebins_arg); |
| 205 |
> |
args_info.nbins_arg, args_info.nanglebins_arg); |
| 206 |
|
} else if (args_info.theta_omega_given) { |
| 207 |
|
analyser = new GofAngle2(info, dumpFileName, sele1, sele2, |
| 208 |
< |
args_info.nanglebins_arg); |
| 208 |
> |
args_info.nanglebins_arg); |
| 209 |
|
} else if (args_info.gxyz_given) { |
| 210 |
|
if (args_info.refsele_given) { |
| 211 |
|
analyser= new GofXyz(info, dumpFileName, sele1, sele2,args_info.refsele_arg, |
| 212 |
< |
maxLen, args_info.nbins_arg); |
| 212 |
> |
maxLen, args_info.nbins_arg); |
| 213 |
|
} else { |
| 214 |
|
sprintf( painCave.errMsg, |
| 215 |
< |
"--refsele must set when --gxyz is used"); |
| 215 |
> |
"--refsele must set when --gxyz is used"); |
| 216 |
|
painCave.severity = OPENMD_ERROR; |
| 217 |
|
painCave.isFatal = 1; |
| 218 |
|
simError(); |
| 220 |
|
} else if (args_info.twodgofr_given){ |
| 221 |
|
if (args_info.dz_given) { |
| 222 |
|
analyser= new TwoDGofR(info, dumpFileName, sele1, sele2, maxLen, |
| 223 |
< |
args_info.dz_arg, args_info.nbins_arg); |
| 223 |
> |
args_info.dz_arg, args_info.nbins_arg); |
| 224 |
|
} else { |
| 225 |
|
sprintf( painCave.errMsg, |
| 226 |
< |
"A slab width (dz) must be specified when calculating TwoDGofR"); |
| 226 |
> |
"A slab width (dz) must be specified when calculating TwoDGofR"); |
| 227 |
|
painCave.severity = OPENMD_ERROR; |
| 228 |
|
painCave.isFatal = 1; |
| 229 |
|
simError(); |
| 230 |
< |
} |
| 230 |
> |
} |
| 231 |
|
} else if (args_info.p2_given) { |
| 232 |
< |
analyser = new P2OrderParameter(info, dumpFileName, sele1, sele2); |
| 232 |
> |
if (args_info.sele1_given) { |
| 233 |
> |
if (args_info.sele2_given) |
| 234 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1, sele2); |
| 235 |
> |
else |
| 236 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1); |
| 237 |
> |
} else { |
| 238 |
> |
sprintf( painCave.errMsg, |
| 239 |
> |
"At least one selection script (--sele1) must be specified when calculating P2 order parameters"); |
| 240 |
> |
painCave.severity = OPENMD_ERROR; |
| 241 |
> |
painCave.isFatal = 1; |
| 242 |
> |
simError(); |
| 243 |
> |
} |
| 244 |
|
} else if (args_info.rp2_given){ |
| 245 |
|
analyser = new RippleOP(info, dumpFileName, sele1, sele2); |
| 246 |
|
} else if (args_info.bo_given){ |
| 247 |
|
if (args_info.rcut_given) { |
| 248 |
|
analyser = new BondOrderParameter(info, dumpFileName, sele1, |
| 249 |
< |
args_info.rcut_arg, |
| 250 |
< |
args_info.nbins_arg); |
| 249 |
> |
args_info.rcut_arg, |
| 250 |
> |
args_info.nbins_arg); |
| 251 |
|
} else { |
| 252 |
|
sprintf( painCave.errMsg, |
| 253 |
< |
"A cutoff radius (rcut) must be specified when calculating Bond Order Parameters"); |
| 253 |
> |
"A cutoff radius (rcut) must be specified when calculating Bond Order Parameters"); |
| 254 |
|
painCave.severity = OPENMD_ERROR; |
| 255 |
|
painCave.isFatal = 1; |
| 256 |
|
simError(); |
| 257 |
|
} |
| 258 |
+ |
|
| 259 |
+ |
} else if (args_info.tet_param_given) { |
| 260 |
+ |
if (args_info.rcut_given) { |
| 261 |
+ |
analyser = new TetrahedralityParam(info, dumpFileName, sele1, |
| 262 |
+ |
args_info.rcut_arg, |
| 263 |
+ |
args_info.nbins_arg); |
| 264 |
+ |
} else { |
| 265 |
+ |
sprintf( painCave.errMsg, |
| 266 |
+ |
"A cutoff radius (rcut) must be specified when calculating Tetrahedrality Parameters"); |
| 267 |
+ |
painCave.severity = OPENMD_ERROR; |
| 268 |
+ |
painCave.isFatal = 1; |
| 269 |
+ |
simError(); |
| 270 |
+ |
} |
| 271 |
+ |
} else if (args_info.tet_param_z_given) { |
| 272 |
+ |
if (args_info.rcut_given) { |
| 273 |
+ |
analyser = new TetrahedralityParamZ(info, dumpFileName, sele1, |
| 274 |
+ |
args_info.rcut_arg, |
| 275 |
+ |
args_info.nbins_arg); |
| 276 |
+ |
} else { |
| 277 |
+ |
sprintf( painCave.errMsg, |
| 278 |
+ |
"A cutoff radius (rcut) must be specified when calculating Tetrahedrality Parameters"); |
| 279 |
+ |
painCave.severity = OPENMD_ERROR; |
| 280 |
+ |
painCave.isFatal = 1; |
| 281 |
+ |
simError(); |
| 282 |
+ |
} |
| 283 |
|
} else if (args_info.bor_given){ |
| 284 |
|
if (args_info.rcut_given) { |
| 285 |
|
analyser = new BOPofR(info, dumpFileName, sele1, args_info.rcut_arg, |
| 286 |
< |
args_info.nbins_arg, maxLen); |
| 286 |
> |
args_info.nbins_arg, maxLen); |
| 287 |
|
} else { |
| 288 |
|
sprintf( painCave.errMsg, |
| 289 |
< |
"A cutoff radius (rcut) must be specified when calculating Bond Order Parameters"); |
| 289 |
> |
"A cutoff radius (rcut) must be specified when calculating Bond Order Parameters"); |
| 290 |
|
painCave.severity = OPENMD_ERROR; |
| 291 |
|
painCave.isFatal = 1; |
| 292 |
|
simError(); |
| 294 |
|
} else if (args_info.bad_given){ |
| 295 |
|
if (args_info.rcut_given) { |
| 296 |
|
analyser = new BondAngleDistribution(info, dumpFileName, sele1, args_info.rcut_arg, |
| 297 |
< |
args_info.nbins_arg); |
| 297 |
> |
args_info.nbins_arg); |
| 298 |
|
} else { |
| 299 |
|
sprintf( painCave.errMsg, |
| 300 |
< |
"A cutoff radius (rcut) must be specified when calculating Bond Angle Distributions"); |
| 300 |
> |
"A cutoff radius (rcut) must be specified when calculating Bond Angle Distributions"); |
| 301 |
|
painCave.severity = OPENMD_ERROR; |
| 302 |
|
painCave.isFatal = 1; |
| 303 |
|
simError(); |
| 304 |
< |
} |
| 304 |
> |
} |
| 305 |
|
} else if (args_info.scd_given) { |
| 306 |
|
if (batchMode) { |
| 307 |
|
analyser = new SCDOrderParameter(info, dumpFileName, args_info.molname_arg, |
| 308 |
< |
args_info.begin_arg, args_info.end_arg); |
| 308 |
> |
args_info.begin_arg, args_info.end_arg); |
| 309 |
|
} else{ |
| 310 |
|
std::string sele3 = args_info.sele3_arg; |
| 311 |
|
analyser = new SCDOrderParameter(info, dumpFileName, sele1, sele2, sele3); |
| 312 |
|
} |
| 313 |
|
}else if (args_info.density_given) { |
| 314 |
|
analyser= new DensityPlot(info, dumpFileName, sele1, sele2, maxLen, |
| 315 |
< |
args_info.nbins_arg); |
| 315 |
> |
args_info.nbins_arg); |
| 316 |
|
} else if (args_info.count_given) { |
| 317 |
|
analyser = new ObjectCount(info, dumpFileName, sele1 ); |
| 318 |
|
} else if (args_info.slab_density_given) { |
| 322 |
|
#if defined(HAVE_FFTW_H) || defined(HAVE_DFFTW_H) || defined(HAVE_FFTW3_H) |
| 323 |
|
}else if (args_info.hxy_given) { |
| 324 |
|
analyser = new Hxy(info, dumpFileName, sele1, args_info.nbins_x_arg, |
| 325 |
< |
args_info.nbins_y_arg, args_info.nbins_arg); |
| 325 |
> |
args_info.nbins_y_arg, args_info.nbins_arg); |
| 326 |
|
#endif |
| 327 |
|
}else if (args_info.rho_r_given) { |
| 328 |
|
if (args_info.radius_given){ |
| 329 |
|
analyser = new RhoR(info, dumpFileName, sele1, maxLen,args_info.nbins_arg,args_info.radius_arg); |
| 330 |
|
}else{ |
| 331 |
|
sprintf( painCave.errMsg, |
| 332 |
< |
"A particle radius (radius) must be specified when calculating Rho(r)"); |
| 332 |
> |
"A particle radius (radius) must be specified when calculating Rho(r)"); |
| 333 |
|
painCave.severity = OPENMD_ERROR; |
| 334 |
|
painCave.isFatal = 1; |
| 335 |
|
simError(); |
| 336 |
|
} |
| 337 |
< |
}else if (args_info.hullvol_given) { |
| 337 |
> |
} else if (args_info.hullvol_given) { |
| 338 |
|
analyser = new NanoVolume(info, dumpFileName, sele1); |
| 339 |
+ |
} else if (args_info.rodlength_given) { |
| 340 |
+ |
analyser = new NanoLength(info, dumpFileName, sele1); |
| 341 |
+ |
} else if (args_info.angle_r_given) { |
| 342 |
+ |
analyser = new AngleR(info, dumpFileName, sele1, maxLen,args_info.nbins_arg); |
| 343 |
|
} |
| 344 |
< |
|
| 344 |
> |
|
| 345 |
|
if (args_info.output_given) { |
| 346 |
|
analyser->setOutputName(args_info.output_arg); |
| 347 |
|
} |
| 348 |
|
if (args_info.step_given) { |
| 349 |
|
analyser->setStep(args_info.step_arg); |
| 350 |
|
} |
| 351 |
< |
|
| 351 |
> |
|
| 352 |
|
analyser->process(); |
| 353 |
< |
|
| 353 |
> |
|
| 354 |
|
delete analyser; |
| 355 |
|
delete info; |
| 356 |
|
|