[1bef07] | 1 | /*
|
---|
| 2 | * Psi3Parser_Parameters.hpp
|
---|
| 3 | *
|
---|
| 4 | * Created on: Feb 3, 2011
|
---|
| 5 | * Author: heber
|
---|
| 6 | */
|
---|
| 7 |
|
---|
| 8 | #ifndef PSI3PARSER_PARAMETERS_HPP_
|
---|
| 9 | #define PSI3PARSER_PARAMETERS_HPP_
|
---|
| 10 |
|
---|
| 11 | // include config.h
|
---|
| 12 | #ifdef HAVE_CONFIG_H
|
---|
| 13 | #include <config.h>
|
---|
| 14 | #endif
|
---|
| 15 |
|
---|
| 16 | #include <iosfwd>
|
---|
| 17 | #include <list>
|
---|
| 18 | #include <map>
|
---|
| 19 | #include <vector>
|
---|
| 20 |
|
---|
| 21 | #include "CodePatterns/Clone.hpp"
|
---|
| 22 | #include "CodePatterns/Log.hpp"
|
---|
| 23 |
|
---|
| 24 | #include "Parser/FormatParser_Parameters.hpp"
|
---|
| 25 |
|
---|
| 26 | #include "Parser/Parameters/ContinuousParameter.hpp"
|
---|
| 27 |
|
---|
| 28 | // specialization for bool (we want "yes/no" not "1/0")
|
---|
| 29 | template <> inline const std::string ContinuousValue<bool>::get() const;
|
---|
| 30 | template <> inline void ContinuousValue<bool>::set(const std::string _value);
|
---|
| 31 |
|
---|
| 32 | class Psi3Parser;
|
---|
| 33 |
|
---|
| 34 | class Psi3Parser_Parameters : public FormatParser_Parameters
|
---|
| 35 | {
|
---|
| 36 | // Psi3Parser should be friend to access params directly for types.
|
---|
| 37 | friend class Psi3Parser;
|
---|
| 38 | // ParserPsi3UnitTest needs to be friend to check types contained in params.
|
---|
| 39 | friend class ParserPsi3UnitTest;
|
---|
| 40 |
|
---|
| 41 | public:
|
---|
| 42 | /** Constructor of Psi3Parser_Parameters.
|
---|
| 43 | *
|
---|
| 44 | */
|
---|
| 45 | Psi3Parser_Parameters();
|
---|
| 46 |
|
---|
| 47 | /** Destructor of Psi3Parser_Parameters.
|
---|
| 48 | *
|
---|
| 49 | */
|
---|
| 50 | virtual ~Psi3Parser_Parameters();
|
---|
| 51 |
|
---|
| 52 | /** Enumeration of all known Parameters to allow placing them in vectors, maps.
|
---|
| 53 | *
|
---|
| 54 | */
|
---|
| 55 | enum Parameters {
|
---|
| 56 | labelParam, //!< labelParam, name of the computation appears in output file
|
---|
| 57 | jobtypeParam, //!< jobtypeParam, type of job to perform (single point, ...)
|
---|
| 58 | wavefunctionParam,//!< wfnParam, wavefunction type
|
---|
| 59 | maxiterParam, //!< maxiterParam, maximum number of iterations
|
---|
| 60 | referenceParam, //!< referenceParam, type of self-consistent field calculation
|
---|
| 61 | basisParam, //!< basisParam, name of the basis
|
---|
| 62 | freeze_coreParam, //!< freeze_coreParam, whether to freeze core orbitals automatically or not
|
---|
| 63 | unitsParam, //!< unitsParam, unit of length
|
---|
| 64 | dertypeParam, //!< dertypeParam, type of derivative to use
|
---|
| 65 | originParam, //!< originParam, origin of the system
|
---|
| 66 | multipParam, //!< multipParam, multiplicity of the molecule (2S+1) in case of unrestricted calculations
|
---|
| 67 | chargeParam, //!< chargeParam, charge of the molecule
|
---|
| 68 | soccParam, //!< soccParam, singly occupied orbitals in each irreducible representation
|
---|
| 69 | doccParam, //!< doccParam, doubly occupied orbitals in each irreducible representation
|
---|
| 70 | subgroupParam, //!< subgroupParam, subgroup symmetry the system fulfulls
|
---|
| 71 | unique_axisParam, //!< unique_axisParam, unique_axis in case of degeneracy for the given subgroup
|
---|
| 72 | unknownParam}; //!< unknownParam, designates an unknown parameter
|
---|
| 73 |
|
---|
| 74 | /** Enumeration of all known job typs.
|
---|
| 75 | *
|
---|
| 76 | */
|
---|
| 77 | enum Jobtype {
|
---|
| 78 | SP, //!< single-point energy calculation
|
---|
| 79 | OPT, //!< geometry optimization
|
---|
| 80 | DISP, //!< different displaced geometries
|
---|
| 81 | FREQ, //!< frequency calculation
|
---|
| 82 | SYMM_FREQ, //!< frequency calculation for symmetric vibrational modes only
|
---|
| 83 | DBOC, //!< Diagonal Born-Oppenheimer correction energy calculation
|
---|
| 84 | RESPONSE, //!< response properties calculation
|
---|
| 85 | unknownJobtype //!< designates an unknown job type
|
---|
| 86 | };
|
---|
| 87 |
|
---|
| 88 | /** Enumeration of all known wavefunction.
|
---|
| 89 | *
|
---|
| 90 | */
|
---|
| 91 | enum Wavefunction {
|
---|
| 92 | SCF, //!< Self-Consistent Field
|
---|
| 93 | MP2, //!< Moeller-Plesset perturbation theory to second order
|
---|
| 94 | MP2R12, //!< Moeller-Plesset perturbation theory to second order with r12 functional
|
---|
| 95 | CIS, //!< Complete Inverse Space
|
---|
| 96 | DETCI, //!< Determinatal Configuration Interaction
|
---|
| 97 | CASSCF, //!< Complete Active Space Self-Consistent Field
|
---|
| 98 | RASSCF, //!< Restriced Active Space Self-Consistent Field
|
---|
| 99 | CCSD, //!< Coupled Cluster with Singles and Doubles
|
---|
| 100 | CCSD_T, //!< Coupled Cluster with Singles, Doubles, and Triples
|
---|
| 101 | BCCD, //!< some Coupled Cluster with Singles and Doubles
|
---|
| 102 | BCCD_T, //!< some Coupled Cluster with Singles, Doubles, and Triples
|
---|
| 103 | EOM_CCSD, //!< some other Coupled Cluster with Singles and Doubles
|
---|
| 104 | ZAPTN, //!< unknown type?
|
---|
| 105 | unknownWavefunction //!< designates an unknown wavefunction
|
---|
| 106 | };
|
---|
| 107 |
|
---|
| 108 | /** Enumeration of all known reference.
|
---|
| 109 | *
|
---|
| 110 | */
|
---|
| 111 | enum Reference {
|
---|
| 112 | RHF, //!< Restricted Hartree-Fock equations
|
---|
| 113 | ROHF, //!< Restricted Open Shell Hartree-Fock equations
|
---|
| 114 | UHF, //!< Unrestricted Hartree-Fock equations
|
---|
| 115 | TWOCON, //!< Special Unrestricted Hartree-Fock equations
|
---|
| 116 | unknownReference //!< designates an unknown reference
|
---|
| 117 | };
|
---|
| 118 |
|
---|
| 119 | /** Enumeration of all known unique_axis values.
|
---|
| 120 | *
|
---|
| 121 | */
|
---|
| 122 | enum UniqueAxis {
|
---|
| 123 | X, //!< x axis
|
---|
| 124 | Y, //!< y axis
|
---|
| 125 | Z, //!< z axis
|
---|
| 126 | unknownUniqueAxis //!< designates an unknown unique axis
|
---|
| 127 | };
|
---|
| 128 |
|
---|
| 129 | /** Enumeration of all known length units.
|
---|
| 130 | *
|
---|
| 131 | */
|
---|
| 132 | enum Units {
|
---|
| 133 | angstrom, //!< angstroem units of length
|
---|
| 134 | bohr, //!< bohr units of length
|
---|
| 135 | unknownUnits //!< designates an unknown unit
|
---|
| 136 | };
|
---|
| 137 |
|
---|
| 138 | /** Enumeration of all known length dertypes.
|
---|
| 139 | *
|
---|
| 140 | */
|
---|
| 141 | enum DerivativeType {
|
---|
| 142 | NONE, //!< no derivative calculation
|
---|
| 143 | unknownDerivativeType //!< designates an unknown dertype
|
---|
| 144 | };
|
---|
| 145 |
|
---|
| 146 | /** Enumeration of all known unique freeze_core values.
|
---|
| 147 | *
|
---|
| 148 | */
|
---|
| 149 | enum FreezeCore {
|
---|
| 150 | YES, //!< freeze cores automatically
|
---|
| 151 | TRUE, //!< same as YES
|
---|
| 152 | NO, //!< don't freeze cores
|
---|
| 153 | FALSE, //!< same as NO
|
---|
| 154 | SMALL, //!< for elements Na-Ar
|
---|
| 155 | LARGE, //!< for elements Na-Ar
|
---|
| 156 | unknownFreezeCore //!< designates an unknown freeze_core
|
---|
| 157 | };
|
---|
| 158 |
|
---|
| 159 | // enum to string getters
|
---|
| 160 | const std::string getParameter(const enum Parameters param) const;
|
---|
| 161 | void setParameter(const enum Parameters param, const std::string &);
|
---|
| 162 | const std::string &getParameterName(const enum Parameters param) const;
|
---|
| 163 | // const std::string &getTheoryName(const enum Theory theory) const;
|
---|
| 164 | // const std::string &getIntegrationMethodName(const enum IntegrationMethod integration) const;
|
---|
| 165 |
|
---|
| 166 | private:
|
---|
| 167 | //!> vector with all available dertype in same order as enum DerivativeType.
|
---|
| 168 | std::vector<std::string> ValidDerivativeType;
|
---|
| 169 |
|
---|
| 170 | //!> vector with all available unit in same order as enum Units.
|
---|
| 171 | std::vector<std::string> ValidUnits;
|
---|
| 172 |
|
---|
| 173 | //!> vector with all available unique_axis in same order as enum UniqueAxis.
|
---|
| 174 | std::vector<std::string> ValidUniqueAxis;
|
---|
| 175 |
|
---|
| 176 | //!> vector with all available freeze_core in same order as enum FreezeCore.
|
---|
| 177 | std::vector<std::string> ValidFreezeCore;
|
---|
| 178 |
|
---|
| 179 | //!> vector with all available job types in same order as enum Jobtypes.
|
---|
| 180 | std::vector<std::string> ValidJobtypes;
|
---|
| 181 |
|
---|
| 182 | //!> vector with all available wavefunction in same order as enum Wavefunction.
|
---|
| 183 | std::vector<std::string> ValidWavefunction;
|
---|
| 184 |
|
---|
| 185 | //!> vector with all available reference in same order as enum Reference.
|
---|
| 186 | std::vector<std::string> ValidReference;
|
---|
| 187 |
|
---|
| 188 | bool checkWorldElementsAgainstCurrentBasis() const;
|
---|
| 189 |
|
---|
| 190 | /** Global initialization in cstor.
|
---|
| 191 | *
|
---|
| 192 | */
|
---|
| 193 | void Init();
|
---|
| 194 |
|
---|
| 195 | // /** Initializes BasisList.
|
---|
| 196 | // *
|
---|
| 197 | // */
|
---|
| 198 | // void initBasis();
|
---|
| 199 |
|
---|
| 200 | //!> vector with all parameter names in same order as enum Parameters
|
---|
| 201 | std::vector<std::string> ParamNames;
|
---|
| 202 |
|
---|
| 203 | //!> typedef for the list of all available basis sets
|
---|
| 204 | typedef std::map<std::string, std::list<std::string> > BasisMapType;
|
---|
| 205 |
|
---|
| 206 | //!> list of all basis along with their present element parametrization
|
---|
| 207 | BasisMapType BasisList;
|
---|
| 208 | };
|
---|
| 209 |
|
---|
| 210 | std::ostream & operator << (std::ostream& ost, const Psi3Parser_Parameters ¶ms);
|
---|
| 211 |
|
---|
| 212 | std::istream & operator >> (std::istream& ist, Psi3Parser_Parameters ¶ms);
|
---|
| 213 |
|
---|
| 214 | #endif /* PSI3PARSER_PARAMETERS_HPP_ */
|
---|