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)
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])
def test_correct_imag_mode(): os.chdir(os.path.join(here, 'data')) bond_rearrangement = BondRearrangement(breaking_bonds=[(4, 1), (4, 18)], forming_bonds=[(1, 18)]) g09 = G09() g09.available = True calc = Calculation(name='tmp', molecule=ReactantComplex( Reactant(smiles='CC(C)(C)C1C=CC=C1')), method=g09, keywords=Config.G09.keywords.opt_ts) calc.output.filename = 'correct_ts_mode_g09.log' calc.output.set_lines() f_displaced_atoms = get_displaced_atoms_along_mode(calc, mode_number=6, disp_magnitude=1.0) f_species = Species(name='f_displaced', atoms=f_displaced_atoms, charge=0, mult=1) # Charge & mult are placeholders b_displaced_atoms = get_displaced_atoms_along_mode(calc, mode_number=6, disp_magnitude=-1.0) b_species = Species(name='b_displaced', atoms=b_displaced_atoms, charge=0, mult=1) # With the correct mode no other bonds are made assert not imag_mode_generates_other_bonds( ts=calc.molecule, f_species=f_species, b_species=b_species, bond_rearrangement=bond_rearrangement) calc.output.filename = 'incorrect_ts_mode_g09.log' calc.output.set_lines() assert not imag_mode_has_correct_displacement(calc, bond_rearrangement) os.chdir(here)
from autode.wrappers.G09 import G09 from autode.calculation import Calculation from autode.species.molecule import Molecule from autode.wrappers.keywords import OptKeywords, SinglePointKeywords from autode.exceptions import AtomsNotFound from autode.exceptions import NoInputError from autode.exceptions import NoNormalModesFound from autode.point_charges import PointCharge import pytest import os import numpy as np here = os.path.dirname(os.path.abspath(__file__)) test_mol = Molecule(name='methane', smiles='C') method = G09() method.available = True opt_keywords = OptKeywords(['PBE1PBE/Def2SVP', 'Opt']) optts_keywords = OptKeywords([ 'PBE1PBE/Def2SVP', 'Freq', 'Opt=(TS, CalcFC, NoEigenTest, ' 'MaxCycles=100, MaxStep=10, NoTrustUpdate)' ]) sp_keywords = SinglePointKeywords(['PBE1PBE/Def2SVP']) def test_gauss_opt_calc(): os.chdir(os.path.join(here, 'data')) methylchloride = Molecule(name='CH3Cl',