def main(self):
        coords = self._search_for_input_files(self.params.args)
        for coord in coords:
            gc3libs.log.info("Processing input file '%s' ..." % coord)
            # XXX: how do we get a unique name for each coord?  for
            # now, assume the directory containing the `coord` file
            # gives the unique name
            name = os.path.basename(os.path.dirname(coord))

            ridft_define_in = Template(
                RIDFT_DEFINE_IN, acceptable_ridft_basis_set,
                TITLE=name,
                ORB_BASIS=self.params.bas,
                RIJK_BASIS=self.params.jkbas,
                RIDFT_MEMORY = [self.params.memory]
                ) # end of RIDFT template

            ricc2_define_in = Template(
                RICC2_DEFINE_IN, acceptable_ricc2_basis_set,
                # the ORB_BASIS will be derived from the RIDFT_DEFINE_IN template
                CBAS_BASIS=self.params.cbas,
                CABS_BASIS=self.params.cabs,
                RICC2_MEMORY = [self.params.memory],
                ) # end of RICC2 template

            for ridft_in in expansions(ridft_define_in):
                orb_basis = ridft_in._keywords['ORB_BASIS']
                self._make_turbomole_files(
                    coord,
                    ridft_in,
                    # ricc2_ins
                    list(expansions(ricc2_define_in,
                                    ORB_BASIS=orb_basis)),
                    os.path.join(self.params.output_dir, name))
Esempio n. 2
0
    def __init__(self,
                 title,
                 coord,
                 bases,
                 jkbases,
                 cbases,
                 cabses,
                 work_dir,
                 valid1=acceptable_ridft_basis_set,
                 valid2=acceptable_ricc2_basis_set,
                 **extra_args):
        """
        Create a new tasks that runs several analyses in parallel, one
        for each accepted combination of orbital and RIJK basis.
        """
        extra_args.setdefault('memory',
                              2000)  # XXX: check with `requested_memory`

        ridft_define_in = Template(RIDFT_DEFINE_IN,
                                   valid1,
                                   TITLE=title,
                                   ORB_BASIS=bases,
                                   RIJK_BASIS=jkbases,
                                   RIDFT_MEMORY=[extra_args['memory']
                                                 ])  # end of RIDFT template

        ricc2_define_in = Template(
            RICC2_DEFINE_IN,
            valid2,
            # the ORB_BASIS will be derived from the RIDFT_DEFINE_IN template
            CBAS_BASIS=cbases,
            CABS_BASIS=cabses,
            RICC2_MEMORY=[extra_args['memory']],
        )  # end of RICC2 template

        tasks = []
        for ridft in expansions(ridft_define_in):
            orb_basis = ridft._keywords['ORB_BASIS']
            tasks.append(
                BasisSweepPasses(
                    title + '.seq', coord, ridft,
                    list(expansions(ricc2_define_in, ORB_BASIS=orb_basis)),
                    work_dir, **extra_args))
        ParallelTaskCollection.__init__(self, title, tasks)
GAMESS_INP = Template(
    """
 $$CONTRL RUNTYP=ENERGY MAXIT=1 UNITS=BOHR $$END
 $$CONTRL ${SCF} ISPHER=${ISPHER} $$END
 $$ACCURACY ITOL=${ITOL} ILOAD=${ILOAD} $$END
 $$SYSTEM MWORDS=10 $$END
 $$BASIS ${BASIS} $$END
 $$GUESS GUESS=HUCKEL $$END

 $$DATA
${GEOMETRY}
 $$END
""",
    match_ispher_with_basis,
    GEOMETRY=[
        # beware that GAMESS won't run if there is a blank
        # line at the end of the $DATA section; so be sure
        # to put the closing `"""` at the very end of the
        # last $DATA line
        """Water
C1
O   8.0        0.0              0.0                    0.0
H   1.0        0.0              1.428036               1.0957706
H   1.0        0.0             -1.428036               1.0957706""",
        """Methane
Td

C     6.0   0.0            0.0            0.0
H     1.0   0.6252197764   0.6252197764   0.6252197764""",
    ],  # end of GEOMETRY
    SCF=[
        Template(
            "SCFTYP=${SCFTYP}",  # "MPLEVL=${MPLEVL}", # NODFT
            SCFTYP=["RHF", "ROHF", "UHF"],
        ),
        # Template("SCFTYP=${SCFTYP} DFTTYP=${DFTTYP}", # WITHDFT
        #          SCFTYP = ["RHF", "ROHF", "UHF"],
        #          DFTTYP = ["SVWN", "BLYP", "B97-D", "B3LYP", "revTPSS", "TPSSh", "M06"],
        #          ),
    ],  # end of SCF
    #DIRSCF = [".TRUE.", ".FALSE."],
    ITOL=[20, 15, 10],
    ILOAD=[9, 7, 5],
    BASIS=[
        Template("GBASIS=${SIMPLEBASIS}",
                 SIMPLEBASIS=[
                     "MINI", "MIDI", "DZV", "TZV", "CCD", "CCT", "CCQ", "CC5",
                     "CC6"
                 ]),
        Template(
            "GBASIS=${GBASIS} NGAUSS=${NGAUSS} ${NPFUNC} ${NDFUNC} ${NFFUNC}",
            acceptable_gbasis_and_ngauss,
            GBASIS=["STO", "N21", "N31", "N311"],
            NGAUSS=[2, 3, 4, 5, 6],
            NPFUNC=["", "NPFUNC=1"],
            NDFUNC=["", "NDFUNC=1"],
            NFFUNC=["", "NFFUNC=1"],
        ),
    ],  # end of BASIS
    ISPHER=[-1, +1],  # 0 is also a legal value; -1 is default
)  # end of GAMESS_INP