63 |
|
#include "applications/dynamicProps/StressCorrFunc.hpp" |
64 |
|
#include "applications/dynamicProps/SystemDipoleCorrFunc.hpp" |
65 |
|
#include "applications/dynamicProps/MomentumCorrFunc.hpp" |
66 |
+ |
#include "applications/dynamicProps/cOHz.hpp" |
67 |
+ |
#include "applications/dynamicProps/BondCorrFunc.hpp" |
68 |
+ |
#include "applications/dynamicProps/FreqFlucCorrFunc.hpp" |
69 |
|
|
70 |
|
using namespace OpenMD; |
71 |
|
|
78 |
|
exit(1) ; |
79 |
|
} |
80 |
|
|
78 |
– |
|
81 |
|
//get the dumpfile name and meta-data file name |
82 |
|
std::string dumpFileName = args_info.input_arg; |
83 |
|
|
84 |
|
std::string sele1; |
85 |
|
std::string sele2; |
86 |
< |
|
86 |
> |
|
87 |
> |
// check the first selection argument, or set it to the environment |
88 |
> |
// variable, or failing that, set it to "select all" |
89 |
> |
|
90 |
|
if (args_info.sele1_given) { |
91 |
|
sele1 = args_info.sele1_arg; |
92 |
< |
}else { |
92 |
> |
} else { |
93 |
|
char* sele1Env= getenv("SELECTION1"); |
94 |
|
if (sele1Env) { |
95 |
|
sele1 = sele1Env; |
96 |
< |
}else { |
97 |
< |
sprintf( painCave.errMsg, |
93 |
< |
"neither --sele1 option nor $SELECTION1 is set"); |
94 |
< |
painCave.severity = OPENMD_ERROR; |
95 |
< |
painCave.isFatal = 1; |
96 |
< |
simError(); |
96 |
> |
} else { |
97 |
> |
sele1 = "select all"; |
98 |
|
} |
99 |
|
} |
100 |
< |
|
100 |
> |
|
101 |
> |
// check the second selection argument, or set it to the environment |
102 |
> |
// variable, or failing that, set it to the first selection |
103 |
> |
|
104 |
|
if (args_info.sele2_given) { |
105 |
|
sele2 = args_info.sele2_arg; |
106 |
|
} else { |
107 |
|
char* sele2Env = getenv("SELECTION2"); |
108 |
|
if (sele2Env) { |
109 |
|
sele2 = sele2Env; |
110 |
< |
} else { |
110 |
> |
} else { |
111 |
> |
//If sele2 is not specified, then the default behavior |
112 |
> |
//should be what is already intended for sele1 |
113 |
|
sele2 = sele1; |
114 |
|
} |
115 |
|
} |
127 |
|
SimCreator creator; |
128 |
|
SimInfo* info = creator.createSim(dumpFileName, false); |
129 |
|
|
130 |
< |
TimeCorrFunc* corrFunc; |
130 |
> |
TimeCorrFunc* corrFunc = NULL; |
131 |
|
if(args_info.sdcorr_given){ |
132 |
< |
corrFunc = new SystemDipoleCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
132 |
> |
corrFunc = new SystemDipoleCorrFunc(info, dumpFileName, sele1, sele2, |
133 |
> |
memSize); |
134 |
|
} else if (args_info.selecorr_given){ |
135 |
|
corrFunc = new SelectionCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
136 |
|
} else if (args_info.dcorr_given){ |
142 |
|
} else if (args_info.thetacorr_given) { |
143 |
|
corrFunc = new ThetaCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
144 |
|
} else if (args_info.drcorr_given) { |
145 |
< |
corrFunc = new DirectionalRCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
145 |
> |
corrFunc = new DirectionalRCorrFunc(info, dumpFileName, sele1, sele2, |
146 |
> |
memSize); |
147 |
|
} else if (args_info.vcorr_given) { |
148 |
|
corrFunc = new VCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
149 |
+ |
} else if (args_info.vcorrZ_given) { |
150 |
+ |
corrFunc = new VCorrFuncZ(info, dumpFileName, sele1, sele2, memSize); |
151 |
+ |
} else if (args_info.vcorrR_given) { |
152 |
+ |
corrFunc = new VCorrFuncR(info, dumpFileName, sele1, sele2, memSize); |
153 |
+ |
} else if (args_info.bondcorr_given) { |
154 |
+ |
corrFunc = new BondCorrFunc(info, dumpFileName, sele1, memSize); |
155 |
|
} else if (args_info.helfandEcorr_given){ |
156 |
|
corrFunc = new EnergyCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
157 |
|
} else if (args_info.stresscorr_given){ |
158 |
|
corrFunc = new StressCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
159 |
|
} else if (args_info.momentum_given){ |
160 |
|
corrFunc = new MomentumCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
161 |
+ |
} else if (args_info.freqfluccorr_given){ |
162 |
+ |
corrFunc = new FreqFlucCorrFunc(info, dumpFileName, sele1, sele2, memSize); |
163 |
|
} else if (args_info.lcorr_given) { |
164 |
< |
int order; |
164 |
> |
int order(0); |
165 |
|
if (args_info.order_given) |
166 |
|
order = args_info.order_arg; |
167 |
|
else { |
172 |
|
simError(); |
173 |
|
} |
174 |
|
|
175 |
< |
corrFunc = new LegendreCorrFunc(info, dumpFileName, sele1, sele2, order, memSize); |
175 |
> |
corrFunc = new LegendreCorrFunc(info, dumpFileName, sele1, sele2, order, |
176 |
> |
memSize); |
177 |
|
} else if (args_info.lcorrZ_given) { |
178 |
< |
int order; |
178 |
> |
int order(0); |
179 |
|
if (args_info.order_given) |
180 |
|
order = args_info.order_arg; |
181 |
|
else { |
186 |
|
simError(); |
187 |
|
} |
188 |
|
|
189 |
< |
corrFunc = new LegendreCorrFuncZ(info, dumpFileName, sele1, sele2, order, args_info.nzbins_arg, memSize); |
189 |
> |
corrFunc = new LegendreCorrFuncZ(info, dumpFileName, sele1, sele2, order, |
190 |
> |
args_info.nzbins_arg, memSize); |
191 |
|
|
192 |
+ |
} else if (args_info.cohZ_given) { |
193 |
+ |
int order(0); |
194 |
+ |
if (args_info.order_given) |
195 |
+ |
order = args_info.order_arg; |
196 |
+ |
else { |
197 |
+ |
sprintf( painCave.errMsg, |
198 |
+ |
"--order must be set if --cohZ is set\n"); |
199 |
+ |
painCave.severity = OPENMD_ERROR; |
200 |
+ |
painCave.isFatal = 1; |
201 |
+ |
simError(); |
202 |
+ |
} |
203 |
+ |
|
204 |
+ |
corrFunc = new COHZ(info, dumpFileName, sele1, sele2, order, |
205 |
+ |
args_info.nzbins_arg, memSize); |
206 |
+ |
|
207 |
|
} |
208 |
|
|
209 |
+ |
|
210 |
|
if (args_info.output_given) { |
211 |
|
corrFunc->setOutputName(args_info.output_arg); |
212 |
|
} |