| 118 |
|
if (sele2Env) { |
| 119 |
|
sele2 = sele2Env; |
| 120 |
|
} else { |
| 121 |
< |
sele2 = "select all"; |
| 121 |
> |
//If sele2 is not specified, then the default behavior |
| 122 |
> |
//should be what is already intended for sele1 |
| 123 |
> |
sele2 = sele1; |
| 124 |
|
} |
| 125 |
|
} |
| 126 |
< |
|
| 125 |
< |
|
| 126 |
< |
// Problems if sele1 wasn't specified, but |
| 127 |
< |
// if (!args_info.scd_given) { |
| 128 |
< |
// sprintf( painCave.errMsg, |
| 129 |
< |
// "neither --sele1 option nor $SELECTION1 is set"); |
| 130 |
< |
// painCave.severity = OPENMD_ERROR; |
| 131 |
< |
// painCave.isFatal = 1; |
| 132 |
< |
// simError(); |
| 133 |
< |
// } |
| 134 |
< |
// } |
| 135 |
< |
|
| 136 |
< |
// Problems if sele1 wasn't specified |
| 137 |
< |
|
| 138 |
< |
// if(!args_info.scd_given && !args_info.density_given && !args_info.slab_density_given) { |
| 139 |
< |
// sprintf( painCave.errMsg, |
| 140 |
< |
// "neither --sele2 option nor $SELECTION1 is set"); |
| 141 |
< |
// painCave.severity = OPENMD_ERROR; |
| 142 |
< |
// painCave.isFatal = 1; |
| 143 |
< |
// simError(); |
| 144 |
< |
// } |
| 145 |
< |
// } |
| 146 |
< |
|
| 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(); |
| 168 |
< |
|
| 150 |
> |
simError(); |
| 151 |
|
} |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
//parse md file and set up the system |
| 155 |
|
SimCreator creator; |
| 174 |
– |
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"); |
| 214 |
|
if (args_info.sele2_given) |
| 215 |
|
analyser = new P2OrderParameter(info, dumpFileName, sele1, sele2); |
| 216 |
|
else |
| 217 |
< |
analyser = new P2OrderParameter(info, dumpFileName, sele1); |
| 217 |
> |
if (args_info.seleoffset_given) |
| 218 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1, |
| 219 |
> |
args_info.seleoffset_arg); |
| 220 |
> |
else |
| 221 |
> |
analyser = new P2OrderParameter(info, dumpFileName, sele1); |
| 222 |
|
} else { |
| 223 |
|
sprintf( painCave.errMsg, |
| 224 |
|
"At least one selection script (--sele1) must be specified when calculating P2 order parameters"); |
| 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 |
|
} |
| 359 |
– |
|