ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/dump2Xyz/Dump2XYZ.cpp
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/dump2Xyz/Dump2XYZ.cpp (file contents):
Revision 1930 by gezelter, Wed Jan 12 22:41:40 2005 UTC vs.
Revision 2240 by tim, Thu May 26 22:45:00 2005 UTC

# Line 1 | Line 1
1 < /*
1 > /*
2   * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
# Line 54 | Line 54 | using namespace oopse;
54   #include "visitors/RigidBodyVisitor.hpp"
55   #include "visitors/OtherVisitor.hpp"
56   #include "visitors/ZconsVisitor.hpp"
57 + #include "selection/SelectionEvaluator.hpp"
58 + #include "selection/SelectionManager.hpp"
59 + #include "visitors/LipidTransVisitor.hpp"
60 + #include "visitors/AtomNameVisitor.hpp"
61 +
62   using namespace oopse;
63  
64   int main(int argc, char* argv[]){
# Line 81 | Line 86 | int main(int argc, char* argv[]){
86    
87    mdFileName = dumpFileName;
88    mdFileName = mdFileName.substr(0, mdFileName.rfind(".")) + ".md";
89 <  
89 >
90    if (args_info.output_given){
91      xyzFileName = args_info.output_arg;
92    } else {
# Line 91 | Line 96 | int main(int argc, char* argv[]){
96    
97    //parse md file and set up the system
98    SimCreator creator;
99 <  SimInfo* info = creator.createSim(mdFileName);
99 >  SimInfo* info = creator.createSim(mdFileName, false);
100    
101    
102    
103 <  //creat visitor list
103 >  //create visitor list
104    CompositeVisitor* compositeVisitor = new CompositeVisitor();
100  
101  //creat ignore visitor
102  if(args_info.ignore_given ||args_info.water_flag){
105      
106 <    IgnoreVisitor* ignoreVisitor = new IgnoreVisitor();
105 <    
106 <    for(int i = 0; i < args_info.ignore_given; i++)
107 <      ignoreVisitor->addIgnoreType(args_info.ignore_arg[i]);
108 <    
109 <    //ignore water
110 <    if(args_info.water_flag){
111 <      ignoreVisitor->addIgnoreType("SSD");
112 <      ignoreVisitor->addIgnoreType("SSD1");
113 <      ignoreVisitor->addIgnoreType("SSD_E");
114 <      ignoreVisitor->addIgnoreType("SSD_RF");
115 <      ignoreVisitor->addIgnoreType("TIP3P_RB_0");
116 <      ignoreVisitor->addIgnoreType("TIP4P_RB_0");
117 <      ignoreVisitor->addIgnoreType("TIP5P_RB_0");
118 <      ignoreVisitor->addIgnoreType("SPCE_RB_0");      
119 <      ignoreVisitor->addIgnoreType("DPD_RB_0");
120 <    }
121 <    
122 <    compositeVisitor->addVisitor(ignoreVisitor, 1000);
123 <  }
124 <  
125 <  //creat RigidBody Visitor
106 >  //create RigidBody Visitor
107    if(args_info.rigidbody_flag){
108      RBCOMVisitor* rbCOMVisitor = new RBCOMVisitor(info);
109      compositeVisitor->addVisitor(rbCOMVisitor, 900);
110    }
111    
112 <  //compositeVisitor->addVisitor(lipidVisitor, 900);
132 <  
133 <  //creat SSD atom visitor
112 >  //create SSD atom visitor
113    SSDAtomVisitor* ssdVisitor = new SSDAtomVisitor(info);
114    compositeVisitor->addVisitor(ssdVisitor, 800);
115    
116 <  LinearVisitor* linearVisitor = new LinearAtomVisitor(info);
116 >  LinearAtomVisitor* linearVisitor = new LinearAtomVisitor(info);
117    compositeVisitor->addVisitor(linearVisitor, 750);
118    
119 <  //creat default atom visitor
119 >  //create default atom visitor
120    DefaultAtomVisitor* defaultAtomVisitor = new DefaultAtomVisitor(info);
121    compositeVisitor->addVisitor(defaultAtomVisitor, 700);
122    
123 <  //creat waterType visitor
123 >  //create waterType visitor
124    if(args_info.watertype_flag){
125      WaterTypeVisitor* waterTypeVisitor = new WaterTypeVisitor;
126      compositeVisitor->addVisitor(waterTypeVisitor, 600);
127    }
128 +
129 +  if (args_info.basetype_flag) {
130 +      AtomNameVisitor* atomNameVisitor = new AtomNameVisitor(info);
131 +      compositeVisitor->addVisitor(atomNameVisitor, 550);
132 +
133 +  }
134    
135    //create ZconsVisitor
136    if(args_info.zconstraint_flag){
# Line 159 | Line 144 | int main(int argc, char* argv[]){
144      }
145    }
146    
147 <  //creat wrapping visitor
147 >  //create wrapping visitor
148    
149    if(args_info.periodicBox_flag){
150      WrappingVisitor* wrappingVisitor = new WrappingVisitor(info);
151      compositeVisitor->addVisitor(wrappingVisitor, 400);
152    }
153 <  
154 <  //creat replicate visitor
153 >
154 >  //create replicate visitor
155    if(args_info.repeatX_given > 0 || args_info.repeatY_given > 0 ||args_info.repeatY_given > 0){
156      Vector3i replicateOpt(args_info.repeatX_arg, args_info.repeatY_arg, args_info.repeatZ_arg);
157      ReplicateVisitor* replicateVisitor = new ReplicateVisitor(info, replicateOpt);
158      compositeVisitor->addVisitor(replicateVisitor, 300);
159    }
160 <  
161 <  //creat xyzVisitor
162 <  XYZVisitor* xyzVisitor = new XYZVisitor(info);
160 >
161 >
162 >  //create rotation visitor
163 >  if (args_info.refsele_given&& args_info.originsele_given) {
164 >    compositeVisitor->addVisitor(new LipidTransVisitor(info, args_info.originsele_arg, args_info.refsele_arg), 250);
165 >  } else if (args_info.refsele_given || args_info.originsele_given) {
166 >    std::cerr << "Both of --refsele and --originsele should appear by pair" << std::endl;
167 >    exit(1);
168 >  }
169 >    
170 >  //create xyzVisitor
171 >  XYZVisitor* xyzVisitor;
172 >  if (args_info.selection_given) {
173 >    xyzVisitor = new XYZVisitor(info, args_info.selection_arg);
174 >  } else {
175 >    xyzVisitor = new XYZVisitor(info);
176 >  }
177    compositeVisitor->addVisitor(xyzVisitor, 200);
178    
179    std::cout << compositeVisitor->toString();
180    
181 <  //creat prepareVisitor
181 >  //create prepareVisitor
182    PrepareVisitor* prepareVisitor = new PrepareVisitor();
183    
184    //open dump file
# Line 197 | Line 196 | int main(int argc, char* argv[]){
196    Molecule* mol;
197    StuntDouble* integrableObject;
198    RigidBody* rb;
199 <  
199 >      
200    for (int i = 0; i < nframes; i += args_info.frame_arg){
201      dumpReader->readFrame(i);
202      
# Line 220 | Line 219 | int main(int argc, char* argv[]){
219      
220      //update visitor
221      compositeVisitor->update();
222 <    
222 >
223 >
224      //visit stuntdouble
225      for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) {
226        for (integrableObject = mol->beginIntegrableObject(iiter); integrableObject != NULL;
# Line 236 | Line 236 | int main(int argc, char* argv[]){
236    
237    xyzStream.close();
238    
239 <  
239 >  delete prepareVisitor;
240    delete compositeVisitor;
241    delete info;
242    

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines