Example #1
0
def rotor_hindered(group,
                   axis,
                   symmetry,
                   potential,
                   remdummy=None,
                   geom=None,
                   use_quantum_weight=False,
                   rotor_id=''):
    """ Writes the string that defines the `Rotor` section for a
        single hindered rotor of a species for a MESS input file by
        formatting input information into strings a filling Mako template.

        :param group: idxs for the atoms of one of the rotational groups
        :type group: list(int)
        :param axis: idxs for the atoms that make up the rotational axis
        :type axis: list(int)
        :param symmetry: overall symmetry of the torsional motion (potential)
        :type symmetry: int
        :param potential: value of the potential along torsion (kcal.mol-1)
        :type potential: list(float)
        :param remdummy: list of idxs of dummy atoms for shifting values
        :type remdummy: list(int)
        :param geom: geometry of the species the rotor exists for
        :type geom: list
        :param use_quantum_weight: toggle weigthing of quantum effects
        :type use_quantum_weight: bool
        :param rotor_id: name associated with the rotor
        :type rotor_id: str
        :rtype: str
    """

    # Format the rotor sections
    rotor_group = util.format_rotor_key_defs(group, remdummy)
    rotor_axis = util.format_rotor_key_defs(axis, remdummy)
    rotor_npotential, rotor_potential = util.format_rotor_potential(potential)

    # Format the geom
    natom = 1
    if geom is not None:
        natom, geom = util.geom_format(geom)
        geom = indent(geom, 4)

    # Create dictionary to fill template
    rotor_keys = {
        'group': rotor_group,
        'axis': rotor_axis,
        'symmetry': symmetry,
        'npotential': rotor_npotential,
        'potential': rotor_potential,
        'natom': natom,
        'geom': geom,
        'use_quantum_weight': use_quantum_weight,
        'rotor_id': rotor_id
    }

    return build_mako_str(template_file_name='rotor_hindered.mako',
                          template_src_path=SPEC_INFO_PATH,
                          template_keys=rotor_keys)
Example #2
0
def umbrella_mode(group, plane, ref_atom, potential, remdummy=None, geom=None):
    """ Writes the string that defines the `Umbrella` section for a
        single umbrella mode of a species for a MESS input file by
        formatting input information into strings a filling Mako template.

        :param group: idxs for the atoms of ?
        :type group: list(int)
        :param axis: idxs for the atoms that ?
        :type axis: list(int)
        :param remdummy: list of idxs of dummy atoms for shifting values
        :type remdummy: list(int)
        :param geom: geometry of the species the umbrella mode exists for
        :type geom: list
        :rtype: str
    """

    # Format the sections
    umbr_group = util.format_rotor_key_defs(group, remdummy)
    umbr_plane = util.format_rotor_key_defs(plane, remdummy)
    umbr_npotential, umbr_potential = util.format_rotor_potential(potential)

    # Format the geom
    if geom is not None:
        natom, geom = util.geom_format(geom)
        geom = indent(geom, 4)
    else:
        natom = None

    # Create dictionary to fill template
    umbr_keys = {
        'group': umbr_group,
        'axis': umbr_plane,
        'ref_atom': ref_atom,
        'npotential': umbr_npotential,
        'potential': umbr_potential,
        'natom': natom,
        'geom': geom,
    }

    return build_mako_str(template_file_name='umbrella_mode.mako',
                          template_src_path=SPEC_INFO_PATH,
                          template_keys=umbr_keys)
Example #3
0
def rotor_internal(group,
                   axis,
                   symmetry,
                   grid_size,
                   mass_exp_size,
                   pot_exp_size=5,
                   hmin=13,
                   hmax=101,
                   remdummy=None,
                   geom=None,
                   rotor_id=''):
    """ Writes the string that defines the `Rotor` section for a
        single internal rotor of a species for a MESS input file by
        formatting input information into strings a filling Mako template.

        :param group: idxs for the atoms of one of the rotational groups
        :type group: list(int)
        :param axis: idxs for the atoms that make up the rotational axis
        :type axis: list(int)
        :param symmetry: overall symmetry of the torsional motion (potential)
        :type symmetry: int
        :param grid_size: grid_size for statistical weight calculation
        :type grid_size: int
        :param mass_exp_size: num. mass expansion Fourier harmonics
        :type mass_exp_size: int
        :param pot_exp_size: num. potential expansion Fourier harmonics
        :type pot_exp_size: int
        :param hmin: minimum value for quantum phase space dimension
        :type hmin: int
        :param hmax: maximum value for quantum phase space dimension
        :type hmax: int
        :param remdummy: list of idxs of dummy atoms for shifting values
        :type remdummy: list(int)
        :param geom: geometry of the species the rotor exists for
        :type geom: list
        :param rotor_id: name associated with the rotor
        :type rotor_id: str
        :rtype: str
    """

    assert mass_exp_size > 0 and mass_exp_size % 2 == 1
    assert pot_exp_size > 0 and pot_exp_size % 2 == 1

    # Format the sections
    rotor_group = util.format_rotor_key_defs(group, remdummy)
    rotor_axis = util.format_rotor_key_defs(axis, remdummy)

    # Format the geom
    if geom is not None:
        natom, geom = util.geom_format(geom)
        geom = indent(geom, 4)
    else:
        natom = None

    # Create dictionary to fill template
    rotor_keys = {
        'group': rotor_group,
        'axis': rotor_axis,
        'symmetry': symmetry,
        'mass_exp_size': mass_exp_size,
        'pot_exp_size': pot_exp_size,
        'hmin': hmin,
        'hmax': hmax,
        'grid_size': grid_size,
        'natom': natom,
        'geom': geom,
        'rotor_id': rotor_id
    }

    return build_mako_str(template_file_name='rotor_internal.mako',
                          template_src_path=SPEC_INFO_PATH,
                          template_keys=rotor_keys)
Example #4
0
def rotor_hindered(group,
                   axis,
                   symmetry,
                   potential,
                   hmin=None,
                   hmax=None,
                   lvl_ene_max=None,
                   therm_pow_max=None,
                   remdummy=None,
                   geom=None,
                   rotor_id=''):
    """ Writes the string that defines the `Rotor` section for a
        single hindered rotor of a species for a MESS input file by
        formatting input information into strings a filling Mako template.

        :param group: idxs for the atoms of one of the rotational groups
        :type group: list(int)
        :param axis: idxs for the atoms that make up the rotational axis
        :type axis: list(int)
        :param symmetry: overall symmetry of the torsional motion (potential)
        :type symmetry: int
        :param hmin: minimum value for quantum phase space dimension
        :type hmin: int
        :param hmax: maximum value for quantum phase space dimension
        :type hmax: int
        :param potential: value of the potential along torsion (kcal.mol-1)
        :type potential: list(float)
        :param therm_pow_max: max exp't power in Boltzmann weight
        :type therm_pow_max: int
        :param remdummy: list of idxs of dummy atoms for shifting values
        :type remdummy: list(int)
        :param geom: geometry of the species the rotor exists for
        :type geom: list
        :param rotor_id: name associated with the rotor
        :type rotor_id: str
        :rtype: str
    """

    # Format the rotor sections
    rotor_group = util.format_rotor_key_defs(group, remdummy)
    rotor_axis = util.format_rotor_key_defs(axis, remdummy)
    rotor_npotential, rotor_potential = util.format_rotor_potential(potential)

    # Format the geom
    natom = 1
    if geom is not None:
        natom, geom = util.geom_format(geom)
        geom = indent(geom, 4)

    # Create dictionary to fill template
    rotor_keys = {
        'group': rotor_group,
        'axis': rotor_axis,
        'symmetry': symmetry,
        'npotential': rotor_npotential,
        'potential': rotor_potential,
        'hmin': hmin,
        'hmax': hmax,
        'lvl_ene_max': lvl_ene_max,
        'therm_pow_max': therm_pow_max,
        'natom': natom,
        'geom': geom,
        'rotor_id': rotor_id
    }

    return build_mako_str(template_file_name='rotor_hindered.mako',
                          template_src_path=SPEC_INFO_PATH,
                          template_keys=rotor_keys)