| [61d69a4] | 1 | /* | 
|---|
|  | 2 | * MpqcParser_Parameters.hpp | 
|---|
|  | 3 | * | 
|---|
|  | 4 | *  Created on: Feb 3, 2011 | 
|---|
|  | 5 | *      Author: heber | 
|---|
|  | 6 | */ | 
|---|
|  | 7 |  | 
|---|
|  | 8 | #ifndef MPQCPARSER_PARAMETERS_HPP_ | 
|---|
|  | 9 | #define MPQCPARSER_PARAMETERS_HPP_ | 
|---|
|  | 10 |  | 
|---|
|  | 11 | // include config.h | 
|---|
|  | 12 | #ifdef HAVE_CONFIG_H | 
|---|
|  | 13 | #include <config.h> | 
|---|
|  | 14 | #endif | 
|---|
|  | 15 |  | 
|---|
|  | 16 | #include <list> | 
|---|
| [ee50c1] | 17 | #include <map> | 
|---|
| [61d69a4] | 18 | #include <vector> | 
|---|
|  | 19 |  | 
|---|
| [c1db05] | 20 | #include "CodePatterns/Clone.hpp" | 
|---|
| [61d69a4] | 21 | #include "CodePatterns/Log.hpp" | 
|---|
|  | 22 |  | 
|---|
| [c1db05] | 23 | #include "Parser/FormatParser_Parameters.hpp" | 
|---|
| [61d69a4] | 24 |  | 
|---|
| [ee50c1] | 25 | #include "Parser/Parameters/ContinuousParameter.hpp" | 
|---|
|  | 26 |  | 
|---|
|  | 27 | // specialization for bool (we want "yes/no" not "1/0") | 
|---|
|  | 28 | template <> const std::string ContinuousValue<bool>::get() const; | 
|---|
|  | 29 | template <> void ContinuousValue<bool>::set(const std::string _value); | 
|---|
|  | 30 |  | 
|---|
| [61d69a4] | 31 | class MpqcParser; | 
|---|
|  | 32 |  | 
|---|
| [c1db05] | 33 | class MpqcParser_Parameters : public FormatParser_Parameters | 
|---|
| [61d69a4] | 34 | { | 
|---|
| [44fce5] | 35 | // MpqcParser should be friend to access params directly for types. | 
|---|
| [61d69a4] | 36 | friend class MpqcParser; | 
|---|
| [44fce5] | 37 | // ParserMpqcUnitTest needs to be friend to check types contained in params. | 
|---|
| [61d69a4] | 38 | friend class ParserMpqcUnitTest; | 
|---|
| [44fce5] | 39 |  | 
|---|
| [61d69a4] | 40 | public: | 
|---|
| [44fce5] | 41 | /** Constructor of MpqcParser_Parameters. | 
|---|
|  | 42 | * | 
|---|
|  | 43 | */ | 
|---|
| [61d69a4] | 44 | MpqcParser_Parameters(); | 
|---|
| [44fce5] | 45 |  | 
|---|
|  | 46 | /** Destructor of MpqcParser_Parameters. | 
|---|
|  | 47 | * | 
|---|
|  | 48 | */ | 
|---|
| [c1db05] | 49 | virtual ~MpqcParser_Parameters(); | 
|---|
| [61d69a4] | 50 |  | 
|---|
| [44fce5] | 51 | /** Enumeration of all known Parameters to allow placing them in vectors, maps. | 
|---|
|  | 52 | * | 
|---|
|  | 53 | */ | 
|---|
| [61d69a4] | 54 | enum Parameters { | 
|---|
| [44fce5] | 55 | hessianParam,    //!< HessianParam, whether hessian should be calculated or not | 
|---|
|  | 56 | savestateParam,  //!< savestateParam, whether intermediate/final states (wave function) should be stored | 
|---|
|  | 57 | do_gradientParam,//!< do_gradientParam, whether a gradient should be calculated | 
|---|
|  | 58 | maxiterParam,    //!< maxiterParam, number of maximum iterations for CG | 
|---|
|  | 59 | memoryParam,     //!< memoryParam, maximum amount of memory to use | 
|---|
|  | 60 | stdapproxParam,  //!< stdapproxParam, standard approximation in MBPT2 R12 | 
|---|
|  | 61 | nfzcParam,       //!< nfzcParam, nfzc parameter in MBPT2 R12 | 
|---|
|  | 62 | basisParam,      //!< basisParam, basis set to use | 
|---|
|  | 63 | aux_basisParam,  //!< aux_basisParam, auxiliary baseis set to use in MBPT2 R12 | 
|---|
|  | 64 | integrationParam,//!< integrationParam, integration method to use in MBPT2 R12 | 
|---|
|  | 65 | theoryParam,     //!< theoryParam, level of theory to use | 
|---|
|  | 66 | unknownParam};   //!< unknownParam, designates an unknown parameter | 
|---|
| [61d69a4] | 67 |  | 
|---|
| [ee50c1] | 68 | /** Enumeration of all known theories. | 
|---|
| [44fce5] | 69 | * | 
|---|
|  | 70 | */ | 
|---|
| [ee50c1] | 71 | enum Theory { | 
|---|
|  | 72 | CLHF,       //!< Closed Shell Hartree-Fock equations | 
|---|
|  | 73 | CLKS,       //!< Closed Shell Kohn-Sham equations | 
|---|
|  | 74 | MBPT2,      //!< Moeller Plesset Perturbation Theory second order | 
|---|
|  | 75 | MBPT2_R12,  //!< Moeller Plesset Perturbation Theory second order with R12 integral | 
|---|
|  | 76 | unknownTheory //!< designates an unknown theory | 
|---|
|  | 77 | }; | 
|---|
| [61d69a4] | 78 |  | 
|---|
| [ee50c1] | 79 | /** Enumeration of all known integration methods | 
|---|
| [44fce5] | 80 | * | 
|---|
|  | 81 | */ | 
|---|
| [ee50c1] | 82 | enum IntegrationMethod { | 
|---|
|  | 83 | IntegralCints,  //!< Integration method Cints in MBPT2 R12? | 
|---|
|  | 84 | unknownIntegration //!< designates unknown integration method | 
|---|
|  | 85 | }; | 
|---|
| [61d69a4] | 86 |  | 
|---|
| [ee50c1] | 87 | // enum to string getters | 
|---|
|  | 88 | const std::string getParameter(const enum Parameters param) const; | 
|---|
|  | 89 | void setParameter(const enum Parameters param, const std::string &); | 
|---|
|  | 90 | const std::string &getParameterName(const enum Parameters param) const; | 
|---|
|  | 91 | const std::string &getTheoryName(const enum Theory theory) const; | 
|---|
|  | 92 | const std::string &getIntegrationMethodName(const enum IntegrationMethod integration) const; | 
|---|
| [44fce5] | 93 |  | 
|---|
| [ee50c1] | 94 | private: | 
|---|
| [44fce5] | 95 |  | 
|---|
| [61d69a4] | 96 |  | 
|---|
| [ee50c1] | 97 | //!> vector with all available theories in same order as enum Theory. | 
|---|
|  | 98 | std::vector<std::string> ValidTheories; | 
|---|
| [c1db05] | 99 |  | 
|---|
| [ee50c1] | 100 | //!> vector with all available integration methods in same order as enum IntegrationMethod. | 
|---|
|  | 101 | std::vector<std::string> ValidIntegrationMethods; | 
|---|
| [c1db05] | 102 |  | 
|---|
| [ee50c1] | 103 | bool checkWorldElementsAgainstCurrentBasis() const; | 
|---|
| [c1db05] | 104 |  | 
|---|
|  | 105 | /** Global initialization in cstor. | 
|---|
|  | 106 | * | 
|---|
|  | 107 | */ | 
|---|
|  | 108 | void Init(); | 
|---|
|  | 109 |  | 
|---|
| [44fce5] | 110 | /** Initializes BasisList. | 
|---|
|  | 111 | * | 
|---|
|  | 112 | */ | 
|---|
| [61d69a4] | 113 | void initBasis(); | 
|---|
| [44fce5] | 114 |  | 
|---|
| [ee50c1] | 115 | //!> vector with all parameter names in same order as enum Parameters | 
|---|
|  | 116 | std::vector<std::string> ParamNames; | 
|---|
| [61d69a4] | 117 |  | 
|---|
| [ee50c1] | 118 | //!> typedef for the list of all available basis sets | 
|---|
| [61d69a4] | 119 | typedef std::map<std::string, std::list<std::string> > BasisMapType; | 
|---|
|  | 120 |  | 
|---|
| [ee50c1] | 121 | //!> list of all basis along with their present element parametrization | 
|---|
| [61d69a4] | 122 | BasisMapType BasisList; | 
|---|
|  | 123 | }; | 
|---|
|  | 124 |  | 
|---|
|  | 125 | #endif /* MPQCPARSER_PARAMETERS_HPP_ */ | 
|---|