Esempio n. 1
0
def get_lmethod():
    """Get the low-level electronic structure theory method to use

    Returns:
        (autode.wrappers.base.ElectronicStructureMethod):
    """
    all_methods = [XTB(), MOPAC(), ORCA(), G16(), G09(), NWChem()]

    if Config.lcode is not None:
        return get_defined_method(name=Config.lcode.lower(),
                                  possibilities=all_methods)
    else:
        return get_first_available_method(all_methods)
Esempio n. 2
0
def get_hmethod():
    """Get the high-level electronic structure theory method to use

    Returns:
        (autode.wrappers.base.ElectronicStructureMethod): Method
    """
    orca = ORCA()
    g09 = G09()
    nwchem = NWChem()
    g16 = G16()

    if Config.hcode is not None:
        return get_defined_method(name=Config.hcode.lower(),
                                  possibilities=[orca, g16, g09, nwchem])
    else:
        return get_first_available_method([orca, g16, g09, nwchem])
Esempio n. 3
0
def test_keyword_setting():

    orca = ORCA()
    orca.keywords.sp.functional = 'B3LYP'

    # Setter should generate a Functional from the keyword string
    assert isinstance(orca.keywords.sp.functional, Functional)

    calc = Calculation(name='tmp',
                       molecule=test_mol.copy(),
                       method=orca,
                       keywords=orca.keywords.sp)
    calc.generate_input()
    assert calc.input.exists()

    # B3LYP should now be in the in input
    inp_lines = open(calc.input.filename, 'r').readlines()
    assert any('B3LYP' in line for line in inp_lines)

    # With a keyword without ORCA defined then raise an exception
    with pytest.raises(UnsuppportedCalculationInput):
        orca.keywords.sp.functional = Functional(name='B3LYP', g09='B3LYP')
        calc = Calculation(name='tmp',
                           molecule=test_mol.copy(),
                           method=orca,
                           keywords=orca.keywords.sp)
        calc.generate_input()

    # Without a default wavefunction method defined in the single point method
    # we can't set keywords.wf
    with pytest.raises(ValueError):
        orca.keywords.sp.wf_method = 'HF'

    # but if we have a WF method in the keywords we should be able to set it
    orca.keywords.sp = SinglePointKeywords(
        [WFMethod('MP2'), BasisSet('def2-TZVP')])

    orca.keywords.sp.wf_method = 'HF'
    assert orca.keywords.sp.wf_method == 'HF'
Esempio n. 4
0
from autode.config import Config
from autode.calculation import Calculation
from autode.wrappers.ORCA import ORCA
from autode.transition_states.base import imag_mode_links_reactant_products
from autode.transition_states.base import imag_mode_has_correct_displacement
from autode.transition_states.base import imag_mode_generates_other_bonds
from autode.species.species import Species
from autode.transition_states.base import get_displaced_atoms_along_mode
from autode.wrappers.G09 import G09
from . import testutils
import pytest
import os
import shutil

here = os.path.dirname(os.path.abspath(__file__))
method = ORCA()
method.available = True

# Force ORCA to appear available
Config.hcode = 'orca'
Config.ORCA.path = here

ch3cl = Reactant(charge=0,
                 mult=1,
                 atoms=[
                     Atom('Cl', 1.63664, 0.02010, -0.05829),
                     Atom('C', -0.14524, -0.00136, 0.00498),
                     Atom('H', -0.52169, -0.54637, -0.86809),
                     Atom('H', -0.45804, -0.50420, 0.92747),
                     Atom('H', -0.51166, 1.03181, -0.00597)
                 ])
Esempio n. 5
0
from autode.exceptions import NoInputError
from autode.exceptions import SolventUnavailable
from autode.exceptions import UnsuppportedCalculationInput
from autode.wrappers.keywords import SinglePointKeywords, OptKeywords
from autode.wrappers.keywords import Functional, WFMethod, BasisSet
from autode.solvent.solvents import Solvent
from autode.config import Config
from autode import utils
from . import testutils
import numpy as np
import pytest

import os
here = os.path.dirname(os.path.abspath(__file__))
test_mol = Molecule(name='methane', smiles='C')
method = ORCA()
Config.keyword_prefixes = False

sp_keywords = SinglePointKeywords(['PBE', 'def2-SVP'])
opt_keywords = OptKeywords(['Opt', 'PBE', 'def2-SVP'])


@testutils.work_in_zipped_dir(os.path.join(here, 'data', 'orca.zip'))
def test_orca_opt_calculation():

    methylchloride = Molecule(name='CH3Cl',
                              smiles='[H]C([H])(Cl)[H]',
                              solvent_name='water')

    calc = Calculation(name='opt',
                       molecule=methylchloride,