summaryrefslogtreecommitdiff
path: root/sim/src/tests/singlebond_stretch/CreateTests.py
blob: cff35dc448ff21f36dea0e0baedfb6c3f0e3393b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python

import os
import sys
import MmpFile
import XyzFile

damianFiles = map(lambda x: x.strip(),
                  open("damianFiles").readlines())

for df in damianFiles:
    prefix = df[:df.index(".")]
    testPrefix = "test_" + prefix
    damianMmp = MmpFile.MmpFile()
    damianMmp.read(df)

    # Generate the xyzcmp file
    xyzcmpFilename = testPrefix + ".xyzcmp"
    outf = open(xyzcmpFilename, "w")
    xyzcmp = damianMmp.convertToXyz()
    xyzcmp.write(df, outf)
    outf.close()

    # Make a perturbed copy of the MMP, use it for test_{foo}.mmp
    dmClone = damianMmp.clone()
    dmClone.perturb()
    testMmpFilename = testPrefix + ".mmp"
    outf = open(testMmpFilename, "w")
    dmClone.write(outf)
    outf.close()

    # Create test_{foo}.test
    testTestFilename = testPrefix + ".test"
    outf = open(testTestFilename, "w")
    outf.write("TYPE struct\n")
    outf.close()

    print "Test input files generated for " + testPrefix