Esempio n. 1
0
def get_energy_by(gl, atomidx_list, energykey):
    """
    input is a list of tuples of atom indexes:
    [(1,2), (3,4,5), (4,5,6,9)]
    in this case a distance, an angle and a dihedral

    the output is a list of lists containing the value of the metric for
    each scan_pt (or opt_pt if optimization)
    and a list with the energy (energytype ONIOM?)
    """

    metrics = []

    # ENERGIES:     if scan: last opt in each step;     if opt: last scan_pt
    if len(gl.bytedict['Converged?']) > 1:
        energies = [e[-1] for e in gl.energies[energykey]]
        for atomidx in atomidx_list:
            metric = []
            for byteS in gl.bytedict['orientation:']:
                xyz = gl.read_coordinates(atomidx, byteS[-1])
                metric.append(geom.anymetric(xyz))
            metrics.append(metric)
    else:
        energies = gl.energies[energykey][-1]
        for atomidx in atomidx_list:
            metric = []
            for byte in gl.bytedict['orientation:'][-1]:
                xyz = gl.read_coordinates(atomidx, byte)
                metric.append(geom.anymetric(xyz))
            metrics.append(metric)

    return metrics, energies
def get_energy_by(gl, atomidx_list, energykey):
    """
    input is a list of tuples of atom indexes:
    [(1,2), (3,4,5), (4,5,6,9)]
    in this case a distance, an angle and a dihedral

    the output is a list of lists containing the value of the metric for
    each scan_pt (or opt_pt if optimization)
    and a list with the energy (energytype ONIOM?)
    """

    metrics = []

    # ENERGIES:     if scan: last opt in each step;     if opt: last scan_pt
    if len(gl.bytedict['Converged?']) > 1:
        energies = [e[-1] for e in gl.energies[energykey]]
        for atomidx in atomidx_list:
            metric = []
            for byteS in gl.bytedict['orientation:']:
                xyz = gl.read_coordinates(atomidx, byteS[-1])
                metric.append(geom.anymetric(xyz))
            metrics.append(metric)
    else:
        energies = gl.energies[energykey][-1]
        for atomidx in atomidx_list:
            metric = []
            for byte in gl.bytedict['orientation:'][-1]:
                xyz = gl.read_coordinates(atomidx, byte)
                metric.append(geom.anymetric(xyz))
            metrics.append(metric)

    return metrics, energies
Esempio n. 3
0
 def process_coords(self, gl, user_coords):
     metrics = []
     for coord in user_coords:
         metric = []
         for b in gl.bytedict['orientation:'][-1]: # last scan point
             xyz = gl.read_coordinates(coord, b)
             metric.append(geom.anymetric(xyz))
         metrics.append(metric)
     return metrics