179 |
|
} |
180 |
|
|
181 |
|
void OOPSEFormat::WriteMDFile(vector<OBMol*> mols, vector<int> numMols, ostream& os, OBMol& mol, vector<int>& indices) { |
182 |
< |
std::string indentLevel1("\t"); |
183 |
< |
std::string indentLevel2("\t\t"); |
182 |
> |
std::string indentLevel1(" "); |
183 |
> |
std::string indentLevel2(" "); |
184 |
|
std::string molPrefix("MolName"); |
185 |
|
unsigned int i; |
186 |
|
const int BUFFLEN = 1024; |
188 |
|
|
189 |
|
|
190 |
|
os << "<OOPSE version=4>" << endl; |
191 |
< |
os << " <MetaData>" << endl; |
191 |
> |
os << " <MetaData>" << endl << endl; |
192 |
|
|
193 |
|
for(i = 0; i < mols.size(); ++i) { |
194 |
|
OBMol* pmol = mols[i]; |
256 |
|
} |
257 |
|
|
258 |
|
os << endl; |
259 |
< |
os << "nComponents = " << mols.size() << ";" << endl; |
259 |
> |
|
260 |
|
|
261 |
|
for(i=0; i < mols.size(); ++i) { |
262 |
|
os << "component{" << endl; |
263 |
|
sprintf(buffer, "%d", i); |
264 |
< |
os << "type = " << molPrefix << buffer << ";\n"; |
265 |
< |
os << "nMol = " << numMols[i]<< ";\n"; |
266 |
< |
os << "}\n"; |
264 |
> |
os << indentLevel1 << "type = " << molPrefix << buffer << ";" << endl; |
265 |
> |
os << indentLevel1 << "nMol = " << numMols[i]<< ";" << endl; |
266 |
> |
os << "}" << endl; |
267 |
|
} |
268 |
|
|
269 |
|
os << " </MetaData>" << endl; |
285 |
|
|
286 |
|
for(vector<int>::iterator i = indices.begin();i != indices.end(); ++i) { |
287 |
|
atom = mol.GetAtom(*i); |
288 |
< |
sprintf(buffer, "%d\tpv\t%18.10g\t%18.10g\t%18.10g\t%14.10g\t%14.10g\t%14.10g", *i - 1, atom->GetX(), atom->GetY(), atom->GetZ(), 0.0, 0.0, 0.0); |
288 |
> |
sprintf(buffer, "%10d %7s %18.10g %18.10g %18.10g %13e %13e %13e", *i - 1, "pv", atom->GetX(), atom->GetY(), atom->GetZ(), 0.0, 0.0, 0.0); |
289 |
|
os << buffer << endl; |
290 |
|
} |
291 |
|
os << " </StuntDoubles>" << endl; |