Beispiel #1
0
    def __init__(self,
                 fragments,
                 basis=None,
                 settings=None,
                 core=None,
                 fde=None,
                 pointcharges=None,
                 fitbas=None,
                 options=None):
        """
        Initialize ADF fragments analysis / FDE job.

        @param fragments:
            the list of fragments to be used in this job.
        @type fragments: list of L{fragment}s or L{fragmentlist}

        @param fde:
            a dictionary with options for FDE. They will be added in the FDE
            block of the input.
            The functional for the non-additive kinetic energy can be specified
            under the key TNAD. If is is not specified, PW91k will be
            chosen as default.
        @type fde: dict

        """

        if isinstance(fragments, list):
            self._fragments = fragmentlist(fragments)
        else:
            self._fragments = fragments

        if fde is None:
            self._fde = {}
        else:
            self._fde = {}
            for k, v in fde.iteritems():
                self._fde[k.upper()] = v

        adfsinglepointjob.__init__(self,
                                   None,
                                   basis,
                                   core=core,
                                   settings=settings,
                                   pointcharges=pointcharges,
                                   fitbas=fitbas,
                                   options=options)

        if self._fragments.has_fde_fragments():
            if 'ALLOW PARTIALSUPERFRAGS' not in self._options:
                self._options.append('ALLOW PARTIALSUPERFRAGS')
Beispiel #2
0
    def __init__(self, mol, basis, settings=None, core=None, options=None):
        """
        Constructor for ADF gradients jobs.

        @param mol:
            The molecular coordinates.
        @type mol: L{molecule}

        @param basis:
            A string specifying the basis set to use (e.g. C{basis='TZ2P'}).
            Alternatively, a dictionary can be given listing different basis sets
            for different atom types. Such a dictionary must contain an entry "default"
            giving the basis set to use for all other atom types
            (e.g. C{basis={default:'DZP', 'C':'TZ2P'}}).
        @type basis: str or dict

        @param settings: The settings for this calculation, see L{adfsettings}
        @type settings: L{adfsettings}

        @param core:
            A string specifying which frozen cores to use (C{None}, C{Small}, C{Medium}, or C{Large}).
            Alternatively, a dictionary can be given to specify explicitly which core to
            use for each atom type (e.g. C{core={O:'1s', H:'None'}}).
            Such a dictionary can contain an entry 'default' giving the frozen core to
            use with all other atoms (possible values are C{None}, C{Small}, C{Medium}, or C{Large}).
        @type core: None or str or dict

        @param options:
            Additional options. These will each be included directly in the ADF input.
        @type options: list of str
        """

        import copy
        if settings == None:
            settings = adfsettings(accint=6.0)
        if options is None:
            opts = []
        else:
            opts = copy.copy(options)
        opts.append('STOPAFTER GGRADS')
        opts.append('GRAD_TRF_BTRF')
        adfsinglepointjob.__init__(self,
                                   mol,
                                   basis,
                                   core=core,
                                   settings=settings,
                                   options=opts)
Beispiel #3
0
    def __init__(self, mol, basis, settings=None, geometrysettings=None, selected_atoms=None,
                 core=None, options=None):
        """
        Create a new ADF geometry optimization job.

        @param mol:
            The molecular coordinates.
        @type mol: L{molecule}

        @param basis:
            A string specifying the basis set to use (e.g. C{basis='TZ2P'}).
            Alternatively, a dictionary can be given listing different basis sets
            for different atom types. Such a dictionary must contain an entry "default"
            giving the basis set to use for all other atom types
            (e.g. C{basis={default:'DZP', 'C':'TZ2P'}}).
        @type basis: str or dict

        @param core:
            A string specifying which frozen cores to use (C{None}, C{Small}, C{Medium}, or C{Large}).
            Alternatively, a dictionary can be given to specify explicitly which core to
            use for each atom type (e.g. C{core={O:'1s', H:'None'}}).
            Such a dictionary can contain an entry 'default' giving the frozen core to
            use with all other atoms (possible values are C{None}, C{Small}, C{Medium}, or C{Large}).
        @type core: None or str or dict

        @param options:
            Additional options. These will each be included directly in the ADF input.
        @type options: list of str

        @param settings: The settings for this calculation, see L{adfsettings}
        @type settings: L{adfsettings}

        @param geometrysettings:
            Settings for the geometry optimization
        @type geometrysettings: L{adfgeometrysettings}

        @param selected_atoms:
            Optionally, a list of atoms for which the coordinates should be optimized.
            (The atom numbering starts with 1). By default, all atoms are optimized.
        @type selected_atoms:
            list of int

        """
        if settings is None:
            settings = adfsettings(accint=6.0)

        if geometrysettings is None:
            self.geometrysettings = adfgeometrysettings()
        else:
            self.geometrysettings = geometrysettings

        if selected_atoms:
            self.geometrysettings.set_optim('Cartesian Selected')
            if type(selected_atoms[0]) == int:
                self._selected_atoms = selected_atoms
            else:
                symbs = mol.get_atom_symbols()
                self._selected_atoms = []
                for i, s in enumerate(symbs):
                    if s in selected_atoms:
                        self._selected_atoms.append(i + 1)
        else:
            self._selected_atoms = None

        adfsinglepointjob.__init__(self, mol, basis, core=core, settings=settings, options=options)