• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Révision5f9f47b94b70df2657296ed27bfad76a9a32ac14 (tree)
l'heure2011-07-02 14:41:51
AuteurMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Message de Log

Parameters::isDavidsonCIS and etc. are added.

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/MolDS/trunk@97 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Modification

--- a/src/base/InputParser.h
+++ b/src/base/InputParser.h
@@ -29,6 +29,8 @@ private:
2929 InputParser(InputParser&);
3030 void operator = (InputParser&);
3131 ~InputParser();
32+ string messageYES;
33+ string messageNO;
3234 string messageStartParseInput;
3335 string messageDoneParseInput;
3436 string messageTotalNumberAOs;
@@ -47,6 +49,7 @@ private:
4749 string messageCisNumberActiveOcc;
4850 string messageCisNumberActiveVir;
4951 string messageCisNumberExcitedStates;
52+ string messageCisDavidson;
5053 string stringSpace;
5154 string stringCommentOut;
5255 string stringTheory;
@@ -89,6 +92,7 @@ private:
8992 string stringCISActiveOcc;
9093 string stringCISActiveVir;
9194 string stringCISNStates;
95+ string stringCISDavidson;
9296 void CalcMolecularBasics(Molecule* molecule);
9397 void CalcCisCondition(Molecule* molecule);
9498 void OutputMolecularBasics(Molecule* molecule);
@@ -101,6 +105,8 @@ private:
101105 InputParser* InputParser::inputParser = NULL;
102106
103107 InputParser::InputParser(){
108+ this->messageYES = "YES";
109+ this->messageNO = "NO";
104110 this->messageStartParseInput = "********** START: Parse input **********\n";
105111 this->messageDoneParseInput = "********** DONE: Parse input ***********\n\n\n";
106112 this->messageTotalNumberAOs = "\tTotal number of valence AOs: ";
@@ -119,6 +125,7 @@ InputParser::InputParser(){
119125 this->messageCisNumberActiveOcc = "\t\tNumber of active Occ.: ";
120126 this->messageCisNumberActiveVir = "\t\tNumber of active Vir.: ";
121127 this->messageCisNumberExcitedStates = "\t\tNumber of excited states: ";
128+ this->messageCisDavidson = "\t\tCIS-Davidson: ";
122129 this->stringSpace = " ";
123130 this->stringCommentOut = "//";
124131 this->stringTheoryCNDO2 = "cndo/2";
@@ -161,6 +168,7 @@ InputParser::InputParser(){
161168 this->stringCISActiveOcc = "activeocc";
162169 this->stringCISActiveVir = "activevir";
163170 this->stringCISNStates = "nstates";
171+ this->stringCISDavidson = "davidson";
164172 }
165173
166174 InputParser::~InputParser(){
@@ -408,6 +416,16 @@ void InputParser::Parse(Molecule* molecule){
408416 Parameters::GetInstance()->SetNumberExcitedStatesCIS(nStates);
409417 j++;
410418 }
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+ }
411429 j++;
412430 }
413431 i = j;
@@ -541,6 +559,14 @@ void InputParser::OutputCisConditions(){
541559 printf("%s%d\n",this->messageCisNumberActiveOcc.c_str(),Parameters::GetInstance()->GetActiveOccCIS());
542560 printf("%s%d\n",this->messageCisNumberActiveVir.c_str(),Parameters::GetInstance()->GetActiveVirCIS());
543561 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+
544570 cout << "\n";
545571 }
546572
--- a/src/base/Parameters.h
+++ b/src/base/Parameters.h
@@ -57,6 +57,8 @@ public:
5757 void SetActiveVirCIS(int activeOccCIS);
5858 int GetNumberExcitedStatesCIS();
5959 void SetNumberExcitedStatesCIS(int nStates);
60+ bool GetIsDavidsonCIS();
61+ void SetIsDavidsonCIS(bool isDavidsonCIS);
6062 private:
6163 static Parameters* parameters;
6264 Parameters();
@@ -89,6 +91,7 @@ private:
8991 int activeOccCIS;
9092 int activeVirCIS;
9193 int numberExcitedStatesCIS;
94+ bool isDavidsonCIS;
9295 };
9396 Parameters* Parameters::parameters = NULL;
9497
@@ -151,6 +154,7 @@ void Parameters::SetDefaultValues(){
151154 this->activeOccCIS = 10;
152155 this->activeVirCIS = 10;
153156 this->numberExcitedStatesCIS = 5;
157+ this->isDavidsonCIS = true;
154158 }
155159
156160 double Parameters::GetThresholdSCF(){
@@ -342,6 +346,13 @@ void Parameters::SetNumberExcitedStatesCIS(int nStates){
342346 this->numberExcitedStatesCIS = nStates;
343347 }
344348
349+bool Parameters::GetIsDavidsonCIS(){
350+ return this->isDavidsonCIS;
351+}
352+
353+void Parameters::SetIsDavidsonCIS(bool isDavidsonCIS){
354+ this->isDavidsonCIS = isDavidsonCIS;
355+}
345356
346357 }
347358 #endif
--- a/src/input.in
+++ b/src/input.in
@@ -19,6 +19,7 @@ SCF
1919 SCF_END
2020
2121 CIS
22+ davidson no
2223 activeOcc 2
2324 activeVir 2
2425 nstates 1000