| 18 |
|
""" |
| 19 |
|
|
| 20 |
|
__author__ = "Dan Gezelter (gezelter@nd.edu)" |
| 21 |
< |
__version__ = "$Revision: 1.2 $" |
| 22 |
< |
__date__ = "$Date: 2009-10-19 14:29:14 $" |
| 21 |
> |
__version__ = "$Revision: 1.3 $" |
| 22 |
> |
__date__ = "$Date: 2009-11-25 20:01:59 $" |
| 23 |
|
__copyright__ = "Copyright (c) 2006 by the University of Notre Dame" |
| 24 |
< |
__license__ = "OOPSE" |
| 24 |
> |
__license__ = "OpenMD" |
| 25 |
|
|
| 26 |
|
import sys |
| 27 |
|
import getopt |
| 62 |
|
|
| 63 |
|
def readFile(mdFileName): |
| 64 |
|
mdFile = open(mdFileName, 'r') |
| 65 |
< |
# Find OOPSE version info first |
| 65 |
> |
# Find OpenMD version info first |
| 66 |
|
line = mdFile.readline() |
| 67 |
|
while 1: |
| 68 |
< |
if '<OOPSE version=' in line: |
| 69 |
< |
OOPSEversion = line |
| 68 |
> |
if '<OOPSE version=' in line or '<OpenMD version=' in line: |
| 69 |
> |
OpenMDversion = line |
| 70 |
|
break |
| 71 |
|
line = mdFile.readline() |
| 72 |
|
|
| 160 |
|
def writeFile(outputFileName): |
| 161 |
|
outputFile = open(outputFileName, 'w') |
| 162 |
|
|
| 163 |
< |
outputFile.write("<OOPSE version=4>\n"); |
| 163 |
> |
outputFile.write("<OpenMD version=1>\n"); |
| 164 |
|
|
| 165 |
|
for metaline in metaData: |
| 166 |
|
outputFile.write(metaline) |
| 179 |
|
|
| 180 |
|
outputFile.write(" </StuntDoubles>\n") |
| 181 |
|
outputFile.write(" </Snapshot>\n") |
| 182 |
< |
outputFile.write("</OOPSE>\n") |
| 182 |
> |
outputFile.write("</OpenMD>\n") |
| 183 |
|
outputFile.close() |
| 184 |
|
|
| 185 |
|
def roundMe(x): |
| 430 |
|
|
| 431 |
|
q = [0.0, 0.0, 0.0, 0.0] |
| 432 |
|
|
| 433 |
< |
# RotMat to Quat code is out of OOPSE's SquareMatrix3.hpp code: |
| 433 |
> |
# RotMat to Quat code is out of OpenMD's SquareMatrix3.hpp code: |
| 434 |
|
|
| 435 |
|
RotMat[0] = ux |
| 436 |
|
RotMat[1] = uy |