Esempio n. 1
0
    def __init__(self, adfres, prop, grid=None, spacing=0.5, frag=None):
        """
        Constructor for densfjob.

        @param adfres:
            The results of the ADF job for which the density
            (or related quantity) should be calculated.
        @type  adfres: L{adfsinglepointresults} or subclass.
        @param prop:
            The property to calculate.
        @type  prop: L{PlotProperty}
        @param grid:
            The grid to use. If None, a default L{cubegrid} is used.
        @type  grid: subclass of L{grid}
        @param frag:
            Which fragment to use. Default is 'Active'.
            This can be used to get the densities of specific frozen
            fragments.
        @type frag: str
        """
        # pylint: disable=W0621

        adfjob.__init__(self)

        self._adfresults = adfres
        if grid is None:
            self.grid = cubegrid(adfres.get_molecule(), spacing)
        else:
            self.grid = grid
        if frag is None:
            self._frag = 'Active'
        else:
            self._frag = frag

        if not isinstance(prop, PlotProperty):
            raise PyAdfError(
                'densfjob needs to be initialized with PlotProperty')
        else:
            self.prop = prop

        # consistency checks for properties that are not implemented

        if 'orbs' in self.prop.opts:
            if ('Loc' not in self.prop.opts['orbs']) and \
                    not (self.prop.opts['orbs'].keys() == ['A']):
                raise PyAdfError(
                    'CJDENSF only working for NSYM=1 (irrep A) orbitals')

        if self.prop.pclass == 'potential':
            if 'func' in self.prop.opts:
                if self.prop.ptype not in ['kinpot', 'nadkin']:
                    raise PyAdfError(
                        "Functional cannot be selected in CJDENSF "
                        "with this potential type")

        self._olddensf = False
Esempio n. 2
0
    def __init__(self, adfres=None, settings=None, options=None):
        """
        Constructor of ADF spin-spin coupling jobs.

        @param adfres:
           results from an ADF single point run
        @type adfres: (subclass of) L{adfsinglepointresults}

        @param settings:
           settings for this CPL run
        @type settings: L{cplsettings}

        @param options:
           optional settings for this CPL run (e.g. GGA).
           These options are included as given in the CPL input.
           See ADF-CPL documentation for details.
        @type options: list of str
        """

        if adfres is None:
            raise PyAdfError(
                'No ADF singe point results provided in adfcpljob')
        elif settings is None:
            raise PyAdfError('No settings (cplsettings) provided in adfcpljob')

        adfjob.__init__(self)

        self.adfresults = adfres

        self.settings = settings
        self.settings.set_cplnuclei(self.adfresults)
        self.settings.check_settings()

        self.mol = self.adfresults.get_molecule()

        if options is None:
            self.options = []
        else:
            if isinstance(options, list):
                self.options = options
            else:
                self.options = [options]
Esempio n. 3
0
    def __init__(self,
                 adfres,
                 nucs,
                 ghosts=None,
                 u1k='best',
                 out=None,
                 calc=None,
                 use=None,
                 analysis=None):
        """
        Constructor of ADF NMR job.

        @param adfres: results of the corresponding ADF single point job
        @type  adfres: (subclass of) L{adfsinglepointresults}
        @param nucs:   the nuclei to calculate the shielding for (numbers in INPUT ORDER)
        @type  nucs:   list of int
        @param ghosts: list of coordinates for ghost sites (NICS)
        @type  ghosts: list of float[3]
        @param u1k:    U1K options options, see ADF-NMR documentation of U1K key. 
                       set here to 'best' which if missing gives rubbish when spin-orbit coupling is on
        @type  u1k:    str
        @param out:    output options, see ADF-NMR documentation of OUT key
                       Default in NMR is 'iso', which outputs the isotropic shieldings
        @type  out:    str
        """

        adfjob.__init__(self)

        self.adfresults = adfres
        self.nucs = nucs
        self.u1k = u1k
        self.use = use
        self.analysis = analysis
        self.nmrnucs = adfres.get_atom_index(nucs)

        self.ghosts = ghosts
        self.out = out
        self.calc = calc