示例#1
0
    write(filename=('reactions_xsimple.%s.db' % formula),
          images=m, format='db', cmr_params=cmr_params)

# analyse the results with CMR

from cmr.ui import DirectoryReader
reader = DirectoryReader('.')

# read all compounds in the project calculated with EMT
all = reader.find(name_value_list=[('calculator', 'EMT')],
                  keyword_list=[project_id])

all.print_table(0, columns=["formula", "ase_potential_energy"])
print

group = cmr.create_group()
group_vars = {"reaction":reaction, "output":"group.db"}
sum = 0.0
for (formula, coef) in reaction:
        data = all.get("formula", formula)
        if data is None:
           print "%s is missing"%formula
           sum = None
           break
        sum += coef*data["ase_potential_energy"]
        group.add(data["db_hash"])

group_vars["result"] = sum
group.write(group_vars)
print "Energy: ",sum
group.dump()
示例#2
0
          cmr_params=cmr_params)

# analyse the results with CMR

from cmr.ui import DirectoryReader

reader = DirectoryReader('.')

# read all compounds in the project calculated with EMT
all = reader.find(name_value_list=[('calculator', 'EMT')],
                  keyword_list=[project_id])

all.print_table(0, columns=["formula", "ase_potential_energy"])
print

group = cmr.create_group()
group_vars = {"reaction": reaction, "output": "group.db"}
sum = 0.0
for (formula, coef) in reaction:
    data = all.get("formula", formula)
    if data is None:
        print "%s is missing" % formula
        sum = None
        break
    sum += coef * data["ase_potential_energy"]
    group.add(data["db_hash"])

group_vars["result"] = sum
group.write(group_vars)
print "Energy: ", sum
group.dump()