Revision | 6de33cc276c8c726fb41a96149424f51a55163fd (tree) |
---|---|
Time | 2012-11-09 13:07:57 |
Author | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
input module for the initial electronic eigenstate for NASCO is implemented. #28791
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1112 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -87,6 +87,8 @@ void InputParser::SetMessages(){ | ||
87 | 87 | = "Error in base::InputParser::ValidateNascoConditions: Theory you set is not supported for NASCO.\n"; |
88 | 88 | this->errorMessageNonValidNumberExcitedStatesNASCO |
89 | 89 | = "Error in base::InputParser::ValidateNascoConditions: The Number of electronic states of NASCO should be not over the number of CIS excited states plus 1.\n"; |
90 | + this->errorMessageNonValidInitialElectronicStateNASCO | |
91 | + = "Error in base::InputParser::ValidateNascoConditions: The initial electronic states for NASCO should be set to one of the electronic eigenstates used in NASCO.\n"; | |
90 | 92 | this->errorMessageNonValidExcitedStatesOptimization |
91 | 93 | = "Error in base::InputParser::ValidateOptimizationConditions: Excited state on which optimization is carried out or CIS condition are wrong.\n"; |
92 | 94 | this->errorMessageNonValidElectronicStateFrequencies |
@@ -98,6 +100,7 @@ void InputParser::SetMessages(){ | ||
98 | 100 | this->errorMessageTheory = "Theory: "; |
99 | 101 | this->errorMessageNumberExcitedStateCIS = "Number of CIS excited states: "; |
100 | 102 | this->errorMessageNumberElectronicStatesNASCO = "Number of electronic states for NASCO: "; |
103 | + this->errorMessageInitialElectronicStateNASCO = "Initial electronic state for NASCO: "; | |
101 | 104 | this->messageStartParseInput = "********** START: Parse input **********\n"; |
102 | 105 | this->messageDoneParseInput = "********** DONE: Parse input ***********\n\n\n"; |
103 | 106 | this->messageTotalNumberAOs = "\tTotal number of valence AOs: "; |
@@ -160,11 +163,12 @@ void InputParser::SetMessages(){ | ||
160 | 163 | this->messageRpmdSeed = "\t\tSeed: "; |
161 | 164 | |
162 | 165 | // NASCO |
163 | - this->messageNascoConditions = "\tNasco conditions:\n"; | |
164 | - this->messageNascoTotalSteps = "\t\tTotal steps: "; | |
165 | - this->messageNascoNumElecStates = "\t\tNumber of the electronic eigenstates: "; | |
166 | - this->messageNascoTimeWidth = "\t\tTime width: "; | |
167 | - this->messageNascoSeed = "\t\tSeed: "; | |
166 | + this->messageNascoConditions = "\tNasco conditions:\n"; | |
167 | + this->messageNascoTotalSteps = "\t\tTotal steps: "; | |
168 | + this->messageNascoNumElecStates = "\t\tNumber of the electronic eigenstates: "; | |
169 | + this->messageNascoInitialElecState = "\t\tInitial electronic eigenstate: "; | |
170 | + this->messageNascoTimeWidth = "\t\tTime width: "; | |
171 | + this->messageNascoSeed = "\t\tSeed: "; | |
168 | 172 | |
169 | 173 | // Optimization |
170 | 174 | this->messageOptimizationConditions = "\tOptimization conditions:\n"; |
@@ -336,12 +340,13 @@ void InputParser::SetMessages(){ | ||
336 | 340 | this->stringRPMDSeed = "seed"; |
337 | 341 | |
338 | 342 | // NASCO |
339 | - this->stringNASCO = "nasco"; | |
340 | - this->stringNASCOEnd = "nasco_end"; | |
341 | - this->stringNASCOTotalSteps = "total_steps"; | |
342 | - this->stringNASCONumElecStates = "num_electronic_states"; | |
343 | - this->stringNASCOTimeWidth = "dt"; | |
344 | - this->stringNASCOSeed = "seed"; | |
343 | + this->stringNASCO = "nasco"; | |
344 | + this->stringNASCOEnd = "nasco_end"; | |
345 | + this->stringNASCOTotalSteps = "total_steps"; | |
346 | + this->stringNASCONumElecStates = "num_electronic_states"; | |
347 | + this->stringNASCOInitialElecState = "initial_electronic_state"; | |
348 | + this->stringNASCOTimeWidth = "dt"; | |
349 | + this->stringNASCOSeed = "seed"; | |
345 | 350 | |
346 | 351 | // Opt |
347 | 352 | this->stringOptimization = "optimization"; |
@@ -940,6 +945,12 @@ int InputParser::ParseConditionsNASCO(vector<string>* inputTerms, int parseIndex | ||
940 | 945 | Parameters::GetInstance()->SetNumberElectronicStatesNASCO(numElecStates); |
941 | 946 | parseIndex++; |
942 | 947 | } |
948 | + // initial electronic eigenstates for NASCO. | |
949 | + if((*inputTerms)[parseIndex].compare(this->stringNASCOInitialElecState) == 0){ | |
950 | + int initElecState = atoi((*inputTerms)[parseIndex+1].c_str()); | |
951 | + Parameters::GetInstance()->SetInitialElectronicStateNASCO(initElecState); | |
952 | + parseIndex++; | |
953 | + } | |
943 | 954 | // time width for NASCO. |
944 | 955 | if((*inputTerms)[parseIndex].compare(this->stringNASCOTimeWidth) == 0){ |
945 | 956 | double timeWidth = atof((*inputTerms)[parseIndex+1].c_str()) * Parameters::GetInstance()->GetFs2AU(); |
@@ -1408,6 +1419,16 @@ void InputParser::ValidateNascoConditions(const Molecule& molecule) const{ | ||
1408 | 1419 | ss << this->errorMessageNumberExcitedStateCIS << numberExcitedStatesCIS << endl; |
1409 | 1420 | throw MolDSException(ss.str()); |
1410 | 1421 | } |
1422 | + // Validate initial electronic eigenstate | |
1423 | + int initialElectronicStateNASCO = Parameters::GetInstance()->GetInitialElectronicStateNASCO(); | |
1424 | + int numberElectronicStatesNASCO = Parameters::GetInstance()->GetNumberElectronicStatesNASCO(); | |
1425 | + if(numberElectronicStatesNASCO<=initialElectronicStateNASCO){ | |
1426 | + stringstream ss; | |
1427 | + ss << this->errorMessageNonValidInitialElectronicStateNASCO; | |
1428 | + ss << this->errorMessageNumberElectronicStatesNASCO << numberElectronicStatesNASCO << endl; | |
1429 | + ss << this->errorMessageInitialElectronicStateNASCO << initialElectronicStateNASCO << endl; | |
1430 | + throw MolDSException(ss.str()); | |
1431 | + } | |
1411 | 1432 | } |
1412 | 1433 | |
1413 | 1434 | void InputParser::ValidateOptimizationConditions(const Molecule& molecule) const{ |
@@ -1613,6 +1634,8 @@ void InputParser::OutputNascoConditions() const{ | ||
1613 | 1634 | % Parameters::GetInstance()->GetTotalStepsNASCO()); |
1614 | 1635 | this->OutputLog(boost::format("%s%d\n") % this->messageNascoNumElecStates.c_str() |
1615 | 1636 | % Parameters::GetInstance()->GetNumberElectronicStatesNASCO()); |
1637 | + this->OutputLog(boost::format("%s%d\n") % this->messageNascoInitialElecState.c_str() | |
1638 | + % Parameters::GetInstance()->GetInitialElectronicStateNASCO()); | |
1616 | 1639 | this->OutputLog(boost::format("%s%lf%s\n") % this->messageNascoTimeWidth.c_str() |
1617 | 1640 | % (Parameters::GetInstance()->GetTimeWidthNASCO()/Parameters::GetInstance()->GetFs2AU()) |
1618 | 1641 | % this->messageFs.c_str()); |
@@ -39,6 +39,7 @@ private: | ||
39 | 39 | std::string errorMessageNonValidExcitedStatesRPMD; |
40 | 40 | std::string errorMessageNonValidTheoriesNASCO; |
41 | 41 | std::string errorMessageNonValidNumberExcitedStatesNASCO; |
42 | + std::string errorMessageNonValidInitialElectronicStateNASCO; | |
42 | 43 | std::string errorMessageNonValidExcitedStatesOptimization; |
43 | 44 | std::string errorMessageNonValidElectronicStateFrequencies; |
44 | 45 | std::string errorMessageNonValidTheoryFrequencies; |
@@ -47,6 +48,7 @@ private: | ||
47 | 48 | std::string errorMessageTheory; |
48 | 49 | std::string errorMessageNumberExcitedStateCIS; |
49 | 50 | std::string errorMessageNumberElectronicStatesNASCO; |
51 | + std::string errorMessageInitialElectronicStateNASCO; | |
50 | 52 | std::string messageStartParseInput; |
51 | 53 | std::string messageDoneParseInput; |
52 | 54 | std::string messageTotalNumberAOs; |
@@ -105,6 +107,7 @@ private: | ||
105 | 107 | std::string messageNascoConditions; |
106 | 108 | std::string messageNascoTotalSteps; |
107 | 109 | std::string messageNascoNumElecStates; |
110 | + std::string messageNascoInitialElecState; | |
108 | 111 | std::string messageNascoTimeWidth; |
109 | 112 | std::string messageNascoSeed; |
110 | 113 | // Optimization |
@@ -261,6 +264,7 @@ private: | ||
261 | 264 | std::string stringNASCOEnd; |
262 | 265 | std::string stringNASCOTotalSteps; |
263 | 266 | std::string stringNASCONumElecStates; |
267 | + std::string stringNASCOInitialElecState; | |
264 | 268 | std::string stringNASCOTimeWidth; |
265 | 269 | std::string stringNASCOSeed; |
266 | 270 | // Optimization |
@@ -186,6 +186,7 @@ void Parameters::SetDefaultValues(){ | ||
186 | 186 | this->seedRPMD = static_cast<unsigned long>(time(0)); |
187 | 187 | // NASCO |
188 | 188 | this->numberElectronicStatesNASCO = 3; |
189 | + this->initialElectronicStateNASCO = 0; | |
189 | 190 | this->totalStepsNASCO = 10; |
190 | 191 | this->timeWidthNASCO = 0.1*this->fs2AU; |
191 | 192 | this->seedNASCO = static_cast<unsigned long>(time(0)); |
@@ -821,6 +822,14 @@ void Parameters::SetNumberElectronicStatesNASCO(int numberElectronicStates){ | ||
821 | 822 | this->numberElectronicStatesNASCO = numberElectronicStates; |
822 | 823 | } |
823 | 824 | |
825 | +int Parameters::GetInitialElectronicStateNASCO() const{ | |
826 | + return this->initialElectronicStateNASCO; | |
827 | +} | |
828 | + | |
829 | +void Parameters::SetInitialElectronicStateNASCO(int initialElectronicState){ | |
830 | + this->initialElectronicStateNASCO = initialElectronicState; | |
831 | +} | |
832 | + | |
824 | 833 | double Parameters::GetTimeWidthNASCO() const{ |
825 | 834 | return this->timeWidthNASCO; |
826 | 835 | } |
@@ -178,6 +178,8 @@ public: | ||
178 | 178 | void SetTotalStepsNASCO(int totalSteps); |
179 | 179 | int GetNumberElectronicStatesNASCO() const; |
180 | 180 | void SetNumberElectronicStatesNASCO(int NumberElectronicStates); |
181 | + int GetInitialElectronicStateNASCO() const; | |
182 | + void SetInitialElectronicStateNASCO(int initialElectronicState); | |
181 | 183 | unsigned long GetSeedNASCO() const; |
182 | 184 | void SetSeedNASCO(unsigned long seed); |
183 | 185 | double GetTimeWidthNASCO() const; |
@@ -296,6 +298,7 @@ private: | ||
296 | 298 | // NASCO |
297 | 299 | int totalStepsNASCO; |
298 | 300 | int numberElectronicStatesNASCO; |
301 | + int initialElectronicStateNASCO; | |
299 | 302 | double timeWidthNASCO; |
300 | 303 | unsigned long seedNASCO; |
301 | 304 | // Optimization |