修訂 | 23e25438a28a981d14c37ce2fd98c04e36378031 (tree) |
---|---|
時間 | 2014-04-29 14:02:11 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Check for adding bare VdW is added. #33724
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1669 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -245,9 +245,10 @@ HOW TO WRITE INPUT: | ||
245 | 245 | The default value of the "diis_end_error" is 10**(-8.0). |
246 | 246 | |
247 | 247 | "vdW" should be set as "yes" or "no". |
248 | - When "yes" is set, Grimmes's empirical van der Waals correction([G_2004]) is applied. | |
248 | + When "yes" is set, Grimmes's empirical van der Waals correction(D1, [G_2004]) is applied. | |
249 | 249 | Note that this empirical van der Waals correction is applied to the semiempirical theories |
250 | 250 | of which semiempirical parameters are not modified. |
251 | + This "vdw" option can be used for H, C, N, O, F, S, and Cl. | |
251 | 252 | If user wants to use PM3-D or AM1-D of which semiempirical parameters are modified to be suite for vdW, |
252 | 253 | set theory-directive as "PM3-D" or "AM1-D". |
253 | 254 | When PM3-D or AM1-D is used, users do not need to set "vdW", "vdW_s6", and "vdW_d". |
@@ -256,6 +257,14 @@ HOW TO WRITE INPUT: | ||
256 | 257 | The default value of the "vdW" with the theories except for PM3-D and AM1-D is "no". |
257 | 258 | For PM3-D and AM1-D, this "vdW" is always "yes" whethere user sets or not. |
258 | 259 | |
260 | + "vdW_s6" is a scaling factor in the Grimme's van der Waals correction([G_2004]). | |
261 | + The default value of the "vdW_s6" is 1.4. | |
262 | + For PM3-D and AM1-D, this "vdW_s6" is forced to be set as 1.4. | |
263 | + | |
264 | + "vdW_d" is a damping factor in the Grimme's van der Waals correction([G_2004]). | |
265 | + The default value of the "vdW_d" is 23.0. | |
266 | + For PM3-D and AM1-D, this "vdW_s6" is forced to be set as 23.0. | |
267 | + | |
259 | 268 | "sum_charges" is an option to calculate of summation of atomic charges in the ground state. |
260 | 269 | To use this option, write |
261 | 270 | "sum_charges first_atom_index last_atom_index" |
@@ -265,14 +274,6 @@ HOW TO WRITE INPUT: | ||
265 | 274 | Multiple setting of this "sum_charges" option is approvable, of course. |
266 | 275 | If you want to calculate summation, same "sum_charges" option is available in CIS-directive. |
267 | 276 | |
268 | - "vdW_s6" is a scaling factor in the Grimme's van der Waals correction([G_2004]). | |
269 | - The default value of the "vdW_s6" is 1.4. | |
270 | - For PM3-D and AM1-D, this "vdW_s6" is forced to be set as 1.4. | |
271 | - | |
272 | - "vdW_d" is a damping factor in the Grimme's van der Waals correction([G_2004]). | |
273 | - The default value of the "vdW_d" is 23.0. | |
274 | - For PM3-D and AM1-D, this "vdW_s6" is forced to be set as 23.0. | |
275 | - | |
276 | 277 | E.g. |
277 | 278 | SCF |
278 | 279 | max_iter 200 |
@@ -77,6 +77,8 @@ void Am1::SetMessages(){ | ||
77 | 77 | = "Error in am1::Am1::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
78 | 78 | this->errorMessageNotEnebleAtomType |
79 | 79 | = "Error in am1::Am1::CheckEnableAtomType: Non available atom is contained.\n"; |
80 | + this->errorMessageNotEnebleAtomTypeVdW | |
81 | + = "Error in am1::Am1::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
80 | 82 | this->errorMessageCoulombInt = "Error in base_am1::Am1::GetCoulombInt: Invalid orbitalType.\n"; |
81 | 83 | this->errorMessageExchangeInt = "Error in base_am1::Am1::GetExchangeInt: Invalid orbitalType.\n"; |
82 | 84 | this->errorMessageCalcCISMatrix |
@@ -79,6 +79,8 @@ void Am1D::SetMessages(){ | ||
79 | 79 | = "Error in am1::Am1D::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
80 | 80 | this->errorMessageNotEnebleAtomType |
81 | 81 | = "Error in am1::Am1D::CheckEnableAtomType: Non available atom is contained.\n"; |
82 | + this->errorMessageNotEnebleAtomTypeVdW | |
83 | + = "Error in am1::Am1D::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
82 | 84 | this->errorMessageCoulombInt = "Error in am1::Am1D::GetCoulombInt: Invalid orbitalType.\n"; |
83 | 85 | this->errorMessageExchangeInt = "Error in am1::Am1D::GetExchangeInt: Invalid orbitalType.\n"; |
84 | 86 | this->errorMessageCalcCISMatrix |
@@ -101,6 +101,7 @@ Cndo2::Cndo2(){ | ||
101 | 101 | //protected methods |
102 | 102 | this->SetMessages(); |
103 | 103 | this->SetEnableAtomTypes(); |
104 | + this->SetEnableAtomTypesVdW(); | |
104 | 105 | |
105 | 106 | //private variables |
106 | 107 | this->elecSCFEnergy = 0.0; |
@@ -152,7 +153,9 @@ void Cndo2::SetMessages(){ | ||
152 | 153 | this->errorMessageOddTotalValenceElectrions |
153 | 154 | = "Error in cndo::Cndo2::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
154 | 155 | this->errorMessageNotEnebleAtomType |
155 | - = "Error in cndo::Cndo2::ChecEnableAtomType: Non available atom is contained.\n"; | |
156 | + = "Error in cndo::Cndo2::CheckEnableAtomType: Non available atom is contained.\n"; | |
157 | + this->errorMessageNotEnebleAtomTypeVdW | |
158 | + = "Error in cndo::Cndo2::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
156 | 159 | this->errorMessageAtomA = "Atom A is:\n"; |
157 | 160 | this->errorMessageAtomB = "Atom B is:\n"; |
158 | 161 | this->errorMessageAtomType = "\tatom type = "; |
@@ -281,6 +284,17 @@ void Cndo2::SetEnableAtomTypes(){ | ||
281 | 284 | this->enableAtomTypes.push_back(Cl); |
282 | 285 | } |
283 | 286 | |
287 | +void Cndo2::SetEnableAtomTypesVdW(){ | |
288 | + this->enableAtomTypesVdW.clear(); | |
289 | + this->enableAtomTypesVdW.push_back(H); | |
290 | + this->enableAtomTypesVdW.push_back(C); | |
291 | + this->enableAtomTypesVdW.push_back(N); | |
292 | + this->enableAtomTypesVdW.push_back(O); | |
293 | + this->enableAtomTypesVdW.push_back(F); | |
294 | + this->enableAtomTypesVdW.push_back(S); | |
295 | + this->enableAtomTypesVdW.push_back(Cl); | |
296 | +} | |
297 | + | |
284 | 298 | TheoryType Cndo2::GetTheoryType() const{ |
285 | 299 | return this->theory; |
286 | 300 | } |
@@ -289,6 +303,7 @@ void Cndo2::SetMolecule(Molecule* molecule){ | ||
289 | 303 | this->molecule = molecule; |
290 | 304 | this->CheckNumberValenceElectrons(*molecule); |
291 | 305 | this->CheckEnableAtomType(*molecule); |
306 | + this->CheckEnableAtomTypeVdW(*molecule); | |
292 | 307 | |
293 | 308 | // malloc |
294 | 309 | MallocerFreer::GetInstance()->Malloc<double>(&this->fockMatrix, |
@@ -352,6 +367,34 @@ void Cndo2::CheckEnableAtomType(const Molecule& molecule) const{ | ||
352 | 367 | } |
353 | 368 | } |
354 | 369 | |
370 | +void Cndo2::CheckEnableAtomTypeVdW(const Molecule& molecule) const{ | |
371 | + if(Parameters::GetInstance()->RequiresVdWSCF()){ | |
372 | + if(this->theory == AM1D || this->theory == PM3D){ | |
373 | + return; | |
374 | + } | |
375 | + } | |
376 | + else{ | |
377 | + return; | |
378 | + } | |
379 | + | |
380 | + for(int i=0; i<molecule.GetAtomVect().size(); i++){ | |
381 | + AtomType atomType = molecule.GetAtomVect()[i]->GetAtomType(); | |
382 | + bool enable = false; | |
383 | + for(int j=0; j<this->enableAtomTypesVdW.size(); j++){ | |
384 | + if(atomType == this->enableAtomTypesVdW[j]){ | |
385 | + enable = true; | |
386 | + break; | |
387 | + } | |
388 | + } | |
389 | + if(!enable){ | |
390 | + stringstream ss; | |
391 | + ss << this->errorMessageNotEnebleAtomTypeVdW; | |
392 | + ss << this->errorMessageAtomType << AtomTypeStr(atomType) << endl; | |
393 | + throw MolDSException(ss.str()); | |
394 | + } | |
395 | + } | |
396 | +} | |
397 | + | |
355 | 398 | void Cndo2::CalcCoreRepulsionEnergy(){ |
356 | 399 | // interaction between atoms |
357 | 400 | double energy = 0.0; |
@@ -423,13 +466,13 @@ void Cndo2::CalcVdWCorrectionEnergy(){ | ||
423 | 466 | } |
424 | 467 | |
425 | 468 | // See damping function in (2) in [G_2004] ((11) in [G_2006]) |
426 | -double Cndo2::GetVdwDampingValue(double vdWDistance, double distance) const{ | |
469 | +double Cndo2::GetVdWDampingValue(double vdWDistance, double distance) const{ | |
427 | 470 | double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF(); |
428 | 471 | return 1.0/(1.0+exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0))); |
429 | 472 | } |
430 | 473 | |
431 | 474 | // See damping function in (2) in [G_2004] ((11) in [G_2006]) |
432 | -double Cndo2::GetVdwDampingValue1stDerivative(double vdWDistance, double distance) const{ | |
475 | +double Cndo2::GetVdWDampingValue1stDerivative(double vdWDistance, double distance) const{ | |
433 | 476 | double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF(); |
434 | 477 | return (dampingFactor/vdWDistance) |
435 | 478 | *exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0)) |
@@ -438,7 +481,7 @@ double Cndo2::GetVdwDampingValue1stDerivative(double vdWDistance, double distanc | ||
438 | 481 | } |
439 | 482 | |
440 | 483 | // See damping function in (2) in [G_2004] ((11) in [G_2006]) |
441 | -double Cndo2::GetVdwDampingValue2ndDerivative(double vdWDistance, double distance) const{ | |
484 | +double Cndo2::GetVdWDampingValue2ndDerivative(double vdWDistance, double distance) const{ | |
442 | 485 | double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF(); |
443 | 486 | double exponent = -1.0*dampingFactor*(distance/vdWDistance - 1.0); |
444 | 487 | double pre = dampingFactor/vdWDistance; |
@@ -454,7 +497,7 @@ double Cndo2::GetDiatomVdWCorrectionEnergy(const Atom& atomA, const Atom& atomB) | ||
454 | 497 | double tmpSum = atomA.GetVdWCoefficient()+atomB.GetVdWCoefficient(); |
455 | 498 | if(tmpSum<=0e0){return 0e0;} |
456 | 499 | double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()/tmpSum; |
457 | - double damping = this->GetVdwDampingValue(vdWDistance, distance); | |
500 | + double damping = this->GetVdWDampingValue(vdWDistance, distance); | |
458 | 501 | double scalingFactor = Parameters::GetInstance()->GetVdWScalingFactorSCF(); |
459 | 502 | return -1.0*scalingFactor*vdWCoefficients*damping |
460 | 503 | /(distance*distance*distance*distance*distance*distance); |
@@ -470,8 +513,8 @@ double Cndo2::GetDiatomVdWCorrection1stDerivative(const Atom& atomA, const Atom& | ||
470 | 513 | if(tmpSum<=0e0){return 0e0;} |
471 | 514 | double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()/tmpSum; |
472 | 515 | double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF(); |
473 | - double damping = this->GetVdwDampingValue(vdWDistance, distance); | |
474 | - double damping1stDerivative = this->GetVdwDampingValue1stDerivative(vdWDistance, distance); | |
516 | + double damping = this->GetVdWDampingValue(vdWDistance, distance); | |
517 | + double damping1stDerivative = this->GetVdWDampingValue1stDerivative(vdWDistance, distance); | |
475 | 518 | double value=0.0; |
476 | 519 | double tmp = distance*distance*distance*distance*distance*distance; |
477 | 520 | value += 6.0*damping/(tmp*distance) |
@@ -498,9 +541,9 @@ double Cndo2::GetDiatomVdWCorrection2ndDerivative(const Atom& atomA, | ||
498 | 541 | if(tmpSum<=0e0){return 0e0;} |
499 | 542 | double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()/tmpSum; |
500 | 543 | double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF(); |
501 | - double damping = this->GetVdwDampingValue(vdWDistance, distance); | |
502 | - double damping1stDerivative = this->GetVdwDampingValue1stDerivative(vdWDistance, distance); | |
503 | - double damping2ndDerivative = this->GetVdwDampingValue2ndDerivative(vdWDistance, distance); | |
544 | + double damping = this->GetVdWDampingValue(vdWDistance, distance); | |
545 | + double damping1stDerivative = this->GetVdWDampingValue1stDerivative(vdWDistance, distance); | |
546 | + double damping2ndDerivative = this->GetVdWDampingValue2ndDerivative(vdWDistance, distance); | |
504 | 547 | |
505 | 548 | double dis6 = distance*distance*distance*distance*distance*distance; |
506 | 549 | double tmp1 = -6.0*damping /(dis6*distance) |
@@ -63,6 +63,7 @@ protected: | ||
63 | 63 | std::string errorMessageMoleculeNotSet; |
64 | 64 | std::string errorMessageOddTotalValenceElectrions; |
65 | 65 | std::string errorMessageNotEnebleAtomType; |
66 | + std::string errorMessageNotEnebleAtomTypeVdW; | |
66 | 67 | std::string errorMessageCoulombInt; |
67 | 68 | std::string errorMessageExchangeInt; |
68 | 69 | std::string errorMessageMolecularIntegralElement; |
@@ -341,6 +342,7 @@ private: | ||
341 | 342 | double elecSCFEnergy; |
342 | 343 | double bondingAdjustParameterK[2]; //see (3.79) in J. A. Pople book |
343 | 344 | double** gammaAB; |
345 | + std::vector<MolDS_base::AtomType> enableAtomTypesVdW; | |
344 | 346 | class ReducedOverlapAOsParameters : private MolDS_base::Uncopyable{ |
345 | 347 | public: |
346 | 348 | // use Y[na][nb][la][lb][m][i][j] |
@@ -368,10 +370,12 @@ private: | ||
368 | 370 | double const* normalForceConstants, |
369 | 371 | const MolDS_base::Molecule& molecule) const; |
370 | 372 | void CalcCoreRepulsionEnergy(); |
373 | + void SetEnableAtomTypesVdW(); | |
374 | + void CheckEnableAtomTypeVdW(const MolDS_base::Molecule& molecule) const; | |
371 | 375 | void CalcVdWCorrectionEnergy(); |
372 | - double GetVdwDampingValue(double vdWDistance, double distance) const; | |
373 | - double GetVdwDampingValue1stDerivative(double vdWDistance, double distance) const; | |
374 | - double GetVdwDampingValue2ndDerivative(double vdWDistance, double distance) const; | |
376 | + double GetVdWDampingValue(double vdWDistance, double distance) const; | |
377 | + double GetVdWDampingValue1stDerivative(double vdWDistance, double distance) const; | |
378 | + double GetVdWDampingValue2ndDerivative(double vdWDistance, double distance) const; | |
375 | 379 | void CalcElectronicDipoleMomentGroundState(double*** electronicTransitionDipoleMoments, |
376 | 380 | double const* const* const* cartesianMatrix, |
377 | 381 | const MolDS_base::Molecule& molecule, |
@@ -72,6 +72,8 @@ void Indo::SetMessages(){ | ||
72 | 72 | = "Error in indo::Indo::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
73 | 73 | this->errorMessageNotEnebleAtomType |
74 | 74 | = "Error in indo::Indo::CheckEnableAtomType: Non available atom is contained.\n"; |
75 | + this->errorMessageNotEnebleAtomTypeVdW | |
76 | + = "Error in indo::Indo::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
75 | 77 | this->errorMessageCoulombInt = "Error in base_indo::Indo::GetCoulombInt: Invalid orbitalType.\n"; |
76 | 78 | this->errorMessageExchangeInt = "Error in base_indo::Indo::GetExchangeInt: Invalid orbitalType.\n"; |
77 | 79 | this->errorMessageMolecularIntegralElement |
@@ -154,6 +154,8 @@ void Mndo::SetMessages(){ | ||
154 | 154 | = "Error in mndo::Mndo::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
155 | 155 | this->errorMessageNotEnebleAtomType |
156 | 156 | = "Error in mndo::Mndo::CheckEnableAtomType: Non available atom is contained.\n"; |
157 | + this->errorMessageNotEnebleAtomTypeVdW | |
158 | + = "Error in mndo::Mndo::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
157 | 159 | this->errorMessageCoulombInt = "Error in base_mndo::Mndo::GetCoulombInt: Invalid orbitalType.\n"; |
158 | 160 | this->errorMessageExchangeInt = "Error in base_mndo::Mndo::GetExchangeInt: Invalid orbitalType.\n"; |
159 | 161 | this->errorMessageCalcCISMatrix |
@@ -79,6 +79,8 @@ void Pm3::SetMessages(){ | ||
79 | 79 | = "Error in pm3::Pm3::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
80 | 80 | this->errorMessageNotEnebleAtomType |
81 | 81 | = "Error in pm3::Pm3::CheckEnableAtomType: Non available atom is contained.\n"; |
82 | + this->errorMessageNotEnebleAtomTypeVdW | |
83 | + = "Error in pm3::Pm3::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
82 | 84 | this->errorMessageCoulombInt = "Error in base_pm3::Pm3::GetCoulombInt: Invalid orbitalType.\n"; |
83 | 85 | this->errorMessageExchangeInt = "Error in base_pm3::Pm3::GetExchangeInt: Invalid orbitalType.\n"; |
84 | 86 | this->errorMessageCalcCISMatrix |
@@ -80,6 +80,8 @@ void Pm3D::SetMessages(){ | ||
80 | 80 | = "Error in pm3::Pm3D::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
81 | 81 | this->errorMessageNotEnebleAtomType |
82 | 82 | = "Error in pm3::Pm3D::CheckEnableAtomType: Non available atom is contained.\n"; |
83 | + this->errorMessageNotEnebleAtomTypeVdW | |
84 | + = "Error in pm3::Pm3D::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
83 | 85 | this->errorMessageCoulombInt = "Error in pm3::Pm3D::GetCoulombInt: Invalid orbitalType.\n"; |
84 | 86 | this->errorMessageExchangeInt = "Error in pm3::Pm3D::GetExchangeInt: Invalid orbitalType.\n"; |
85 | 87 | this->errorMessageCalcCISMatrix |
@@ -78,6 +78,8 @@ void Pm3Pddg::SetMessages(){ | ||
78 | 78 | = "Error in pm3::Pm3Pddg::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
79 | 79 | this->errorMessageNotEnebleAtomType |
80 | 80 | = "Error in pm3::Pm3Pddg::CheckEnableAtomType: Non available atom is contained.\n"; |
81 | + this->errorMessageNotEnebleAtomTypeVdW | |
82 | + = "Error in pm3::Pm3Pddg::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
81 | 83 | this->errorMessageCoulombInt = "Error in base_pm3::Pm3Pddg::GetCoulombInt: Invalid orbitalType.\n"; |
82 | 84 | this->errorMessageExchangeInt = "Error in base_pm3::Pm3Pddg::GetExchangeInt: Invalid orbitalType.\n"; |
83 | 85 | this->errorMessageCalcCISMatrix |
@@ -155,6 +155,8 @@ void ZindoS::SetMessages(){ | ||
155 | 155 | = "Error in zindo::ZindoS::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons="; |
156 | 156 | this->errorMessageNotEnebleAtomType |
157 | 157 | = "Error in zindo::ZindoS::CheckEnableAtomType: Non available atom is contained.\n"; |
158 | + this->errorMessageNotEnebleAtomTypeVdW | |
159 | + = "Error in zindo::ZindoS::CheckEnableAtomTypeVdW: Non available atom to add VdW correction is contained.\n"; | |
158 | 160 | this->errorMessageCoulombInt = "Error in zindo::ZindoS::GetCoulombInt: Invalid orbitalType.\n"; |
159 | 161 | this->errorMessageExchangeInt = "Error in zindo::ZindoS::GetExchangeInt: Invalid orbitalType.\n"; |
160 | 162 | this->errorMessageNishimotoMataga = "Error in zindo::ZindoS::GetNishimotoMatagaTwoEleInt: Invalid orbitalType.\n"; |