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 |
+ |
#include "visitors/AtomNameVisitor.hpp" |
61 |
+ |
|
62 |
|
using namespace oopse; |
63 |
|
|
64 |
|
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 { |
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 |
|
LinearAtomVisitor* linearVisitor = new LinearAtomVisitor(info); |
117 |
|
compositeVisitor->addVisitor(linearVisitor, 750); |
118 |
+ |
if (args_info.gb_given) { |
119 |
+ |
linearVisitor->addGayBerneAtomType(args_info.gb_arg); |
120 |
+ |
} |
121 |
|
|
122 |
< |
//creat default atom visitor |
122 |
> |
GBLipidAtomVisitor* gbLipidVisitor = new GBLipidAtomVisitor(info); |
123 |
> |
compositeVisitor->addVisitor(gbLipidVisitor, 740); |
124 |
> |
|
125 |
> |
//create default atom visitor |
126 |
|
DefaultAtomVisitor* defaultAtomVisitor = new DefaultAtomVisitor(info); |
127 |
|
compositeVisitor->addVisitor(defaultAtomVisitor, 700); |
128 |
|
|
129 |
< |
//creat waterType visitor |
129 |
> |
//create waterType visitor |
130 |
|
if(args_info.watertype_flag){ |
131 |
|
WaterTypeVisitor* waterTypeVisitor = new WaterTypeVisitor; |
132 |
|
compositeVisitor->addVisitor(waterTypeVisitor, 600); |
133 |
|
} |
134 |
+ |
|
135 |
+ |
if (args_info.basetype_flag) { |
136 |
+ |
AtomNameVisitor* atomNameVisitor = new AtomNameVisitor(info); |
137 |
+ |
compositeVisitor->addVisitor(atomNameVisitor, 550); |
138 |
+ |
|
139 |
+ |
} |
140 |
|
|
141 |
|
//create ZconsVisitor |
142 |
|
if(args_info.zconstraint_flag){ |
150 |
|
} |
151 |
|
} |
152 |
|
|
153 |
< |
//creat wrapping visitor |
153 |
> |
//create wrapping visitor |
154 |
|
|
155 |
|
if(args_info.periodicBox_flag){ |
156 |
|
WrappingVisitor* wrappingVisitor = new WrappingVisitor(info); |
157 |
|
compositeVisitor->addVisitor(wrappingVisitor, 400); |
158 |
|
} |
159 |
< |
|
160 |
< |
//creat replicate visitor |
159 |
> |
|
160 |
> |
//create replicate visitor |
161 |
|
if(args_info.repeatX_given > 0 || args_info.repeatY_given > 0 ||args_info.repeatY_given > 0){ |
162 |
|
Vector3i replicateOpt(args_info.repeatX_arg, args_info.repeatY_arg, args_info.repeatZ_arg); |
163 |
|
ReplicateVisitor* replicateVisitor = new ReplicateVisitor(info, replicateOpt); |
164 |
|
compositeVisitor->addVisitor(replicateVisitor, 300); |
165 |
|
} |
166 |
< |
|
167 |
< |
//creat xyzVisitor |
168 |
< |
XYZVisitor* xyzVisitor = new XYZVisitor(info); |
166 |
> |
|
167 |
> |
|
168 |
> |
//create rotation visitor |
169 |
> |
if (args_info.refsele_given&& args_info.originsele_given) { |
170 |
> |
compositeVisitor->addVisitor(new LipidTransVisitor(info, args_info.originsele_arg, args_info.refsele_arg), 250); |
171 |
> |
} else if (args_info.refsele_given || args_info.originsele_given) { |
172 |
> |
std::cerr << "Both of --refsele and --originsele should appear by pair" << std::endl; |
173 |
> |
exit(1); |
174 |
> |
} |
175 |
> |
|
176 |
> |
//create xyzVisitor |
177 |
> |
XYZVisitor* xyzVisitor; |
178 |
> |
if (args_info.selection_given) { |
179 |
> |
xyzVisitor = new XYZVisitor(info, args_info.selection_arg); |
180 |
> |
} else { |
181 |
> |
xyzVisitor = new XYZVisitor(info); |
182 |
> |
} |
183 |
|
compositeVisitor->addVisitor(xyzVisitor, 200); |
184 |
|
|
185 |
|
std::cout << compositeVisitor->toString(); |
186 |
|
|
187 |
< |
//creat prepareVisitor |
187 |
> |
//create prepareVisitor |
188 |
|
PrepareVisitor* prepareVisitor = new PrepareVisitor(); |
189 |
|
|
190 |
|
//open dump file |
202 |
|
Molecule* mol; |
203 |
|
StuntDouble* integrableObject; |
204 |
|
RigidBody* rb; |
205 |
< |
|
205 |
> |
|
206 |
|
for (int i = 0; i < nframes; i += args_info.frame_arg){ |
207 |
|
dumpReader->readFrame(i); |
208 |
|
|
225 |
|
|
226 |
|
//update visitor |
227 |
|
compositeVisitor->update(); |
228 |
< |
|
228 |
> |
|
229 |
> |
|
230 |
|
//visit stuntdouble |
231 |
|
for (mol = info->beginMolecule(miter); mol != NULL; mol = info->nextMolecule(miter)) { |
232 |
|
for (integrableObject = mol->beginIntegrableObject(iiter); integrableObject != NULL; |
242 |
|
|
243 |
|
xyzStream.close(); |
244 |
|
|
245 |
< |
|
245 |
> |
delete prepareVisitor; |
246 |
|
delete compositeVisitor; |
247 |
|
delete info; |
248 |
|
|