示例#1
0
def _get_sktable_twocnt_prereq(elem1, elem2, skdefs, builddir, searchdirs,
                               onecnt_binary, twocnt_binary):
    logger.info("Creating twocnt prerequisite for {}-{}".format(
        sc.capitalize_elem_name(elem1), sc.capitalize_elem_name(elem2)))
    calc_twocnt = run_twocnt(skdefs, elem1, elem2, builddir, searchdirs,
                             onecnt_binary, twocnt_binary)
    dir_twocnt = calc_twocnt.get_result_directory()
    result_twocnt = calc_twocnt.get_result()
    return SkgenSktableTwocntPrereq(dir_twocnt, result_twocnt)
示例#2
0
def _get_sktable_atom_prereq(elem, skdefs, builddir, searchdirs, onecnt_binary):
    logger.info("Creating free atom prerequisite for {}".format(
        sc.capitalize_elem_name(elem)))
    calc_atom = run_atom(skdefs, elem, builddir, searchdirs, onecnt_binary)
    dir_atom = calc_atom.get_result_directory()
    result_atom = calc_atom.get_result()
    return SkgenSktableAtomPrereq(dir_atom, result_atom)
示例#3
0
文件: twocnt.py 项目: smarkov/skprogs
def run_twocnt(skdefs, elem1, elem2, builddir, searchdirs, onecnt_binary,
               twocnt_binary):
    logger.info("Started for {}-{}".format(
        sc.capitalize_elem_name(elem1), sc.capitalize_elem_name(elem2)))
    hetero = (elem1.lower() != elem2.lower())
    prereq1 = _get_compression_prereq(elem1, skdefs, builddir, searchdirs,
                                      onecnt_binary)
    if hetero:
        prereq2 = _get_compression_prereq(elem2, skdefs, builddir, searchdirs,
                                          onecnt_binary)
    else:
        prereq2 = None
    calculator = SkgenTwocnt(builddir, searchdirs, twocnt_binary)
    calculator.set_input(skdefs, elem1, elem2, prereq1, prereq2)
    calculator.find_or_run_calculation()
    logger.info("Finished")
    return calculator
示例#4
0
def run_denscomp(skdefs, elem, builddir, searchdirs, onecnt_binary):
    logger.info("Started for {}".format(sc.capitalize_elem_name(elem)))
    calculator = SkgenDenscomp(
        builddir, searchdirs, onecnt_binary)
    calculator.set_input(skdefs, elem)
    calculator.find_or_run_calculation()
    logger.info("Finished")
    return calculator
示例#5
0
def run_wavecomp(skdefs, elem, builddir, searchdirs, onecnt_binary):

    LOGGER.info('Started for {}'.format(sc.capitalize_elem_name(elem)))
    calculator = SkgenWavecomp(builddir, searchdirs, onecnt_binary)
    calculator.set_input(skdefs, elem)
    calculator.find_or_run_calculation()
    LOGGER.info('Finished')

    return calculator
示例#6
0
文件: atom.py 项目: smarkov/skprogs
def run_atom(skdefs, elem, builddir, searchdirs, onecnt_binary,
             eigenonly=False, eigenspinonly=False):
    logger.info("Started for {}".format(
        sc.capitalize_elem_name(elem)))
    calculator = SkgenAtom(builddir, searchdirs, onecnt_binary)
    calculator.set_input(skdefs, elem)
    calculator.find_or_run_calculation(eigenonly, eigenspinonly)
    logger.info("Finished")
    return calculator
示例#7
0
文件: twocnt.py 项目: smarkov/skprogs
def _get_compression_prereq(elem, skdefs, builddir, searchdirs, onecnt_binary):
    logger.info("Creating compressed atom prerequisite for {}".format(
        sc.capitalize_elem_name(elem)))
    calc_dens = run_denscomp(skdefs, elem, builddir, searchdirs, onecnt_binary)
    dir_dens = calc_dens.get_result_directory()
    result_dens = calc_dens.get_result()
    calc_wave = run_wavecomp(skdefs, elem, builddir, searchdirs, onecnt_binary)
    dirs_wave = calc_wave.get_result_directories()
    result_wave = calc_wave.get_result()
    return SkgenTwocntCompressionPrereq(dir_dens, result_dens, dirs_wave,
                                        result_wave)
示例#8
0
def run_sktable(skdefs, elem1, elem2, builddir, searchdirs, onecnt_binary,
                twocnt_binary, workdir, add_dummy_repulsive):
    logger.info("Started for {}-{}".format(
        sc.capitalize_elem_name(elem1), sc.capitalize_elem_name(elem2)))
    hetero = (elem1.lower() != elem2.lower())
    prereq_atom1 = _get_sktable_atom_prereq(elem1, skdefs, builddir, searchdirs,
                                            onecnt_binary)
    if hetero:
        prereq_atom2 = _get_sktable_atom_prereq(elem2, skdefs, builddir,
                                                searchdirs, onecnt_binary)
    else:
        prereq_atom2 = None
    prereq_twocnt = _get_sktable_twocnt_prereq(
        elem1, elem2, skdefs, builddir, searchdirs, onecnt_binary,
        twocnt_binary)
    calculator = SkgenSktable(builddir, searchdirs)
    calculator.set_input(skdefs, elem1, elem2, prereq_atom1, prereq_atom2,
                         prereq_twocnt)
    skfiles_written = calculator.write_sktables(workdir, add_dummy_repulsive)
    logger.info("Finished")
    return skfiles_written