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 |
99 |
|
|
100 |
|
|
101 |
|
|
102 |
< |
//creat visitor list |
102 |
> |
//create visitor list |
103 |
|
CompositeVisitor* compositeVisitor = new CompositeVisitor(); |
104 |
– |
|
105 |
– |
//creat ignore visitor |
106 |
– |
if(args_info.ignore_given ||args_info.water_flag){ |
104 |
|
|
105 |
< |
IgnoreVisitor* ignoreVisitor = new IgnoreVisitor(info); |
109 |
< |
|
110 |
< |
for(int i = 0; i < args_info.ignore_given; i++) |
111 |
< |
ignoreVisitor->addIgnoreType(args_info.ignore_arg[i]); |
112 |
< |
|
113 |
< |
//ignore water |
114 |
< |
if(args_info.water_flag){ |
115 |
< |
ignoreVisitor->addIgnoreType("SSD"); |
116 |
< |
ignoreVisitor->addIgnoreType("SSD1"); |
117 |
< |
ignoreVisitor->addIgnoreType("SSD_E"); |
118 |
< |
ignoreVisitor->addIgnoreType("SSD_RF"); |
119 |
< |
ignoreVisitor->addIgnoreType("TIP3P_RB_0"); |
120 |
< |
ignoreVisitor->addIgnoreType("TIP4P_RB_0"); |
121 |
< |
ignoreVisitor->addIgnoreType("TIP5P_RB_0"); |
122 |
< |
ignoreVisitor->addIgnoreType("SPCE_RB_0"); |
123 |
< |
ignoreVisitor->addIgnoreType("DPD_RB_0"); |
124 |
< |
} |
125 |
< |
|
126 |
< |
compositeVisitor->addVisitor(ignoreVisitor, 1000); |
127 |
< |
} |
128 |
< |
|
129 |
< |
//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 |
< |
//create selection visitor |
136 |
< |
//if (args_info.selection_given){ |
137 |
< |
// SelectionVisitor* selectionVisitor = new SelectionVisitor(info, args_info.selection_arg); |
138 |
< |
// compositeVisitor->addVisitor(selectionVisitor, 850); |
139 |
< |
//} |
140 |
< |
|
141 |
< |
SelectionEvaluator* evaluator = NULL; |
142 |
< |
if (args_info.selection_given) { |
143 |
< |
evaluator = new SelectionEvaluator(info); |
144 |
< |
assert(evaluator); |
145 |
< |
evaluator->loadScriptString( args_info.selection_arg); |
146 |
< |
|
147 |
< |
} |
148 |
< |
|
149 |
< |
//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 |
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); |
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 --originselc should appear by pair" << std::endl; |
159 |
> |
std::cerr << "Both of --refsele and --originsele should appear by pair" << std::endl; |
160 |
|
exit(1); |
161 |
|
} |
162 |
|
|
163 |
< |
//creat xyzVisitor |
164 |
< |
XYZVisitor* xyzVisitor = new XYZVisitor(info); |
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 |
< |
|
226 |
< |
if (evaluator && !evaluator->isDynamic()) { |
227 |
< |
info->getSelectionManager()->setSelectionSet(evaluator->evaluate()); |
228 |
< |
} |
229 |
< |
|
192 |
> |
|
193 |
|
for (int i = 0; i < nframes; i += args_info.frame_arg){ |
194 |
|
dumpReader->readFrame(i); |
195 |
|
|
213 |
|
//update visitor |
214 |
|
compositeVisitor->update(); |
215 |
|
|
216 |
< |
//if dynamic, we need to re-evaluate the selection |
254 |
< |
if (evaluator && evaluator->isDynamic()) { |
255 |
< |
info->getSelectionManager()->setSelectionSet(evaluator->evaluate()); |
256 |
< |
} |
257 |
< |
|
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 |
|
|