ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/trunk/src/applications/staticProps/StaticProps.cpp
(Generate patch)

Comparing trunk/src/applications/staticProps/StaticProps.cpp (file contents):
Revision 1039 by gezelter, Tue Sep 19 21:14:11 2006 UTC vs.
Revision 1413 by gezelter, Mon Mar 22 19:21:22 2010 UTC

# Line 6 | Line 6
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
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).          
39 + * [4]  Vardeman & Gezelter, in progress (2009).                        
40   */
41  
42   #include <iostream>
# Line 52 | Line 52
52   #include "applications/staticProps/StaticPropsCmd.h"
53   #include "applications/staticProps/StaticAnalyser.hpp"
54   #include "applications/staticProps/GofR.hpp"
55 + #include "applications/staticProps/GofZ.hpp"
56   #include "applications/staticProps/GofRAngle.hpp"
57   #include "applications/staticProps/GofAngle2.hpp"
58   #include "applications/staticProps/GofXyz.hpp"
59   #include "applications/staticProps/P2OrderParameter.hpp"
60   #include "applications/staticProps/BondOrderParameter.hpp"
61 + #include "applications/staticProps/BOPofR.hpp"
62   #include "applications/staticProps/RippleOP.hpp"
63   #include "applications/staticProps/SCDOrderParameter.hpp"
64   #include "applications/staticProps/DensityPlot.hpp"
65   #include "applications/staticProps/RhoZ.hpp"
66 + #include "applications/staticProps/pAngle.hpp"
67 + #include "applications/staticProps/BondAngleDistribution.hpp"
68 + #include "applications/staticProps/NanoVolume.hpp"
69   #if defined(HAVE_FFTW_H) || defined(HAVE_DFFTW_H) || defined(HAVE_FFTW3_H)
70   #include "applications/staticProps/Hxy.hpp"
71   #endif
72 + #include "applications/staticProps/RhoR.hpp"
73  
74 < using namespace oopse;
74 > using namespace OpenMD;
75  
76   int main(int argc, char* argv[]){
77    
# Line 92 | Line 98 | int main(int argc, char* argv[]){
98    if (args_info.sele1_given) {
99      sele1 = args_info.sele1_arg;
100    } else {
101 <    char*  sele1Env= getenv("OOPSE_SELE1");
101 >    char*  sele1Env= getenv("SELECTION1");
102      if (sele1Env) {
103        sele1 = sele1Env;
104      } else {
# Line 106 | Line 112 | int main(int argc, char* argv[]){
112    if (args_info.sele2_given) {
113      sele2 = args_info.sele2_arg;
114    } else {
115 <    char* sele2Env = getenv("OOPSE_SELE2");
115 >    char* sele2Env = getenv("SELECTION1");
116      if (sele2Env) {
117        sele2 = sele2Env;            
118      } else {
# Line 118 | Line 124 | int main(int argc, char* argv[]){
124    // Problems if sele1 wasn't specified, but
125   // if (!args_info.scd_given) {
126   //       sprintf( painCave.errMsg,
127 < //                "neither --sele1 option nor $OOPSE_SELE1 is set");
128 < //       painCave.severity = OOPSE_ERROR;
127 > //                "neither --sele1 option nor $SELECTION1 is set");
128 > //       painCave.severity = OPENMD_ERROR;
129   //       painCave.isFatal = 1;
130   //       simError();
131   //     }
# Line 129 | Line 135 | int main(int argc, char* argv[]){
135  
136   //     if(!args_info.scd_given && !args_info.density_given && !args_info.slab_density_given)  {
137   //       sprintf( painCave.errMsg,
138 < //                "neither --sele2 option nor $OOPSE_SELE2 is set");
139 < //       painCave.severity = OOPSE_ERROR;
138 > //                "neither --sele2 option nor $SELECTION1 is set");
139 > //       painCave.severity = OPENMD_ERROR;
140   //       painCave.isFatal = 1;
141   //       simError();        
142   //     }
# Line 145 | Line 151 | int main(int argc, char* argv[]){
151          sprintf( painCave.errMsg,
152                   "below conditions are not satisfied:\n"
153                   "0 <= begin && 0<= end && begin <= end-2\n");
154 <        painCave.severity = OOPSE_ERROR;
154 >        painCave.severity = OPENMD_ERROR;
155          painCave.isFatal = 1;
156          simError();                    
157        }
# Line 154 | Line 160 | int main(int argc, char* argv[]){
160        sprintf( painCave.errMsg,
161                 "either --sele1, --sele2, --sele3 are specified,"
162                 " or --molname, --begin, --end are specified\n");
163 <      painCave.severity = OOPSE_ERROR;
163 >      painCave.severity = OPENMD_ERROR;
164        painCave.isFatal = 1;
165        simError();        
166      
# Line 163 | Line 169 | int main(int argc, char* argv[]){
169  
170    //parse md file and set up the system
171    SimCreator creator;
172 +  std::cout << "dumpFile = " << dumpFileName << "\n";
173    SimInfo* info = creator.createSim(dumpFileName);
174  
175    RealType maxLen;
# Line 175 | Line 182 | int main(int argc, char* argv[]){
182  
183    StaticAnalyser* analyser;
184    if (args_info.gofr_given){
185 <    analyser= new GofR(info, dumpFileName, sele1, sele2, maxLen, args_info.nrbins_arg);        
185 >    analyser= new GofR(info, dumpFileName, sele1, sele2, maxLen,
186 >                       args_info.nbins_arg);        
187 >  } else if (args_info.gofz_given) {
188 >    analyser= new GofZ(info, dumpFileName, sele1, sele2, maxLen,
189 >                       args_info.nbins_arg);
190    } else if (args_info.r_theta_given) {
191 <    analyser  = new GofRTheta(info, dumpFileName, sele1, sele2, maxLen, args_info.nrbins_arg, args_info.nanglebins_arg);
191 >    analyser  = new GofRTheta(info, dumpFileName, sele1, sele2, maxLen,
192 >                              args_info.nbins_arg, args_info.nanglebins_arg);
193    } else if (args_info.r_omega_given) {
194 <    analyser  = new GofROmega(info, dumpFileName, sele1, sele2, maxLen, args_info.nrbins_arg, args_info.nanglebins_arg);
194 >    analyser  = new GofROmega(info, dumpFileName, sele1, sele2, maxLen,
195 >                              args_info.nbins_arg, args_info.nanglebins_arg);
196    } else if (args_info.theta_omega_given) {
197 <    analyser  = new GofAngle2(info, dumpFileName, sele1, sele2, args_info.nanglebins_arg);
197 >    analyser  = new GofAngle2(info, dumpFileName, sele1, sele2,
198 >                              args_info.nanglebins_arg);
199    } else if (args_info.gxyz_given) {
200      if (args_info.refsele_given) {
201 <      analyser= new GofXyz(info, dumpFileName, sele1, sele2,args_info.refsele_arg, maxLen, args_info.nrbins_arg);        
201 >      analyser= new GofXyz(info, dumpFileName, sele1, sele2,args_info.refsele_arg,
202 >                           maxLen, args_info.nbins_arg);        
203      } else {
204        sprintf( painCave.errMsg,
205                 "--refsele must set when --gxyz is used");
206 <      painCave.severity = OOPSE_ERROR;
206 >      painCave.severity = OPENMD_ERROR;
207        painCave.isFatal = 1;
208        simError();  
209      }
# Line 197 | Line 212 | int main(int argc, char* argv[]){
212    } else if (args_info.rp2_given){
213      analyser = new RippleOP(info, dumpFileName, sele1, sele2);
214    } else if (args_info.bo_given){
215 <    if (args_info.rcut_given && args_info.LegendreL_given) {
215 >    if (args_info.rcut_given) {
216        analyser = new BondOrderParameter(info, dumpFileName, sele1,
217                                          args_info.rcut_arg,
218 <                                        args_info.LegendreL_arg);
218 >                                        args_info.nbins_arg);
219      } else {
220        sprintf( painCave.errMsg,
221 <               "Both the cutoff radius (rcut) and LegendreL must be specified when calculating Bond Order Parameters");
222 <      painCave.severity = OOPSE_ERROR;
221 >               "A cutoff radius (rcut) must be specified when calculating Bond Order Parameters");
222 >      painCave.severity = OPENMD_ERROR;
223        painCave.isFatal = 1;
224        simError();
225      }
226 +  } else if (args_info.bor_given){
227 +    if (args_info.rcut_given) {
228 +      analyser = new BOPofR(info, dumpFileName, sele1, args_info.rcut_arg,
229 +                            args_info.nbins_arg, maxLen);
230 +    } else {
231 +      sprintf( painCave.errMsg,
232 +               "A cutoff radius (rcut) must be specified when calculating Bond Order Parameters");
233 +      painCave.severity = OPENMD_ERROR;
234 +      painCave.isFatal = 1;
235 +      simError();
236 +    }
237 +  } else if (args_info.bad_given){
238 +    if (args_info.rcut_given) {
239 +      analyser = new BondAngleDistribution(info, dumpFileName, sele1, args_info.rcut_arg,
240 +                            args_info.nbins_arg);
241 +    } else {
242 +      sprintf( painCave.errMsg,
243 +               "A cutoff radius (rcut) must be specified when calculating Bond Angle Distributions");
244 +      painCave.severity = OPENMD_ERROR;
245 +      painCave.isFatal = 1;
246 +      simError();
247 +    }
248    } else if (args_info.scd_given) {
249      if (batchMode) {
250        analyser  = new SCDOrderParameter(info, dumpFileName, args_info.molname_arg,
# Line 217 | Line 254 | int main(int argc, char* argv[]){
254        analyser  = new SCDOrderParameter(info, dumpFileName, sele1, sele2, sele3);
255      }
256    }else if (args_info.density_given) {
257 <    analyser= new DensityPlot(info, dumpFileName, sele1, sele2, maxLen, args_info.nrbins_arg);  
257 >    analyser= new DensityPlot(info, dumpFileName, sele1, sele2, maxLen,
258 >                              args_info.nbins_arg);  
259    } else if (args_info.slab_density_given) {
260 <    Mat3x3d hmat = info->getSnapshotManager()->getCurrentSnapshot()->getHmat();
261 <    analyser = new RhoZ(info, dumpFileName, sele1, hmat(2, 2), args_info.nrbins_arg);
260 >    analyser = new RhoZ(info, dumpFileName, sele1, args_info.nbins_arg);
261 >  } else if (args_info.p_angle_given) {
262 >    analyser = new pAngle(info, dumpFileName, sele1, args_info.nbins_arg);
263   #if defined(HAVE_FFTW_H) || defined(HAVE_DFFTW_H) || defined(HAVE_FFTW3_H)
264    }else if (args_info.hxy_given) {
265 <    analyser = new Hxy(info, dumpFileName, sele1, args_info.nbins_x_arg, args_info.nbins_y_arg, args_info.nrbins_arg);
265 >    analyser = new Hxy(info, dumpFileName, sele1, args_info.nbins_x_arg,
266 >                       args_info.nbins_y_arg, args_info.nbins_arg);
267   #endif
268 +  }else if (args_info.rho_r_given) {
269 +    if (args_info.radius_given){
270 +      analyser = new RhoR(info, dumpFileName, sele1, maxLen,args_info.nbins_arg,args_info.radius_arg);
271 +    }else{
272 +      sprintf( painCave.errMsg,
273 +               "A particle radius (radius) must be specified when calculating Rho(r)");
274 +      painCave.severity = OPENMD_ERROR;
275 +      painCave.isFatal = 1;
276 +      simError();
277 +    }
278 +        }else if (args_info.hullvol_given) {
279 +    analyser = new NanoVolume(info, dumpFileName, sele1);
280    }
281    
282    if (args_info.output_given) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines