| 1 |
|
/********************************************************************** |
| 2 |
|
Copyright (C) 2000 by OpenEye Scientific Software, Inc. |
| 3 |
< |
Some portions Copyright (C) 2001-2005 by Geoffrey R. Hutchison |
| 3 |
> |
Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison |
| 4 |
|
Some portions Copyright (C) 2004 by Chris Morley |
| 5 |
< |
Some portions Copyright (C) 2008 by J. Daniel Gezelter |
| 5 |
> |
Some portions Copyright (C) 2008-2009 by J. Daniel Gezelter |
| 6 |
|
|
| 7 |
|
This program is free software; you can redistribute it and/or modify |
| 8 |
|
it under the terms of the GNU General Public License as published by |
| 40 |
|
virtual const char* Description() //required |
| 41 |
|
{ |
| 42 |
|
return |
| 43 |
< |
"OpenMD combined meta-data / cartesian coordinates format\nNo comments yet\n"; |
| 43 |
> |
"OpenMD combined meta-data / cartesian coordinates format\n\ |
| 44 |
> |
No comments yet\n"; |
| 45 |
|
}; |
| 46 |
|
|
| 47 |
|
virtual const char* SpecificationURL() |
| 129 |
|
return false; |
| 130 |
|
} |
| 131 |
|
|
| 132 |
+ |
|
| 133 |
+ |
|
| 134 |
|
WriteMDFile(mdMols, numMols, ofs, *pmol, indices); |
| 135 |
|
|
| 136 |
|
for(vector<OBMol*>::iterator i = mdMols.begin(); i != mdMols.end(); ++i) { |
| 173 |
|
vector<int>& fragment) { |
| 174 |
|
|
| 175 |
|
OBMol* newMol = new OBMol(); |
| 176 |
+ |
OBChainsParser* chainParser = new OBChainsParser(); |
| 177 |
+ |
bool molIsWater = false; |
| 178 |
+ |
|
| 179 |
|
newMol->ReserveAtoms(fragment.size()); |
| 180 |
|
newMol->BeginModify(); |
| 181 |
|
for(vector<int>::iterator i = fragment.begin(); i != fragment.end(); ++i) { |
| 217 |
|
OBMol* pmol = mols[i]; |
| 218 |
|
map<OBAtom*, int> atomMap; |
| 219 |
|
|
| 220 |
+ |
|
| 221 |
|
//chainParser->PerceiveChains(*pmol, false); |
| 222 |
|
molIsWater = false; |
| 223 |
|
FOR_RESIDUES_OF_MOL(residue, *pmol) { |
| 217 |
– |
std::cerr << "residue = " << residue->GetName() << "\n"; |
| 224 |
|
if (residue->GetName().compare("HOH") == 0) { |
| 225 |
|
molIsWater = true; |
| 226 |
|
} |
| 356 |
|
size_t endpos = str.find_last_not_of(" "); |
| 357 |
|
str = str.substr( startpos, endpos-startpos+1 ); |
| 358 |
|
str1 = resName + "-" + str; |
| 359 |
< |
} |
| 359 |
> |
} |
| 360 |
|
os << " atom[" << ai << "] { "; |
| 361 |
|
os << "type = " << "\"" << str1 << "\"" << "; "; |
| 362 |
|
os << "position( " << (&*atom)->GetX() << ", " << (&*atom)->GetY() << ", " << (&*atom)->GetZ() << ");"; |
| 395 |
|
OBMol* pmol = mols[i]; |
| 396 |
|
os << "component{" << endl; |
| 397 |
|
if (std::string(pmol->GetTitle()).compare("HOH") == 0) { |
| 398 |
< |
os << " type = " << "HOH" << ";" << endl; |
| 398 |
> |
os << " type = " << "\"HOH\"" << "; // change to appropriate water model" << endl; |
| 399 |
|
} else { |
| 400 |
|
sprintf(buffer, "%d", i); |
| 401 |
|
os << " type = " << molPrefix << buffer << ";" << endl; |
| 421 |
|
os << buffer << endl; |
| 422 |
|
os << " </FrameData>" << endl; |
| 423 |
|
os << " <StuntDoubles>" << endl; |
| 424 |
< |
|
| 424 |
> |
|
| 425 |
|
OBAtom *atom; |
| 426 |
< |
|
| 421 |
< |
// still to do: intercept waters and recompute pvqj lines |
| 422 |
< |
|
| 426 |
> |
|
| 427 |
|
for(vector<int>::iterator i = indices.begin();i != indices.end(); ++i) { |
| 428 |
+ |
|
| 429 |
|
atom = mol.GetAtom(*i); |
| 430 |
|
sprintf(buffer, "%10d %7s %18.10g %18.10g %18.10g %13e %13e %13e", *i - 1, |
| 431 |
|
"pv", atom->GetX(), atom->GetY(), atom->GetZ(), 0.0, 0.0, 0.0); |