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 |
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 |
+ |
|
61 |
|
using namespace oopse; |
62 |
|
|
63 |
|
int main(int argc, char* argv[]){ |
99 |
|
|
100 |
|
|
101 |
|
|
102 |
< |
//creat visitor list |
102 |
> |
//create visitor list |
103 |
|
CompositeVisitor* compositeVisitor = new CompositeVisitor(); |
100 |
– |
|
101 |
– |
//creat ignore visitor |
102 |
– |
if(args_info.ignore_given ||args_info.water_flag){ |
104 |
|
|
105 |
< |
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 |
105 |
> |
//create RigidBody Visitor |
106 |
|
if(args_info.rigidbody_flag){ |
107 |
|
RBCOMVisitor* rbCOMVisitor = new RBCOMVisitor(info); |
108 |
|
compositeVisitor->addVisitor(rbCOMVisitor, 900); |
109 |
|
} |
110 |
|
|
111 |
< |
//compositeVisitor->addVisitor(lipidVisitor, 900); |
132 |
< |
|
133 |
< |
//creat SSD atom visitor |
111 |
> |
//create SSD atom visitor |
112 |
|
SSDAtomVisitor* ssdVisitor = new SSDAtomVisitor(info); |
113 |
|
compositeVisitor->addVisitor(ssdVisitor, 800); |
114 |
|
|
115 |
|
LinearAtomVisitor* linearVisitor = new LinearAtomVisitor(info); |
116 |
|
compositeVisitor->addVisitor(linearVisitor, 750); |
117 |
|
|
118 |
< |
//creat default atom visitor |
118 |
> |
//create default atom visitor |
119 |
|
DefaultAtomVisitor* defaultAtomVisitor = new DefaultAtomVisitor(info); |
120 |
|
compositeVisitor->addVisitor(defaultAtomVisitor, 700); |
121 |
|
|
122 |
< |
//creat waterType visitor |
122 |
> |
//create waterType visitor |
123 |
|
if(args_info.watertype_flag){ |
124 |
|
WaterTypeVisitor* waterTypeVisitor = new WaterTypeVisitor; |
125 |
|
compositeVisitor->addVisitor(waterTypeVisitor, 600); |
137 |
|
} |
138 |
|
} |
139 |
|
|
140 |
< |
//creat wrapping visitor |
140 |
> |
//create wrapping visitor |
141 |
|
|
142 |
|
if(args_info.periodicBox_flag){ |
143 |
|
WrappingVisitor* wrappingVisitor = new WrappingVisitor(info); |
144 |
|
compositeVisitor->addVisitor(wrappingVisitor, 400); |
145 |
|
} |
146 |
< |
|
147 |
< |
//creat replicate visitor |
146 |
> |
|
147 |
> |
//create replicate visitor |
148 |
|
if(args_info.repeatX_given > 0 || args_info.repeatY_given > 0 ||args_info.repeatY_given > 0){ |
149 |
|
Vector3i replicateOpt(args_info.repeatX_arg, args_info.repeatY_arg, args_info.repeatZ_arg); |
150 |
|
ReplicateVisitor* replicateVisitor = new ReplicateVisitor(info, replicateOpt); |
151 |
|
compositeVisitor->addVisitor(replicateVisitor, 300); |
152 |
|
} |
153 |
< |
|
154 |
< |
//creat xyzVisitor |
155 |
< |
XYZVisitor* xyzVisitor = new XYZVisitor(info); |
153 |
> |
|
154 |
> |
|
155 |
> |
//create rotation visitor |
156 |
> |
if (args_info.refsele_given&& args_info.originsele_given) { |
157 |
> |
compositeVisitor->addVisitor(new LipidTransVisitor(info, args_info.originsele_arg, args_info.refsele_arg), 250); |
158 |
> |
} else if (args_info.refsele_given || args_info.originsele_given) { |
159 |
> |
std::cerr << "Both of --refsele and --originsele should appear by pair" << std::endl; |
160 |
> |
exit(1); |
161 |
> |
} |
162 |
> |
|
163 |
> |
//create xyzVisitor |
164 |
> |
XYZVisitor* xyzVisitor; |
165 |
> |
if (args_info.selection_given) { |
166 |
> |
xyzVisitor = new XYZVisitor(info, args_info.selection_arg); |
167 |
> |
} else { |
168 |
> |
xyzVisitor = new XYZVisitor(info); |
169 |
> |
} |
170 |
|
compositeVisitor->addVisitor(xyzVisitor, 200); |
171 |
|
|
172 |
|
std::cout << compositeVisitor->toString(); |
173 |
|
|
174 |
< |
//creat prepareVisitor |
174 |
> |
//create prepareVisitor |
175 |
|
PrepareVisitor* prepareVisitor = new PrepareVisitor(); |
176 |
|
|
177 |
|
//open dump file |
189 |
|
Molecule* mol; |
190 |
|
StuntDouble* integrableObject; |
191 |
|
RigidBody* rb; |
192 |
< |
|
192 |
> |
|
193 |
|
for (int i = 0; i < nframes; i += args_info.frame_arg){ |
194 |
|
dumpReader->readFrame(i); |
195 |
|
|
212 |
|
|
213 |
|
//update visitor |
214 |
|
compositeVisitor->update(); |
215 |
< |
|
215 |
> |
|
216 |
> |
|
217 |
|
//visit stuntdouble |
218 |
|
for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) { |
219 |
|
for (integrableObject = mol->beginIntegrableObject(iiter); integrableObject != NULL; |
229 |
|
|
230 |
|
xyzStream.close(); |
231 |
|
|
232 |
< |
|
232 |
> |
delete prepareVisitor; |
233 |
|
delete compositeVisitor; |
234 |
|
delete info; |
235 |
|
|