• R/O
  • SSH
  • HTTPS

molds: Commit


Commit MetaInfo

Revision1669 (tree)
Time2014-04-29 14:02:11
Authormikiya_fujii

Log Message

Check for adding bare VdW is added. #33724

Change Summary

Incremental Difference

--- trunk/doc/README.txt (revision 1668)
+++ trunk/doc/README.txt (revision 1669)
@@ -245,9 +245,10 @@
245245 The default value of the "diis_end_error" is 10**(-8.0).
246246
247247 "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.
249249 Note that this empirical van der Waals correction is applied to the semiempirical theories
250250 of which semiempirical parameters are not modified.
251+ This "vdw" option can be used for H, C, N, O, F, S, and Cl.
251252 If user wants to use PM3-D or AM1-D of which semiempirical parameters are modified to be suite for vdW,
252253 set theory-directive as "PM3-D" or "AM1-D".
253254 When PM3-D or AM1-D is used, users do not need to set "vdW", "vdW_s6", and "vdW_d".
@@ -256,6 +257,14 @@
256257 The default value of the "vdW" with the theories except for PM3-D and AM1-D is "no".
257258 For PM3-D and AM1-D, this "vdW" is always "yes" whethere user sets or not.
258259
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+
259268 "sum_charges" is an option to calculate of summation of atomic charges in the ground state.
260269 To use this option, write
261270 "sum_charges first_atom_index last_atom_index"
@@ -265,14 +274,6 @@
265274 Multiple setting of this "sum_charges" option is approvable, of course.
266275 If you want to calculate summation, same "sum_charges" option is available in CIS-directive.
267276
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-
276277 E.g.
277278 SCF
278279 max_iter 200
--- trunk/src/zindo/ZindoS.cpp (revision 1668)
+++ trunk/src/zindo/ZindoS.cpp (revision 1669)
@@ -155,6 +155,8 @@
155155 = "Error in zindo::ZindoS::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
156156 this->errorMessageNotEnebleAtomType
157157 = "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";
158160 this->errorMessageCoulombInt = "Error in zindo::ZindoS::GetCoulombInt: Invalid orbitalType.\n";
159161 this->errorMessageExchangeInt = "Error in zindo::ZindoS::GetExchangeInt: Invalid orbitalType.\n";
160162 this->errorMessageNishimotoMataga = "Error in zindo::ZindoS::GetNishimotoMatagaTwoEleInt: Invalid orbitalType.\n";
--- trunk/src/cndo/Cndo2.cpp (revision 1668)
+++ trunk/src/cndo/Cndo2.cpp (revision 1669)
@@ -101,6 +101,7 @@
101101 //protected methods
102102 this->SetMessages();
103103 this->SetEnableAtomTypes();
104+ this->SetEnableAtomTypesVdW();
104105
105106 //private variables
106107 this->elecSCFEnergy = 0.0;
@@ -152,7 +153,9 @@
152153 this->errorMessageOddTotalValenceElectrions
153154 = "Error in cndo::Cndo2::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
154155 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";
156159 this->errorMessageAtomA = "Atom A is:\n";
157160 this->errorMessageAtomB = "Atom B is:\n";
158161 this->errorMessageAtomType = "\tatom type = ";
@@ -281,6 +284,17 @@
281284 this->enableAtomTypes.push_back(Cl);
282285 }
283286
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+
284298 TheoryType Cndo2::GetTheoryType() const{
285299 return this->theory;
286300 }
@@ -289,6 +303,7 @@
289303 this->molecule = molecule;
290304 this->CheckNumberValenceElectrons(*molecule);
291305 this->CheckEnableAtomType(*molecule);
306+ this->CheckEnableAtomTypeVdW(*molecule);
292307
293308 // malloc
294309 MallocerFreer::GetInstance()->Malloc<double>(&this->fockMatrix,
@@ -352,6 +367,34 @@
352367 }
353368 }
354369
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+
355398 void Cndo2::CalcCoreRepulsionEnergy(){
356399 // interaction between atoms
357400 double energy = 0.0;
@@ -423,13 +466,13 @@
423466 }
424467
425468 // 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{
427470 double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF();
428471 return 1.0/(1.0+exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0)));
429472 }
430473
431474 // 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{
433476 double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF();
434477 return (dampingFactor/vdWDistance)
435478 *exp(-1.0*dampingFactor*(distance/vdWDistance - 1.0))
@@ -438,7 +481,7 @@
438481 }
439482
440483 // 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{
442485 double dampingFactor = Parameters::GetInstance()->GetVdWDampingFactorSCF();
443486 double exponent = -1.0*dampingFactor*(distance/vdWDistance - 1.0);
444487 double pre = dampingFactor/vdWDistance;
@@ -454,7 +497,7 @@
454497 double tmpSum = atomA.GetVdWCoefficient()+atomB.GetVdWCoefficient();
455498 if(tmpSum<=0e0){return 0e0;}
456499 double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()/tmpSum;
457- double damping = this->GetVdwDampingValue(vdWDistance, distance);
500+ double damping = this->GetVdWDampingValue(vdWDistance, distance);
458501 double scalingFactor = Parameters::GetInstance()->GetVdWScalingFactorSCF();
459502 return -1.0*scalingFactor*vdWCoefficients*damping
460503 /(distance*distance*distance*distance*distance*distance);
@@ -470,8 +513,8 @@
470513 if(tmpSum<=0e0){return 0e0;}
471514 double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()/tmpSum;
472515 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);
475518 double value=0.0;
476519 double tmp = distance*distance*distance*distance*distance*distance;
477520 value += 6.0*damping/(tmp*distance)
@@ -498,9 +541,9 @@
498541 if(tmpSum<=0e0){return 0e0;}
499542 double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()/tmpSum;
500543 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);
504547
505548 double dis6 = distance*distance*distance*distance*distance*distance;
506549 double tmp1 = -6.0*damping /(dis6*distance)
--- trunk/src/cndo/Cndo2.h (revision 1668)
+++ trunk/src/cndo/Cndo2.h (revision 1669)
@@ -63,6 +63,7 @@
6363 std::string errorMessageMoleculeNotSet;
6464 std::string errorMessageOddTotalValenceElectrions;
6565 std::string errorMessageNotEnebleAtomType;
66+ std::string errorMessageNotEnebleAtomTypeVdW;
6667 std::string errorMessageCoulombInt;
6768 std::string errorMessageExchangeInt;
6869 std::string errorMessageMolecularIntegralElement;
@@ -341,6 +342,7 @@
341342 double elecSCFEnergy;
342343 double bondingAdjustParameterK[2]; //see (3.79) in J. A. Pople book
343344 double** gammaAB;
345+ std::vector<MolDS_base::AtomType> enableAtomTypesVdW;
344346 class ReducedOverlapAOsParameters : private MolDS_base::Uncopyable{
345347 public:
346348 // use Y[na][nb][la][lb][m][i][j]
@@ -368,10 +370,12 @@
368370 double const* normalForceConstants,
369371 const MolDS_base::Molecule& molecule) const;
370372 void CalcCoreRepulsionEnergy();
373+ void SetEnableAtomTypesVdW();
374+ void CheckEnableAtomTypeVdW(const MolDS_base::Molecule& molecule) const;
371375 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;
375379 void CalcElectronicDipoleMomentGroundState(double*** electronicTransitionDipoleMoments,
376380 double const* const* const* cartesianMatrix,
377381 const MolDS_base::Molecule& molecule,
--- trunk/src/indo/Indo.cpp (revision 1668)
+++ trunk/src/indo/Indo.cpp (revision 1669)
@@ -72,6 +72,8 @@
7272 = "Error in indo::Indo::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
7373 this->errorMessageNotEnebleAtomType
7474 = "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";
7577 this->errorMessageCoulombInt = "Error in base_indo::Indo::GetCoulombInt: Invalid orbitalType.\n";
7678 this->errorMessageExchangeInt = "Error in base_indo::Indo::GetExchangeInt: Invalid orbitalType.\n";
7779 this->errorMessageMolecularIntegralElement
--- trunk/src/mndo/Mndo.cpp (revision 1668)
+++ trunk/src/mndo/Mndo.cpp (revision 1669)
@@ -154,6 +154,8 @@
154154 = "Error in mndo::Mndo::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
155155 this->errorMessageNotEnebleAtomType
156156 = "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";
157159 this->errorMessageCoulombInt = "Error in base_mndo::Mndo::GetCoulombInt: Invalid orbitalType.\n";
158160 this->errorMessageExchangeInt = "Error in base_mndo::Mndo::GetExchangeInt: Invalid orbitalType.\n";
159161 this->errorMessageCalcCISMatrix
--- trunk/src/pm3/Pm3Pddg.cpp (revision 1668)
+++ trunk/src/pm3/Pm3Pddg.cpp (revision 1669)
@@ -78,6 +78,8 @@
7878 = "Error in pm3::Pm3Pddg::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
7979 this->errorMessageNotEnebleAtomType
8080 = "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";
8183 this->errorMessageCoulombInt = "Error in base_pm3::Pm3Pddg::GetCoulombInt: Invalid orbitalType.\n";
8284 this->errorMessageExchangeInt = "Error in base_pm3::Pm3Pddg::GetExchangeInt: Invalid orbitalType.\n";
8385 this->errorMessageCalcCISMatrix
--- trunk/src/pm3/Pm3.cpp (revision 1668)
+++ trunk/src/pm3/Pm3.cpp (revision 1669)
@@ -79,6 +79,8 @@
7979 = "Error in pm3::Pm3::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
8080 this->errorMessageNotEnebleAtomType
8181 = "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";
8284 this->errorMessageCoulombInt = "Error in base_pm3::Pm3::GetCoulombInt: Invalid orbitalType.\n";
8385 this->errorMessageExchangeInt = "Error in base_pm3::Pm3::GetExchangeInt: Invalid orbitalType.\n";
8486 this->errorMessageCalcCISMatrix
--- trunk/src/pm3/Pm3D.cpp (revision 1668)
+++ trunk/src/pm3/Pm3D.cpp (revision 1669)
@@ -80,6 +80,8 @@
8080 = "Error in pm3::Pm3D::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
8181 this->errorMessageNotEnebleAtomType
8282 = "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";
8385 this->errorMessageCoulombInt = "Error in pm3::Pm3D::GetCoulombInt: Invalid orbitalType.\n";
8486 this->errorMessageExchangeInt = "Error in pm3::Pm3D::GetExchangeInt: Invalid orbitalType.\n";
8587 this->errorMessageCalcCISMatrix
--- trunk/src/am1/Am1.cpp (revision 1668)
+++ trunk/src/am1/Am1.cpp (revision 1669)
@@ -77,6 +77,8 @@
7777 = "Error in am1::Am1::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
7878 this->errorMessageNotEnebleAtomType
7979 = "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";
8082 this->errorMessageCoulombInt = "Error in base_am1::Am1::GetCoulombInt: Invalid orbitalType.\n";
8183 this->errorMessageExchangeInt = "Error in base_am1::Am1::GetExchangeInt: Invalid orbitalType.\n";
8284 this->errorMessageCalcCISMatrix
--- trunk/src/am1/Am1D.cpp (revision 1668)
+++ trunk/src/am1/Am1D.cpp (revision 1669)
@@ -79,6 +79,8 @@
7979 = "Error in am1::Am1D::SetMolecule: Total number of valence electrons is odd. totalNumberValenceElectrons=";
8080 this->errorMessageNotEnebleAtomType
8181 = "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";
8284 this->errorMessageCoulombInt = "Error in am1::Am1D::GetCoulombInt: Invalid orbitalType.\n";
8385 this->errorMessageExchangeInt = "Error in am1::Am1D::GetExchangeInt: Invalid orbitalType.\n";
8486 this->errorMessageCalcCISMatrix
Show on old repository browser