修订版 | 592284608ac794c52cea232f74f41bbfa41ae1cf (tree) |
---|---|
时间 | 2013-05-22 07:32:17 |
作者 | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
ZindoS::CalcForce for excited states is paritally implemented although not completed yet. #31221
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1343 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -3937,6 +3937,31 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3937 | 3937 | // excited state force |
3938 | 3938 | for(int n=0; n<elecStates.size(); n++){ |
3939 | 3939 | if(elecStates[n]<=0){continue;} |
3940 | + // static part | |
3941 | + double forceExcitedStaticPart[CartesianType_end] = {0.0,0.0,0.0}; | |
3942 | + this->CalcForceExcitedStaticPart(forceExcitedStaticPart, | |
3943 | + n, | |
3944 | + a, | |
3945 | + b, | |
3946 | + diatomicTwoElecTwoCore1stDerivs); | |
3947 | + // sum up contributions from static part (excited state) | |
3948 | +#pragma omp critical | |
3949 | + { | |
3950 | + for(int i=0; i<CartesianType_end; i++){ | |
3951 | + this->matrixForce[n][b][i] += forceExcitedStaticPart[i]; | |
3952 | + this->matrixForce[n][a][i] -= forceExcitedStaticPart[i]; | |
3953 | + } | |
3954 | + } | |
3955 | + | |
3956 | + // response part | |
3957 | + // electron core attraction part (excited state) | |
3958 | + double forceExcitedElecCoreAttPart[CartesianType_end]={0.0,0.0,0.0}; | |
3959 | + this->CalcForceExcitedElecCoreAttractionPart( | |
3960 | + forceExcitedElecCoreAttPart, | |
3961 | + n, | |
3962 | + a, | |
3963 | + b, | |
3964 | + diatomicTwoElecTwoCore1stDerivs); | |
3940 | 3965 | } |
3941 | 3966 | } // end of for(int b) |
3942 | 3967 | } // end of for(int a) |
@@ -3960,7 +3985,8 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3960 | 3985 | } |
3961 | 3986 | |
3962 | 3987 | /* |
3963 | - // Calculate force. First derivative of overlapAOs integral is | |
3988 | + // Calculate force (on the ground state only). | |
3989 | + // First derivative of overlapAOs integral is | |
3964 | 3990 | // calculated with GTO expansion technique. |
3965 | 3991 | stringstream ompErrors; |
3966 | 3992 | #pragma omp parallel for schedule(auto) |
@@ -4040,5 +4066,52 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
4040 | 4066 | } |
4041 | 4067 | */ |
4042 | 4068 | } |
4069 | + | |
4070 | +void ZindoS::CalcForceExcitedStaticPart(double* force, | |
4071 | + int elecStateIndex, | |
4072 | + int indexAtomA, | |
4073 | + int indexAtomB, | |
4074 | + double const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
4075 | + const Atom& atomA = *this->molecule->GetAtom(indexAtomA); | |
4076 | + const Atom& atomB = *this->molecule->GetAtom(indexAtomB); | |
4077 | + int firstAOIndexA = atomA.GetFirstAOIndex(); | |
4078 | + int firstAOIndexB = atomB.GetFirstAOIndex(); | |
4079 | + int lastAOIndexA = atomA.GetLastAOIndex(); | |
4080 | + int lastAOIndexB = atomB.GetLastAOIndex(); | |
4081 | + for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ | |
4082 | + for(int lambda=firstAOIndexB; lambda<=lastAOIndexB; lambda++){ | |
4083 | + for(int i=0; i<CartesianType_end; i++){ | |
4084 | + double temp= 2.0*this->etaMatrixForce[elecStateIndex][mu][mu] | |
4085 | + *this->etaMatrixForce[elecStateIndex][lambda][lambda] | |
4086 | + -1.0*this->etaMatrixForce[elecStateIndex][mu][lambda] | |
4087 | + *this->etaMatrixForce[elecStateIndex][mu][lambda]; | |
4088 | + force[i] += temp | |
4089 | + *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
4090 | + [lambda-firstAOIndexB] | |
4091 | + [i]; | |
4092 | + } | |
4093 | + } | |
4094 | + } | |
4095 | +} | |
4096 | + | |
4097 | +void ZindoS::CalcForceExcitedElecCoreAttractionPart(double* force, | |
4098 | + int elecStateIndex, | |
4099 | + int indexAtomA, | |
4100 | + int indexAtomB, | |
4101 | + double const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
4102 | + const Atom& atomA = *this->molecule->GetAtom(indexAtomA); | |
4103 | + const Atom& atomB = *this->molecule->GetAtom(indexAtomB); | |
4104 | + int firstAOIndexA = atomA.GetFirstAOIndex(); | |
4105 | + int lastAOIndexA = atomA.GetLastAOIndex(); | |
4106 | + for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ | |
4107 | + for(int i=0; i<CartesianType_end; i++){ | |
4108 | + force[i] += this->zMatrixForce[elecStateIndex][mu][mu] | |
4109 | + *atomB.GetCoreCharge() | |
4110 | + *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA][s][i]; | |
4111 | + } | |
4112 | + } | |
4113 | +} | |
4114 | + | |
4115 | + | |
4043 | 4116 | } |
4044 | 4117 |
@@ -237,6 +237,16 @@ private: | ||
237 | 237 | void CalcDiatomicTwoElecTwoCore1stDerivatives(double*** matrix, |
238 | 238 | int indexAtomA, |
239 | 239 | int indexAtomB) const; |
240 | + void CalcForceExcitedStaticPart(double* force, | |
241 | + int elecStateIndex, | |
242 | + int indexAtomA, | |
243 | + int indexAtomB, | |
244 | + double const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
245 | + void CalcForceExcitedElecCoreAttractionPart(double* force, | |
246 | + int elecStateIndex, | |
247 | + int indexAtomA, | |
248 | + int indexAtomB, | |
249 | + double const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
240 | 250 | void CalcFreeExcitonEnergies(double** freeExcitonEnergiesCIS, |
241 | 251 | const MolDS_base::Molecule& molecule, |
242 | 252 | double const* energiesMO, |