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