Revisión | 758a81446a96594988841be62f3f70da7c431737 (tree) |
---|---|
Tiempo | 2013-05-21 05:13:11 |
Autor | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
Refactoring of CalcForce in Mndo & ZindoS. #31221
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1341 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -3817,6 +3817,30 @@ double ZindoS::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) cons | ||
3817 | 3817 | return value; |
3818 | 3818 | } |
3819 | 3819 | |
3820 | +void ZindoS::CalcDiatomicTwoElecTwoCore1stDerivatives(double*** matrix, | |
3821 | + int indexAtomA, | |
3822 | + int indexAtomB) const{ | |
3823 | + const Atom& atomA = *molecule->GetAtom(indexAtomA); | |
3824 | + const int firstAOIndexA = atomA.GetFirstAOIndex(); | |
3825 | + const int lastAOIndexA = atomA.GetLastAOIndex(); | |
3826 | + const Atom& atomB = *molecule->GetAtom(indexAtomB); | |
3827 | + const int firstAOIndexB = atomB.GetFirstAOIndex(); | |
3828 | + const int lastAOIndexB = atomB.GetLastAOIndex(); | |
3829 | + const double rAB = this->molecule->GetDistanceAtoms(atomA, atomB); | |
3830 | + for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ | |
3831 | + const OrbitalType orbitalMu = atomA.GetValence(mu-firstAOIndexA); | |
3832 | + for(int nu=firstAOIndexB; nu<=lastAOIndexB; nu++){ | |
3833 | + const OrbitalType orbitalNu = atomB.GetValence(nu-firstAOIndexB); | |
3834 | + for(int i=0; i<CartesianType_end; i++){ | |
3835 | + matrix[mu-firstAOIndexA][nu-firstAOIndexB][i] | |
3836 | + = this->GetNishimotoMatagaTwoEleInt1stDerivative( | |
3837 | + atomA, orbitalMu, atomB, orbitalNu, rAB, static_cast<CartesianType>(i)); | |
3838 | + } | |
3839 | + } | |
3840 | + } | |
3841 | +} | |
3842 | + | |
3843 | + | |
3820 | 3844 | // elecStates is indeces of the electroinc eigen states. |
3821 | 3845 | // The index = 0 means electronic ground state. |
3822 | 3846 | void ZindoS::CalcForce(const vector<int>& elecStates){ |
@@ -3861,17 +3885,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3861 | 3885 | this->CalcDiatomicOverlapAOs1stDerivatives(diatomicOverlapAOs1stDerivs, atomA, atomB); |
3862 | 3886 | |
3863 | 3887 | // calc. first derivative of two elec two core interaction by Nishimoto-Mataga |
3864 | - for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ | |
3865 | - OrbitalType orbitalMu = atomA.GetValence(mu-firstAOIndexA); | |
3866 | - for(int nu=firstAOIndexB; nu<=lastAOIndexB; nu++){ | |
3867 | - OrbitalType orbitalNu = atomB.GetValence(nu-firstAOIndexB); | |
3868 | - for(int i=0; i<CartesianType_end; i++){ | |
3869 | - diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA][nu-firstAOIndexB][i] | |
3870 | - = this->GetNishimotoMatagaTwoEleInt1stDerivative( | |
3871 | - atomA, orbitalMu, atomB, orbitalNu, rAB, static_cast<CartesianType>(i)); | |
3872 | - } | |
3873 | - } | |
3874 | - } | |
3888 | + this->CalcDiatomicTwoElecTwoCore1stDerivatives(diatomicTwoElecTwoCore1stDerivs, a, b); | |
3875 | 3889 | |
3876 | 3890 | double coreRepulsion [CartesianType_end] = {0.0,0.0,0.0}; |
3877 | 3891 | double forceElecCoreAttPart[CartesianType_end] = {0.0,0.0,0.0}; |
@@ -3912,13 +3926,17 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3912 | 3926 | { |
3913 | 3927 | for(int n=0; n<elecStates.size(); n++){ |
3914 | 3928 | for(int i=0; i<CartesianType_end; i++){ |
3915 | - this->matrixForce[n][a][i] -= coreRepulsion[i]; | |
3916 | - this->matrixForce[n][a][i] += forceElecCoreAttPart[i]; | |
3917 | - this->matrixForce[n][a][i] -= forceOverlapAOsPart[i]; | |
3918 | - this->matrixForce[n][a][i] -= forceTwoElecPart[i]; | |
3929 | + this->matrixForce[n][a][i] += -coreRepulsion[i] | |
3930 | + +forceElecCoreAttPart[i] | |
3931 | + -forceOverlapAOsPart[i] | |
3932 | + -forceTwoElecPart[i]; | |
3919 | 3933 | } |
3920 | 3934 | } |
3921 | 3935 | } |
3936 | + // excited state force | |
3937 | + for(int n=0; n<elecStates.size(); n++){ | |
3938 | + if(elecStates[n]<=0){continue;} | |
3939 | + } | |
3922 | 3940 | } // end of for(int b) |
3923 | 3941 | } // end of for(int a) |
3924 | 3942 | } // end of try |
@@ -4021,6 +4039,5 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
4021 | 4039 | } |
4022 | 4040 | */ |
4023 | 4041 | } |
4024 | - | |
4025 | 4042 | } |
4026 | 4043 |
@@ -234,6 +234,9 @@ private: | ||
234 | 234 | void OutputCISTransitionDipole() const; |
235 | 235 | void OutputCISMulliken() const; |
236 | 236 | void OutputCISUnpairedPop() const; |
237 | + void CalcDiatomicTwoElecTwoCore1stDerivatives(double*** matrix, | |
238 | + int indexAtomA, | |
239 | + int indexAtomB) const; | |
237 | 240 | void CalcFreeExcitonEnergies(double** freeExcitonEnergiesCIS, |
238 | 241 | const MolDS_base::Molecule& molecule, |
239 | 242 | double const* energiesMO, |