| 121 |  | //If sele2 is not specified, then the default behavior | 
| 122 |  | //should be what is already intended for sele1 | 
| 123 |  | sele2 = sele1; | 
| 124 | – | //sele2 = "select all"; | 
| 124 |  | } | 
| 125 |  | } | 
| 126 | < |  | 
| 128 | < |  | 
| 129 | < | // Problems if sele1 wasn't specified, but | 
| 130 | < | // if (!args_info.scd_given) { | 
| 131 | < | //       sprintf( painCave.errMsg, | 
| 132 | < | //                "neither --sele1 option nor $SELECTION1 is set"); | 
| 133 | < | //       painCave.severity = OPENMD_ERROR; | 
| 134 | < | //       painCave.isFatal = 1; | 
| 135 | < | //       simError(); | 
| 136 | < | //     } | 
| 137 | < | //   } | 
| 138 | < |  | 
| 139 | < | // Problems if sele1 wasn't specified | 
| 140 | < |  | 
| 141 | < | //     if(!args_info.scd_given && !args_info.density_given && !args_info.slab_density_given)  { | 
| 142 | < | //       sprintf( painCave.errMsg, | 
| 143 | < | //                "neither --sele2 option nor $SELECTION1 is set"); | 
| 144 | < | //       painCave.severity = OPENMD_ERROR; | 
| 145 | < | //       painCave.isFatal = 1; | 
| 146 | < | //       simError(); | 
| 147 | < | //     } | 
| 148 | < | //   } | 
| 149 | < |  | 
| 126 | > |  | 
| 127 |  | bool batchMode; | 
| 128 |  | if (args_info.scd_given){ | 
| 129 | < | if (args_info.sele1_given && args_info.sele2_given && args_info.sele3_given) { | 
| 129 | > | if (args_info.sele1_given && | 
| 130 | > | args_info.sele2_given && args_info.sele3_given) { | 
| 131 |  | batchMode = false; | 
| 132 | < | } else if (args_info.molname_given && args_info.begin_given && args_info.end_given) { | 
| 133 | < | if (args_info.begin_arg < 0 || args_info.end_arg < 0 || args_info.begin_arg > args_info.end_arg-2) { | 
| 132 | > | } else if (args_info.molname_given && | 
| 133 | > | args_info.begin_given && args_info.end_given) { | 
| 134 | > | if (args_info.begin_arg < 0 || | 
| 135 | > | args_info.end_arg < 0 || args_info.begin_arg > args_info.end_arg-2) { | 
| 136 |  | sprintf( painCave.errMsg, | 
| 137 |  | "below conditions are not satisfied:\n" | 
| 138 |  | "0 <= begin && 0<= end && begin <= end-2\n"); | 
| 147 |  | " or --molname, --begin, --end are specified\n"); | 
| 148 |  | painCave.severity = OPENMD_ERROR; | 
| 149 |  | painCave.isFatal = 1; | 
| 150 | < | simError(); | 
| 171 | < |  | 
| 150 | > | simError(); | 
| 151 |  | } | 
| 152 |  | } | 
| 153 |  |  | 
| 154 |  | //parse md file and set up the system | 
| 155 |  | SimCreator creator; | 
| 177 | – | std::cout << "dumpFile = " << dumpFileName << "\n"; | 
| 156 |  | SimInfo* info = creator.createSim(dumpFileName); | 
| 157 |  |  | 
| 158 |  | RealType maxLen; | 
| 189 |  | args_info.nanglebins_arg); | 
| 190 |  | } else if (args_info.gxyz_given) { | 
| 191 |  | if (args_info.refsele_given) { | 
| 192 | < | analyser= new GofXyz(info, dumpFileName, sele1, sele2,args_info.refsele_arg, | 
| 193 | < | maxLen, args_info.nbins_arg); | 
| 192 | > | analyser= new GofXyz(info, dumpFileName, sele1, sele2, | 
| 193 | > | args_info.refsele_arg, maxLen, args_info.nbins_arg); | 
| 194 |  | } else { | 
| 195 |  | sprintf( painCave.errMsg, | 
| 196 |  | "--refsele must set when --gxyz is used"); | 
| 255 |  | } | 
| 256 |  | } else if (args_info.tet_param_z_given) { | 
| 257 |  | if (args_info.rcut_given) { | 
| 258 | < | analyser = new TetrahedralityParamZ(info, dumpFileName, sele1, | 
| 259 | < | args_info.rcut_arg, | 
| 260 | < | args_info.nbins_arg); | 
| 258 | > | analyser = new TetrahedralityParamZ(info, dumpFileName, sele1, sele2, | 
| 259 | > | args_info.rcut_arg, | 
| 260 | > | args_info.nbins_arg); | 
| 261 |  | } else { | 
| 262 |  | sprintf( painCave.errMsg, | 
| 263 |  | "A cutoff radius (rcut) must be specified when calculating Tetrahedrality Parameters"); | 
| 278 |  | } | 
| 279 |  | } else if (args_info.bad_given){ | 
| 280 |  | if (args_info.rcut_given) { | 
| 281 | < | analyser = new BondAngleDistribution(info, dumpFileName, sele1, args_info.rcut_arg, | 
| 281 | > | analyser = new BondAngleDistribution(info, dumpFileName, sele1, | 
| 282 | > | args_info.rcut_arg, | 
| 283 |  | args_info.nbins_arg); | 
| 284 |  | } else { | 
| 285 |  | sprintf( painCave.errMsg, | 
| 287 |  | painCave.severity = OPENMD_ERROR; | 
| 288 |  | painCave.isFatal = 1; | 
| 289 |  | simError(); | 
| 290 | < | } | 
| 290 | > | } | 
| 291 |  | } else if (args_info.scd_given) { | 
| 292 |  | if (batchMode) { | 
| 293 | < | analyser  = new SCDOrderParameter(info, dumpFileName, args_info.molname_arg, | 
| 293 | > | analyser  = new SCDOrderParameter(info, dumpFileName, | 
| 294 | > | args_info.molname_arg, | 
| 295 |  | args_info.begin_arg, args_info.end_arg); | 
| 296 |  | } else{ | 
| 297 |  | std::string sele3 = args_info.sele3_arg; | 
| 298 | < | analyser  = new SCDOrderParameter(info, dumpFileName, sele1, sele2, sele3); | 
| 298 | > | analyser  = new SCDOrderParameter(info, dumpFileName, | 
| 299 | > | sele1, sele2, sele3); | 
| 300 |  | } | 
| 301 |  | }else if (args_info.density_given) { | 
| 302 |  | analyser= new DensityPlot(info, dumpFileName, sele1, sele2, maxLen, | 
| 329 |  | } else if (args_info.angle_r_given) { | 
| 330 |  | analyser = new AngleR(info, dumpFileName, sele1, maxLen,args_info.nbins_arg); | 
| 331 |  | } | 
| 332 | < |  | 
| 332 | > |  | 
| 333 |  | if (args_info.output_given) { | 
| 334 |  | analyser->setOutputName(args_info.output_arg); | 
| 335 |  | } | 
| 336 |  | if (args_info.step_given) { | 
| 337 |  | analyser->setStep(args_info.step_arg); | 
| 338 |  | } | 
| 339 | < |  | 
| 339 | > |  | 
| 340 |  | analyser->process(); | 
| 341 |  |  | 
| 342 |  | delete analyser; | 
| 343 |  | delete info; | 
| 344 | < |  | 
| 344 | > |  | 
| 345 |  | return 0; | 
| 346 |  | } | 
| 366 | – |  |