Révision | 5f9f47b94b70df2657296ed27bfad76a9a32ac14 (tree) |
---|---|
l'heure | 2011-07-02 14:41:51 |
Auteur | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Parameters::isDavidsonCIS and etc. are added.
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@97 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -29,6 +29,8 @@ private: | ||
29 | 29 | InputParser(InputParser&); |
30 | 30 | void operator = (InputParser&); |
31 | 31 | ~InputParser(); |
32 | + string messageYES; | |
33 | + string messageNO; | |
32 | 34 | string messageStartParseInput; |
33 | 35 | string messageDoneParseInput; |
34 | 36 | string messageTotalNumberAOs; |
@@ -47,6 +49,7 @@ private: | ||
47 | 49 | string messageCisNumberActiveOcc; |
48 | 50 | string messageCisNumberActiveVir; |
49 | 51 | string messageCisNumberExcitedStates; |
52 | + string messageCisDavidson; | |
50 | 53 | string stringSpace; |
51 | 54 | string stringCommentOut; |
52 | 55 | string stringTheory; |
@@ -89,6 +92,7 @@ private: | ||
89 | 92 | string stringCISActiveOcc; |
90 | 93 | string stringCISActiveVir; |
91 | 94 | string stringCISNStates; |
95 | + string stringCISDavidson; | |
92 | 96 | void CalcMolecularBasics(Molecule* molecule); |
93 | 97 | void CalcCisCondition(Molecule* molecule); |
94 | 98 | void OutputMolecularBasics(Molecule* molecule); |
@@ -101,6 +105,8 @@ private: | ||
101 | 105 | InputParser* InputParser::inputParser = NULL; |
102 | 106 | |
103 | 107 | InputParser::InputParser(){ |
108 | + this->messageYES = "YES"; | |
109 | + this->messageNO = "NO"; | |
104 | 110 | this->messageStartParseInput = "********** START: Parse input **********\n"; |
105 | 111 | this->messageDoneParseInput = "********** DONE: Parse input ***********\n\n\n"; |
106 | 112 | this->messageTotalNumberAOs = "\tTotal number of valence AOs: "; |
@@ -119,6 +125,7 @@ InputParser::InputParser(){ | ||
119 | 125 | this->messageCisNumberActiveOcc = "\t\tNumber of active Occ.: "; |
120 | 126 | this->messageCisNumberActiveVir = "\t\tNumber of active Vir.: "; |
121 | 127 | this->messageCisNumberExcitedStates = "\t\tNumber of excited states: "; |
128 | + this->messageCisDavidson = "\t\tCIS-Davidson: "; | |
122 | 129 | this->stringSpace = " "; |
123 | 130 | this->stringCommentOut = "//"; |
124 | 131 | this->stringTheoryCNDO2 = "cndo/2"; |
@@ -161,6 +168,7 @@ InputParser::InputParser(){ | ||
161 | 168 | this->stringCISActiveOcc = "activeocc"; |
162 | 169 | this->stringCISActiveVir = "activevir"; |
163 | 170 | this->stringCISNStates = "nstates"; |
171 | + this->stringCISDavidson = "davidson"; | |
164 | 172 | } |
165 | 173 | |
166 | 174 | InputParser::~InputParser(){ |
@@ -408,6 +416,16 @@ void InputParser::Parse(Molecule* molecule){ | ||
408 | 416 | Parameters::GetInstance()->SetNumberExcitedStatesCIS(nStates); |
409 | 417 | j++; |
410 | 418 | } |
419 | + // Davidson is used or not | |
420 | + if(inputTerms[j].compare(this->stringCISDavidson) == 0){ | |
421 | + if(inputTerms[j+1].compare(this->messageYES) == 0){ | |
422 | + Parameters::GetInstance()->SetIsDavidsonCIS(true); | |
423 | + } | |
424 | + else{ | |
425 | + Parameters::GetInstance()->SetIsDavidsonCIS(false); | |
426 | + } | |
427 | + j++; | |
428 | + } | |
411 | 429 | j++; |
412 | 430 | } |
413 | 431 | i = j; |
@@ -541,6 +559,14 @@ void InputParser::OutputCisConditions(){ | ||
541 | 559 | printf("%s%d\n",this->messageCisNumberActiveOcc.c_str(),Parameters::GetInstance()->GetActiveOccCIS()); |
542 | 560 | printf("%s%d\n",this->messageCisNumberActiveVir.c_str(),Parameters::GetInstance()->GetActiveVirCIS()); |
543 | 561 | printf("%s%d\n",this->messageCisNumberExcitedStates.c_str(),Parameters::GetInstance()->GetNumberExcitedStatesCIS()); |
562 | + printf("%s",this->messageCisDavidson.c_str()); | |
563 | + if(Parameters::GetInstance()->GetIsDavidsonCIS()){ | |
564 | + printf("%s\n",this->messageYES.c_str()); | |
565 | + } | |
566 | + else{ | |
567 | + printf("%s\n",this->messageNO.c_str()); | |
568 | + } | |
569 | + | |
544 | 570 | cout << "\n"; |
545 | 571 | } |
546 | 572 |
@@ -57,6 +57,8 @@ public: | ||
57 | 57 | void SetActiveVirCIS(int activeOccCIS); |
58 | 58 | int GetNumberExcitedStatesCIS(); |
59 | 59 | void SetNumberExcitedStatesCIS(int nStates); |
60 | + bool GetIsDavidsonCIS(); | |
61 | + void SetIsDavidsonCIS(bool isDavidsonCIS); | |
60 | 62 | private: |
61 | 63 | static Parameters* parameters; |
62 | 64 | Parameters(); |
@@ -89,6 +91,7 @@ private: | ||
89 | 91 | int activeOccCIS; |
90 | 92 | int activeVirCIS; |
91 | 93 | int numberExcitedStatesCIS; |
94 | + bool isDavidsonCIS; | |
92 | 95 | }; |
93 | 96 | Parameters* Parameters::parameters = NULL; |
94 | 97 |
@@ -151,6 +154,7 @@ void Parameters::SetDefaultValues(){ | ||
151 | 154 | this->activeOccCIS = 10; |
152 | 155 | this->activeVirCIS = 10; |
153 | 156 | this->numberExcitedStatesCIS = 5; |
157 | + this->isDavidsonCIS = true; | |
154 | 158 | } |
155 | 159 | |
156 | 160 | double Parameters::GetThresholdSCF(){ |
@@ -342,6 +346,13 @@ void Parameters::SetNumberExcitedStatesCIS(int nStates){ | ||
342 | 346 | this->numberExcitedStatesCIS = nStates; |
343 | 347 | } |
344 | 348 | |
349 | +bool Parameters::GetIsDavidsonCIS(){ | |
350 | + return this->isDavidsonCIS; | |
351 | +} | |
352 | + | |
353 | +void Parameters::SetIsDavidsonCIS(bool isDavidsonCIS){ | |
354 | + this->isDavidsonCIS = isDavidsonCIS; | |
355 | +} | |
345 | 356 | |
346 | 357 | } |
347 | 358 | #endif |
@@ -19,6 +19,7 @@ SCF | ||
19 | 19 | SCF_END |
20 | 20 | |
21 | 21 | CIS |
22 | + davidson no | |
22 | 23 | activeOcc 2 |
23 | 24 | activeVir 2 |
24 | 25 | nstates 1000 |