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