# IODATA is an input and output module for quantum chemistry.# Copyright (C) 2011-2019 The IODATA Development Team## This file is part of IODATA.## IODATA is free software; you can redistribute it and/or# modify it under the terms of the GNU General Public License# as published by the Free Software Foundation; either version 3# of the License, or (at your option) any later version.## IODATA is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.## You should have received a copy of the GNU General Public License# along with this program; if not, see <http://www.gnu.org/licenses/># --"""Orca Input Module."""fromtypingimportCallable,Optional,TextIOfrom..docstringsimportdocument_write_inputfrom..iodataimportIODatafrom..periodicimportnum2symfrom..utilsimportangstromfrom.commonimportwrite_input_base__all__=()default_template="""\! {lot}{obasis_name}{run_type}# {title}*xyz {charge}{spinmult}{geometry}*"""
[docs]defdefault_atom_line(data:IOData,iatom:int):"""Format atom line for ORCA input."""symbol=num2sym[data.atnums[iatom]]atcoord=data.atcoords[iatom]/angstromreturnf"{symbol:3s}{atcoord[0]:10.6f}{atcoord[1]:10.6f}{atcoord[2]:10.6f}"
[docs]@document_write_input("ORCA",["atnums","atcoords"],["title","run_type","lot","obasis_name","spinmult","charge"],)defwrite_input(fh:TextIO,data:IOData,template:Optional[str]=None,atom_line:Optional[Callable]=None,**kwargs,):"""Do not edit this docstring. It will be overwritten."""# Fill in some ORCA-specific defaults and field names.iftemplateisNone:template=default_templateifatom_lineisNone:atom_line=default_atom_lineorca_keywords={"energy":"Energy","freq":"Freq","opt":"Opt"}# Set format-specific defaults.fields={"lot":data.lotor"HF","obasis_name":data.obasis_nameor"STO-3G","run_type":orca_keywords[(data.run_typeor"energy").lower()],}# User-specifield fields have priority, may overwrite default ones.fields.update(kwargs)write_input_base(fh,data,template,atom_line,fields)