Revision | 2a09f969ccaf8f907b0c7f1491f40b741874a61f (tree) |
---|---|
Zeit | 2013-11-29 16:51:34 |
Autor | Mikiya Fujii <mikiya.fujii@gmai...> |
Commiter | Mikiya Fujii |
EnvironmentalPointCharge-class(EPC) is added. In molecule-class distance matrix for EPC is added. InputParser-class is modified for EPCs. Some methods for two electrons integral is refactored such as rename. README is updated. #32469
git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1569 1136aad2-a195-0410-b898-f5ea1d11b9d8
@@ -338,6 +338,43 @@ HOW TO WRITE INPUT: | ||
338 | 338 | file_prefix MOPlot_ |
339 | 339 | MOPLOT_END |
340 | 340 | |
341 | + <Environmental Point Charge(EPC) method> | |
342 | + Environmental point charge method is a simplified method of the QM/MM | |
343 | + because the environmental point changes are treated as atoms in the MM region. | |
344 | + The differences between the QM/MM and EPC are summarized below: | |
345 | + - Electrostatic interaction between QM and MM region: | |
346 | + QM/MM: Electrostatic interaction is mutually added to QM and MM atoms. | |
347 | + EPC : Electrostatic field caused by the EPCs affects the QM region | |
348 | + although the each EPC is not affected by electrostatic field | |
349 | + caused by the QM atoms and other EPCs. | |
350 | + Namely, each EPC is fixed at point of space. | |
351 | + - Van der Waals interaction between QM and MM region: | |
352 | + QM/MM: Included. | |
353 | + EPC : Not included. | |
354 | + This EPC method can be used with MNDO-series (MNDO, AM1, AM1-D, PM3, PM3-D, and PDDG/PM3) only. | |
355 | + To use this environmental point charges method, write EPC-directive. | |
356 | + | |
357 | + E.g. | |
358 | + EPC | |
359 | + (options) | |
360 | + EPC_END | |
361 | + | |
362 | + -options | |
363 | + "the cartesian coordinates and charge" is only prepared. | |
364 | + Namely, each line should containe 4 doubles. | |
365 | + The first three doubles are the cartesian coordinates of | |
366 | + each environmental point charge in angstrom unit. | |
367 | + The last double is the charge in atomic unit, | |
368 | + e.g. -1 and 1 mean charge of an electron and a proton, respectively. | |
369 | + Multiple setting of the environmental point charge is approvable, of course. | |
370 | + | |
371 | + E.g. | |
372 | + EPC | |
373 | + 0.0 0.0 0.0 -1 | |
374 | + 2.2 1.5 3.0 -1.5 | |
375 | + 0.0 2.0 5.0 0.3 | |
376 | + EPC_END | |
377 | + | |
341 | 378 | <Frequencies (Normal modes analysis)> |
342 | 379 | write frequencies-directive. Note taht not only the frequencies but also the normal modes are calculated. |
343 | 380 |
@@ -37,9 +37,9 @@ EXENAME = molds | ||
37 | 37 | DEPFILE = obj/objfile.dep |
38 | 38 | LDFLAGS = |
39 | 39 | |
40 | -ALL_CPP_FILES = base/Enums.cpp base/PrintController.cpp base/MolDSException.cpp base/MallocerFreer.cpp mpi/MpiProcess.cpp mpi/AsyncCommunicator.cpp wrappers/Blas.cpp wrappers/Lapack.cpp base/Utilities.cpp base/MathUtilities.cpp base/EularAngle.cpp base/Parameters.cpp base/RealSphericalHarmonicsIndex.cpp base/atoms/Atom.cpp base/atoms/Hatom.cpp base/atoms/Liatom.cpp base/atoms/Catom.cpp base/atoms/Natom.cpp base/atoms/Oatom.cpp base/atoms/Satom.cpp base/factories/AtomFactory.cpp base/Molecule.cpp base/InputParser.cpp base/GTOExpansionSTO.cpp base/loggers/MOLogger.cpp base/loggers/DensityLogger.cpp base/loggers/HoleDensityLogger.cpp base/loggers/ParticleDensityLogger.cpp cndo/Cndo2.cpp indo/Indo.cpp zindo/ZindoS.cpp mndo/Mndo.cpp am1/Am1.cpp am1/Am1D.cpp pm3/Pm3.cpp pm3/Pm3D.cpp pm3/Pm3Pddg.cpp base/factories/ElectronicStructureFactory.cpp md/MD.cpp mc/MC.cpp rpmd/RPMD.cpp nasco/NASCO.cpp optimization/Optimizer.cpp optimization/ConjugateGradient.cpp optimization/SteepestDescent.cpp optimization/BFGS.cpp optimization/GEDIIS.cpp base/factories/OptimizerFactory.cpp base/MolDS.cpp Main.cpp | |
41 | -ALL_HEAD_FILES = config.h base/Enums.h base/Uncopyable.h base/PrintController.h base/MolDSException.h base/containers/ThreadSafeQueue.h base/MallocerFreer.h mpi/MpiInt.h mpi/MpiProcess.h mpi/AsyncCommunicator.h wrappers/Blas.h wrappers/Lapack.h base/Utilities.h base/MathUtilities.h base/EularAngle.h base/Parameters.h base/RealSphericalHarmonicsIndex.h base/atoms/Atom.h base/atoms/Hatom.h base/atoms/Liatom.h base/atoms/Catom.h base/atoms/Natom.h base/atoms/Oatom.h base/atoms/Satom.h base/factories/AtomFactory.h base/Molecule.h base/InputParser.h base/GTOExpansionSTO.h base/loggers/MOLogger.h base/loggers/DensityLogger.h base/loggers/HoleDensityLogger.h base/loggers/ParticleDensityLogger.h base/ElectronicStructure.h cndo/Cndo2.h cndo/ReducedOverlapAOsParameters.h indo/Indo.h zindo/ZindoS.h mndo/Mndo.h am1/Am1.h am1/Am1D.h pm3/Pm3.h pm3/Pm3D.h pm3/Pm3Pddg.h base/factories/ElectronicStructureFactory.h md/MD.h mc/MC.h rpmd/RPMD.h nasco/NASCO.h optimization/Optimizer.h optimization/ConjugateGradient.h optimization/SteepestDescent.h optimization/BFGS.h optimization/GEDIIS.h base/factories/OptimizerFactory.h base/MolDS.h | |
42 | -ALL_OBJ_FILES = obj/Enums.o obj/PrintController.o obj/MolDSException.o obj/MallocerFreer.o obj/MpiProcess.o obj/AsyncCommunicator.o obj/Blas.o obj/Lapack.o obj/Utilities.o obj/MathUtilities.o obj/EularAngle.o obj/Parameters.o obj/RealSphericalHarmonicsIndex.o obj/Atom.o obj/Hatom.o obj/Liatom.o obj/Catom.o obj/Natom.o obj/Oatom.o obj/Satom.o obj/AtomFactory.o obj/Molecule.o obj/InputParser.o obj/GTOExpansionSTO.o obj/MOLogger.o obj/DensityLogger.o obj/HoleDensityLogger.o obj/ParticleDensityLogger.o obj/Cndo2.o obj/Indo.o obj/ZindoS.o obj/Mndo.o obj/Am1.o obj/Am1D.o obj/Pm3.o obj/Pm3D.o obj/Pm3Pddg.o obj/ElectronicStructureFactory.o obj/MD.o obj/MC.o obj/RPMD.o obj/NASCO.o obj/Optimizer.o obj/ConjugateGradient.o obj/SteepestDescent.o obj/BFGS.o obj/GEDIIS.o obj/OptimizerFactory.o obj/MolDS.o obj/Main.o | |
40 | +ALL_CPP_FILES = base/Enums.cpp base/PrintController.cpp base/MolDSException.cpp base/MallocerFreer.cpp mpi/MpiProcess.cpp mpi/AsyncCommunicator.cpp wrappers/Blas.cpp wrappers/Lapack.cpp base/Utilities.cpp base/MathUtilities.cpp base/EularAngle.cpp base/Parameters.cpp base/RealSphericalHarmonicsIndex.cpp base/atoms/Atom.cpp base/atoms/Hatom.cpp base/atoms/Liatom.cpp base/atoms/Catom.cpp base/atoms/Natom.cpp base/atoms/Oatom.cpp base/atoms/Satom.cpp base/atoms/mm/EnvironmentalPointCharge.cpp base/factories/AtomFactory.cpp base/Molecule.cpp base/InputParser.cpp base/GTOExpansionSTO.cpp base/loggers/MOLogger.cpp base/loggers/DensityLogger.cpp base/loggers/HoleDensityLogger.cpp base/loggers/ParticleDensityLogger.cpp cndo/Cndo2.cpp indo/Indo.cpp zindo/ZindoS.cpp mndo/Mndo.cpp am1/Am1.cpp am1/Am1D.cpp pm3/Pm3.cpp pm3/Pm3D.cpp pm3/Pm3Pddg.cpp base/factories/ElectronicStructureFactory.cpp md/MD.cpp mc/MC.cpp rpmd/RPMD.cpp nasco/NASCO.cpp optimization/Optimizer.cpp optimization/ConjugateGradient.cpp optimization/SteepestDescent.cpp optimization/BFGS.cpp optimization/GEDIIS.cpp base/factories/OptimizerFactory.cpp base/MolDS.cpp Main.cpp | |
41 | +ALL_HEAD_FILES = config.h base/Enums.h base/Uncopyable.h base/PrintController.h base/MolDSException.h base/containers/ThreadSafeQueue.h base/MallocerFreer.h mpi/MpiInt.h mpi/MpiProcess.h mpi/AsyncCommunicator.h wrappers/Blas.h wrappers/Lapack.h base/Utilities.h base/MathUtilities.h base/EularAngle.h base/Parameters.h base/RealSphericalHarmonicsIndex.h base/atoms/Atom.h base/atoms/Hatom.h base/atoms/Liatom.h base/atoms/Catom.h base/atoms/Natom.h base/atoms/Oatom.h base/atoms/Satom.h base/atoms/mm/EnvironmentalPointCharge.h base/factories/AtomFactory.h base/Molecule.h base/InputParser.h base/GTOExpansionSTO.h base/loggers/MOLogger.h base/loggers/DensityLogger.h base/loggers/HoleDensityLogger.h base/loggers/ParticleDensityLogger.h base/ElectronicStructure.h cndo/Cndo2.h cndo/ReducedOverlapAOsParameters.h indo/Indo.h zindo/ZindoS.h mndo/Mndo.h am1/Am1.h am1/Am1D.h pm3/Pm3.h pm3/Pm3D.h pm3/Pm3Pddg.h base/factories/ElectronicStructureFactory.h md/MD.h mc/MC.h rpmd/RPMD.h nasco/NASCO.h optimization/Optimizer.h optimization/ConjugateGradient.h optimization/SteepestDescent.h optimization/BFGS.h optimization/GEDIIS.h base/factories/OptimizerFactory.h base/MolDS.h | |
42 | +ALL_OBJ_FILES = obj/Enums.o obj/PrintController.o obj/MolDSException.o obj/MallocerFreer.o obj/MpiProcess.o obj/AsyncCommunicator.o obj/Blas.o obj/Lapack.o obj/Utilities.o obj/MathUtilities.o obj/EularAngle.o obj/Parameters.o obj/RealSphericalHarmonicsIndex.o obj/Atom.o obj/Hatom.o obj/Liatom.o obj/Catom.o obj/Natom.o obj/Oatom.o obj/Satom.o obj/EnvironmentalPointCharge.o obj/AtomFactory.o obj/Molecule.o obj/InputParser.o obj/GTOExpansionSTO.o obj/MOLogger.o obj/DensityLogger.o obj/HoleDensityLogger.o obj/ParticleDensityLogger.o obj/Cndo2.o obj/Indo.o obj/ZindoS.o obj/Mndo.o obj/Am1.o obj/Am1D.o obj/Pm3.o obj/Pm3D.o obj/Pm3Pddg.o obj/ElectronicStructureFactory.o obj/MD.o obj/MC.o obj/RPMD.o obj/NASCO.o obj/Optimizer.o obj/ConjugateGradient.o obj/SteepestDescent.o obj/BFGS.o obj/GEDIIS.o obj/OptimizerFactory.o obj/MolDS.o obj/Main.o | |
43 | 43 | |
44 | 44 | $(EXENAME): $(ALL_OBJ_FILES) |
45 | 45 | $(CC) -o $@ -Wl,-rpath=$(BOOST_LIB_DIR) -L$(BOOST_LIB_DIR) $(LDFLAGS) $(ALL_OBJ_FILES) $(LIBS) |
@@ -92,20 +92,20 @@ void Am1::SetMessages(){ | ||
92 | 92 | = "Error in am1::Am1::GetNddoRepulsionIntegral1stDerivative: Bad orbital is set.\n"; |
93 | 93 | this->errorMessageGetNddoRepulsionIntegral2ndDerivative |
94 | 94 | = "Error in am1::Am1::GetNddoRepulsionIntegral2ndDerivative: Bad orbital is set.\n"; |
95 | - this->errorMessageCalcTwoElecTwoCoreNullMatrix | |
96 | - = "Error in am1::Am1::CalcTwoElecTwoCore: The two elec two core matrix is NULL.\n"; | |
97 | - this->errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms | |
98 | - = "Error in am1::Am1::CalcDiatomicTwoElecTwoCore: Atom A and B is same.\n"; | |
99 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms | |
100 | - = "Error in am1::Am1::CalcDiatomicTwoElecTwoCore1stDerivatives: Atom A and B is same.\n"; | |
101 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms | |
102 | - = "Error in am1::Am1::CalcDiatomicTwoElecTwoCore2ndDerivatives: Atom A and B is same.\n"; | |
103 | - this->errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix | |
104 | - = "Error in am1::Am1::CalcDiatomicTwoElecTwoCore: The two elec two core diatomic matrix is NULL.\n"; | |
105 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix | |
106 | - = "Error in am1::Am1::CalcDiatomicTwoElecTwoCore1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
107 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix | |
108 | - = "Error in am1::Am1::CalcDiatomicTwoElecTwoCore2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
95 | + this->errorMessageCalcTwoElecsTwoCoresNullMatrix | |
96 | + = "Error in am1::Am1::CalcTwoElecsTwoCores: The two elec two core matrix is NULL.\n"; | |
97 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms | |
98 | + = "Error in am1::Am1::CalcDiatomicTwoElecsTwoCores: Atom A and B is same.\n"; | |
99 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms | |
100 | + = "Error in am1::Am1::CalcDiatomicTwoElecsTwoCores1stDerivatives: Atom A and B is same.\n"; | |
101 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms | |
102 | + = "Error in am1::Am1::CalcDiatomicTwoElecsTwoCores2ndDerivatives: Atom A and B is same.\n"; | |
103 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix | |
104 | + = "Error in am1::Am1::CalcDiatomicTwoElecsTwoCores: The two elec two core diatomic matrix is NULL.\n"; | |
105 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix | |
106 | + = "Error in am1::Am1::CalcDiatomicTwoElecsTwoCores1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
107 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix | |
108 | + = "Error in am1::Am1::CalcDiatomicTwoElecsTwoCores2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
109 | 109 | this->errorMessageGetElectronicEnergyEnergyNotCalculated |
110 | 110 | = "Error in am1::Am1::GetElectronicEnergy: Set electronic state is not calculated by CIS.\n"; |
111 | 111 | this->errorMessageGetElectronicEnergyNULLCISEnergy |
@@ -94,20 +94,20 @@ void Am1D::SetMessages(){ | ||
94 | 94 | = "Error in am1::Am1D::GetNddoRepulsionIntegral1stDerivative: Bad orbital is set.\n"; |
95 | 95 | this->errorMessageGetNddoRepulsionIntegral2ndDerivative |
96 | 96 | = "Error in am1::Am1D::GetNddoRepulsionIntegral2ndDerivative: Bad orbital is set.\n"; |
97 | - this->errorMessageCalcTwoElecTwoCoreNullMatrix | |
98 | - = "Error in am1::Am1D::CalcTwoElecTwoCore: The two elec two core matrix is NULL.\n"; | |
99 | - this->errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms | |
100 | - = "Error in am1::Am1D::CalcDiatomicTwoElecTwoCore: Atom A and B is same.\n"; | |
101 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms | |
102 | - = "Error in am1::Am1D::CalcDiatomicTwoElecTwoCore1stDerivatives: Atom A and B is same.\n"; | |
103 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms | |
104 | - = "Error in am1::Am1D::CalcDiatomicTwoElecTwoCore2ndDerivatives: Atom A and B is same.\n"; | |
105 | - this->errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix | |
106 | - = "Error in am1::Am1D::CalcDiatomicTwoElecTwoCore: The two elec two core diatomic matrix is NULL.\n"; | |
107 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix | |
108 | - = "Error in am1::Am1D::CalcDiatomicTwoElecTwoCore1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
109 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix | |
110 | - = "Error in am1::Am1D::CalcDiatomicTwoElecTwoCore2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
97 | + this->errorMessageCalcTwoElecsTwoCoresNullMatrix | |
98 | + = "Error in am1::Am1D::CalcTwoElecsTwoCores: The two elec two core matrix is NULL.\n"; | |
99 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms | |
100 | + = "Error in am1::Am1D::CalcDiatomicTwoElecsTwoCores: Atom A and B is same.\n"; | |
101 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms | |
102 | + = "Error in am1::Am1D::CalcDiatomicTwoElecsTwoCores1stDerivatives: Atom A and B is same.\n"; | |
103 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms | |
104 | + = "Error in am1::Am1D::CalcDiatomicTwoElecsTwoCores2ndDerivatives: Atom A and B is same.\n"; | |
105 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix | |
106 | + = "Error in am1::Am1D::CalcDiatomicTwoElecsTwoCores: The two elec two core diatomic matrix is NULL.\n"; | |
107 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix | |
108 | + = "Error in am1::Am1D::CalcDiatomicTwoElecsTwoCores1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
109 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix | |
110 | + = "Error in am1::Am1D::CalcDiatomicTwoElecsTwoCores2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
111 | 111 | this->errorMessageGetElectronicEnergyEnergyNotCalculated |
112 | 112 | = "Error in am1::Am1D::GetElectronicEnergy: Set electronic state is not calculated by CIS.\n"; |
113 | 113 | this->errorMessageGetElectronicEnergyNULLCISEnergy |
@@ -125,6 +125,7 @@ RENUMSTR_BEGIN( AtomType, AtomTypeStr ) | ||
125 | 125 | RENUMSTR( S, "S" ) |
126 | 126 | RENUMSTR( Cl, "Cl" ) |
127 | 127 | RENUMSTR( Ar, "Ar" ) |
128 | + RENUMSTR( EPC, "Environmental Point Charge" ) | |
128 | 129 | RENUMSTR( AtomType_end, "AtomType_end" ) |
129 | 130 | RENUMSTR_END() |
130 | 131 |
@@ -82,6 +82,8 @@ void InputParser::SetMessages(){ | ||
82 | 82 | = "Error in base::InputParser::GetInputTerms: Input file is empty.\n"; |
83 | 83 | this->errorMessageNotFoundInputFile |
84 | 84 | = "Error in base::InputParser::StoreInputTermsFromFile: Not found.\n"; |
85 | + this->errorMessageNonValidTheoriesEpc | |
86 | + = "Error in base::InputParser::ValidateEpcConditions: Theory you set is not supported for EPC. The supported theories are MNDO-sefies(MNDO, AM1, AM1D, PM3, PM3D, PDDG/PM3) only.\n"; | |
85 | 87 | this->errorMessageNonValidTheoriesMD |
86 | 88 | = "Error in base::InputParser::ValidateMdConditions: Theory you set is not supported for MD.\n"; |
87 | 89 | this->errorMessageNonValidExcitedStatesMD |
@@ -248,6 +250,10 @@ void InputParser::SetMessages(){ | ||
248 | 250 | this->stringGeometry = "geometry"; |
249 | 251 | this->stringGeometryEnd = "geometry_end"; |
250 | 252 | |
253 | + // Environmental Point Charge | |
254 | + this->stringEpc = "epc"; | |
255 | + this->stringEpcEnd = "epc_end"; | |
256 | + | |
251 | 257 | // SCF |
252 | 258 | this->stringScf = "scf"; |
253 | 259 | this->stringScfEnd = "scf_end"; |
@@ -488,6 +494,22 @@ int InputParser::ParseMolecularGeometry(Molecule* molecule, vector<string>* inpu | ||
488 | 494 | return parseIndex; |
489 | 495 | } |
490 | 496 | |
497 | +int InputParser::ParseEpcsConfiguration(Molecule* molecule, vector<string>* inputTerms, int parseIndex) const{ | |
498 | + parseIndex++; | |
499 | + while((*inputTerms)[parseIndex].compare(this->stringEpcEnd) != 0){ | |
500 | + double x = atof((*inputTerms)[parseIndex+0].c_str()) * Parameters::GetInstance()->GetAngstrom2AU(); | |
501 | + double y = atof((*inputTerms)[parseIndex+1].c_str()) * Parameters::GetInstance()->GetAngstrom2AU(); | |
502 | + double z = atof((*inputTerms)[parseIndex+2].c_str()) * Parameters::GetInstance()->GetAngstrom2AU(); | |
503 | + double charge = atof((*inputTerms)[parseIndex+3].c_str()); | |
504 | + AtomType atomType = EPC; | |
505 | + int index = molecule->GetNumberEpcs(); | |
506 | + Atom* atom = AtomFactory::Create(atomType, index, x, y, z, charge); | |
507 | + molecule->AddEpc(atom); | |
508 | + parseIndex += 4; | |
509 | + } | |
510 | + return parseIndex; | |
511 | +} | |
512 | + | |
491 | 513 | int InputParser::ParseConditionsSCF(vector<string>* inputTerms, int parseIndex) const{ |
492 | 514 | parseIndex++; |
493 | 515 | while((*inputTerms)[parseIndex].compare(this->stringScfEnd) != 0){ |
@@ -1169,6 +1191,11 @@ void InputParser::Parse(Molecule* molecule, int argc, char *argv[]) const{ | ||
1169 | 1191 | i = this->ParseMolecularGeometry(molecule, &inputTerms, i); |
1170 | 1192 | } |
1171 | 1193 | |
1194 | + // Environmental Point Charges Configuration | |
1195 | + if(inputTerms[i].compare(this->stringEpc) == 0){ | |
1196 | + i = this->ParseEpcsConfiguration(molecule, &inputTerms, i); | |
1197 | + } | |
1198 | + | |
1172 | 1199 | // scf condition |
1173 | 1200 | if(inputTerms[i].compare(this->stringScf) == 0){ |
1174 | 1201 | i = this->ParseConditionsSCF(&inputTerms, i); |
@@ -1249,6 +1276,7 @@ void InputParser::Parse(Molecule* molecule, int argc, char *argv[]) const{ | ||
1249 | 1276 | // calculate basics and validate conditions |
1250 | 1277 | this->CalcMolecularBasics(molecule); |
1251 | 1278 | this->ValidateVdWConditions(); |
1279 | + this->ValidateEpcConditions(*molecule); | |
1252 | 1280 | if(Parameters::GetInstance()->RequiresCIS()){ |
1253 | 1281 | this->ValidateCisConditions(*molecule); |
1254 | 1282 | } |
@@ -1326,6 +1354,25 @@ void InputParser::ValidateVdWConditions() const{ | ||
1326 | 1354 | } |
1327 | 1355 | } |
1328 | 1356 | |
1357 | +void InputParser::ValidateEpcConditions(const Molecule& molecule) const{ | |
1358 | + if(molecule.GetNumberEpcs()<=0){return;} | |
1359 | + TheoryType theory = Parameters::GetInstance()->GetCurrentTheory(); | |
1360 | + // Validate theory | |
1361 | + if(theory == MNDO || | |
1362 | + theory == AM1 || | |
1363 | + theory == AM1D || | |
1364 | + theory == PM3 || | |
1365 | + theory == PM3D || | |
1366 | + theory == PM3PDDG ){ | |
1367 | + } | |
1368 | + else{ | |
1369 | + stringstream ss; | |
1370 | + ss << this->errorMessageNonValidTheoriesEpc; | |
1371 | + ss << this->errorMessageTheory << TheoryTypeStr(theory) << endl; | |
1372 | + throw MolDSException(ss.str()); | |
1373 | + } | |
1374 | +} | |
1375 | + | |
1329 | 1376 | void InputParser::ValidateCisConditions(const Molecule& molecule) const{ |
1330 | 1377 | |
1331 | 1378 | // direct CIS |
@@ -1550,6 +1597,7 @@ void InputParser::OutputMolecularBasics(Molecule* molecule) const{ | ||
1550 | 1597 | molecule->OutputConfiguration(); |
1551 | 1598 | molecule->OutputXyzCOM(); |
1552 | 1599 | molecule->OutputXyzCOC(); |
1600 | + molecule->OutputEpcs(); | |
1553 | 1601 | } |
1554 | 1602 | |
1555 | 1603 | void InputParser::OutputScfConditions() const{ |
@@ -35,6 +35,7 @@ private: | ||
35 | 35 | void SetMessages(); |
36 | 36 | std::string errorMessageInputFileEmpty; |
37 | 37 | std::string errorMessageNotFoundInputFile; |
38 | + std::string errorMessageNonValidTheoriesEpc; | |
38 | 39 | std::string errorMessageNonValidTheoriesMD; |
39 | 40 | std::string errorMessageNonValidExcitedStatesMD; |
40 | 41 | std::string errorMessageNonValidExcitedStatesMC; |
@@ -173,6 +174,9 @@ private: | ||
173 | 174 | // geometry |
174 | 175 | std::string stringGeometry; |
175 | 176 | std::string stringGeometryEnd; |
177 | + // EPC | |
178 | + std::string stringEpc; | |
179 | + std::string stringEpcEnd; | |
176 | 180 | // SCF |
177 | 181 | std::string stringScf; |
178 | 182 | std::string stringScfEnd; |
@@ -297,6 +301,7 @@ private: | ||
297 | 301 | std::string stringFrequenciesElecState; |
298 | 302 | void CalcMolecularBasics(Molecule* molecule) const; |
299 | 303 | void ValidateVdWConditions() const; |
304 | + void ValidateEpcConditions(const Molecule& molecule) const; | |
300 | 305 | void ValidateCisConditions(const Molecule& molecule) const; |
301 | 306 | void ValidateMdConditions(const Molecule& molecule) const; |
302 | 307 | void ValidateMcConditions(const Molecule& molecule) const; |
@@ -324,6 +329,7 @@ private: | ||
324 | 329 | void StoreInputTermsFromFile(std::vector<std::string>& inputTerms, char* fileName) const; |
325 | 330 | void AddInputTermsFromString(std::vector<std::string>& inputTerms, std::string str) const; |
326 | 331 | int ParseMolecularGeometry(Molecule* molecule, std::vector<std::string>* inputTerms, int parseIndex) const; |
332 | + int ParseEpcsConfiguration(Molecule* molecule, std::vector<std::string>* inputTerms, int parseIndex) const; | |
327 | 333 | int ParseTheory(std::vector<std::string>* inputTerms, int parseIndex) const; |
328 | 334 | int ParseConditionsSCF(std::vector<std::string>* inputTerms, int parseIndex) const; |
329 | 335 | int ParseConditionsPrincipalAxes(std::vector<std::string>* inputTerms, int parseIndex) const; |
@@ -30,6 +30,7 @@ public: | ||
30 | 30 | //1d |
31 | 31 | template<typename T> void Malloc(T** matrix, size_t size1) const{ |
32 | 32 | if(*matrix!=NULL) return; |
33 | + if(size1<=0) return; | |
33 | 34 | double requiredMalloc = this->GetMemoryAmount<T>(size1); |
34 | 35 | this->CheckLimitHeap(requiredMalloc); |
35 | 36 | *matrix = new T[size1](); |
@@ -58,6 +59,7 @@ public: | ||
58 | 59 | // 2d |
59 | 60 | template<typename T> void Malloc(T*** matrix, size_t size1, size_t size2) const{ |
60 | 61 | if(*matrix!=NULL) return; |
62 | + if(size1*size2<=0) return; | |
61 | 63 | double requiredMalloc = this->GetMemoryAmount<T*>(size1); |
62 | 64 | this->CheckLimitHeap(requiredMalloc); |
63 | 65 |
@@ -100,6 +102,7 @@ public: | ||
100 | 102 | // 3d |
101 | 103 | template<typename T> void Malloc(T**** matrix, size_t size1, size_t size2, size_t size3) const{ |
102 | 104 | if(*matrix!=NULL) return; |
105 | + if(size1*size2*size3<=0) return; | |
103 | 106 | double requiredMalloc = this->GetMemoryAmount<T**>(size1); |
104 | 107 | this->CheckLimitHeap(requiredMalloc); |
105 | 108 |
@@ -144,6 +147,7 @@ public: | ||
144 | 147 | //4d |
145 | 148 | template<typename T> void Malloc(T***** matrix, size_t size1, size_t size2, size_t size3, size_t size4) const{ |
146 | 149 | if(*matrix!=NULL) return; |
150 | + if(size1*size2*size3*size4<=0) return; | |
147 | 151 | double requiredMalloc = this->GetMemoryAmount<T***>(size1); |
148 | 152 | this->CheckLimitHeap(requiredMalloc); |
149 | 153 |
@@ -189,6 +193,7 @@ public: | ||
189 | 193 | //5d |
190 | 194 | template<typename T> void Malloc(T****** matrix, size_t size1, size_t size2, size_t size3, size_t size4, size_t size5) const{ |
191 | 195 | if(*matrix!=NULL) return; |
196 | + if(size1*size2*size3*size4*size5<=0) return; | |
192 | 197 | double requiredMalloc = this->GetMemoryAmount<T****>(size1); |
193 | 198 | this->CheckLimitHeap(requiredMalloc); |
194 | 199 |
@@ -235,6 +240,7 @@ public: | ||
235 | 240 | //6d |
236 | 241 | template<typename T> void Malloc(T******* matrix, size_t size1, size_t size2, size_t size3, size_t size4, size_t size5, size_t size6) const{ |
237 | 242 | if(*matrix!=NULL) return; |
243 | + if(size1*size2*size3*size4*size5*size6<=0) return; | |
238 | 244 | double requiredMalloc = this->GetMemoryAmount<T*****>(size1); |
239 | 245 | this->CheckLimitHeap(requiredMalloc); |
240 | 246 |
@@ -282,6 +288,7 @@ public: | ||
282 | 288 | //7d |
283 | 289 | template<typename T> void Malloc(T******** matrix, size_t size1, size_t size2, size_t size3, size_t size4, size_t size5, size_t size6, size_t size7) const{ |
284 | 290 | if(*matrix!=NULL) return; |
291 | + if(size1*size2*size3*size4*size5*size6*size7<=0) return; | |
285 | 292 | double requiredMalloc = this->GetMemoryAmount<T******>(size1); |
286 | 293 | this->CheckLimitHeap(requiredMalloc); |
287 | 294 |
@@ -57,15 +57,30 @@ Molecule::Molecule(const Molecule& rhs){ | ||
57 | 57 | Molecule& Molecule::operator=(const Molecule& rhs){ |
58 | 58 | double* oldXyzCOM = this->xyzCOM; |
59 | 59 | double* oldXyzCOC = this->xyzCOC; |
60 | - double** oldDistanceMatrix = this->distanceMatrix; | |
60 | + double** oldDistanceAtoms = this->distanceAtoms; | |
61 | + double** oldDistanceEpcs = this->distanceEpcs; | |
62 | + double** oldDistanceAtomsEpcs = this->distanceAtomsEpcs; | |
61 | 63 | vector<Atom*>* oldAtomVect = this->atomVect; |
64 | + vector<Atom*>* oldEpcVect = this->epcVect; | |
62 | 65 | this->CopyInitialize(rhs); |
63 | - this->Finalize(&oldAtomVect, &oldXyzCOM, &oldXyzCOC, &oldDistanceMatrix); | |
66 | + this->Finalize(&oldAtomVect, | |
67 | + &oldEpcVect, | |
68 | + &oldXyzCOM, | |
69 | + &oldXyzCOC, | |
70 | + &oldDistanceAtoms, | |
71 | + &oldDistanceEpcs, | |
72 | + &oldDistanceAtomsEpcs); | |
64 | 73 | return *this; |
65 | 74 | } |
66 | 75 | |
67 | 76 | Molecule::~Molecule(){ |
68 | - this->Finalize(&this->atomVect, &this->xyzCOM, &this->xyzCOC, &this->distanceMatrix); | |
77 | + this->Finalize(&this->atomVect, | |
78 | + &this->epcVect, | |
79 | + &this->xyzCOM, | |
80 | + &this->xyzCOC, | |
81 | + &this->distanceAtoms, | |
82 | + &this->distanceEpcs, | |
83 | + &this->distanceAtomsEpcs); | |
69 | 84 | //this->OutputLog("molecule deleted\n"); |
70 | 85 | } |
71 | 86 |
@@ -78,48 +93,101 @@ void Molecule::CopyInitialize(const Molecule& rhs){ | ||
78 | 93 | this->totalNumberAOs = rhs.totalNumberAOs; |
79 | 94 | this->totalNumberValenceElectrons = rhs.totalNumberValenceElectrons; |
80 | 95 | this->totalCoreMass = rhs.totalCoreMass; |
81 | - for(int i=0; i<rhs.atomVect->size(); i++){ | |
82 | - Atom* atom = (*rhs.atomVect)[i]; | |
83 | - this->atomVect->push_back(AtomFactory::Create(atom->GetAtomType(), | |
84 | - atom->GetIndex(), | |
85 | - atom->GetXyz()[XAxis], | |
86 | - atom->GetXyz()[YAxis], | |
87 | - atom->GetXyz()[ZAxis], | |
88 | - atom->GetPxyz()[XAxis], | |
89 | - atom->GetPxyz()[YAxis], | |
90 | - atom->GetPxyz()[ZAxis])); | |
91 | - (*this->atomVect)[i]->SetFirstAOIndex(atom->GetFirstAOIndex()); | |
92 | - } | |
93 | - int atomNum = this->atomVect->size(); | |
94 | - MallocerFreer::GetInstance()->Malloc<double>(&this->distanceMatrix, atomNum, atomNum); | |
95 | - for(int i=0; i<atomNum; i++){ | |
96 | - for(int j=0; j<atomNum; j++){ | |
97 | - this->distanceMatrix[i][j] = rhs.distanceMatrix[i][j]; | |
96 | + if(rhs.atomVect != NULL){ | |
97 | + int atomNum = rhs.atomVect->size(); | |
98 | + for(int i=0; i<atomNum; i++){ | |
99 | + Atom* atom = (*rhs.atomVect)[i]; | |
100 | + this->atomVect->push_back(AtomFactory::Create(atom->GetAtomType(), | |
101 | + atom->GetIndex(), | |
102 | + atom->GetXyz()[XAxis], | |
103 | + atom->GetXyz()[YAxis], | |
104 | + atom->GetXyz()[ZAxis], | |
105 | + atom->GetPxyz()[XAxis], | |
106 | + atom->GetPxyz()[YAxis], | |
107 | + atom->GetPxyz()[ZAxis])); | |
108 | + (*this->atomVect)[i]->SetFirstAOIndex(atom->GetFirstAOIndex()); | |
109 | + } | |
110 | + MallocerFreer::GetInstance()->Malloc<double>(&this->distanceAtoms, atomNum, atomNum); | |
111 | + for(int i=0; i<atomNum; i++){ | |
112 | + for(int j=0; j<atomNum; j++){ | |
113 | + this->distanceAtoms[i][j] = rhs.distanceAtoms[i][j]; | |
114 | + } | |
115 | + } | |
116 | + } | |
117 | + if(rhs.epcVect != NULL){ | |
118 | + int epcNum = rhs.epcVect->size(); | |
119 | + for(int i=0; i<epcNum; i++){ | |
120 | + Atom* epc = (*rhs.epcVect)[i]; | |
121 | + this->epcVect->push_back( | |
122 | + AtomFactory::Create(EPC, | |
123 | + epc->GetIndex(), | |
124 | + epc->GetXyz()[XAxis], | |
125 | + epc->GetXyz()[YAxis], | |
126 | + epc->GetXyz()[ZAxis], | |
127 | + epc->GetPxyz()[XAxis], | |
128 | + epc->GetPxyz()[YAxis], | |
129 | + epc->GetPxyz()[ZAxis], | |
130 | + epc->GetCoreCharge())); | |
131 | + (*this->epcVect)[i]->SetFirstAOIndex(epc->GetFirstAOIndex()); | |
132 | + } | |
133 | + MallocerFreer::GetInstance()->Malloc<double>(&this->distanceEpcs, epcNum, epcNum); | |
134 | + for(int i=0; i<epcNum; i++){ | |
135 | + for(int j=0; j<epcNum; j++){ | |
136 | + this->distanceEpcs[i][j] = rhs.distanceEpcs[i][j]; | |
137 | + } | |
138 | + } | |
139 | + } | |
140 | + if(rhs.atomVect != NULL && rhs.epcVect != NULL){ | |
141 | + int atomNum = rhs.atomVect->size(); | |
142 | + int epcNum = rhs.epcVect->size(); | |
143 | + MallocerFreer::GetInstance()->Malloc<double>(&this->distanceAtomsEpcs, atomNum, epcNum); | |
144 | + for(int i=0; i<atomNum; i++){ | |
145 | + for(int j=0; j<epcNum; j++){ | |
146 | + this->distanceAtomsEpcs[i][j] = rhs.distanceAtomsEpcs[i][j]; | |
147 | + } | |
98 | 148 | } |
99 | 149 | } |
100 | - | |
101 | 150 | } |
102 | 151 | |
103 | 152 | void Molecule::Initialize(){ |
104 | 153 | this->SetMessages(); |
105 | - this->xyzCOM = NULL; | |
106 | - this->xyzCOC = NULL; | |
107 | - this->distanceMatrix = NULL; | |
108 | - this->atomVect = NULL; | |
154 | + this->xyzCOM = NULL; | |
155 | + this->xyzCOC = NULL; | |
156 | + this->distanceAtoms = NULL; | |
157 | + this->distanceEpcs = NULL; | |
158 | + this->distanceAtomsEpcs = NULL; | |
159 | + this->atomVect = NULL; | |
160 | + this->epcVect = NULL; | |
109 | 161 | try{ |
110 | 162 | this->atomVect = new vector<Atom*>; |
163 | + this->epcVect = new vector<Atom*>; | |
111 | 164 | MallocerFreer::GetInstance()->Malloc<double>(&this->xyzCOM, CartesianType_end); |
112 | 165 | MallocerFreer::GetInstance()->Malloc<double>(&this->xyzCOC, CartesianType_end); |
113 | 166 | } |
114 | 167 | catch(exception ex){ |
115 | - this->Finalize(&this->atomVect, &this->xyzCOM, &this->xyzCOC, &this->distanceMatrix); | |
168 | + this->Finalize(&this->atomVect, | |
169 | + &this->epcVect, | |
170 | + &this->xyzCOM, | |
171 | + &this->xyzCOC, | |
172 | + &this->distanceAtoms, | |
173 | + &this->distanceEpcs, | |
174 | + &this->distanceAtomsEpcs); | |
116 | 175 | throw MolDSException(ex.what()); |
117 | 176 | } |
118 | 177 | } |
119 | 178 | |
120 | -void Molecule::Finalize(vector<Atom*>** atomVect, double** xyzCOM, double** xyzCOC, double*** distanceMatrix){ | |
121 | - int atomNum = (*atomVect)->size(); | |
179 | +void Molecule::Finalize(vector<Atom*>** atomVect, | |
180 | + vector<Atom*>** epcVect, | |
181 | + double** xyzCOM, | |
182 | + double** xyzCOC, | |
183 | + double*** distanceAtoms, | |
184 | + double*** distanceEpcs, | |
185 | + double*** distanceAtomsEpcs){ | |
186 | + MallocerFreer::GetInstance()->Free<double>(xyzCOM, CartesianType_end); | |
187 | + MallocerFreer::GetInstance()->Free<double>(xyzCOC, CartesianType_end); | |
188 | + int atomNum=0; | |
122 | 189 | if(*atomVect != NULL){ |
190 | + atomNum = (*atomVect)->size(); | |
123 | 191 | for(int i=0; i<atomNum; i++){ |
124 | 192 | if((**atomVect)[i] != NULL){ |
125 | 193 | delete (**atomVect)[i]; |
@@ -130,16 +198,37 @@ void Molecule::Finalize(vector<Atom*>** atomVect, double** xyzCOM, double** xyzC | ||
130 | 198 | delete *atomVect; |
131 | 199 | *atomVect = NULL; |
132 | 200 | //this->OutputLog("atomVect deleted\n"); |
201 | + MallocerFreer::GetInstance()->Free<double>(distanceAtoms, atomNum, atomNum); | |
202 | + } | |
203 | + int epcNum = 0; | |
204 | + if(*epcVect != NULL){ | |
205 | + epcNum = (*epcVect)->size(); | |
206 | + for(int i=0; i<epcNum; i++){ | |
207 | + if((**epcVect)[i] != NULL){ | |
208 | + delete (**epcVect)[i]; | |
209 | + (**epcVect)[i] = NULL; | |
210 | + } | |
211 | + } | |
212 | + (*epcVect)->clear(); | |
213 | + delete *epcVect; | |
214 | + *epcVect = NULL; | |
215 | + //this->OutputLog("epcVect deleted\n"); | |
216 | + MallocerFreer::GetInstance()->Free<double>(distanceEpcs, epcNum, epcNum); | |
217 | + } | |
218 | + if(*atomVect != NULL && *epcVect != NULL){ | |
219 | + atomNum = (*atomVect)->size(); | |
220 | + epcNum = (*epcVect)->size(); | |
221 | + MallocerFreer::GetInstance()->Free<double>(distanceAtomsEpcs, atomNum, epcNum); | |
133 | 222 | } |
134 | - MallocerFreer::GetInstance()->Free<double>(xyzCOM, CartesianType_end); | |
135 | - MallocerFreer::GetInstance()->Free<double>(xyzCOC, CartesianType_end); | |
136 | - MallocerFreer::GetInstance()->Free<double>(distanceMatrix, atomNum, atomNum); | |
137 | 223 | } |
138 | 224 | |
139 | 225 | void Molecule::SetMessages(){ |
140 | 226 | this->errorMessageGetAtomNull = "Error in base::Molecule::GetAtom: atomVect is NULL.\n"; |
227 | + this->errorMessageGetEPCNull = "Error in base::Molecule::GetEnviromentalPointCharge: enviromentalPointChargeVect is NULL.\n"; | |
141 | 228 | this->errorMessageAddAtomNull = "Error in base::Molecule::AddAtom: atomVect is NULL.\n"; |
229 | + this->errorMessageAddEPCNull = "Error in base::Molecule::AddEnviromentalPointCharge: enviromentalPointChargeVect is NULL.\n"; | |
142 | 230 | this->errorMessageGetNumberAtomsNull = "Error in base::Molecule::GetNumberAtoms: atomVect is NULL.\n"; |
231 | + this->errorMessageGetNumberEPCsNull = "Error in base::Molecule::GetNumberEnviromentalPointChargess: epcVect is NULL.\n"; | |
143 | 232 | this->errorMessageGetXyzCOMNull = "Error in base::Molecule::GetXyzCOM: xyzCOM is NULL.\n"; |
144 | 233 | this->errorMessageGetXyzCOCNull = "Error in base::Molecule::GetXyzCOC: xyzCOC is NULL.\n"; |
145 | 234 | this->errorMessageCalcXyzCOMNull = "Error in base::Molecule::CalcXyzCOM: xyzCOM is NULL.\n"; |
@@ -151,6 +240,9 @@ void Molecule::SetMessages(){ | ||
151 | 240 | this->messageAtomCoordinates = "\tAtom coordinates:"; |
152 | 241 | this->messageAtomMomenta = "\tAtom momenta:"; |
153 | 242 | this->messageAtomMomentaTitle = "\t\t\t| i-th | atom type | px[a.u.] | py[a.u.] | pz[a.u.] |\t\t| px[u] | py[u] | pz[u] | [u] = [(g/Mol)*(angst/fs)]\n"; |
243 | + this->messageEpcConfiguration = "\tEnvironmental Point Charge(EPC) configuration:\n"; | |
244 | + this->messageEpcCoordinates = "\tEPC coordinates:"; | |
245 | + this->messageEpcCoordinatesTitle = "\t\t\t\t| i-th | charge[a.u.] | x[a.u.] | y[a.u.] | z[a.u.] |\t\t| x[angst.] | y[angst.] | z[angst.] |\n"; | |
154 | 246 | this->messageCOM = "\tCenter of Mass:"; |
155 | 247 | this->messageCOC = "\tCenter of Core:"; |
156 | 248 | this->messageCOMTitle = "\t\t\t| x[a.u.] | y[a.u.] | z[a.u.] |\t\t| x[angst.] | y[angst.] | z[angst.] |\n"; |
@@ -182,7 +274,13 @@ void Molecule::AddAtom(Atom* atom){ | ||
182 | 274 | if(this->atomVect==NULL) throw MolDSException(this->errorMessageAddAtomNull); |
183 | 275 | #endif |
184 | 276 | this->atomVect->push_back(atom); |
185 | - | |
277 | +} | |
278 | + | |
279 | +void Molecule::AddEpc(Atom* epc){ | |
280 | +#ifdef MOLDS_DBG | |
281 | + if(this->epcVect==NULL) throw MolDSException(this->errorMessageAddEPCNull); | |
282 | +#endif | |
283 | + this->epcVect->push_back(epc); | |
186 | 284 | } |
187 | 285 | |
188 | 286 | double const* Molecule::GetXyzCOM() const{ |
@@ -251,9 +349,9 @@ void Molecule::CalcXyzCOC(){ | ||
251 | 349 | } |
252 | 350 | } |
253 | 351 | |
254 | -void Molecule::CalcDistanceMatrix(){ | |
255 | - if(this->distanceMatrix==NULL){ | |
256 | - MallocerFreer::GetInstance()->Malloc<double>(&this->distanceMatrix, this->atomVect->size(), this->atomVect->size()); | |
352 | +void Molecule::CalcDistanceAtoms(){ | |
353 | + if(this->distanceAtoms==NULL){ | |
354 | + MallocerFreer::GetInstance()->Malloc<double>(&this->distanceAtoms, this->atomVect->size(), this->atomVect->size()); | |
257 | 355 | } |
258 | 356 | for(int a=0; a<this->atomVect->size(); a++){ |
259 | 357 | const Atom& atomA = *(*this->atomVect)[a]; |
@@ -263,8 +361,45 @@ void Molecule::CalcDistanceMatrix(){ | ||
263 | 361 | distance = sqrt( pow(atomA.GetXyz()[0] - atomB.GetXyz()[0], 2.0) |
264 | 362 | +pow(atomA.GetXyz()[1] - atomB.GetXyz()[1], 2.0) |
265 | 363 | +pow(atomA.GetXyz()[2] - atomB.GetXyz()[2], 2.0) ); |
266 | - this->distanceMatrix[a][b] = distance; | |
267 | - this->distanceMatrix[b][a] = distance; | |
364 | + this->distanceAtoms[a][b] = distance; | |
365 | + this->distanceAtoms[b][a] = distance; | |
366 | + } | |
367 | + } | |
368 | +} | |
369 | + | |
370 | +void Molecule::CalcDistanceEpcs(){ | |
371 | + if(this->epcVect == NULL){return;} | |
372 | + if(this->distanceEpcs==NULL){ | |
373 | + MallocerFreer::GetInstance()->Malloc<double>(&this->distanceEpcs, this->epcVect->size(), this->epcVect->size()); | |
374 | + } | |
375 | + for(int a=0; a<this->epcVect->size(); a++){ | |
376 | + const Atom& epcA = *(*this->epcVect)[a]; | |
377 | + for(int b=a; b<this->epcVect->size(); b++){ | |
378 | + const Atom& epcB = *(*this->epcVect)[b]; | |
379 | + double distance=0.0; | |
380 | + distance = sqrt( pow(epcA.GetXyz()[0] - epcB.GetXyz()[0], 2.0) | |
381 | + +pow(epcA.GetXyz()[1] - epcB.GetXyz()[1], 2.0) | |
382 | + +pow(epcA.GetXyz()[2] - epcB.GetXyz()[2], 2.0) ); | |
383 | + this->distanceEpcs[a][b] = distance; | |
384 | + this->distanceEpcs[b][a] = distance; | |
385 | + } | |
386 | + } | |
387 | +} | |
388 | + | |
389 | +void Molecule::CalcDistanceAtomsEpcs(){ | |
390 | + if(this->epcVect == NULL){return;} | |
391 | + if(this->distanceAtomsEpcs==NULL){ | |
392 | + MallocerFreer::GetInstance()->Malloc<double>(&this->distanceAtomsEpcs, this->atomVect->size(), this->epcVect->size()); | |
393 | + } | |
394 | + for(int a=0; a<this->atomVect->size(); a++){ | |
395 | + const Atom& atom = *(*this->atomVect)[a]; | |
396 | + for(int b=0; b<this->epcVect->size(); b++){ | |
397 | + const Atom& epc = *(*this->epcVect)[b]; | |
398 | + double distance=0.0; | |
399 | + distance = sqrt( pow(atom.GetXyz()[0] - epc.GetXyz()[0], 2.0) | |
400 | + +pow(atom.GetXyz()[1] - epc.GetXyz()[1], 2.0) | |
401 | + +pow(atom.GetXyz()[2] - epc.GetXyz()[2], 2.0) ); | |
402 | + this->distanceAtomsEpcs[a][b] = distance; | |
268 | 403 | } |
269 | 404 | } |
270 | 405 | } |
@@ -279,7 +414,9 @@ void Molecule::CalcBasics(){ | ||
279 | 414 | void Molecule::CalcBasicsConfiguration(){ |
280 | 415 | this->CalcXyzCOM(); |
281 | 416 | this->CalcXyzCOC(); |
282 | - this->CalcDistanceMatrix(); | |
417 | + this->CalcDistanceAtoms(); | |
418 | + this->CalcDistanceEpcs(); | |
419 | + this->CalcDistanceAtomsEpcs(); | |
283 | 420 | } |
284 | 421 | |
285 | 422 | void Molecule::CalcTotalNumberAOs(){ |
@@ -347,6 +484,27 @@ void Molecule::OutputMomenta() const{ | ||
347 | 484 | this->OutputLog("\n"); |
348 | 485 | } |
349 | 486 | |
487 | +void Molecule::OutputEpcs() const{ | |
488 | + if(this->epcVect == NULL || this->epcVect->size() <= 0) {return;} | |
489 | + double ang2AU = Parameters::GetInstance()->GetAngstrom2AU(); | |
490 | + this->OutputLog(this->messageEpcConfiguration); | |
491 | + this->OutputLog(this->messageEpcCoordinatesTitle); | |
492 | + for(int a=0; a<this->epcVect->size(); a++){ | |
493 | + const Atom& atom = *(*this->epcVect)[a]; | |
494 | + this->OutputLog(boost::format("%s\t%d\t%e\t%e\t%e\t%e\t\t%e\t%e\t%e\n") | |
495 | + % this->messageEpcCoordinates | |
496 | + % a | |
497 | + % atom.GetCoreCharge() | |
498 | + % atom.GetXyz()[0] | |
499 | + % atom.GetXyz()[1] | |
500 | + % atom.GetXyz()[2] | |
501 | + % (atom.GetXyz()[0]/ang2AU) | |
502 | + % (atom.GetXyz()[1]/ang2AU) | |
503 | + % (atom.GetXyz()[2]/ang2AU)); | |
504 | + } | |
505 | + this->OutputLog("\n"); | |
506 | +} | |
507 | + | |
350 | 508 | void Molecule::OutputXyzCOM() const{ |
351 | 509 | double ang2AU = Parameters::GetInstance()->GetAngstrom2AU(); |
352 | 510 | this->OutputLog(this->messageCOMTitle); |
@@ -673,14 +831,6 @@ void Molecule::OutputTranslatingConditions(double const* translatingDifference) | ||
673 | 831 | % (translatingDifference[2]/angst2AU)); |
674 | 832 | } |
675 | 833 | |
676 | -//double Molecule::GetDistanceAtoms(int indexAtomA, int indexAtomB) const{ | |
677 | -// return this->distanceMatrix[indexAtomA][indexAtomB]; | |
678 | -//} | |
679 | -// | |
680 | -//double Molecule::GetDistanceAtoms(const Atom& atomA, const Atom& atomB) const{ | |
681 | -// return this->GetDistanceAtoms(atomA.GetIndex(), atomB.GetIndex()); | |
682 | -//} | |
683 | - | |
684 | 834 | void Molecule::SynchronizeConfigurationTo(const Molecule& ref){ |
685 | 835 | for(int a=0; a<this->GetNumberAtoms(); a++){ |
686 | 836 | Atom& atom = *this->GetAtom(a); |
@@ -38,7 +38,20 @@ public: | ||
38 | 38 | #endif |
39 | 39 | return (*this->atomVect)[atomIndex]; |
40 | 40 | } |
41 | + inline int GetNumberEpcs() const{ | |
42 | +#ifdef MOLDS_DBG | |
43 | + if(this->epcVect==NULL) throw MolDS_base::MolDSException(this->errorMessageGetNumberEPCsNull); | |
44 | +#endif | |
45 | + return this->epcVect->size(); | |
46 | + } | |
47 | + inline MolDS_base_atoms::Atom* GetEpc(int epcIndex) const{ | |
48 | +#ifdef MOLDS_DBG | |
49 | + if(this->epcVect==NULL) throw MolDS_base::MolDSException(this->errorMessageGetEPCNull); | |
50 | +#endif | |
51 | + return (*this->epcVect)[epcIndex]; | |
52 | + } | |
41 | 53 | void AddAtom(MolDS_base_atoms::Atom* atom); |
54 | + void AddEpc(MolDS_base_atoms::Atom* epc); | |
42 | 55 | double const* GetXyzCOM() const; |
43 | 56 | double const* GetXyzCOC() const; |
44 | 57 | void CalcBasics(); |
@@ -51,12 +64,19 @@ public: | ||
51 | 64 | void OutputTotalNumberAtomsAOsValenceelectrons() const; |
52 | 65 | void OutputConfiguration() const; |
53 | 66 | void OutputMomenta() const; |
67 | + void OutputEpcs() const; | |
54 | 68 | void CalcPrincipalAxes(); |
55 | 69 | void Rotate(); |
56 | 70 | void Translate(); |
57 | - double GetDistanceAtoms(int indexAtomA, int indexAtomB) const{return this->distanceMatrix[indexAtomA][indexAtomB];}; | |
71 | + double GetDistanceAtoms(int indexAtomA, int indexAtomB) const{return this->distanceAtoms[indexAtomA][indexAtomB];}; | |
58 | 72 | double GetDistanceAtoms(const MolDS_base_atoms::Atom& atomA, |
59 | 73 | const MolDS_base_atoms::Atom& atomB) const{return this->GetDistanceAtoms(atomA.GetIndex(), atomB.GetIndex());}; |
74 | + double GetDistanceEpcs(int indexEpcA, int indexEpcB) const{return this->distanceEpcs[indexEpcA][indexEpcB];}; | |
75 | + double GetDistanceEpcs(const MolDS_base_atoms::Atom& epcA, | |
76 | + const MolDS_base_atoms::Atom& epcB) const{return this->GetDistanceEpcs(epcA.GetIndex(), epcB.GetIndex());}; | |
77 | + double GetDistanceAtomEpc(int indexAtom, int indexEpc) const{return this->distanceAtomsEpcs[indexAtom][indexEpc];}; | |
78 | + double GetDistanceAtomEpc(const MolDS_base_atoms::Atom& atom, | |
79 | + const MolDS_base_atoms::Atom& epc) const{return this->GetDistanceAtomEpc(atom.GetIndex(), epc.GetIndex());}; | |
60 | 80 | void SynchronizeConfigurationTo (const Molecule& ref); |
61 | 81 | void SynchronizeMomentaTo (const Molecule& ref); |
62 | 82 | void SynchronizePhaseSpacePointTo(const Molecule& ref); |
@@ -65,22 +85,33 @@ public: | ||
65 | 85 | void BroadcastPhaseSpacePointToAllProcesses(int root) const; |
66 | 86 | private: |
67 | 87 | std::vector<MolDS_base_atoms::Atom*>* atomVect; |
88 | + std::vector<MolDS_base_atoms::Atom*>* epcVect; // Vector of Environmental Point Charges | |
68 | 89 | double* xyzCOM; // x, y, z coordinates of Center of Mass; |
69 | 90 | double* xyzCOC; // x, y, z coordinates of Center of Core; |
70 | - double** distanceMatrix; // distance between each atom; | |
91 | + double** distanceAtoms; // distance between each atom; | |
92 | + double** distanceEpcs; // distance between each environmental point charge; | |
93 | + double** distanceAtomsEpcs;// distance between each atom and environmental point charge; | |
71 | 94 | int totalNumberAOs; |
72 | 95 | int totalNumberValenceElectrons; |
73 | 96 | double totalCoreMass; |
74 | 97 | void Initialize(); |
75 | 98 | void CopyInitialize(const Molecule& rhs); |
76 | - void Finalize(std::vector<MolDS_base_atoms::Atom*>** atomVect, double** xyzCOM, double** xyzCOC, double*** distanceMatrix); | |
99 | + void Finalize(std::vector<MolDS_base_atoms::Atom*>** atomVect, | |
100 | + std::vector<MolDS_base_atoms::Atom*>** epcVect, | |
101 | + double** xyzCOM, | |
102 | + double** xyzCOC, | |
103 | + double*** distanceAtoms, | |
104 | + double*** distanceEpcs, | |
105 | + double*** distanceAtomsEpcs); | |
77 | 106 | void SetMessages(); |
78 | 107 | void CalcTotalNumberValenceElectrons(); |
79 | 108 | void CalcTotalNumberAOs(); |
80 | 109 | void CalcTotalCoreMass(); |
81 | 110 | void CalcXyzCOM(); |
82 | 111 | void CalcXyzCOC(); |
83 | - void CalcDistanceMatrix(); | |
112 | + void CalcDistanceAtoms(); | |
113 | + void CalcDistanceEpcs(); | |
114 | + void CalcDistanceAtomsEpcs(); | |
84 | 115 | void CalcInertiaTensor(double** inertiaTensor, |
85 | 116 | double const* inertiaTensorOrigin); |
86 | 117 | void FreeInertiaTensorMoments(double*** inertiaTensor, |
@@ -98,8 +129,11 @@ private: | ||
98 | 129 | MolDS_base::EularAngle rotatingEularAngles)const; |
99 | 130 | void OutputTranslatingConditions(double const* translatingDifference) const; |
100 | 131 | std::string errorMessageGetAtomNull; |
132 | + std::string errorMessageGetEPCNull; | |
101 | 133 | std::string errorMessageAddAtomNull; |
134 | + std::string errorMessageAddEPCNull; | |
102 | 135 | std::string errorMessageGetNumberAtomsNull; |
136 | + std::string errorMessageGetNumberEPCsNull; | |
103 | 137 | std::string errorMessageGetXyzCOMNull; |
104 | 138 | std::string errorMessageGetXyzCOCNull; |
105 | 139 | std::string errorMessageCalcXyzCOMNull; |
@@ -111,6 +145,9 @@ private: | ||
111 | 145 | std::string messageAtomCoordinatesTitle; |
112 | 146 | std::string messageAtomMomenta; |
113 | 147 | std::string messageAtomMomentaTitle; |
148 | + std::string messageEpcConfiguration; | |
149 | + std::string messageEpcCoordinates; | |
150 | + std::string messageEpcCoordinatesTitle; | |
114 | 151 | std::string messageCOM; |
115 | 152 | std::string messageCOC; |
116 | 153 | std::string messageCOMTitle; |
@@ -47,6 +47,7 @@ public: | ||
47 | 47 | double GetBondingParameter(MolDS_base::TheoryType theory, |
48 | 48 | MolDS_base::OrbitalType orbital) const; |
49 | 49 | inline double GetCoreCharge() const{return this->coreCharge;} |
50 | + inline void SetCoreCharge(double charge) {this->coreCharge=charge;} | |
50 | 51 | inline int GetFirstAOIndex() const{return this->firstAOIndex;} |
51 | 52 | inline void SetFirstAOIndex(int firstAOIndex){this->firstAOIndex = firstAOIndex;} |
52 | 53 | inline int GetLastAOIndex() const{return this->firstAOIndex + this->valence.size()-1;} |
@@ -0,0 +1,52 @@ | ||
1 | +//************************************************************************// | |
2 | +// Copyright (C) 2011-2012 Mikiya Fujii // | |
3 | +// // | |
4 | +// This file is part of MolDS. // | |
5 | +// // | |
6 | +// MolDS is free software: you can redistribute it and/or modify // | |
7 | +// it under the terms of the GNU General Public License as published by // | |
8 | +// the Free Software Foundation, either version 3 of the License, or // | |
9 | +// (at your option) any later version. // | |
10 | +// // | |
11 | +// MolDS is distributed in the hope that it will be useful, // | |
12 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of // | |
13 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // | |
14 | +// GNU General Public License for more details. // | |
15 | +// // | |
16 | +// You should have received a copy of the GNU General Public License // | |
17 | +// along with MolDS. If not, see <http://www.gnu.org/licenses/>. // | |
18 | +//************************************************************************// | |
19 | +#include<stdio.h> | |
20 | +#include<stdlib.h> | |
21 | +#include<iostream> | |
22 | +#include<sstream> | |
23 | +#include<math.h> | |
24 | +#include<vector> | |
25 | +#include<boost/format.hpp> | |
26 | +#include"../../Enums.h" | |
27 | +#include"../../Uncopyable.h" | |
28 | +#include"../../PrintController.h" | |
29 | +#include"../../MolDSException.h" | |
30 | +#include"../../MallocerFreer.h" | |
31 | +#include"../../../mpi/MpiInt.h" | |
32 | +#include"../../../mpi/MpiProcess.h" | |
33 | +#include"../../EularAngle.h" | |
34 | +#include"../../Parameters.h" | |
35 | +#include"../../RealSphericalHarmonicsIndex.h" | |
36 | +#include"../Atom.h" | |
37 | +#include"EnvironmentalPointCharge.h" | |
38 | +using namespace std; | |
39 | +using namespace MolDS_base; | |
40 | +namespace MolDS_base_atoms_mm{ | |
41 | +EnvironmentalPointCharge::EnvironmentalPointCharge(int index) : MolDS_base_atoms::Atom(index){ | |
42 | + this->SetAtomicParameters(); | |
43 | +} | |
44 | + | |
45 | +void EnvironmentalPointCharge::SetAtomicParameters(){ | |
46 | + this->atomType = EPC; | |
47 | + this->valence.push_back(s); | |
48 | + for(int i=0; i<this->valence.size();i++){ | |
49 | + this->realSphericalHarmonicsIndeces.push_back(new RealSphericalHarmonicsIndex(this->valence[i])); | |
50 | + } | |
51 | +} | |
52 | +} |
@@ -0,0 +1,30 @@ | ||
1 | +//************************************************************************// | |
2 | +// Copyright (C) 2011-2012 Mikiya Fujii // | |
3 | +// // | |
4 | +// This file is part of MolDS. // | |
5 | +// // | |
6 | +// MolDS is free software: you can redistribute it and/or modify // | |
7 | +// it under the terms of the GNU General Public License as published by // | |
8 | +// the Free Software Foundation, either version 3 of the License, or // | |
9 | +// (at your option) any later version. // | |
10 | +// // | |
11 | +// MolDS is distributed in the hope that it will be useful, // | |
12 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of // | |
13 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // | |
14 | +// GNU General Public License for more details. // | |
15 | +// // | |
16 | +// You should have received a copy of the GNU General Public License // | |
17 | +// along with MolDS. If not, see <http://www.gnu.org/licenses/>. // | |
18 | +//************************************************************************// | |
19 | +#ifndef INCLUDED_ENVIRONMENTAL_POINT_CHARGE | |
20 | +#define INCLUDED_ENVIRONMENTAL_POINT_CHARGE | |
21 | +namespace MolDS_base_atoms_mm{ | |
22 | +class EnvironmentalPointCharge : public MolDS_base_atoms::Atom { | |
23 | +public: | |
24 | + EnvironmentalPointCharge(int index); | |
25 | +private: | |
26 | + EnvironmentalPointCharge(); | |
27 | + void SetAtomicParameters(); | |
28 | +}; | |
29 | +} | |
30 | +#endif |
@@ -38,14 +38,17 @@ | ||
38 | 38 | #include"../atoms/Natom.h" |
39 | 39 | #include"../atoms/Oatom.h" |
40 | 40 | #include"../atoms/Satom.h" |
41 | +#include"../atoms/mm/EnvironmentalPointCharge.h" | |
41 | 42 | #include"AtomFactory.h" |
42 | 43 | using namespace std; |
43 | 44 | using namespace MolDS_base; |
44 | 45 | using namespace MolDS_base_atoms; |
46 | +using namespace MolDS_base_atoms_mm; | |
45 | 47 | namespace MolDS_base_factories{ |
46 | 48 | |
47 | -string AtomFactory::errorMessageNotEnableAtom = "Error in base::AtomFactory::Create: Not Enable AtomType is set."; | |
48 | -string AtomFactory::errorMessageAtomType = "\tatom type = "; | |
49 | +string AtomFactory::errorMessageNotEnableAtom = "Error in base::AtomFactory::Create: Not Enable AtomType is set."; | |
50 | +string AtomFactory::errorMessageNotEnvironmentalPointCharge = "Error in base::AtomFactory::Create: Not Environmental point charge is set."; | |
51 | +string AtomFactory::errorMessageAtomType = "\tatom type = "; | |
49 | 52 | |
50 | 53 | Atom* AtomFactory::Create(AtomType atomType, int index, double x, double y, double z, double px, double py, double pz){ |
51 | 54 | Atom* atom=NULL; |
@@ -78,12 +81,36 @@ Atom* AtomFactory::Create(AtomType atomType, int index, double x, double y, doub | ||
78 | 81 | return atom; |
79 | 82 | } |
80 | 83 | |
84 | +Atom* AtomFactory::Create(AtomType atomType, int index, double x, double y, double z, double px, double py, double pz, double charge){ | |
85 | + Atom* atom=NULL; | |
86 | + if(atomType == EPC){ | |
87 | + atom = new EnvironmentalPointCharge(index); | |
88 | + } | |
89 | + else{ | |
90 | + stringstream ss; | |
91 | + ss << AtomFactory::errorMessageNotEnvironmentalPointCharge << endl; | |
92 | + ss << AtomFactory::errorMessageAtomType << AtomTypeStr(atomType) << endl; | |
93 | + throw MolDSException(ss.str()); | |
94 | + } | |
95 | + atom->SetXyz(x, y, z); | |
96 | + atom->SetPxyz(px, py, pz); | |
97 | + atom->SetCoreCharge(charge); | |
98 | + return atom; | |
99 | +} | |
100 | + | |
81 | 101 | Atom* AtomFactory::Create(AtomType atomType, int index, double x, double y, double z){ |
82 | 102 | double px=0.0; |
83 | 103 | double py=0.0; |
84 | 104 | double pz=0.0; |
85 | 105 | return AtomFactory::Create(atomType, index, x, y, z, px, py, pz); |
86 | 106 | } |
107 | + | |
108 | +Atom* AtomFactory::Create(AtomType atomType, int index, double x, double y, double z, double charge){ | |
109 | + double px=0.0; | |
110 | + double py=0.0; | |
111 | + double pz=0.0; | |
112 | + return AtomFactory::Create(atomType, index, x, y, z, px, py, pz, charge); | |
113 | +} | |
87 | 114 | } |
88 | 115 | |
89 | 116 |
@@ -35,11 +35,27 @@ public: | ||
35 | 35 | int index, |
36 | 36 | double x, |
37 | 37 | double y, |
38 | + double z, | |
39 | + double px, | |
40 | + double py, | |
41 | + double pz, | |
42 | + double charge); | |
43 | + static MolDS_base_atoms::Atom* Create(MolDS_base::AtomType atomType, | |
44 | + int index, | |
45 | + double x, | |
46 | + double y, | |
38 | 47 | double z); |
48 | + static MolDS_base_atoms::Atom* Create(MolDS_base::AtomType atomType, | |
49 | + int index, | |
50 | + double x, | |
51 | + double y, | |
52 | + double z, | |
53 | + double charge); | |
39 | 54 | private: |
40 | 55 | AtomFactory(); |
41 | 56 | ~AtomFactory(); |
42 | 57 | static std::string errorMessageNotEnableAtom; |
58 | + static std::string errorMessageNotEnvironmentalPointCharge; | |
43 | 59 | static std::string errorMessageAtomType; |
44 | 60 | }; |
45 | 61 |
@@ -82,7 +82,7 @@ Cndo2::Cndo2(){ | ||
82 | 82 | this->atomicElectronPopulationCIS = NULL; |
83 | 83 | this->atomicUnpairedPopulationCIS = NULL; |
84 | 84 | this->overlapAOs = NULL; |
85 | - this->twoElecTwoCore = NULL; | |
85 | + this->twoElecsTwoAtomCores = NULL; | |
86 | 86 | this->cartesianMatrix = NULL; |
87 | 87 | this->electronicTransitionDipoleMoments = NULL; |
88 | 88 | this->coreDipoleMoment = NULL; |
@@ -533,7 +533,7 @@ void Cndo2::DoSCF(bool requiresGuess){ | ||
533 | 533 | this->CalcGammaAB(this->gammaAB, *this->molecule); |
534 | 534 | this->CalcOverlapAOs(this->overlapAOs, *this->molecule); |
535 | 535 | this->CalcCartesianMatrixByGTOExpansion(this->cartesianMatrix, *this->molecule, STO6G); |
536 | - this->CalcTwoElecTwoCore(this->twoElecTwoCore, *this->molecule); | |
536 | + this->CalcTwoElecsTwoCores(this->twoElecsTwoAtomCores, *this->molecule); | |
537 | 537 | |
538 | 538 | // SCF |
539 | 539 | double rmsDensity=0.0; |
@@ -556,7 +556,7 @@ void Cndo2::DoSCF(bool requiresGuess){ | ||
556 | 556 | this->gammaAB, |
557 | 557 | this->orbitalElectronPopulation, |
558 | 558 | this->atomicElectronPopulation, |
559 | - this->twoElecTwoCore, | |
559 | + this->twoElecsTwoAtomCores, | |
560 | 560 | isGuess); |
561 | 561 | |
562 | 562 | // diagonalization of the Fock matrix |
@@ -744,8 +744,8 @@ double const* const* Cndo2::GetForce(int elecState){ | ||
744 | 744 | return this->matrixForce[0]; |
745 | 745 | } |
746 | 746 | |
747 | -void Cndo2::CalcTwoElecTwoCore(double****** twoElecTwoCore, | |
748 | - const Molecule& molecule) const{ | |
747 | +void Cndo2::CalcTwoElecsTwoCores(double****** twoElecsTwoAtomCores, | |
748 | + const Molecule& molecule) const{ | |
749 | 749 | // do nothing for CNDO, INDO, and ZINDO/S. |
750 | 750 | // two electron two core integrals are not needed for CNDO, INDO, and ZINDO/S. |
751 | 751 | } |
@@ -1214,7 +1214,7 @@ void Cndo2::CalcElecSCFEnergy(double* elecSCFEnergy, | ||
1214 | 1214 | this->gammaAB, |
1215 | 1215 | this->orbitalElectronPopulation, |
1216 | 1216 | this->atomicElectronPopulation, |
1217 | - this->twoElecTwoCore, | |
1217 | + this->twoElecsTwoAtomCores, | |
1218 | 1218 | isGuess); |
1219 | 1219 | this->CalcFockMatrix(hMatrix, |
1220 | 1220 | molecule, |
@@ -1222,7 +1222,7 @@ void Cndo2::CalcElecSCFEnergy(double* elecSCFEnergy, | ||
1222 | 1222 | this->gammaAB, |
1223 | 1223 | dammyOrbitalElectronPopulation, |
1224 | 1224 | dammyAtomicElectronPopulation, |
1225 | - this->twoElecTwoCore, | |
1225 | + this->twoElecsTwoAtomCores, | |
1226 | 1226 | isGuess); |
1227 | 1227 | |
1228 | 1228 | for(int i=0; i<totalNumberAOs; i++){ |
@@ -1386,7 +1386,7 @@ void Cndo2::CalcFockMatrix(double** fockMatrix, | ||
1386 | 1386 | double const* const* gammaAB, |
1387 | 1387 | double const* const* orbitalElectronPopulation, |
1388 | 1388 | double const* atomicElectronPopulation, |
1389 | - double const* const* const* const* const* const* twoElecTwoCore, | |
1389 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
1390 | 1390 | bool isGuess) const{ |
1391 | 1391 | int totalNumberAOs = molecule.GetTotalNumberAOs(); |
1392 | 1392 | int totalNumberAtoms = molecule.GetNumberAtoms(); |
@@ -1423,7 +1423,7 @@ void Cndo2::CalcFockMatrix(double** fockMatrix, | ||
1423 | 1423 | gammaAB, |
1424 | 1424 | orbitalElectronPopulation, |
1425 | 1425 | atomicElectronPopulation, |
1426 | - twoElecTwoCore, | |
1426 | + twoElecsTwoAtomCores, | |
1427 | 1427 | isGuess); |
1428 | 1428 | } |
1429 | 1429 | else if(mu < nu){ |
@@ -1438,7 +1438,7 @@ void Cndo2::CalcFockMatrix(double** fockMatrix, | ||
1438 | 1438 | gammaAB, |
1439 | 1439 | overlapAOs, |
1440 | 1440 | orbitalElectronPopulation, |
1441 | - twoElecTwoCore, | |
1441 | + twoElecsTwoAtomCores, | |
1442 | 1442 | isGuess); |
1443 | 1443 | } |
1444 | 1444 | else{ |
@@ -1495,7 +1495,7 @@ double Cndo2::GetFockDiagElement(const Atom& atomA, | ||
1495 | 1495 | double const* const* gammaAB, |
1496 | 1496 | double const* const* orbitalElectronPopulation, |
1497 | 1497 | double const* atomicElectronPopulation, |
1498 | - double const* const* const* const* const* const* twoElecTwoCore, | |
1498 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
1499 | 1499 | bool isGuess) const{ |
1500 | 1500 | double value; |
1501 | 1501 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -1531,7 +1531,7 @@ double Cndo2::GetFockOffDiagElement(const Atom& atomA, | ||
1531 | 1531 | double const* const* gammaAB, |
1532 | 1532 | double const* const* overlapAOs, |
1533 | 1533 | double const* const* orbitalElectronPopulation, |
1534 | - double const* const* const* const* const* const* twoElecTwoCore, | |
1534 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
1535 | 1535 | bool isGuess) const{ |
1536 | 1536 | double value; |
1537 | 1537 | double K = this->GetBondingAdjustParameterK(atomA.GetValenceShellType(), atomB.GetValenceShellType()); |
@@ -104,7 +104,7 @@ protected: | ||
104 | 104 | double** atomicElectronPopulationCIS; |
105 | 105 | double** atomicUnpairedPopulationCIS; |
106 | 106 | double** overlapAOs; // overlap integral between AOs |
107 | - double****** twoElecTwoCore; | |
107 | + double****** twoElecsTwoAtomCores; | |
108 | 108 | double*** cartesianMatrix; // cartesian matrix represented by AOs |
109 | 109 | double*** electronicTransitionDipoleMoments; // Diagnonal terms are electronic dipole moments of each eigenstates (i.e. electronicDipole[0][0][XAxis] is the x-component of the electronic dipole moment of the ground state. electronicDipole[10][10][XAxis] is the x-component of the electronic dipole moment of the 10-th excited state). Off-diagonal terms are transition dipole moments between eigenstates (i.e. electronicDipole[10][0][XAxis] is the x-component of the transition dipole moment from the ground state to 10-th excited state.). |
110 | 110 | double* coreDipoleMoment; // dipole moment of configuration. |
@@ -170,7 +170,7 @@ protected: | ||
170 | 170 | double const* const* gammaAB, |
171 | 171 | double const* const* orbitalElectronPopulation, |
172 | 172 | double const* atomicElectronPopulation, |
173 | - double const* const* const* const* const* const* twoElecTwoCore, | |
173 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
174 | 174 | bool isGuess) const; |
175 | 175 | virtual double GetFockOffDiagElement(const MolDS_base_atoms::Atom& atomA, |
176 | 176 | const MolDS_base_atoms::Atom& atomB, |
@@ -182,7 +182,7 @@ protected: | ||
182 | 182 | double const* const* gammaAB, |
183 | 183 | double const* const* overlapAOs, |
184 | 184 | double const* const* orbitalElectronPopulation, |
185 | - double const* const* const* const* const* const* twoElecTwoCore, | |
185 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
186 | 186 | bool isGuess) const; |
187 | 187 | void TransposeFockMatrixMatrix(double** transposedFockMatrix) const; |
188 | 188 | virtual void CalcDiatomicOverlapAOsInDiatomicFrame(double** diatomicOverlapAOs, |
@@ -250,8 +250,8 @@ protected: | ||
250 | 250 | const MolDS_base::Molecule& molecule, |
251 | 251 | double const* const* fockMatrix, |
252 | 252 | double const* const* gammaAB) const; |
253 | - virtual void CalcTwoElecTwoCore(double****** twoElecTwoCore, | |
254 | - const MolDS_base::Molecule& molecule) const; | |
253 | + virtual void CalcTwoElecsTwoCores(double****** twoElecsTwoAtomCores, | |
254 | + const MolDS_base::Molecule& molecule) const; | |
255 | 255 | virtual void CalcForce(const std::vector<int>& elecStates); |
256 | 256 | void CalcRotatingMatrix1stDerivatives(double*** rotMat1stDerivatives, |
257 | 257 | const MolDS_base_atoms::Atom& atomA, |
@@ -463,7 +463,7 @@ private: | ||
463 | 463 | double const* const* gammaAB, |
464 | 464 | double const* const* orbitalElectronPopulation, |
465 | 465 | double const* atomicElectronPopulation, |
466 | - double const* const* const* const* const* const* twoElecTwoCore, | |
466 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
467 | 467 | bool isGuess) const; |
468 | 468 | void RotateDiatmicOverlapAOsToSpaceFrame(double** diatomicOverlapAOs, |
469 | 469 | double const* const* rotatingMatrix, |
@@ -113,7 +113,7 @@ double Indo::GetFockDiagElement(const Atom& atomA, | ||
113 | 113 | double const* const* gammaAB, |
114 | 114 | double const* const* orbitalElectronPopulation, |
115 | 115 | double const* atomicElectronPopulation, |
116 | - double const* const* const* const* const* const* twoElecTwoCore, | |
116 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
117 | 117 | bool isGuess) const{ |
118 | 118 | double value; |
119 | 119 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -160,7 +160,7 @@ double Indo::GetFockOffDiagElement(const Atom& atomA, | ||
160 | 160 | double const* const* gammaAB, |
161 | 161 | double const* const* overlapAOs, |
162 | 162 | double const* const* orbitalElectronPopulation, |
163 | - double const* const* const* const* const* const* twoElecTwoCore, | |
163 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
164 | 164 | bool isGuess) const{ |
165 | 165 | double value; |
166 | 166 | double K = this->GetBondingAdjustParameterK(atomA.GetValenceShellType(), atomB.GetValenceShellType()); |
@@ -37,7 +37,7 @@ protected: | ||
37 | 37 | double const* const* gammaAB, |
38 | 38 | double const* const* orbitalElectronPopulation, |
39 | 39 | double const* atomicElectronPopulation, |
40 | - double const* const* const* const* const* const* twoElecTwoCore, | |
40 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
41 | 41 | bool isGuess) const; |
42 | 42 | virtual double GetFockOffDiagElement(const MolDS_base_atoms::Atom& atomA, |
43 | 43 | const MolDS_base_atoms::Atom& atomB, |
@@ -49,7 +49,7 @@ protected: | ||
49 | 49 | double const* const* gammaAB, |
50 | 50 | double const* const* overelap, |
51 | 51 | double const* const* orbitalElectronPopulation, |
52 | - double const* const* const* const* const* const* twoElecTwoCore, | |
52 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
53 | 53 | bool isGuess) const; |
54 | 54 | virtual double GetMolecularIntegralElement(int moI, int moJ, int moK, int moL, |
55 | 55 | const MolDS_base::Molecule& molecule, |
@@ -49,6 +49,7 @@ | ||
49 | 49 | #include"../base/atoms/Natom.h" |
50 | 50 | #include"../base/atoms/Oatom.h" |
51 | 51 | #include"../base/atoms/Satom.h" |
52 | +#include"../base/atoms/mm/EnvironmentalPointCharge.h" | |
52 | 53 | #include"../base/Molecule.h" |
53 | 54 | #include"../base/ElectronicStructure.h" |
54 | 55 | #include"../cndo/Cndo2.h" |
@@ -68,14 +69,14 @@ Mndo::Mndo() : MolDS_zindo::ZindoS(){ | ||
68 | 69 | this->SetMessages(); |
69 | 70 | this->SetEnableAtomTypes(); |
70 | 71 | // private variables |
71 | - this->twoElecTwoCoreMpiBuff = NULL; | |
72 | + this->twoElecsTwoAtomCoresMpiBuff = NULL; | |
72 | 73 | this->heatsFormation = 0.0; |
73 | 74 | //this->OutputLog("Mndo created\n"); |
74 | 75 | } |
75 | 76 | |
76 | 77 | Mndo::~Mndo(){ |
77 | 78 | OrbitalType twoElecLimit = dxy; |
78 | - MallocerFreer::GetInstance()->Free<double>(&this->twoElecTwoCore, | |
79 | + MallocerFreer::GetInstance()->Free<double>(&this->twoElecsTwoAtomCores, | |
79 | 80 | this->molecule->GetNumberAtoms(), |
80 | 81 | this->molecule->GetNumberAtoms(), |
81 | 82 | twoElecLimit, |
@@ -83,7 +84,7 @@ Mndo::~Mndo(){ | ||
83 | 84 | twoElecLimit, |
84 | 85 | twoElecLimit); |
85 | 86 | int numBuff = (twoElecLimit+1)*twoElecLimit/2; |
86 | - MallocerFreer::GetInstance()->Free<double>(&this->twoElecTwoCoreMpiBuff, | |
87 | + MallocerFreer::GetInstance()->Free<double>(&this->twoElecsTwoAtomCoresMpiBuff, | |
87 | 88 | this->molecule->GetNumberAtoms(), |
88 | 89 | this->molecule->GetNumberAtoms(), |
89 | 90 | numBuff, |
@@ -98,7 +99,7 @@ Mndo::~Mndo(){ | ||
98 | 99 | void Mndo::SetMolecule(Molecule* molecule){ |
99 | 100 | ZindoS::SetMolecule(molecule); |
100 | 101 | OrbitalType twoElecLimit = dxy; |
101 | - MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecTwoCore, | |
102 | + MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecsTwoAtomCores, | |
102 | 103 | molecule->GetNumberAtoms(), |
103 | 104 | molecule->GetNumberAtoms(), |
104 | 105 | twoElecLimit, |
@@ -106,7 +107,7 @@ void Mndo::SetMolecule(Molecule* molecule){ | ||
106 | 107 | twoElecLimit, |
107 | 108 | twoElecLimit); |
108 | 109 | int numBuff = (twoElecLimit+1)*twoElecLimit/2; |
109 | - MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecTwoCoreMpiBuff, | |
110 | + MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecsTwoAtomCoresMpiBuff, | |
110 | 111 | this->molecule->GetNumberAtoms(), |
111 | 112 | this->molecule->GetNumberAtoms(), |
112 | 113 | numBuff, |
@@ -145,20 +146,20 @@ void Mndo::SetMessages(){ | ||
145 | 146 | = "Error in mndo::Mndo::GetNddoRepulsionIntegral1stDerivative: Bad orbital is set.\n"; |
146 | 147 | this->errorMessageGetNddoRepulsionIntegral2ndDerivative |
147 | 148 | = "Error in mndo::Mndo::GetNddoRepulsionIntegral2ndDerivative: Bad orbital is set.\n"; |
148 | - this->errorMessageCalcTwoElecTwoCoreNullMatrix | |
149 | - = "Error in mndo::Mndo::CalcTwoElecTwoCore: The two elec two core matrix is NULL.\n"; | |
150 | - this->errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms | |
151 | - = "Error in mndo::Mndo::CalcDiatomicTwoElecTwoCore: Atom A and B is same.\n"; | |
152 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms | |
153 | - = "Error in mndo::Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives: Atom A and B is same.\n"; | |
154 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms | |
155 | - = "Error in mndo::Mndo::CalcDiatomicTwoElecTwoCore2ndDerivatives: Atom A and B is same.\n"; | |
156 | - this->errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix | |
157 | - = "Error in mndo::Mndo::CalcDiatomicTwoElecTwoCore: The two elec two core diatomic matrix is NULL.\n"; | |
158 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix | |
159 | - = "Error in mndo::Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
160 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix | |
161 | - = "Error in mndo::Mndo::CalcDiatomicTwoElecTwoCore2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
149 | + this->errorMessageCalcTwoElecsTwoCoresNullMatrix | |
150 | + = "Error in mndo::Mndo::CalcTwoElecsTwoCores: The two elec two core matrix is NULL.\n"; | |
151 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms | |
152 | + = "Error in mndo::Mndo::CalcDiatomicTwoElecsTwoCores: Atom A and B is same.\n"; | |
153 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms | |
154 | + = "Error in mndo::Mndo::CalcDiatomicTwoElecsTwoCores1stDerivatives: Atom A and B is same.\n"; | |
155 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms | |
156 | + = "Error in mndo::Mndo::CalcDiatomicTwoElecsTwoCores2ndDerivatives: Atom A and B is same.\n"; | |
157 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix | |
158 | + = "Error in mndo::Mndo::CalcDiatomicTwoElecsTwoCores: The two elec two core diatomic matrix is NULL.\n"; | |
159 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix | |
160 | + = "Error in mndo::Mndo::CalcDiatomicTwoElecsTwoCores1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
161 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix | |
162 | + = "Error in mndo::Mndo::CalcDiatomicTwoElecsTwoCores2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
162 | 163 | this->errorMessageGetElectronicEnergyEnergyNotCalculated |
163 | 164 | = "Error in mndo::Mndo::GetElectronicEnergy: Set electronic state is not calculated by CIS.\n"; |
164 | 165 | this->errorMessageGetElectronicEnergyNULLCISEnergy |
@@ -402,7 +403,7 @@ double Mndo::GetFockDiagElement(const Atom& atomA, | ||
402 | 403 | double const* const* gammaAB, |
403 | 404 | double const* const* orbitalElectronPopulation, |
404 | 405 | double const* atomicElectronPopulation, |
405 | - double const* const* const* const* const* const* twoElecTwoCore, | |
406 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
406 | 407 | bool isGuess) const{ |
407 | 408 | double value=0.0; |
408 | 409 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -432,22 +433,56 @@ double Mndo::GetFockDiagElement(const Atom& atomA, | ||
432 | 433 | for(int sigma=0; sigma<valenceSizeB; sigma++){ |
433 | 434 | temp += orbitalElectronPopulation[lambda+firstAOIndexB] |
434 | 435 | [sigma+firstAOIndexB] |
435 | - *twoElecTwoCore[indexAtomA][B][mu][mu][lambda][sigma]; | |
436 | + *twoElecsTwoAtomCores[indexAtomA][B][mu][mu][lambda][sigma]; | |
436 | 437 | } |
437 | 438 | /* |
438 | 439 | temp += MolDS_wrappers::Blas::GetInstance()->Ddot(valenceSizeB, |
439 | 440 | &orbitalElectronPopulation[lambda+firstAOIndexB][firstAOIndexB], |
440 | - &twoElecTwoCore[indexAtomA][B][mu][mu][lambda][0]); | |
441 | + &twoElecsTwoAtomCores[indexAtomA][B][mu][mu][lambda][0]); | |
441 | 442 | */ |
442 | 443 | } |
443 | 444 | temp += this->GetElectronCoreAttraction(indexAtomA, |
444 | 445 | B, |
445 | 446 | mu, |
446 | 447 | mu, |
447 | - twoElecTwoCore); | |
448 | + twoElecsTwoAtomCores); | |
448 | 449 | } |
449 | 450 | } |
450 | 451 | value += temp; |
452 | + | |
453 | + /* coulomb repulsion with point charge * | |
454 | + { | |
455 | + Atom* pointCharge = new MolDS_base_atoms_mm::EnvironmentalPointCharge(1000); | |
456 | + pointCharge->SetXyz(0.0,0.0,0.0); | |
457 | + pointCharge->SetPxyz(0.0,0.0,0.0); | |
458 | + | |
459 | + double**** diatomicTwoElecsTwoCores = NULL; | |
460 | + double* tmpDiatomicTwoElecsTwoCores = NULL; | |
461 | + double** tmpRotMat = NULL; | |
462 | + double** tmpMatrixBC = NULL; | |
463 | + double* tmpVectorBC = NULL; | |
464 | + MallocerFreer::GetInstance()->Malloc<double>(&diatomicTwoElecsTwoCores, dxy, dxy, dxy, dxy); | |
465 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpDiatomicTwoElecsTwoCores, dxy*dxy*dxy*dxy); | |
466 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
467 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
468 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
469 | + this->CalcDiatomicTwoElecsTwoCoresPointCharge(diatomicTwoElecsTwoCores, | |
470 | + tmpDiatomicTwoElecsTwoCores, | |
471 | + tmpRotMat, | |
472 | + tmpMatrixBC, | |
473 | + tmpVectorBC, | |
474 | + atomA, | |
475 | + *pointCharge); | |
476 | + value += diatomicTwoElecsTwoCores[mu][mu][s][s]; | |
477 | + MallocerFreer::GetInstance()->Free<double>(&diatomicTwoElecsTwoCores, dxy, dxy, dxy, dxy); | |
478 | + MallocerFreer::GetInstance()->Free<double>(&tmpDiatomicTwoElecsTwoCores, dxy*dxy*dxy*dxy); | |
479 | + MallocerFreer::GetInstance()->Free<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
480 | + MallocerFreer::GetInstance()->Free<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
481 | + MallocerFreer::GetInstance()->Free<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
482 | + | |
483 | + delete pointCharge; | |
484 | + } | |
485 | + */ | |
451 | 486 | } |
452 | 487 | return value; |
453 | 488 | } |
@@ -462,7 +497,7 @@ double Mndo::GetFockOffDiagElement(const Atom& atomA, | ||
462 | 497 | double const* const* gammaAB, |
463 | 498 | double const* const* overlapAOs, |
464 | 499 | double const* const* orbitalElectronPopulation, |
465 | - double const* const* const* const* const* const* twoElecTwoCore, | |
500 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
466 | 501 | bool isGuess) const{ |
467 | 502 | double value = 0.0; |
468 | 503 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -495,21 +530,54 @@ double Mndo::GetFockOffDiagElement(const Atom& atomA, | ||
495 | 530 | for(int sigma=0; sigma<valenceSizeBB; sigma++){ |
496 | 531 | temp += orbitalElectronPopulation[lambda+firstAOIndexBB] |
497 | 532 | [sigma+firstAOIndexBB] |
498 | - *twoElecTwoCore[indexAtomA][BB][mu][nu][lambda][sigma]; | |
533 | + *twoElecsTwoAtomCores[indexAtomA][BB][mu][nu][lambda][sigma]; | |
499 | 534 | } |
500 | 535 | /* |
501 | 536 | temp += MolDS_wrappers::Blas::GetInstance()->Ddot(valenceSizeBB, |
502 | 537 | &orbitalElectronPopulation[lambda+firstAOIndexBB][firstAOIndexBB], |
503 | - &twoElecTwoCore[indexAtomA][BB][mu][nu][lambda][0]); | |
538 | + &twoElecsTwoAtomCores[indexAtomA][BB][mu][nu][lambda][0]); | |
504 | 539 | */ |
505 | 540 | } |
506 | 541 | temp += this->GetElectronCoreAttraction(indexAtomA, |
507 | 542 | BB, |
508 | 543 | mu, |
509 | 544 | nu, |
510 | - twoElecTwoCore); | |
545 | + twoElecsTwoAtomCores); | |
511 | 546 | } |
512 | 547 | } |
548 | + /* coulomb repulsion with point charge * | |
549 | + { | |
550 | + Atom* pointCharge = new MolDS_base_atoms_mm::EnvironmentalPointCharge(1000); | |
551 | + pointCharge->SetXyz(0.0,0.0,0.0); | |
552 | + pointCharge->SetPxyz(0.0,0.0,0.0); | |
553 | + | |
554 | + double**** diatomicTwoElecsTwoCores = NULL; | |
555 | + double* tmpDiatomicTwoElecsTwoCores = NULL; | |
556 | + double** tmpRotMat = NULL; | |
557 | + double** tmpMatrixBC = NULL; | |
558 | + double* tmpVectorBC = NULL; | |
559 | + MallocerFreer::GetInstance()->Malloc<double>(&diatomicTwoElecsTwoCores, dxy, dxy, dxy, dxy); | |
560 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpDiatomicTwoElecsTwoCores, dxy*dxy*dxy*dxy); | |
561 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
562 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
563 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
564 | + this->CalcDiatomicTwoElecsTwoCoresPointCharge(diatomicTwoElecsTwoCores, | |
565 | + tmpDiatomicTwoElecsTwoCores, | |
566 | + tmpRotMat, | |
567 | + tmpMatrixBC, | |
568 | + tmpVectorBC, | |
569 | + atomA, | |
570 | + *pointCharge); | |
571 | + value += diatomicTwoElecsTwoCores[mu][nu][s][s]; | |
572 | + MallocerFreer::GetInstance()->Free<double>(&diatomicTwoElecsTwoCores, dxy, dxy, dxy, dxy); | |
573 | + MallocerFreer::GetInstance()->Free<double>(&tmpDiatomicTwoElecsTwoCores, dxy*dxy*dxy*dxy); | |
574 | + MallocerFreer::GetInstance()->Free<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
575 | + MallocerFreer::GetInstance()->Free<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
576 | + MallocerFreer::GetInstance()->Free<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
577 | + | |
578 | + delete pointCharge; | |
579 | + } | |
580 | + */ | |
513 | 581 | } |
514 | 582 | else{ |
515 | 583 | temp = bondParameter*overlapAOs[mu+firstAOIndexA][nu+firstAOIndexB]; |
@@ -518,15 +586,15 @@ double Mndo::GetFockOffDiagElement(const Atom& atomA, | ||
518 | 586 | for(int lambda=0; lambda<valenceSizeB; lambda++){ |
519 | 587 | //temp -= 0.5*orbitalElectronPopulation[lambda+firstAOIndexB] |
520 | 588 | // [sigma+firstAOIndexA] |
521 | - // *twoElecTwoCore[indexAtomA][indexAtomB][mu][sigma][nu][lambda]; | |
589 | + // *twoElecsTwoAtomCores[indexAtomA][indexAtomB][mu][sigma][nu][lambda]; | |
522 | 590 | temp -= 0.5*orbitalElectronPopulation[sigma+firstAOIndexA] |
523 | 591 | [lambda+firstAOIndexB] |
524 | - *twoElecTwoCore[indexAtomA][indexAtomB][mu][sigma][nu][lambda]; | |
592 | + *twoElecsTwoAtomCores[indexAtomA][indexAtomB][mu][sigma][nu][lambda]; | |
525 | 593 | } |
526 | 594 | /* |
527 | 595 | temp -= 0.5*MolDS_wrappers::Blas::GetInstance()->Ddot(valenceSizeB, |
528 | 596 | &orbitalElectronPopulation[sigma+firstAOIndexA][firstAOIndexB], |
529 | - &twoElecTwoCore[indexAtomA][indexAtomB][mu][sigma][nu][0]); | |
597 | + &twoElecsTwoAtomCores[indexAtomA][indexAtomB][mu][sigma][nu][0]); | |
530 | 598 | */ |
531 | 599 | } |
532 | 600 | } |
@@ -600,24 +668,24 @@ double Mndo::GetElectronCoreAttraction(int indexAtomA, | ||
600 | 668 | int indexAtomB, |
601 | 669 | int mu, |
602 | 670 | int nu, |
603 | - double const* const* const* const* const* const* twoElecTwoCore) const{ | |
671 | + double const* const* const* const* const* const* twoElecsTwoAtomCores) const{ | |
604 | 672 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
605 | - return -1.0*atomB.GetCoreCharge()*twoElecTwoCore[indexAtomA][indexAtomB][mu][nu][s][s]; | |
673 | + return -1.0*atomB.GetCoreCharge()*twoElecsTwoAtomCores[indexAtomA][indexAtomB][mu][nu][s][s]; | |
606 | 674 | } |
607 | 675 | |
608 | 676 | // First derivative of electron in atom A (mu and nu) and core (atom B) attraction. |
609 | 677 | // This derivative is related to the coordinate of atomA. |
610 | -// Note that diatomicTwoElecTwoCore1stDerivative is dioatomic one. | |
678 | +// Note that diatomicTwoElecsTwoCores1stDerivative is dioatomic one. | |
611 | 679 | // see Eq. (16) in [DT_1977-2] with f_2 = 0. |
612 | 680 | double Mndo::GetElectronCoreAttraction1stDerivative(int indexAtomA, |
613 | 681 | int indexAtomB, |
614 | 682 | int mu, |
615 | 683 | int nu, |
616 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivatives, | |
684 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivatives, | |
617 | 685 | CartesianType axisA) const{ |
618 | 686 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
619 | 687 | double value = -1.0*atomB.GetCoreCharge() |
620 | - *diatomicTwoElecTwoCore1stDerivatives[mu][nu][s][s][axisA]; | |
688 | + *diatomicTwoElecsTwoCores1stDerivatives[mu][nu][s][s][axisA]; | |
621 | 689 | return value; |
622 | 690 | } |
623 | 691 |
@@ -666,12 +734,12 @@ double Mndo::GetMolecularIntegralElement(int moI, int moJ, int moK, int moL, | ||
666 | 734 | for(int lambda=firstAOIndexB; lambda<=lastAOIndexB; lambda++){ |
667 | 735 | for(int sigma=lambda; sigma<=lastAOIndexB; sigma++){ |
668 | 736 | OrbitalType orbitalSigma = atomB.GetValence(sigma-firstAOIndexB); |
669 | - gamma = this->twoElecTwoCore[A] | |
670 | - [B] | |
671 | - [mu-firstAOIndexA] | |
672 | - [nu-firstAOIndexA] | |
673 | - [lambda-firstAOIndexB] | |
674 | - [sigma-firstAOIndexB]; | |
737 | + gamma = this->twoElecsTwoAtomCores[A] | |
738 | + [B] | |
739 | + [mu-firstAOIndexA] | |
740 | + [nu-firstAOIndexA] | |
741 | + [lambda-firstAOIndexB] | |
742 | + [sigma-firstAOIndexB]; | |
675 | 743 | |
676 | 744 | value += gamma*fockMatrix[moI][mu] |
677 | 745 | *fockMatrix[moJ][nu] |
@@ -821,12 +889,12 @@ void Mndo::CalcCISMatrix(double** matrixCIS) const{ | ||
821 | 889 | double tmpMuNuLamda16 = tmpMuNu12*fockMatrix[moB][lambda]; |
822 | 890 | for(int sigma=lambda; sigma<=lastAOIndexB; sigma++){ |
823 | 891 | OrbitalType orbitalSigma = atomB.GetValence(sigma-firstAOIndexB); |
824 | - gamma = this->twoElecTwoCore[A] | |
825 | - [B] | |
826 | - [mu-firstAOIndexA] | |
827 | - [nu-firstAOIndexA] | |
828 | - [lambda-firstAOIndexB] | |
829 | - [sigma-firstAOIndexB]; | |
892 | + gamma = this->twoElecsTwoAtomCores[A] | |
893 | + [B] | |
894 | + [mu-firstAOIndexA] | |
895 | + [nu-firstAOIndexA] | |
896 | + [lambda-firstAOIndexB] | |
897 | + [sigma-firstAOIndexB]; | |
830 | 898 | |
831 | 899 | value += gamma*tmpMuNuLamda01*fockMatrix[moB][sigma]; |
832 | 900 | value += gamma*tmpMuNuLamda02*fockMatrix[moI][sigma]; |
@@ -993,14 +1061,14 @@ double Mndo::GetCISCoefficientTwoElecIntegral(int k, | ||
993 | 1061 | |
994 | 1062 | void Mndo::MallocTempMatricesEachThreadCalcHessianSCF(double***** diatomicOverlapAOs1stDerivs, |
995 | 1063 | double****** diatomicOverlapAOs2ndDerivs, |
996 | - double******* diatomicTwoElecTwoCore1stDerivs, | |
997 | - double******** diatomicTwoElecTwoCore2ndDerivs, | |
1064 | + double******* diatomicTwoElecsTwoCores1stDerivs, | |
1065 | + double******** diatomicTwoElecsTwoCores2ndDerivs, | |
998 | 1066 | double*** tmpRotMat, |
999 | 1067 | double*** tmpRotMat1stDeriv, |
1000 | 1068 | double**** tmpRotMat1stDerivs, |
1001 | 1069 | double***** tmpRotMat2ndDerivs, |
1002 | - double***** tmpDiatomicTwoElecTwoCore, | |
1003 | - double****** tmpDiatomicTwoElecTwoCore1stDerivs, | |
1070 | + double***** tmpDiatomicTwoElecsTwoCores, | |
1071 | + double****** tmpDiatomicTwoElecsTwoCores1stDerivs, | |
1004 | 1072 | double*** tmpDiaOverlapAOsInDiaFrame, |
1005 | 1073 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
1006 | 1074 | double*** tmpDiaOverlapAOs2ndDerivInDiaFrame, |
@@ -1021,14 +1089,14 @@ void Mndo::MallocTempMatricesEachThreadCalcHessianSCF(double***** diatomicOve | ||
1021 | 1089 | OrbitalType_end, |
1022 | 1090 | CartesianType_end, |
1023 | 1091 | CartesianType_end); |
1024 | - MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecTwoCore1stDerivs, | |
1092 | + MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecsTwoCores1stDerivs, | |
1025 | 1093 | this->molecule->GetNumberAtoms(), |
1026 | 1094 | dxy, |
1027 | 1095 | dxy, |
1028 | 1096 | dxy, |
1029 | 1097 | dxy, |
1030 | 1098 | CartesianType_end); |
1031 | - MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecTwoCore2ndDerivs, | |
1099 | + MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecsTwoCores2ndDerivs, | |
1032 | 1100 | this->molecule->GetNumberAtoms(), |
1033 | 1101 | dxy, |
1034 | 1102 | dxy, |
@@ -1051,12 +1119,12 @@ void Mndo::MallocTempMatricesEachThreadCalcHessianSCF(double***** diatomicOve | ||
1051 | 1119 | OrbitalType_end, |
1052 | 1120 | CartesianType_end, |
1053 | 1121 | CartesianType_end); |
1054 | - MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecTwoCore, | |
1122 | + MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecsTwoCores, | |
1055 | 1123 | dxy, |
1056 | 1124 | dxy, |
1057 | 1125 | dxy, |
1058 | 1126 | dxy); |
1059 | - MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecTwoCore1stDerivs, | |
1127 | + MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecsTwoCores1stDerivs, | |
1060 | 1128 | dxy, |
1061 | 1129 | dxy, |
1062 | 1130 | dxy, |
@@ -1093,14 +1161,14 @@ void Mndo::MallocTempMatricesEachThreadCalcHessianSCF(double***** diatomicOve | ||
1093 | 1161 | |
1094 | 1162 | void Mndo::FreeTempMatricesEachThreadCalcHessianSCF(double***** diatomicOverlapAOs1stDerivs, |
1095 | 1163 | double****** diatomicOverlapAOs2ndDerivs, |
1096 | - double******* diatomicTwoElecTwoCore1stDerivs, | |
1097 | - double******** diatomicTwoElecTwoCore2ndDerivs, | |
1164 | + double******* diatomicTwoElecsTwoCores1stDerivs, | |
1165 | + double******** diatomicTwoElecsTwoCores2ndDerivs, | |
1098 | 1166 | double*** tmpRotMat, |
1099 | 1167 | double*** tmpRotMat1stDeriv, |
1100 | 1168 | double**** tmpRotMat1stDerivs, |
1101 | 1169 | double***** tmpRotMat2ndDerivs, |
1102 | - double***** tmpDiatomicTwoElecTwoCore, | |
1103 | - double****** tmpDiatomicTwoElecTwoCore1stDerivs, | |
1170 | + double***** tmpDiatomicTwoElecsTwoCores, | |
1171 | + double****** tmpDiatomicTwoElecsTwoCores1stDerivs, | |
1104 | 1172 | double*** tmpDiaOverlapAOsInDiaFrame, |
1105 | 1173 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
1106 | 1174 | double*** tmpDiaOverlapAOs2ndDerivInDiaFrame, |
@@ -1121,14 +1189,14 @@ void Mndo::FreeTempMatricesEachThreadCalcHessianSCF(double***** diatomicOverl | ||
1121 | 1189 | OrbitalType_end, |
1122 | 1190 | CartesianType_end, |
1123 | 1191 | CartesianType_end); |
1124 | - MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecTwoCore1stDerivs, | |
1192 | + MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecsTwoCores1stDerivs, | |
1125 | 1193 | this->molecule->GetNumberAtoms(), |
1126 | 1194 | dxy, |
1127 | 1195 | dxy, |
1128 | 1196 | dxy, |
1129 | 1197 | dxy, |
1130 | 1198 | CartesianType_end); |
1131 | - MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecTwoCore2ndDerivs, | |
1199 | + MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecsTwoCores2ndDerivs, | |
1132 | 1200 | this->molecule->GetNumberAtoms(), |
1133 | 1201 | dxy, |
1134 | 1202 | dxy, |
@@ -1151,12 +1219,12 @@ void Mndo::FreeTempMatricesEachThreadCalcHessianSCF(double***** diatomicOverl | ||
1151 | 1219 | OrbitalType_end, |
1152 | 1220 | CartesianType_end, |
1153 | 1221 | CartesianType_end); |
1154 | - MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecTwoCore, | |
1222 | + MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecsTwoCores, | |
1155 | 1223 | dxy, |
1156 | 1224 | dxy, |
1157 | 1225 | dxy, |
1158 | 1226 | dxy); |
1159 | - MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecTwoCore1stDerivs, | |
1227 | + MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecsTwoCores1stDerivs, | |
1160 | 1228 | dxy, |
1161 | 1229 | dxy, |
1162 | 1230 | dxy, |
@@ -1202,18 +1270,18 @@ double Mndo::GetAuxiliaryHessianElement1(int mu, | ||
1202 | 1270 | CartesianType axisA1, |
1203 | 1271 | CartesianType axisA2, |
1204 | 1272 | double const* const* orbitalElectronPopulation, |
1205 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const{ | |
1273 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{ | |
1206 | 1274 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
1207 | 1275 | const Atom& atomC = *this->molecule->GetAtom(indexAtomC); |
1208 | 1276 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
1209 | 1277 | double value = orbitalElectronPopulation[mu] |
1210 | 1278 | [nu] |
1211 | - *diatomicTwoElecTwoCore2ndDerivs[mu-firstAOIndexA] | |
1212 | - [nu-firstAOIndexA] | |
1213 | - [s] | |
1214 | - [s] | |
1215 | - [axisA1] | |
1216 | - [axisA2]; | |
1279 | + *diatomicTwoElecsTwoCores2ndDerivs[mu-firstAOIndexA] | |
1280 | + [nu-firstAOIndexA] | |
1281 | + [s] | |
1282 | + [s] | |
1283 | + [axisA1] | |
1284 | + [axisA2]; | |
1217 | 1285 | return value*atomC.GetCoreCharge(); |
1218 | 1286 | } |
1219 | 1287 |
@@ -1228,7 +1296,7 @@ double Mndo::GetAuxiliaryHessianElement2(int mu, | ||
1228 | 1296 | CartesianType axisA, |
1229 | 1297 | CartesianType axisB, |
1230 | 1298 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
1231 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
1299 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
1232 | 1300 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
1233 | 1301 | const Atom& atomC = *this->molecule->GetAtom(indexAtomC); |
1234 | 1302 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -1236,11 +1304,11 @@ double Mndo::GetAuxiliaryHessianElement2(int mu, | ||
1236 | 1304 | [nu] |
1237 | 1305 | [indexAtomB] |
1238 | 1306 | [axisB] |
1239 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
1240 | - [nu-firstAOIndexA] | |
1241 | - [s] | |
1242 | - [s] | |
1243 | - [axisA]; | |
1307 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
1308 | + [nu-firstAOIndexA] | |
1309 | + [s] | |
1310 | + [s] | |
1311 | + [axisA]; | |
1244 | 1312 | return value*atomC.GetCoreCharge(); |
1245 | 1313 | } |
1246 | 1314 |
@@ -1254,18 +1322,18 @@ double Mndo::GetAuxiliaryHessianElement3(int lambda, | ||
1254 | 1322 | CartesianType axisA1, |
1255 | 1323 | CartesianType axisA2, |
1256 | 1324 | double const* const* orbitalElectronPopulation, |
1257 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const{ | |
1325 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{ | |
1258 | 1326 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
1259 | 1327 | const Atom& atomC = *this->molecule->GetAtom(indexAtomC); |
1260 | 1328 | int firstAOIndexC = atomC.GetFirstAOIndex(); |
1261 | 1329 | double value = orbitalElectronPopulation[lambda] |
1262 | 1330 | [sigma] |
1263 | - *diatomicTwoElecTwoCore2ndDerivs[s] | |
1264 | - [s] | |
1265 | - [lambda-firstAOIndexC] | |
1266 | - [sigma-firstAOIndexC] | |
1267 | - [axisA1] | |
1268 | - [axisA2]; | |
1331 | + *diatomicTwoElecsTwoCores2ndDerivs[s] | |
1332 | + [s] | |
1333 | + [lambda-firstAOIndexC] | |
1334 | + [sigma-firstAOIndexC] | |
1335 | + [axisA1] | |
1336 | + [axisA2]; | |
1269 | 1337 | return value*atomA.GetCoreCharge(); |
1270 | 1338 | } |
1271 | 1339 |
@@ -1280,7 +1348,7 @@ double Mndo::GetAuxiliaryHessianElement4(int lambda, | ||
1280 | 1348 | CartesianType axisA, |
1281 | 1349 | CartesianType axisB, |
1282 | 1350 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
1283 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
1351 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
1284 | 1352 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
1285 | 1353 | const Atom& atomC = *this->molecule->GetAtom(indexAtomC); |
1286 | 1354 | int firstAOIndexC = atomC.GetFirstAOIndex(); |
@@ -1288,11 +1356,11 @@ double Mndo::GetAuxiliaryHessianElement4(int lambda, | ||
1288 | 1356 | [sigma] |
1289 | 1357 | [indexAtomB] |
1290 | 1358 | [axisB] |
1291 | - *diatomicTwoElecTwoCore1stDerivs[s] | |
1292 | - [s] | |
1293 | - [lambda-firstAOIndexC] | |
1294 | - [sigma-firstAOIndexC] | |
1295 | - [axisA]; | |
1359 | + *diatomicTwoElecsTwoCores1stDerivs[s] | |
1360 | + [s] | |
1361 | + [lambda-firstAOIndexC] | |
1362 | + [sigma-firstAOIndexC] | |
1363 | + [axisA]; | |
1296 | 1364 | return value*atomA.GetCoreCharge(); |
1297 | 1365 | } |
1298 | 1366 |
@@ -1365,7 +1433,7 @@ double Mndo::GetAuxiliaryHessianElement7(int mu, | ||
1365 | 1433 | CartesianType axisA1, |
1366 | 1434 | CartesianType axisA2, |
1367 | 1435 | double const* const* orbitalElectronPopulation, |
1368 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const{ | |
1436 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{ | |
1369 | 1437 | const Atom& atomA = *molecule->GetAtom(indexAtomA); |
1370 | 1438 | const Atom& atomC = *molecule->GetAtom(indexAtomC); |
1371 | 1439 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -1373,12 +1441,12 @@ double Mndo::GetAuxiliaryHessianElement7(int mu, | ||
1373 | 1441 | double temp1 = orbitalElectronPopulation[mu][nu]*orbitalElectronPopulation[lambda][sigma]; |
1374 | 1442 | double temp2 = orbitalElectronPopulation[mu][lambda]*orbitalElectronPopulation[nu][sigma]; |
1375 | 1443 | double value = (temp1 - 0.5*temp2) |
1376 | - *diatomicTwoElecTwoCore2ndDerivs[mu-firstAOIndexA] | |
1377 | - [nu-firstAOIndexA] | |
1378 | - [lambda-firstAOIndexC] | |
1379 | - [sigma-firstAOIndexC] | |
1380 | - [axisA1] | |
1381 | - [axisA2]; | |
1444 | + *diatomicTwoElecsTwoCores2ndDerivs[mu-firstAOIndexA] | |
1445 | + [nu-firstAOIndexA] | |
1446 | + [lambda-firstAOIndexC] | |
1447 | + [sigma-firstAOIndexC] | |
1448 | + [axisA1] | |
1449 | + [axisA2]; | |
1382 | 1450 | return value; |
1383 | 1451 | } |
1384 | 1452 |
@@ -1396,7 +1464,7 @@ double Mndo::GetAuxiliaryHessianElement8(int mu, | ||
1396 | 1464 | CartesianType axisB, |
1397 | 1465 | double const* const* orbitalElectronPopulation, |
1398 | 1466 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
1399 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
1467 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
1400 | 1468 | const Atom& atomA = *molecule->GetAtom(indexAtomA); |
1401 | 1469 | const Atom& atomC = *molecule->GetAtom(indexAtomC); |
1402 | 1470 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -1410,11 +1478,11 @@ double Mndo::GetAuxiliaryHessianElement8(int mu, | ||
1410 | 1478 | double temp4 = orbitalElectronPopulation [mu][lambda] |
1411 | 1479 | *orbitalElectronPopulation1stDerivs[nu][sigma] [indexAtomB][axisB]; |
1412 | 1480 | double value = ((temp1 + temp2) - 0.5*(temp3 + temp4)) |
1413 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
1414 | - [nu-firstAOIndexA] | |
1415 | - [lambda-firstAOIndexC] | |
1416 | - [sigma-firstAOIndexC] | |
1417 | - [axisA]; | |
1481 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
1482 | + [nu-firstAOIndexA] | |
1483 | + [lambda-firstAOIndexC] | |
1484 | + [sigma-firstAOIndexC] | |
1485 | + [axisA]; | |
1418 | 1486 | return value; |
1419 | 1487 | } |
1420 | 1488 |
@@ -1428,8 +1496,8 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1428 | 1496 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
1429 | 1497 | double const* const* const* const* diatomicOverlapAOs1stDerivs, |
1430 | 1498 | double const* const* const* const* const* diatomicOverlapAOs2ndDerivs, |
1431 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs, | |
1432 | - double const* const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const{ | |
1499 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs, | |
1500 | + double const* const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{ | |
1433 | 1501 | double value=0.0; |
1434 | 1502 | int indexAtomB = indexAtomA; |
1435 | 1503 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
@@ -1451,7 +1519,7 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1451 | 1519 | static_cast<CartesianType>(axisA1), |
1452 | 1520 | static_cast<CartesianType>(axisA2), |
1453 | 1521 | orbitalElectronPopulation, |
1454 | - diatomicTwoElecTwoCore2ndDerivs[indexAtomC]); | |
1522 | + diatomicTwoElecsTwoCores2ndDerivs[indexAtomC]); | |
1455 | 1523 | value -= this->GetAuxiliaryHessianElement2(mu, |
1456 | 1524 | nu, |
1457 | 1525 | indexAtomA, |
@@ -1460,7 +1528,7 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1460 | 1528 | static_cast<CartesianType>(axisA1), |
1461 | 1529 | static_cast<CartesianType>(axisA2), |
1462 | 1530 | orbitalElectronPopulation1stDerivs, |
1463 | - diatomicTwoElecTwoCore1stDerivs[indexAtomC]); | |
1531 | + diatomicTwoElecsTwoCores1stDerivs[indexAtomC]); | |
1464 | 1532 | } |
1465 | 1533 | } |
1466 | 1534 | for(int lambda=firstAOIndexC; lambda<firstAOIndexC+numberAOsC; lambda++){ |
@@ -1472,7 +1540,7 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1472 | 1540 | static_cast<CartesianType>(axisA1), |
1473 | 1541 | static_cast<CartesianType>(axisA2), |
1474 | 1542 | orbitalElectronPopulation, |
1475 | - diatomicTwoElecTwoCore2ndDerivs[indexAtomC]); | |
1543 | + diatomicTwoElecsTwoCores2ndDerivs[indexAtomC]); | |
1476 | 1544 | value -= this->GetAuxiliaryHessianElement4(lambda, |
1477 | 1545 | sigma, |
1478 | 1546 | indexAtomA, |
@@ -1481,7 +1549,7 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1481 | 1549 | static_cast<CartesianType>(axisA1), |
1482 | 1550 | static_cast<CartesianType>(axisA2), |
1483 | 1551 | orbitalElectronPopulation1stDerivs, |
1484 | - diatomicTwoElecTwoCore1stDerivs[indexAtomC]); | |
1552 | + diatomicTwoElecsTwoCores1stDerivs[indexAtomC]); | |
1485 | 1553 | } |
1486 | 1554 | } |
1487 | 1555 | for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ |
@@ -1518,7 +1586,7 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1518 | 1586 | static_cast<CartesianType>(axisA1), |
1519 | 1587 | static_cast<CartesianType>(axisA2), |
1520 | 1588 | orbitalElectronPopulation, |
1521 | - diatomicTwoElecTwoCore2ndDerivs[indexAtomC]); | |
1589 | + diatomicTwoElecsTwoCores2ndDerivs[indexAtomC]); | |
1522 | 1590 | value += this->GetAuxiliaryHessianElement8(mu, |
1523 | 1591 | nu, |
1524 | 1592 | lambda, |
@@ -1530,7 +1598,7 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA, | ||
1530 | 1598 | static_cast<CartesianType>(axisA2), |
1531 | 1599 | orbitalElectronPopulation, |
1532 | 1600 | orbitalElectronPopulation1stDerivs, |
1533 | - diatomicTwoElecTwoCore1stDerivs[indexAtomC]); | |
1601 | + diatomicTwoElecsTwoCores1stDerivs[indexAtomC]); | |
1534 | 1602 | } |
1535 | 1603 | } |
1536 | 1604 | } |
@@ -1565,8 +1633,8 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1565 | 1633 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
1566 | 1634 | double const* const* const* const* diatomicOverlapAOs1stDerivs, |
1567 | 1635 | double const* const* const* const* const* diatomicOverlapAOs2ndDerivs, |
1568 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs, | |
1569 | - double const* const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const{ | |
1636 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs, | |
1637 | + double const* const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{ | |
1570 | 1638 | double value=0.0; |
1571 | 1639 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
1572 | 1640 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
@@ -1585,7 +1653,7 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1585 | 1653 | static_cast<CartesianType>(axisA), |
1586 | 1654 | static_cast<CartesianType>(axisB), |
1587 | 1655 | orbitalElectronPopulation, |
1588 | - diatomicTwoElecTwoCore2ndDerivs[indexAtomB]); | |
1656 | + diatomicTwoElecsTwoCores2ndDerivs[indexAtomB]); | |
1589 | 1657 | } |
1590 | 1658 | } |
1591 | 1659 | for(int lambda=firstAOIndexB; lambda<=lastAOIndexB; lambda++){ |
@@ -1597,7 +1665,7 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1597 | 1665 | static_cast<CartesianType>(axisA), |
1598 | 1666 | static_cast<CartesianType>(axisB), |
1599 | 1667 | orbitalElectronPopulation, |
1600 | - diatomicTwoElecTwoCore2ndDerivs[indexAtomB]); | |
1668 | + diatomicTwoElecsTwoCores2ndDerivs[indexAtomB]); | |
1601 | 1669 | } |
1602 | 1670 | } |
1603 | 1671 | for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ |
@@ -1625,7 +1693,7 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1625 | 1693 | static_cast<CartesianType>(axisA), |
1626 | 1694 | static_cast<CartesianType>(axisB), |
1627 | 1695 | orbitalElectronPopulation, |
1628 | - diatomicTwoElecTwoCore2ndDerivs[indexAtomB]); | |
1696 | + diatomicTwoElecsTwoCores2ndDerivs[indexAtomB]); | |
1629 | 1697 | } |
1630 | 1698 | } |
1631 | 1699 | } |
@@ -1648,7 +1716,7 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1648 | 1716 | static_cast<CartesianType>(axisA), |
1649 | 1717 | static_cast<CartesianType>(axisB), |
1650 | 1718 | orbitalElectronPopulation1stDerivs, |
1651 | - diatomicTwoElecTwoCore1stDerivs[indexAtomC]); | |
1719 | + diatomicTwoElecsTwoCores1stDerivs[indexAtomC]); | |
1652 | 1720 | } |
1653 | 1721 | } |
1654 | 1722 | for(int lambda=firstAOIndexC; lambda<firstAOIndexC+numberAOsC; lambda++){ |
@@ -1661,7 +1729,7 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1661 | 1729 | static_cast<CartesianType>(axisA), |
1662 | 1730 | static_cast<CartesianType>(axisB), |
1663 | 1731 | orbitalElectronPopulation1stDerivs, |
1664 | - diatomicTwoElecTwoCore1stDerivs[indexAtomC]); | |
1732 | + diatomicTwoElecsTwoCores1stDerivs[indexAtomC]); | |
1665 | 1733 | } |
1666 | 1734 | } |
1667 | 1735 | for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){ |
@@ -1692,7 +1760,7 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA, | ||
1692 | 1760 | static_cast<CartesianType>(axisB), |
1693 | 1761 | orbitalElectronPopulation, |
1694 | 1762 | orbitalElectronPopulation1stDerivs, |
1695 | - diatomicTwoElecTwoCore1stDerivs[indexAtomC]); | |
1763 | + diatomicTwoElecsTwoCores1stDerivs[indexAtomC]); | |
1696 | 1764 | } |
1697 | 1765 | } |
1698 | 1766 | } |
@@ -1731,37 +1799,37 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{ | ||
1731 | 1799 | stringstream ompErrors; |
1732 | 1800 | #pragma omp parallel |
1733 | 1801 | { |
1734 | - double**** diatomicOverlapAOs1stDerivs = NULL; | |
1735 | - double***** diatomicOverlapAOs2ndDerivs = NULL; | |
1736 | - double****** diatomicTwoElecTwoCore1stDerivs = NULL; | |
1737 | - double******* diatomicTwoElecTwoCore2ndDerivs = NULL; | |
1738 | - double** tmpRotMat = NULL; | |
1739 | - double*** tmpRotMat1stDerivs = NULL; | |
1740 | - double**** tmpRotMat2ndDerivs = NULL; | |
1741 | - double**** tmpDiatomicTwoElecTwoCore = NULL; | |
1742 | - double***** tmpDiatomicTwoElecTwoCore1stDerivs = NULL; | |
1743 | - double** tmpDiaOverlapAOsInDiaFrame = NULL; // diatomic overlapAOs in diatomic frame | |
1744 | - double** tmpDiaOverlapAOs1stDerivInDiaFrame = NULL; // first derivative of the diaOverlapAOs. This derivative is related to the distance between two atoms. | |
1745 | - double** tmpDiaOverlapAOs2ndDerivInDiaFrame = NULL; // second derivative of the diaOverlapAOs. This derivative is related to the distance between two atoms. | |
1746 | - double*** tmpDiaOverlapAOs1stDerivs = NULL; // first derivatives of the diaOverlapAOs. This derivatives are related to the all Cartesian coordinates. | |
1747 | - double**** tmpDiaOverlapAOs2ndDerivs = NULL; //sedond derivatives of the diaOverlapAOs. This derivatives are related to the all Cartesian coordinates. | |
1748 | - double** tmpRotMat1stDeriv = NULL; | |
1749 | - double** tmpRotatedDiatomicOverlap = NULL; | |
1750 | - double* tmpRotatedDiatomicOverlapVec = NULL; // used in dgemmm | |
1751 | - double** tmpMatrixBC = NULL; // used in dgemmm | |
1752 | - double* tmpVectorBC = NULL; // used in dgemmm | |
1802 | + double**** diatomicOverlapAOs1stDerivs = NULL; | |
1803 | + double***** diatomicOverlapAOs2ndDerivs = NULL; | |
1804 | + double****** diatomicTwoElecsTwoCores1stDerivs = NULL; | |
1805 | + double******* diatomicTwoElecsTwoCores2ndDerivs = NULL; | |
1806 | + double** tmpRotMat = NULL; | |
1807 | + double*** tmpRotMat1stDerivs = NULL; | |
1808 | + double**** tmpRotMat2ndDerivs = NULL; | |
1809 | + double**** tmpDiatomicTwoElecsTwoCores = NULL; | |
1810 | + double***** tmpDiatomicTwoElecsTwoCores1stDerivs = NULL; | |
1811 | + double** tmpDiaOverlapAOsInDiaFrame = NULL; // diatomic overlapAOs in diatomic frame | |
1812 | + double** tmpDiaOverlapAOs1stDerivInDiaFrame = NULL; // first derivative of the diaOverlapAOs. This derivative is related to the distance between two atoms. | |
1813 | + double** tmpDiaOverlapAOs2ndDerivInDiaFrame = NULL; // second derivative of the diaOverlapAOs. This derivative is related to the distance between two atoms. | |
1814 | + double*** tmpDiaOverlapAOs1stDerivs = NULL; // first derivatives of the diaOverlapAOs. This derivatives are related to the all Cartesian coordinates. | |
1815 | + double**** tmpDiaOverlapAOs2ndDerivs = NULL; //sedond derivatives of the diaOverlapAOs. This derivatives are related to the all Cartesian coordinates. | |
1816 | + double** tmpRotMat1stDeriv = NULL; | |
1817 | + double** tmpRotatedDiatomicOverlap = NULL; | |
1818 | + double* tmpRotatedDiatomicOverlapVec = NULL; // used in dgemmm | |
1819 | + double** tmpMatrixBC = NULL; // used in dgemmm | |
1820 | + double* tmpVectorBC = NULL; // used in dgemmm | |
1753 | 1821 | |
1754 | 1822 | try{ |
1755 | 1823 | this->MallocTempMatricesEachThreadCalcHessianSCF(&diatomicOverlapAOs1stDerivs, |
1756 | 1824 | &diatomicOverlapAOs2ndDerivs, |
1757 | - &diatomicTwoElecTwoCore1stDerivs, | |
1758 | - &diatomicTwoElecTwoCore2ndDerivs, | |
1825 | + &diatomicTwoElecsTwoCores1stDerivs, | |
1826 | + &diatomicTwoElecsTwoCores2ndDerivs, | |
1759 | 1827 | &tmpRotMat, |
1760 | 1828 | &tmpRotMat1stDeriv, |
1761 | 1829 | &tmpRotMat1stDerivs, |
1762 | 1830 | &tmpRotMat2ndDerivs, |
1763 | - &tmpDiatomicTwoElecTwoCore, | |
1764 | - &tmpDiatomicTwoElecTwoCore1stDerivs, | |
1831 | + &tmpDiatomicTwoElecsTwoCores, | |
1832 | + &tmpDiatomicTwoElecsTwoCores1stDerivs, | |
1765 | 1833 | &tmpDiaOverlapAOsInDiaFrame, |
1766 | 1834 | &tmpDiaOverlapAOs1stDerivInDiaFrame, |
1767 | 1835 | &tmpDiaOverlapAOs2ndDerivInDiaFrame, |
@@ -1804,20 +1872,20 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{ | ||
1804 | 1872 | tmpRotMat2ndDerivs, |
1805 | 1873 | indexAtomA, |
1806 | 1874 | indexAtomB); |
1807 | - this->CalcDiatomicTwoElecTwoCore1stDerivatives(diatomicTwoElecTwoCore1stDerivs[indexAtomB], | |
1808 | - tmpRotMat, | |
1809 | - tmpRotMat1stDerivs, | |
1810 | - tmpDiatomicTwoElecTwoCore, | |
1811 | - indexAtomA, | |
1812 | - indexAtomB); | |
1813 | - this->CalcDiatomicTwoElecTwoCore2ndDerivatives(diatomicTwoElecTwoCore2ndDerivs[indexAtomB], | |
1814 | - tmpRotMat, | |
1815 | - tmpRotMat1stDerivs, | |
1816 | - tmpRotMat2ndDerivs, | |
1817 | - tmpDiatomicTwoElecTwoCore, | |
1818 | - tmpDiatomicTwoElecTwoCore1stDerivs, | |
1819 | - indexAtomA, | |
1820 | - indexAtomB); | |
1875 | + this->CalcDiatomicTwoElecsTwoCores1stDerivatives(diatomicTwoElecsTwoCores1stDerivs[indexAtomB], | |
1876 | + tmpRotMat, | |
1877 | + tmpRotMat1stDerivs, | |
1878 | + tmpDiatomicTwoElecsTwoCores, | |
1879 | + indexAtomA, | |
1880 | + indexAtomB); | |
1881 | + this->CalcDiatomicTwoElecsTwoCores2ndDerivatives(diatomicTwoElecsTwoCores2ndDerivs[indexAtomB], | |
1882 | + tmpRotMat, | |
1883 | + tmpRotMat1stDerivs, | |
1884 | + tmpRotMat2ndDerivs, | |
1885 | + tmpDiatomicTwoElecsTwoCores, | |
1886 | + tmpDiatomicTwoElecsTwoCores1stDerivs, | |
1887 | + indexAtomA, | |
1888 | + indexAtomB); | |
1821 | 1889 | } |
1822 | 1890 | } |
1823 | 1891 |
@@ -1837,8 +1905,8 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{ | ||
1837 | 1905 | orbitalElectronPopulation1stDerivs, |
1838 | 1906 | diatomicOverlapAOs1stDerivs, |
1839 | 1907 | diatomicOverlapAOs2ndDerivs, |
1840 | - diatomicTwoElecTwoCore1stDerivs, | |
1841 | - diatomicTwoElecTwoCore2ndDerivs); | |
1908 | + diatomicTwoElecsTwoCores1stDerivs, | |
1909 | + diatomicTwoElecsTwoCores2ndDerivs); | |
1842 | 1910 | if(isMassWeighted){ |
1843 | 1911 | hessianSCF[k][l] /= sqrt(atomA.GetCoreMass()*atomB.GetCoreMass()); |
1844 | 1912 | } |
@@ -1855,8 +1923,8 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{ | ||
1855 | 1923 | orbitalElectronPopulation1stDerivs, |
1856 | 1924 | diatomicOverlapAOs1stDerivs, |
1857 | 1925 | diatomicOverlapAOs2ndDerivs, |
1858 | - diatomicTwoElecTwoCore1stDerivs, | |
1859 | - diatomicTwoElecTwoCore2ndDerivs); | |
1926 | + diatomicTwoElecsTwoCores1stDerivs, | |
1927 | + diatomicTwoElecsTwoCores2ndDerivs); | |
1860 | 1928 | if(isMassWeighted){ |
1861 | 1929 | hessianSCF[k][l] /= atomA.GetCoreMass(); |
1862 | 1930 | } |
@@ -1873,14 +1941,14 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{ | ||
1873 | 1941 | } |
1874 | 1942 | this->FreeTempMatricesEachThreadCalcHessianSCF(&diatomicOverlapAOs1stDerivs, |
1875 | 1943 | &diatomicOverlapAOs2ndDerivs, |
1876 | - &diatomicTwoElecTwoCore1stDerivs, | |
1877 | - &diatomicTwoElecTwoCore2ndDerivs, | |
1944 | + &diatomicTwoElecsTwoCores1stDerivs, | |
1945 | + &diatomicTwoElecsTwoCores2ndDerivs, | |
1878 | 1946 | &tmpRotMat, |
1879 | 1947 | &tmpRotMat1stDeriv, |
1880 | 1948 | &tmpRotMat1stDerivs, |
1881 | 1949 | &tmpRotMat2ndDerivs, |
1882 | - &tmpDiatomicTwoElecTwoCore, | |
1883 | - &tmpDiatomicTwoElecTwoCore1stDerivs, | |
1950 | + &tmpDiatomicTwoElecsTwoCores, | |
1951 | + &tmpDiatomicTwoElecsTwoCores1stDerivs, | |
1884 | 1952 | &tmpDiaOverlapAOsInDiaFrame, |
1885 | 1953 | &tmpDiaOverlapAOs1stDerivInDiaFrame, |
1886 | 1954 | &tmpDiaOverlapAOs2ndDerivInDiaFrame, |
@@ -1988,12 +2056,12 @@ void Mndo::CalcOrbitalElectronPopulation1stDerivatives(double**** orbitalElectro | ||
1988 | 2056 | for(int indexAtomA=0; indexAtomA<this->molecule->GetNumberAtoms(); indexAtomA++){ |
1989 | 2057 | for(int axis=XAxis; axis<CartesianType_end; axis++){ |
1990 | 2058 | double temp=0.0; |
1991 | - printf("hoge-cphf: atom:%d axis:%s start\n ",indexAtomA,CartesianTypeStr(axis)); | |
2059 | + printf("cphf: atom:%d axis:%s start\n ",indexAtomA,CartesianTypeStr(axis)); | |
1992 | 2060 | for(int mu=0; mu<totalNumberAOs; mu++){ |
1993 | 2061 | temp += orbitalElectronPopulation1stDerivs[mu][mu][indexAtomA][axis]; |
1994 | 2062 | printf("%e\n",orbitalElectronPopulation1stDerivs[mu][mu][indexAtomA][axis]); |
1995 | 2063 | } |
1996 | - printf("hoge-cphf: atom:%d axis:%s %e\n\n",indexAtomA,CartesianTypeStr(axis),temp); | |
2064 | + printf("cphf: atom:%d axis:%s %e\n\n",indexAtomA,CartesianTypeStr(axis),temp); | |
1997 | 2065 | } |
1998 | 2066 | } |
1999 | 2067 | */ |
@@ -2070,11 +2138,11 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2070 | 2138 | CartesianType axisA) const{ |
2071 | 2139 | MallocerFreer::GetInstance()->Initialize<double>(staticFirstOrderFock, |
2072 | 2140 | nonRedundantQIndeces.size()+redundantQIndeces.size()); |
2073 | - double***** diatomicTwoElecTwoCore1stDerivs = NULL; | |
2074 | - double*** diatomicOverlapAOs1stDerivs = NULL; | |
2075 | - double** tmpRotMat = NULL; | |
2076 | - double*** tmpRotMat1stDerivs = NULL; | |
2077 | - double**** tmpDiatomicTwoElecTwoCore = NULL; | |
2141 | + double***** diatomicTwoElecsTwoCores1stDerivs = NULL; | |
2142 | + double*** diatomicOverlapAOs1stDerivs = NULL; | |
2143 | + double** tmpRotMat = NULL; | |
2144 | + double*** tmpRotMat1stDerivs = NULL; | |
2145 | + double**** tmpDiatomicTwoElecsTwoCores = NULL; | |
2078 | 2146 | |
2079 | 2147 | double** tmpDiaOverlapAOsInDiaFrame = NULL; // diatomic overlapAOs in diatomic frame |
2080 | 2148 | double** tmpDiaOverlapAOs1stDerivInDiaFrame = NULL; // first derivative of the diaOverlapAOs. This derivative is related to the distance between two atoms. |
@@ -2084,11 +2152,11 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2084 | 2152 | double** tmpMatrixBC = NULL; |
2085 | 2153 | double* tmpVectorBC = NULL; |
2086 | 2154 | try{ |
2087 | - this->MallocTempMatricesStaticFirstOrderFock(&diatomicTwoElecTwoCore1stDerivs, | |
2155 | + this->MallocTempMatricesStaticFirstOrderFock(&diatomicTwoElecsTwoCores1stDerivs, | |
2088 | 2156 | &diatomicOverlapAOs1stDerivs, |
2089 | 2157 | &tmpRotMat, |
2090 | 2158 | &tmpRotMat1stDerivs, |
2091 | - &tmpDiatomicTwoElecTwoCore); | |
2159 | + &tmpDiatomicTwoElecsTwoCores); | |
2092 | 2160 | MallocerFreer::GetInstance()->Malloc<double>(&tmpDiaOverlapAOsInDiaFrame, OrbitalType_end, OrbitalType_end); |
2093 | 2161 | MallocerFreer::GetInstance()->Malloc<double>(&tmpDiaOverlapAOs1stDerivInDiaFrame, OrbitalType_end, OrbitalType_end); |
2094 | 2162 | MallocerFreer::GetInstance()->Malloc<double>(&tmpRotMat1stDeriv, OrbitalType_end, OrbitalType_end); |
@@ -2108,11 +2176,11 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2108 | 2176 | int coreChargeB = atomB.GetCoreCharge(); |
2109 | 2177 | |
2110 | 2178 | // calc. first derivative of two elec two core interaction |
2111 | - this->CalcDiatomicTwoElecTwoCore1stDerivatives(diatomicTwoElecTwoCore1stDerivs, | |
2112 | - tmpRotMat, | |
2113 | - tmpRotMat1stDerivs, | |
2114 | - tmpDiatomicTwoElecTwoCore, | |
2115 | - indexAtomA, indexAtomB); | |
2179 | + this->CalcDiatomicTwoElecsTwoCores1stDerivatives(diatomicTwoElecsTwoCores1stDerivs, | |
2180 | + tmpRotMat, | |
2181 | + tmpRotMat1stDerivs, | |
2182 | + tmpDiatomicTwoElecsTwoCores, | |
2183 | + indexAtomA, indexAtomB); | |
2116 | 2184 | // calc. first derivative of overlapAOs. |
2117 | 2185 | this->CalcDiatomicOverlapAOs1stDerivatives(diatomicOverlapAOs1stDerivs, |
2118 | 2186 | tmpDiaOverlapAOsInDiaFrame, |
@@ -2157,22 +2225,22 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2157 | 2225 | *this->fockMatrix[moI][lambda] |
2158 | 2226 | *this->fockMatrix[moJ][mu] |
2159 | 2227 | *this->orbitalElectronPopulation[nu][sigma]; |
2160 | - staticFirstOrderFock[i] += temp1*diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
2161 | - [nu-firstAOIndexA] | |
2162 | - [lambda-firstAOIndexB] | |
2163 | - [sigma-firstAOIndexB] | |
2164 | - [axisA]; | |
2228 | + staticFirstOrderFock[i] += temp1*diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
2229 | + [nu-firstAOIndexA] | |
2230 | + [lambda-firstAOIndexB] | |
2231 | + [sigma-firstAOIndexB] | |
2232 | + [axisA]; | |
2165 | 2233 | } //sigma-loop |
2166 | 2234 | } // lambda-loop |
2167 | 2235 | |
2168 | 2236 | double temp2 = this->fockMatrix[moI][mu] |
2169 | 2237 | *this->fockMatrix[moJ][nu] |
2170 | 2238 | *coreChargeB |
2171 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
2172 | - [nu-firstAOIndexA] | |
2173 | - [s] | |
2174 | - [s] | |
2175 | - [axisA]; | |
2239 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
2240 | + [nu-firstAOIndexA] | |
2241 | + [s] | |
2242 | + [s] | |
2243 | + [axisA]; | |
2176 | 2244 | staticFirstOrderFock[i] -= temp2; |
2177 | 2245 | |
2178 | 2246 | } // nu-loop |
@@ -2184,11 +2252,11 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2184 | 2252 | double temp3 = this->fockMatrix[moI][lambda] |
2185 | 2253 | *this->fockMatrix[moJ][sigma] |
2186 | 2254 | *coreChargeA |
2187 | - *diatomicTwoElecTwoCore1stDerivs[s] | |
2188 | - [s] | |
2189 | - [lambda-firstAOIndexB] | |
2190 | - [sigma-firstAOIndexB] | |
2191 | - [axisA]; | |
2255 | + *diatomicTwoElecsTwoCores1stDerivs[s] | |
2256 | + [s] | |
2257 | + [lambda-firstAOIndexB] | |
2258 | + [sigma-firstAOIndexB] | |
2259 | + [axisA]; | |
2192 | 2260 | staticFirstOrderFock[i] -= temp3; |
2193 | 2261 | |
2194 | 2262 | } //sigma-loop |
@@ -2216,11 +2284,11 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2216 | 2284 | } |
2217 | 2285 | } |
2218 | 2286 | catch(MolDSException ex){ |
2219 | - this->FreeTempMatricesStaticFirstOrderFock(&diatomicTwoElecTwoCore1stDerivs, | |
2287 | + this->FreeTempMatricesStaticFirstOrderFock(&diatomicTwoElecsTwoCores1stDerivs, | |
2220 | 2288 | &diatomicOverlapAOs1stDerivs, |
2221 | 2289 | &tmpRotMat, |
2222 | 2290 | &tmpRotMat1stDerivs, |
2223 | - &tmpDiatomicTwoElecTwoCore); | |
2291 | + &tmpDiatomicTwoElecsTwoCores); | |
2224 | 2292 | MallocerFreer::GetInstance()->Free<double>(&tmpDiaOverlapAOsInDiaFrame, OrbitalType_end, OrbitalType_end); |
2225 | 2293 | MallocerFreer::GetInstance()->Free<double>(&tmpDiaOverlapAOs1stDerivInDiaFrame, OrbitalType_end, OrbitalType_end); |
2226 | 2294 | //MallocerFreer::GetInstance()->Free<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); |
@@ -2232,11 +2300,11 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2232 | 2300 | MallocerFreer::GetInstance()->Free<double>(&tmpVectorBC, OrbitalType_end*OrbitalType_end); |
2233 | 2301 | throw ex; |
2234 | 2302 | } |
2235 | - this->FreeTempMatricesStaticFirstOrderFock(&diatomicTwoElecTwoCore1stDerivs, | |
2303 | + this->FreeTempMatricesStaticFirstOrderFock(&diatomicTwoElecsTwoCores1stDerivs, | |
2236 | 2304 | &diatomicOverlapAOs1stDerivs, |
2237 | 2305 | &tmpRotMat, |
2238 | 2306 | &tmpRotMat1stDerivs, |
2239 | - &tmpDiatomicTwoElecTwoCore); | |
2307 | + &tmpDiatomicTwoElecsTwoCores); | |
2240 | 2308 | MallocerFreer::GetInstance()->Free<double>(&tmpDiaOverlapAOsInDiaFrame, OrbitalType_end, OrbitalType_end); |
2241 | 2309 | MallocerFreer::GetInstance()->Free<double>(&tmpDiaOverlapAOs1stDerivInDiaFrame, OrbitalType_end, OrbitalType_end); |
2242 | 2310 | //MallocerFreer::GetInstance()->Free<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); |
@@ -2255,12 +2323,12 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock, | ||
2255 | 2323 | */ |
2256 | 2324 | } |
2257 | 2325 | |
2258 | -void Mndo::MallocTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecTwoCore1stDeriv, | |
2326 | +void Mndo::MallocTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecsTwoCores1stDeriv, | |
2259 | 2327 | double**** diatomicOverlapAOs1stDeriv, |
2260 | 2328 | double*** tmpRotMat, |
2261 | 2329 | double**** tmpRotMat1stDerivs, |
2262 | - double***** tmpDiatomicTwoElecTwoCore)const{ | |
2263 | - MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecTwoCore1stDeriv, | |
2330 | + double***** tmpDiatomicTwoElecsTwoCores)const{ | |
2331 | + MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecsTwoCores1stDeriv, | |
2264 | 2332 | dxy, |
2265 | 2333 | dxy, |
2266 | 2334 | dxy, |
@@ -2277,19 +2345,19 @@ void Mndo::MallocTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecTw | ||
2277 | 2345 | OrbitalType_end, |
2278 | 2346 | OrbitalType_end, |
2279 | 2347 | CartesianType_end); |
2280 | - MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecTwoCore, | |
2348 | + MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecsTwoCores, | |
2281 | 2349 | dxy, |
2282 | 2350 | dxy, |
2283 | 2351 | dxy, |
2284 | 2352 | dxy); |
2285 | 2353 | } |
2286 | 2354 | |
2287 | -void Mndo::FreeTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecTwoCore1stDeriv, | |
2355 | +void Mndo::FreeTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecsTwoCores1stDeriv, | |
2288 | 2356 | double**** diatomicOverlapAOs1stDeriv, |
2289 | 2357 | double*** tmpRotMat, |
2290 | 2358 | double**** tmpRotMat1stDerivs, |
2291 | - double***** tmpDiatomicTwoElecTwoCore)const{ | |
2292 | - MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecTwoCore1stDeriv, | |
2359 | + double***** tmpDiatomicTwoElecsTwoCores)const{ | |
2360 | + MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecsTwoCores1stDeriv, | |
2293 | 2361 | dxy, |
2294 | 2362 | dxy, |
2295 | 2363 | dxy, |
@@ -2306,7 +2374,7 @@ void Mndo::FreeTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecTwoC | ||
2306 | 2374 | OrbitalType_end, |
2307 | 2375 | OrbitalType_end, |
2308 | 2376 | CartesianType_end); |
2309 | - MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecTwoCore, | |
2377 | + MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecsTwoCores, | |
2310 | 2378 | dxy, |
2311 | 2379 | dxy, |
2312 | 2380 | dxy, |
@@ -2405,7 +2473,7 @@ void Mndo::FreeTempMatricesSolveCPHF(double*** matrixCPHF, | ||
2405 | 2473 | void Mndo::CalcForceSCFElecCoreAttractionPart(double* force, |
2406 | 2474 | int indexAtomA, |
2407 | 2475 | int indexAtomB, |
2408 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
2476 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
2409 | 2477 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
2410 | 2478 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
2411 | 2479 | int lastAOIndexA = atomA.GetLastAOIndex(); |
@@ -2418,7 +2486,7 @@ void Mndo::CalcForceSCFElecCoreAttractionPart(double* force, | ||
2418 | 2486 | indexAtomB, |
2419 | 2487 | mu-firstAOIndexA, |
2420 | 2488 | nu-firstAOIndexA, |
2421 | - diatomicTwoElecTwoCore1stDerivs, | |
2489 | + diatomicTwoElecsTwoCores1stDerivs, | |
2422 | 2490 | (CartesianType)i); |
2423 | 2491 | } |
2424 | 2492 | } |
@@ -2457,7 +2525,7 @@ void Mndo::CalcForceSCFOverlapAOsPart(double* force, | ||
2457 | 2525 | void Mndo::CalcForceSCFTwoElecPart(double* force, |
2458 | 2526 | int indexAtomA, |
2459 | 2527 | int indexAtomB, |
2460 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
2528 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
2461 | 2529 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
2462 | 2530 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
2463 | 2531 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -2472,19 +2540,19 @@ void Mndo::CalcForceSCFTwoElecPart(double* force, | ||
2472 | 2540 | force[i] -= 0.5 |
2473 | 2541 | *this->orbitalElectronPopulation[mu][nu] |
2474 | 2542 | *this->orbitalElectronPopulation[lambda][sigma] |
2475 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
2476 | - [nu-firstAOIndexA] | |
2477 | - [lambda-firstAOIndexB] | |
2478 | - [sigma-firstAOIndexB] | |
2479 | - [(CartesianType)i]; | |
2543 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
2544 | + [nu-firstAOIndexA] | |
2545 | + [lambda-firstAOIndexB] | |
2546 | + [sigma-firstAOIndexB] | |
2547 | + [(CartesianType)i]; | |
2480 | 2548 | force[i] += 0.25 |
2481 | 2549 | *this->orbitalElectronPopulation[mu][lambda] |
2482 | 2550 | *this->orbitalElectronPopulation[nu][sigma] |
2483 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
2484 | - [nu-firstAOIndexA] | |
2485 | - [lambda-firstAOIndexB] | |
2486 | - [sigma-firstAOIndexB] | |
2487 | - [(CartesianType)i]; | |
2551 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
2552 | + [nu-firstAOIndexA] | |
2553 | + [lambda-firstAOIndexB] | |
2554 | + [sigma-firstAOIndexB] | |
2555 | + [(CartesianType)i]; | |
2488 | 2556 | } |
2489 | 2557 | } |
2490 | 2558 | } |
@@ -2496,7 +2564,7 @@ void Mndo::CalcForceExcitedStaticPart(double* force, | ||
2496 | 2564 | int elecStateIndex, |
2497 | 2565 | int indexAtomA, |
2498 | 2566 | int indexAtomB, |
2499 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
2567 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
2500 | 2568 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
2501 | 2569 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
2502 | 2570 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -2513,11 +2581,11 @@ void Mndo::CalcForceExcitedStaticPart(double* force, | ||
2513 | 2581 | -1.0*this->etaMatrixForce[elecStateIndex][mu][lambda] |
2514 | 2582 | *this->etaMatrixForce[elecStateIndex][nu][sigma]; |
2515 | 2583 | force[i] += temp |
2516 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
2517 | - [nu-firstAOIndexA] | |
2518 | - [lambda-firstAOIndexB] | |
2519 | - [sigma-firstAOIndexB] | |
2520 | - [i]; | |
2584 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
2585 | + [nu-firstAOIndexA] | |
2586 | + [lambda-firstAOIndexB] | |
2587 | + [sigma-firstAOIndexB] | |
2588 | + [i]; | |
2521 | 2589 | } |
2522 | 2590 | } |
2523 | 2591 | } |
@@ -2529,7 +2597,7 @@ void Mndo::CalcForceExcitedElecCoreAttractionPart(double* force, | ||
2529 | 2597 | int elecStateIndex, |
2530 | 2598 | int indexAtomA, |
2531 | 2599 | int indexAtomB, |
2532 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
2600 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
2533 | 2601 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
2534 | 2602 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
2535 | 2603 | int lastAOIndexA = atomA.GetLastAOIndex(); |
@@ -2542,7 +2610,7 @@ void Mndo::CalcForceExcitedElecCoreAttractionPart(double* force, | ||
2542 | 2610 | indexAtomB, |
2543 | 2611 | mu-firstAOIndexA, |
2544 | 2612 | nu-firstAOIndexA, |
2545 | - diatomicTwoElecTwoCore1stDerivs, | |
2613 | + diatomicTwoElecsTwoCores1stDerivs, | |
2546 | 2614 | (CartesianType)i); |
2547 | 2615 | } |
2548 | 2616 | } |
@@ -2553,7 +2621,7 @@ void Mndo::CalcForceExcitedTwoElecPart(double* force, | ||
2553 | 2621 | int elecStateIndex, |
2554 | 2622 | int indexAtomA, |
2555 | 2623 | int indexAtomB, |
2556 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
2624 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
2557 | 2625 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
2558 | 2626 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
2559 | 2627 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -2567,19 +2635,19 @@ void Mndo::CalcForceExcitedTwoElecPart(double* force, | ||
2567 | 2635 | for(int i=0; i<CartesianType_end; i++){ |
2568 | 2636 | force[i] -= this->zMatrixForce[elecStateIndex][mu][nu] |
2569 | 2637 | *this->orbitalElectronPopulation[lambda][sigma] |
2570 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
2571 | - [nu-firstAOIndexA] | |
2572 | - [lambda-firstAOIndexB] | |
2573 | - [sigma-firstAOIndexB] | |
2574 | - [i]; | |
2638 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
2639 | + [nu-firstAOIndexA] | |
2640 | + [lambda-firstAOIndexB] | |
2641 | + [sigma-firstAOIndexB] | |
2642 | + [i]; | |
2575 | 2643 | force[i] += 0.50 |
2576 | 2644 | *this->zMatrixForce[elecStateIndex][mu][lambda] |
2577 | 2645 | *this->orbitalElectronPopulation[nu][sigma] |
2578 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
2579 | - [nu-firstAOIndexA] | |
2580 | - [lambda-firstAOIndexB] | |
2581 | - [sigma-firstAOIndexB] | |
2582 | - [(CartesianType)i]; | |
2646 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
2647 | + [nu-firstAOIndexA] | |
2648 | + [lambda-firstAOIndexB] | |
2649 | + [sigma-firstAOIndexB] | |
2650 | + [(CartesianType)i]; | |
2583 | 2651 | } |
2584 | 2652 | } |
2585 | 2653 | } |
@@ -2608,10 +2676,10 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2608 | 2676 | #pragma omp parallel |
2609 | 2677 | { |
2610 | 2678 | double*** diatomicOverlapAOs1stDerivs = NULL; |
2611 | - double***** diatomicTwoElecTwoCore1stDerivs = NULL; | |
2612 | - double** tmpRotMat = NULL; | |
2613 | - double*** tmpRotMat1stDerivs = NULL; | |
2614 | - double**** tmpDiatomicTwoElecTwoCore = NULL; | |
2679 | + double***** diatomicTwoElecsTwoCores1stDerivs = NULL; | |
2680 | + double** tmpRotMat = NULL; | |
2681 | + double*** tmpRotMat1stDerivs = NULL; | |
2682 | + double**** tmpDiatomicTwoElecsTwoCores = NULL; | |
2615 | 2683 | |
2616 | 2684 | double** tmpDiaOverlapAOsInDiaFrame = NULL; // diatomic overlapAOs in diatomic frame |
2617 | 2685 | double** tmpDiaOverlapAOs1stDerivInDiaFrame = NULL; // first derivative of the diaOverlapAOs. This derivative is related to the distance between two atoms. |
@@ -2622,7 +2690,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2622 | 2690 | double* tmpVectorBC = NULL; // used in dgemmm |
2623 | 2691 | try{ |
2624 | 2692 | this->MallocTempMatricesCalcForce(&diatomicOverlapAOs1stDerivs, |
2625 | - &diatomicTwoElecTwoCore1stDerivs, | |
2693 | + &diatomicTwoElecsTwoCores1stDerivs, | |
2626 | 2694 | &tmpDiaOverlapAOsInDiaFrame, |
2627 | 2695 | &tmpDiaOverlapAOs1stDerivInDiaFrame, |
2628 | 2696 | &tmpRotMat, |
@@ -2632,7 +2700,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2632 | 2700 | &tmpRotatedDiatomicOverlapVec, |
2633 | 2701 | &tmpMatrixBC, |
2634 | 2702 | &tmpVectorBC, |
2635 | - &tmpDiatomicTwoElecTwoCore); | |
2703 | + &tmpDiatomicTwoElecsTwoCores); | |
2636 | 2704 | |
2637 | 2705 | #pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) |
2638 | 2706 | for(int b=0; b<this->molecule->GetNumberAtoms(); b++){ |
@@ -2655,11 +2723,11 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2655 | 2723 | atomA, |
2656 | 2724 | atomB); |
2657 | 2725 | // calc. first derivative of two elec two core interaction |
2658 | - this->CalcDiatomicTwoElecTwoCore1stDerivatives(diatomicTwoElecTwoCore1stDerivs, | |
2659 | - tmpRotMat, | |
2660 | - tmpRotMat1stDerivs, | |
2661 | - tmpDiatomicTwoElecTwoCore, | |
2662 | - a, b); | |
2726 | + this->CalcDiatomicTwoElecsTwoCores1stDerivatives(diatomicTwoElecsTwoCores1stDerivs, | |
2727 | + tmpRotMat, | |
2728 | + tmpRotMat1stDerivs, | |
2729 | + tmpDiatomicTwoElecsTwoCores, | |
2730 | + a, b); | |
2663 | 2731 | |
2664 | 2732 | // core repulsion part |
2665 | 2733 | double coreRepulsion[CartesianType_end] = {0.0,0.0,0.0}; |
@@ -2676,7 +2744,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2676 | 2744 | this->CalcForceSCFElecCoreAttractionPart(forceElecCoreAttPart, |
2677 | 2745 | a, |
2678 | 2746 | b, |
2679 | - diatomicTwoElecTwoCore1stDerivs); | |
2747 | + diatomicTwoElecsTwoCores1stDerivs); | |
2680 | 2748 | // overlapAOs part (ground state) |
2681 | 2749 | double forceOverlapAOsPart[CartesianType_end] = {0.0,0.0,0.0}; |
2682 | 2750 | this->CalcForceSCFOverlapAOsPart(forceOverlapAOsPart, |
@@ -2688,7 +2756,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2688 | 2756 | this->CalcForceSCFTwoElecPart(forceTwoElecPart, |
2689 | 2757 | a, |
2690 | 2758 | b, |
2691 | - diatomicTwoElecTwoCore1stDerivs); | |
2759 | + diatomicTwoElecsTwoCores1stDerivs); | |
2692 | 2760 | // sum up contributions from each part (ground state) |
2693 | 2761 | #pragma omp critical |
2694 | 2762 | { |
@@ -2713,7 +2781,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2713 | 2781 | n, |
2714 | 2782 | a, |
2715 | 2783 | b, |
2716 | - diatomicTwoElecTwoCore1stDerivs); | |
2784 | + diatomicTwoElecsTwoCores1stDerivs); | |
2717 | 2785 | // sum up contributions from static part (excited state) |
2718 | 2786 | #pragma omp critical |
2719 | 2787 | { |
@@ -2731,7 +2799,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2731 | 2799 | n, |
2732 | 2800 | a, |
2733 | 2801 | b, |
2734 | - diatomicTwoElecTwoCore1stDerivs); | |
2802 | + diatomicTwoElecsTwoCores1stDerivs); | |
2735 | 2803 | // overlapAOs part (excited states) |
2736 | 2804 | double forceExcitedOverlapAOsPart[CartesianType_end] = {0.0,0.0,0.0}; |
2737 | 2805 | this->CalcForceExcitedOverlapAOsPart(forceExcitedOverlapAOsPart, |
@@ -2745,7 +2813,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2745 | 2813 | n, |
2746 | 2814 | a, |
2747 | 2815 | b, |
2748 | - diatomicTwoElecTwoCore1stDerivs); | |
2816 | + diatomicTwoElecsTwoCores1stDerivs); | |
2749 | 2817 | // sum up contributions from response part (excited state) |
2750 | 2818 | #pragma omp critical |
2751 | 2819 | { |
@@ -2767,7 +2835,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2767 | 2835 | ex.Serialize(ompErrors); |
2768 | 2836 | } |
2769 | 2837 | this->FreeTempMatricesCalcForce(&diatomicOverlapAOs1stDerivs, |
2770 | - &diatomicTwoElecTwoCore1stDerivs, | |
2838 | + &diatomicTwoElecsTwoCores1stDerivs, | |
2771 | 2839 | &tmpDiaOverlapAOsInDiaFrame, |
2772 | 2840 | &tmpDiaOverlapAOs1stDerivInDiaFrame, |
2773 | 2841 | &tmpRotMat, |
@@ -2777,7 +2845,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2777 | 2845 | &tmpRotatedDiatomicOverlapVec, |
2778 | 2846 | &tmpMatrixBC, |
2779 | 2847 | &tmpVectorBC, |
2780 | - &tmpDiatomicTwoElecTwoCore); | |
2848 | + &tmpDiatomicTwoElecsTwoCores); | |
2781 | 2849 | } // end of omp-parallelized region |
2782 | 2850 | // Exception throwing for omp-region |
2783 | 2851 | if(!ompErrors.str().empty()){ |
@@ -2791,7 +2859,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){ | ||
2791 | 2859 | } |
2792 | 2860 | |
2793 | 2861 | void Mndo::MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
2794 | - double****** diatomicTwoElecTwoCore1stDerivs, | |
2862 | + double****** diatomicTwoElecsTwoCores1stDerivs, | |
2795 | 2863 | double*** tmpDiaOverlapAOsInDiaFrame, |
2796 | 2864 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
2797 | 2865 | double*** tmpRotMat, |
@@ -2801,12 +2869,12 @@ void Mndo::MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
2801 | 2869 | double** tmpRotatedDiatomicOverlapVec, |
2802 | 2870 | double*** tmpMatrixBC, |
2803 | 2871 | double** tmpVectorBC, |
2804 | - double***** tmpDiatomicTwoElecTwoCore) const{ | |
2872 | + double***** tmpDiatomicTwoElecsTwoCores) const{ | |
2805 | 2873 | MallocerFreer::GetInstance()->Malloc<double>(diatomicOverlapAOs1stDerivs, |
2806 | 2874 | OrbitalType_end, |
2807 | 2875 | OrbitalType_end, |
2808 | 2876 | CartesianType_end); |
2809 | - MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecTwoCore1stDerivs, | |
2877 | + MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecsTwoCores1stDerivs, | |
2810 | 2878 | dxy, |
2811 | 2879 | dxy, |
2812 | 2880 | dxy, |
@@ -2838,7 +2906,7 @@ void Mndo::MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
2838 | 2906 | OrbitalType_end); |
2839 | 2907 | MallocerFreer::GetInstance()->Malloc<double>(tmpVectorBC, |
2840 | 2908 | OrbitalType_end*OrbitalType_end); |
2841 | - MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecTwoCore, | |
2909 | + MallocerFreer::GetInstance()->Malloc<double>(tmpDiatomicTwoElecsTwoCores, | |
2842 | 2910 | dxy, |
2843 | 2911 | dxy, |
2844 | 2912 | dxy, |
@@ -2846,7 +2914,7 @@ void Mndo::MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
2846 | 2914 | } |
2847 | 2915 | |
2848 | 2916 | void Mndo::FreeTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
2849 | - double****** diatomicTwoElecTwoCore1stDerivs, | |
2917 | + double****** diatomicTwoElecsTwoCores1stDerivs, | |
2850 | 2918 | double*** tmpDiaOverlapAOsInDiaFrame, |
2851 | 2919 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
2852 | 2920 | double*** tmpRotMat, |
@@ -2856,12 +2924,12 @@ void Mndo::FreeTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
2856 | 2924 | double** tmpRotatedDiatomicOverlapVec, |
2857 | 2925 | double*** tmpMatrixBC, |
2858 | 2926 | double** tmpVectorBC, |
2859 | - double***** tmpDiatomicTwoElecTwoCore) const{ | |
2927 | + double***** tmpDiatomicTwoElecsTwoCores) const{ | |
2860 | 2928 | MallocerFreer::GetInstance()->Free<double>(diatomicOverlapAOs1stDerivs, |
2861 | 2929 | OrbitalType_end, |
2862 | 2930 | OrbitalType_end, |
2863 | 2931 | CartesianType_end); |
2864 | - MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecTwoCore1stDerivs, | |
2932 | + MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecsTwoCores1stDerivs, | |
2865 | 2933 | dxy, |
2866 | 2934 | dxy, |
2867 | 2935 | dxy, |
@@ -2893,7 +2961,7 @@ void Mndo::FreeTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
2893 | 2961 | OrbitalType_end); |
2894 | 2962 | MallocerFreer::GetInstance()->Free<double>(tmpVectorBC, |
2895 | 2963 | OrbitalType_end*OrbitalType_end); |
2896 | - MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecTwoCore, | |
2964 | + MallocerFreer::GetInstance()->Free<double>(tmpDiatomicTwoElecsTwoCores, | |
2897 | 2965 | dxy, |
2898 | 2966 | dxy, |
2899 | 2967 | dxy, |
@@ -2926,12 +2994,12 @@ double Mndo::GetSmallQElement(int moI, | ||
2926 | 2994 | for(int lambda=firstAOIndexB; lambda<=lastAOIndexB; lambda++){ |
2927 | 2995 | for(int sigma=lambda; sigma<=lastAOIndexB; sigma++){ |
2928 | 2996 | double twoElecInt = 0.0; |
2929 | - twoElecInt = this->twoElecTwoCore[A] | |
2930 | - [B] | |
2931 | - [mu-firstAOIndexA] | |
2932 | - [nu-firstAOIndexA] | |
2933 | - [lambda-firstAOIndexB] | |
2934 | - [sigma-firstAOIndexB]; | |
2997 | + twoElecInt = this->twoElecsTwoAtomCores[A] | |
2998 | + [B] | |
2999 | + [mu-firstAOIndexA] | |
3000 | + [nu-firstAOIndexA] | |
3001 | + [lambda-firstAOIndexB] | |
3002 | + [sigma-firstAOIndexB]; | |
2935 | 3003 | double temp = 0.0; |
2936 | 3004 | if(isMoPOcc){ |
2937 | 3005 | int p = numberOcc - (moP+1); |
@@ -3201,7 +3269,7 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{ | ||
3201 | 3269 | } |
3202 | 3270 | double gamma = 0.0; |
3203 | 3271 | if(A!=B){ |
3204 | - gamma = this->twoElecTwoCore[A][B][muOffSet][nuOffSet][lambdaOffSet][sigmaOffSet]; | |
3272 | + gamma = this->twoElecsTwoAtomCores[A][B][muOffSet][nuOffSet][lambdaOffSet][sigmaOffSet]; | |
3205 | 3273 | } |
3206 | 3274 | else{ |
3207 | 3275 | if(mu==nu && lambda==sigma){ |
@@ -3289,12 +3357,12 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{ | ||
3289 | 3357 | for(int sigma=firstAOIndexB; sigma<=lastAOIndexB; sigma++){ |
3290 | 3358 | twoElec[A*dxy*dxy+(mu-firstAOIndexA)*dxy+(nu-firstAOIndexA)] |
3291 | 3359 | [B*dxy*dxy+(lambda-firstAOIndexB)*dxy+(sigma-firstAOIndexB)] = |
3292 | - this->twoElecTwoCore[A] | |
3293 | - [B] | |
3294 | - [mu-firstAOIndexA] | |
3295 | - [nu-firstAOIndexA] | |
3296 | - [lambda-firstAOIndexB] | |
3297 | - [sigma-firstAOIndexB]; | |
3360 | + this->twoElecsTwoAtomCores[A] | |
3361 | + [B] | |
3362 | + [mu-firstAOIndexA] | |
3363 | + [nu-firstAOIndexA] | |
3364 | + [lambda-firstAOIndexB] | |
3365 | + [sigma-firstAOIndexB]; | |
3298 | 3366 | } |
3299 | 3367 | } |
3300 | 3368 | } |
@@ -3411,12 +3479,12 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{ | ||
3411 | 3479 | for(int sigma=firstAOIndexB; sigma<=lastAOIndexB; sigma++){ |
3412 | 3480 | twoElec[A*dxy*dxy+(mu-firstAOIndexA)*dxy+(nu-firstAOIndexA)] |
3413 | 3481 | [B*dxy*dxy+(lambda-firstAOIndexB)*dxy+(sigma-firstAOIndexB)] = |
3414 | - this->twoElecTwoCore[A] | |
3415 | - [B] | |
3416 | - [mu-firstAOIndexA] | |
3417 | - [nu-firstAOIndexA] | |
3418 | - [lambda-firstAOIndexB] | |
3419 | - [sigma-firstAOIndexB]; | |
3482 | + this->twoElecsTwoAtomCores[A] | |
3483 | + [B] | |
3484 | + [mu-firstAOIndexA] | |
3485 | + [nu-firstAOIndexA] | |
3486 | + [lambda-firstAOIndexB] | |
3487 | + [sigma-firstAOIndexB]; | |
3420 | 3488 | } |
3421 | 3489 | } |
3422 | 3490 | } |
@@ -3486,15 +3554,15 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{ | ||
3486 | 3554 | return value; |
3487 | 3555 | } |
3488 | 3556 | |
3489 | -void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | |
3557 | +void Mndo::CalcTwoElecsTwoCores(double****** twoElecsTwoAtomCores, | |
3490 | 3558 | const Molecule& molecule) const{ |
3491 | 3559 | #ifdef MOLDS_DBG |
3492 | - if(twoElecTwoCore == NULL){ | |
3493 | - throw MolDSException(this->errorMessageCalcTwoElecTwoCoreNullMatrix); | |
3560 | + if(twoElecsTwoAtomCores == NULL){ | |
3561 | + throw MolDSException(this->errorMessageCalcTwoElecsTwoCoresNullMatrix); | |
3494 | 3562 | } |
3495 | 3563 | #endif |
3496 | 3564 | int totalNumberAtoms = molecule.GetNumberAtoms(); |
3497 | - MallocerFreer::GetInstance()->Initialize<double>(twoElecTwoCore, | |
3565 | + MallocerFreer::GetInstance()->Initialize<double>(twoElecsTwoAtomCores, | |
3498 | 3566 | totalNumberAtoms, |
3499 | 3567 | totalNumberAtoms, |
3500 | 3568 | dxy, dxy, dxy, dxy); |
@@ -3512,34 +3580,34 @@ void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | ||
3512 | 3580 | if(mpiRank == calcRank){ |
3513 | 3581 | #pragma omp parallel |
3514 | 3582 | { |
3515 | - double**** diatomicTwoElecTwoCore = NULL; | |
3516 | - double* tmpDiatomicTwoElecTwoCore = NULL; | |
3517 | - double** tmpRotMat = NULL; | |
3518 | - double** tmpMatrixBC = NULL; | |
3519 | - double* tmpVectorBC = NULL; | |
3583 | + double**** diatomicTwoElecsTwoCores = NULL; | |
3584 | + double* tmpDiatomicTwoElecsTwoCores = NULL; | |
3585 | + double** tmpRotMat = NULL; | |
3586 | + double** tmpMatrixBC = NULL; | |
3587 | + double* tmpVectorBC = NULL; | |
3520 | 3588 | try{ |
3521 | - MallocerFreer::GetInstance()->Malloc<double>(&diatomicTwoElecTwoCore, dxy, dxy, dxy, dxy); | |
3522 | - MallocerFreer::GetInstance()->Malloc<double>(&tmpDiatomicTwoElecTwoCore, dxy*dxy*dxy*dxy); | |
3523 | - MallocerFreer::GetInstance()->Malloc<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
3524 | - MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
3525 | - MallocerFreer::GetInstance()->Malloc<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
3589 | + MallocerFreer::GetInstance()->Malloc<double>(&diatomicTwoElecsTwoCores, dxy, dxy, dxy, dxy); | |
3590 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpDiatomicTwoElecsTwoCores, dxy*dxy*dxy*dxy); | |
3591 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
3592 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
3593 | + MallocerFreer::GetInstance()->Malloc<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
3526 | 3594 | // note that terms with condition a==b are not needed to calculate. |
3527 | 3595 | #pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE) |
3528 | 3596 | for(int b=a+1; b<totalNumberAtoms; b++){ |
3529 | - this->CalcDiatomicTwoElecTwoCore(diatomicTwoElecTwoCore, | |
3530 | - tmpDiatomicTwoElecTwoCore, | |
3531 | - tmpRotMat, | |
3532 | - tmpMatrixBC, | |
3533 | - tmpVectorBC, | |
3534 | - a, b); | |
3597 | + this->CalcDiatomicTwoElecsTwoCores(diatomicTwoElecsTwoCores, | |
3598 | + tmpDiatomicTwoElecsTwoCores, | |
3599 | + tmpRotMat, | |
3600 | + tmpMatrixBC, | |
3601 | + tmpVectorBC, | |
3602 | + a, b); | |
3535 | 3603 | int i=0; |
3536 | 3604 | for(int mu=0; mu<dxy; mu++){ |
3537 | 3605 | for(int nu=mu; nu<dxy; nu++){ |
3538 | 3606 | int j=0; |
3539 | 3607 | for(int lambda=0; lambda<dxy; lambda++){ |
3540 | 3608 | for(int sigma=lambda; sigma<dxy; sigma++){ |
3541 | - this->twoElecTwoCoreMpiBuff[a][b][i][j] | |
3542 | - = diatomicTwoElecTwoCore[mu][nu][lambda][sigma]; | |
3609 | + this->twoElecsTwoAtomCoresMpiBuff[a][b][i][j] | |
3610 | + = diatomicTwoElecsTwoCores[mu][nu][lambda][sigma]; | |
3543 | 3611 | j++; |
3544 | 3612 | } |
3545 | 3613 | } |
@@ -3552,11 +3620,11 @@ void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | ||
3552 | 3620 | #pragma omp critical |
3553 | 3621 | ex.Serialize(errorStream); |
3554 | 3622 | } |
3555 | - MallocerFreer::GetInstance()->Free<double>(&diatomicTwoElecTwoCore, dxy, dxy, dxy, dxy); | |
3556 | - MallocerFreer::GetInstance()->Free<double>(&tmpDiatomicTwoElecTwoCore, dxy*dxy*dxy*dxy); | |
3557 | - MallocerFreer::GetInstance()->Free<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
3558 | - MallocerFreer::GetInstance()->Free<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
3559 | - MallocerFreer::GetInstance()->Free<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
3623 | + MallocerFreer::GetInstance()->Free<double>(&diatomicTwoElecsTwoCores, dxy, dxy, dxy, dxy); | |
3624 | + MallocerFreer::GetInstance()->Free<double>(&tmpDiatomicTwoElecsTwoCores, dxy*dxy*dxy*dxy); | |
3625 | + MallocerFreer::GetInstance()->Free<double>(&tmpRotMat, OrbitalType_end, OrbitalType_end); | |
3626 | + MallocerFreer::GetInstance()->Free<double>(&tmpMatrixBC, dxy*dxy, dxy*dxy); | |
3627 | + MallocerFreer::GetInstance()->Free<double>(&tmpVectorBC, dxy*dxy*dxy*dxy); | |
3560 | 3628 | } |
3561 | 3629 | } |
3562 | 3630 | if(errorStream.str().empty()){ |
@@ -3565,7 +3633,7 @@ void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | ||
3565 | 3633 | OrbitalType twoElecLimit = dxy; |
3566 | 3634 | int numBuff = (twoElecLimit+1)*twoElecLimit/2; |
3567 | 3635 | int num = (totalNumberAtoms-b)*numBuff*numBuff; |
3568 | - asyncCommunicator.SetBroadcastedMessage(&this->twoElecTwoCoreMpiBuff[a][b][0][0], num, calcRank); | |
3636 | + asyncCommunicator.SetBroadcastedMessage(&this->twoElecsTwoAtomCoresMpiBuff[a][b][0][0], num, calcRank); | |
3569 | 3637 | } |
3570 | 3638 | } |
3571 | 3639 | } |
@@ -3584,15 +3652,15 @@ void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | ||
3584 | 3652 | int j=0; |
3585 | 3653 | for(int lambda=0; lambda<dxy; lambda++){ |
3586 | 3654 | for(int sigma=lambda; sigma<dxy; sigma++){ |
3587 | - double value = this->twoElecTwoCoreMpiBuff[a][b][i][j]; | |
3588 | - twoElecTwoCore[a][b][mu][nu][lambda][sigma] = value; | |
3589 | - twoElecTwoCore[a][b][mu][nu][sigma][lambda] = value; | |
3590 | - twoElecTwoCore[a][b][nu][mu][lambda][sigma] = value; | |
3591 | - twoElecTwoCore[a][b][nu][mu][sigma][lambda] = value; | |
3592 | - twoElecTwoCore[b][a][lambda][sigma][mu][nu] = value; | |
3593 | - twoElecTwoCore[b][a][lambda][sigma][nu][mu] = value; | |
3594 | - twoElecTwoCore[b][a][sigma][lambda][mu][nu] = value; | |
3595 | - twoElecTwoCore[b][a][sigma][lambda][nu][mu] = value; | |
3655 | + double value = this->twoElecsTwoAtomCoresMpiBuff[a][b][i][j]; | |
3656 | + twoElecsTwoAtomCores[a][b][mu][nu][lambda][sigma] = value; | |
3657 | + twoElecsTwoAtomCores[a][b][mu][nu][sigma][lambda] = value; | |
3658 | + twoElecsTwoAtomCores[a][b][nu][mu][lambda][sigma] = value; | |
3659 | + twoElecsTwoAtomCores[a][b][nu][mu][sigma][lambda] = value; | |
3660 | + twoElecsTwoAtomCores[b][a][lambda][sigma][mu][nu] = value; | |
3661 | + twoElecsTwoAtomCores[b][a][lambda][sigma][nu][mu] = value; | |
3662 | + twoElecsTwoAtomCores[b][a][sigma][lambda][mu][nu] = value; | |
3663 | + twoElecsTwoAtomCores[b][a][sigma][lambda][nu][mu] = value; | |
3596 | 3664 | j++; |
3597 | 3665 | } |
3598 | 3666 | } |
@@ -3611,18 +3679,75 @@ void Mndo::CalcTwoElecTwoCore(double****** twoElecTwoCore, | ||
3611 | 3679 | // Note that atomA != atomB. |
3612 | 3680 | // Note taht d-orbital cannot be treated, |
3613 | 3681 | // that is, matrix[dxy][dxy][dxy][dxy] cannot be treatable. |
3614 | -void Mndo::CalcDiatomicTwoElecTwoCore(double**** matrix, | |
3682 | +void Mndo::CalcDiatomicTwoElecsTwoCoresPointCharge(double**** matrix, | |
3615 | 3683 | double* tmpVec, |
3616 | 3684 | double** tmpRotMat, |
3617 | 3685 | double** tmpMatrixBC, |
3618 | 3686 | double* tmpVectorBC, |
3619 | - int indexAtomA, | |
3620 | - int indexAtomB) const{ | |
3687 | + const Atom& atomA, | |
3688 | + const Atom& pc) const{ | |
3689 | + MallocerFreer::GetInstance()->Initialize<double>(matrix, dxy, dxy, dxy, dxy); | |
3690 | + | |
3691 | + // calclation in diatomic frame | |
3692 | + for(int mu=0; mu<atomA.GetValenceSize(); mu++){ | |
3693 | + for(int nu=mu; nu<atomA.GetValenceSize(); nu++){ | |
3694 | + for(int lambda=0; lambda<pc.GetValenceSize(); lambda++){ | |
3695 | + for(int sigma=lambda; sigma<pc.GetValenceSize(); sigma++){ | |
3696 | + double value = this->GetNddoRepulsionIntegralPointCharge( | |
3697 | + atomA, | |
3698 | + atomA.GetValence(mu), | |
3699 | + atomA.GetValence(nu), | |
3700 | + pc, | |
3701 | + pc.GetValence(lambda), | |
3702 | + pc.GetValence(sigma)); | |
3703 | + matrix[mu][nu][lambda][sigma] = value; | |
3704 | + matrix[mu][nu][sigma][lambda] = value; | |
3705 | + matrix[nu][mu][lambda][sigma] = value; | |
3706 | + matrix[nu][mu][sigma][lambda] = value; | |
3707 | + } | |
3708 | + } | |
3709 | + } | |
3710 | + } | |
3711 | + // rotate matirix into the space frame | |
3712 | + this->CalcRotatingMatrix(tmpRotMat, atomA, pc); | |
3713 | + this->RotateDiatomicTwoElecsTwoCoresToSpaceFrame(matrix, tmpVec, tmpRotMat, tmpMatrixBC, tmpVectorBC); | |
3714 | + | |
3715 | + /* | |
3716 | + this->OutputLog("(mu, nu | lambda, sigma) matrix\n"); | |
3717 | + for(int mu=0; mu<dxy; mu++){ | |
3718 | + for(int nu=0; nu<dxy; nu++){ | |
3719 | + for(int lambda=0; lambda<dxy; lambda++){ | |
3720 | + for(int sigma=0; sigma<dxy; sigma++){ | |
3721 | + this->OutputLog(boost::format("mu=%d nu=%d lambda=%d sigma=%d $e\n") % mu | |
3722 | + % nu | |
3723 | + % lambda | |
3724 | + % sigma | |
3725 | + % matrix[mu][nu][lambda][sigma]); | |
3726 | + } | |
3727 | + } | |
3728 | + } | |
3729 | + } | |
3730 | + */ | |
3731 | +} | |
3732 | +// Calculation of two electrons two cores integral (mu, nu | lambda, sigma) in space fixed frame, | |
3733 | +// taht is, Eq. (9) in ref. [DT_1977-2]. | |
3734 | +// mu and nu are included in atomA's AOs. | |
3735 | +// lambda and sigma are included in atomB's AOs. | |
3736 | +// Note that atomA != atomB. | |
3737 | +// Note taht d-orbital cannot be treated, | |
3738 | +// that is, matrix[dxy][dxy][dxy][dxy] cannot be treatable. | |
3739 | +void Mndo::CalcDiatomicTwoElecsTwoCores(double**** matrix, | |
3740 | + double* tmpVec, | |
3741 | + double** tmpRotMat, | |
3742 | + double** tmpMatrixBC, | |
3743 | + double* tmpVectorBC, | |
3744 | + int indexAtomA, | |
3745 | + int indexAtomB) const{ | |
3621 | 3746 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
3622 | 3747 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
3623 | 3748 | if(indexAtomA == indexAtomB){ |
3624 | 3749 | stringstream ss; |
3625 | - ss << this->errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms; | |
3750 | + ss << this->errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms; | |
3626 | 3751 | ss << this->errorMessageAtomA << indexAtomA |
3627 | 3752 | << AtomTypeStr(atomA.GetAtomType()) << endl; |
3628 | 3753 | ss << this->errorMessageAtomB << indexAtomB |
@@ -3632,7 +3757,7 @@ void Mndo::CalcDiatomicTwoElecTwoCore(double**** matrix, | ||
3632 | 3757 | |
3633 | 3758 | #ifdef MOLDS_DBG |
3634 | 3759 | if(matrix == NULL){ |
3635 | - throw MolDSException(this->errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix); | |
3760 | + throw MolDSException(this->errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix); | |
3636 | 3761 | } |
3637 | 3762 | #endif |
3638 | 3763 | MallocerFreer::GetInstance()->Initialize<double>(matrix, dxy, dxy, dxy, dxy); |
@@ -3659,7 +3784,7 @@ void Mndo::CalcDiatomicTwoElecTwoCore(double**** matrix, | ||
3659 | 3784 | } |
3660 | 3785 | // rotate matirix into the space frame |
3661 | 3786 | this->CalcRotatingMatrix(tmpRotMat, atomA, atomB); |
3662 | - this->RotateDiatomicTwoElecTwoCoreToSpaceFrame(matrix, tmpVec, tmpRotMat, tmpMatrixBC, tmpVectorBC); | |
3787 | + this->RotateDiatomicTwoElecsTwoCoresToSpaceFrame(matrix, tmpVec, tmpRotMat, tmpMatrixBC, tmpVectorBC); | |
3663 | 3788 | |
3664 | 3789 | /* |
3665 | 3790 | this->OutputLog("(mu, nu | lambda, sigma) matrix\n"); |
@@ -3687,17 +3812,17 @@ void Mndo::CalcDiatomicTwoElecTwoCore(double**** matrix, | ||
3687 | 3812 | // Note that atomA != atomB. |
3688 | 3813 | // Note taht d-orbital cannot be treated, |
3689 | 3814 | // that is, matrix[dxy][dxy][dxy][dxy][CartesianType_end] cannot be treatable. |
3690 | -void Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives(double***** matrix, | |
3691 | - double** tmpRotMat, | |
3692 | - double*** tmpRotMat1stDerivs, | |
3693 | - double**** tmpDiatomicTwoElecTwoCore, | |
3694 | - int indexAtomA, | |
3695 | - int indexAtomB) const{ | |
3815 | +void Mndo::CalcDiatomicTwoElecsTwoCores1stDerivatives(double***** matrix, | |
3816 | + double** tmpRotMat, | |
3817 | + double*** tmpRotMat1stDerivs, | |
3818 | + double**** tmpDiatomicTwoElecsTwoCores, | |
3819 | + int indexAtomA, | |
3820 | + int indexAtomB) const{ | |
3696 | 3821 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
3697 | 3822 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
3698 | 3823 | if(indexAtomA == indexAtomB){ |
3699 | 3824 | stringstream ss; |
3700 | - ss << this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms; | |
3825 | + ss << this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms; | |
3701 | 3826 | ss << this->errorMessageAtomA << indexAtomA |
3702 | 3827 | << AtomTypeStr(atomA.GetAtomType()) << endl; |
3703 | 3828 | ss << this->errorMessageAtomB << indexAtomB |
@@ -3707,7 +3832,7 @@ void Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives(double***** matrix, | ||
3707 | 3832 | |
3708 | 3833 | #ifdef MOLDS_DBG |
3709 | 3834 | if(matrix == NULL){ |
3710 | - throw MolDSException(this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix); | |
3835 | + throw MolDSException(this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix); | |
3711 | 3836 | } |
3712 | 3837 | #endif |
3713 | 3838 | MallocerFreer::GetInstance()->Initialize<double>(matrix, |
@@ -3736,7 +3861,7 @@ void Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives(double***** matrix, | ||
3736 | 3861 | matrix[nu][mu][sigma][lambda][dimA] = matrix[mu][nu][lambda][sigma][dimA]; |
3737 | 3862 | matrix[mu][nu][sigma][lambda][dimA] = matrix[mu][nu][lambda][sigma][dimA]; |
3738 | 3863 | } |
3739 | - tmpDiatomicTwoElecTwoCore[mu][nu][lambda][sigma] | |
3864 | + tmpDiatomicTwoElecsTwoCores[mu][nu][lambda][sigma] | |
3740 | 3865 | = this->GetNddoRepulsionIntegral( |
3741 | 3866 | atomA, |
3742 | 3867 | atomA.GetValence(mu), |
@@ -3744,9 +3869,9 @@ void Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives(double***** matrix, | ||
3744 | 3869 | atomB, |
3745 | 3870 | atomB.GetValence(lambda), |
3746 | 3871 | atomB.GetValence(sigma)); |
3747 | - tmpDiatomicTwoElecTwoCore[nu][mu][lambda][sigma] = tmpDiatomicTwoElecTwoCore[mu][nu][lambda][sigma]; | |
3748 | - tmpDiatomicTwoElecTwoCore[nu][mu][sigma][lambda] = tmpDiatomicTwoElecTwoCore[mu][nu][lambda][sigma]; | |
3749 | - tmpDiatomicTwoElecTwoCore[mu][nu][sigma][lambda] = tmpDiatomicTwoElecTwoCore[mu][nu][lambda][sigma]; | |
3872 | + tmpDiatomicTwoElecsTwoCores[nu][mu][lambda][sigma] = tmpDiatomicTwoElecsTwoCores[mu][nu][lambda][sigma]; | |
3873 | + tmpDiatomicTwoElecsTwoCores[nu][mu][sigma][lambda] = tmpDiatomicTwoElecsTwoCores[mu][nu][lambda][sigma]; | |
3874 | + tmpDiatomicTwoElecsTwoCores[mu][nu][sigma][lambda] = tmpDiatomicTwoElecsTwoCores[mu][nu][lambda][sigma]; | |
3750 | 3875 | } |
3751 | 3876 | } |
3752 | 3877 | } |
@@ -3755,10 +3880,10 @@ void Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives(double***** matrix, | ||
3755 | 3880 | // rotate matirix into the space frame |
3756 | 3881 | this->CalcRotatingMatrix(tmpRotMat, atomA, atomB); |
3757 | 3882 | this->CalcRotatingMatrix1stDerivatives(tmpRotMat1stDerivs, atomA, atomB); |
3758 | - this->RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame(matrix, | |
3759 | - tmpDiatomicTwoElecTwoCore, | |
3760 | - tmpRotMat, | |
3761 | - tmpRotMat1stDerivs); | |
3883 | + this->RotateDiatomicTwoElecsTwoCores1stDerivativesToSpaceFrame(matrix, | |
3884 | + tmpDiatomicTwoElecsTwoCores, | |
3885 | + tmpRotMat, | |
3886 | + tmpRotMat1stDerivs); | |
3762 | 3887 | } |
3763 | 3888 | |
3764 | 3889 | // Calculation of second derivatives of the two electrons two cores integral in space fixed frame, |
@@ -3769,19 +3894,19 @@ void Mndo::CalcDiatomicTwoElecTwoCore1stDerivatives(double***** matrix, | ||
3769 | 3894 | // Note that atomA != atomB. |
3770 | 3895 | // Note taht d-orbital cannot be treated, |
3771 | 3896 | // that is, matrix[dxy][dxy][dxy][dxy][CartesianType_end][CartesianType_end] cannot be treatable. |
3772 | -void Mndo::CalcDiatomicTwoElecTwoCore2ndDerivatives(double****** matrix, | |
3773 | - double** tmpRotMat, | |
3774 | - double*** tmpRotMat1stDerivs, | |
3775 | - double**** tmpRotMat2ndDerivs, | |
3776 | - double**** tmpDiatomicTwoElecTwoCore, | |
3777 | - double***** tmpDiatomicTwoElecTwoCore1stDerivs, | |
3778 | - int indexAtomA, | |
3779 | - int indexAtomB) const{ | |
3897 | +void Mndo::CalcDiatomicTwoElecsTwoCores2ndDerivatives(double****** matrix, | |
3898 | + double** tmpRotMat, | |
3899 | + double*** tmpRotMat1stDerivs, | |
3900 | + double**** tmpRotMat2ndDerivs, | |
3901 | + double**** tmpDiatomicTwoElecsTwoCores, | |
3902 | + double***** tmpDiatomicTwoElecsTwoCores1stDerivs, | |
3903 | + int indexAtomA, | |
3904 | + int indexAtomB) const{ | |
3780 | 3905 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
3781 | 3906 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
3782 | 3907 | if(indexAtomA == indexAtomB){ |
3783 | 3908 | stringstream ss; |
3784 | - ss << this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms; | |
3909 | + ss << this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms; | |
3785 | 3910 | ss << this->errorMessageAtomA << indexAtomA |
3786 | 3911 | << AtomTypeStr(atomA.GetAtomType()) << endl; |
3787 | 3912 | ss << this->errorMessageAtomB << indexAtomB |
@@ -3791,7 +3916,7 @@ void Mndo::CalcDiatomicTwoElecTwoCore2ndDerivatives(double****** matrix, | ||
3791 | 3916 | |
3792 | 3917 | #ifdef MOLDS_DBG |
3793 | 3918 | if(matrix == NULL){ |
3794 | - throw MolDSException(this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix); | |
3919 | + throw MolDSException(this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix); | |
3795 | 3920 | } |
3796 | 3921 | #endif |
3797 | 3922 | MallocerFreer::GetInstance()->Initialize<double>(matrix, |
@@ -3820,7 +3945,7 @@ void Mndo::CalcDiatomicTwoElecTwoCore2ndDerivatives(double****** matrix, | ||
3820 | 3945 | static_cast<CartesianType>(dimA1), |
3821 | 3946 | static_cast<CartesianType>(dimA2)); |
3822 | 3947 | } |
3823 | - tmpDiatomicTwoElecTwoCore1stDerivs[mu][nu][lambda][sigma][dimA1] | |
3948 | + tmpDiatomicTwoElecsTwoCores1stDerivs[mu][nu][lambda][sigma][dimA1] | |
3824 | 3949 | = this->GetNddoRepulsionIntegral1stDerivative( |
3825 | 3950 | atomA, |
3826 | 3951 | atomA.GetValence(mu), |
@@ -3830,7 +3955,7 @@ void Mndo::CalcDiatomicTwoElecTwoCore2ndDerivatives(double****** matrix, | ||
3830 | 3955 | atomB.GetValence(sigma), |
3831 | 3956 | static_cast<CartesianType>(dimA1)); |
3832 | 3957 | } |
3833 | - tmpDiatomicTwoElecTwoCore[mu][nu][lambda][sigma] | |
3958 | + tmpDiatomicTwoElecsTwoCores[mu][nu][lambda][sigma] | |
3834 | 3959 | = this->GetNddoRepulsionIntegral( |
3835 | 3960 | atomA, |
3836 | 3961 | atomA.GetValence(mu), |
@@ -3847,21 +3972,21 @@ void Mndo::CalcDiatomicTwoElecTwoCore2ndDerivatives(double****** matrix, | ||
3847 | 3972 | this->CalcRotatingMatrix(tmpRotMat, atomA, atomB); |
3848 | 3973 | this->CalcRotatingMatrix1stDerivatives(tmpRotMat1stDerivs, atomA, atomB); |
3849 | 3974 | this->CalcRotatingMatrix2ndDerivatives(tmpRotMat2ndDerivs, atomA, atomB); |
3850 | - this->RotateDiatomicTwoElecTwoCore2ndDerivativesToSpaceFrame(matrix, | |
3851 | - tmpDiatomicTwoElecTwoCore, | |
3852 | - tmpDiatomicTwoElecTwoCore1stDerivs, | |
3853 | - tmpRotMat, | |
3854 | - tmpRotMat1stDerivs, | |
3855 | - tmpRotMat2ndDerivs); | |
3975 | + this->RotateDiatomicTwoElecsTwoCores2ndDerivativesToSpaceFrame(matrix, | |
3976 | + tmpDiatomicTwoElecsTwoCores, | |
3977 | + tmpDiatomicTwoElecsTwoCores1stDerivs, | |
3978 | + tmpRotMat, | |
3979 | + tmpRotMat1stDerivs, | |
3980 | + tmpRotMat2ndDerivs); | |
3856 | 3981 | } |
3857 | 3982 | |
3858 | 3983 | // Rotate 4-dimensional matrix from diatomic frame to space frame |
3859 | 3984 | // Note tha in this method d-orbitals can not be treatable. |
3860 | -void Mndo::RotateDiatomicTwoElecTwoCoreToSpaceFrame(double**** matrix, | |
3861 | - double* tmpVec, | |
3862 | - double const* const* rotatingMatrix, | |
3863 | - double** tmpMatrixBC, | |
3864 | - double* tmpVectorBC) const{ | |
3985 | +void Mndo::RotateDiatomicTwoElecsTwoCoresToSpaceFrame(double**** matrix, | |
3986 | + double* tmpVec, | |
3987 | + double const* const* rotatingMatrix, | |
3988 | + double** tmpMatrixBC, | |
3989 | + double* tmpVectorBC) const{ | |
3865 | 3990 | double oldMatrix[dxy][dxy][dxy][dxy]; |
3866 | 3991 | MolDS_wrappers::Blas::GetInstance()->Dcopy(dxy*dxy*dxy*dxy, &matrix[0][0][0][0], &oldMatrix[0][0][0][0]); |
3867 | 3992 |
@@ -3931,9 +4056,9 @@ void Mndo::RotateDiatomicTwoElecTwoCoreToSpaceFrame(double**** matrix, | ||
3931 | 4056 | |
3932 | 4057 | // Rotate 5-dimensional matrix from diatomic frame to space frame |
3933 | 4058 | // Note tha in this method d-orbitals can not be treatable. |
3934 | -void Mndo::RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame( | |
4059 | +void Mndo::RotateDiatomicTwoElecsTwoCores1stDerivativesToSpaceFrame( | |
3935 | 4060 | double***** matrix, |
3936 | - double const* const*const* const* diatomicTwoElecTwoCore, | |
4061 | + double const* const*const* const* diatomicTwoElecsTwoCores, | |
3937 | 4062 | double const* const* rotatingMatrix, |
3938 | 4063 | double const* const* const* rotMat1stDerivatives) const{ |
3939 | 4064 |
@@ -3953,15 +4078,15 @@ void Mndo::RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame( | ||
3953 | 4078 | double* tmpVector = NULL; |
3954 | 4079 | double** ptrDiatomic = NULL; |
3955 | 4080 | try{ |
3956 | - this->MallocTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(&twiceRotatingMatrix, | |
3957 | - &twiceRotatingMatrixDerivA, | |
3958 | - &twiceRotatingMatrixDerivB, | |
3959 | - &oldMatrix, | |
3960 | - &rotatedMatrix, | |
3961 | - &tmpRotatedVec, | |
3962 | - &tmpMatrix, | |
3963 | - &tmpVector, | |
3964 | - &ptrDiatomic); | |
4081 | + this->MallocTempMatricesRotateDiatomicTwoElecsTwoCores1stDerivs(&twiceRotatingMatrix, | |
4082 | + &twiceRotatingMatrixDerivA, | |
4083 | + &twiceRotatingMatrixDerivB, | |
4084 | + &oldMatrix, | |
4085 | + &rotatedMatrix, | |
4086 | + &tmpRotatedVec, | |
4087 | + &tmpMatrix, | |
4088 | + &tmpVector, | |
4089 | + &ptrDiatomic); | |
3965 | 4090 | for(int mu=0; mu<dxy; mu++){ |
3966 | 4091 | for(int nu=0; nu<dxy; nu++){ |
3967 | 4092 | int i=mu*dxy+nu; |
@@ -3972,7 +4097,7 @@ void Mndo::RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame( | ||
3972 | 4097 | *rotatingMatrix[nu][sigma ]; |
3973 | 4098 | } |
3974 | 4099 | } |
3975 | - ptrDiatomic[i] = const_cast<double*>(&diatomicTwoElecTwoCore[mu][nu][0][0]); | |
4100 | + ptrDiatomic[i] = const_cast<double*>(&diatomicTwoElecsTwoCores[mu][nu][0][0]); | |
3976 | 4101 | } |
3977 | 4102 | } |
3978 | 4103 | for(int axis=0; axis<CartesianType_end; axis++){ |
@@ -4067,26 +4192,26 @@ void Mndo::RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame( | ||
4067 | 4192 | } |
4068 | 4193 | } |
4069 | 4194 | catch(MolDSException ex){ |
4070 | - this->FreeTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(&twiceRotatingMatrix, | |
4071 | - &twiceRotatingMatrixDerivA, | |
4072 | - &twiceRotatingMatrixDerivB, | |
4073 | - &oldMatrix, | |
4074 | - &rotatedMatrix, | |
4075 | - &tmpRotatedVec, | |
4076 | - &tmpMatrix, | |
4077 | - &tmpVector, | |
4078 | - &ptrDiatomic); | |
4195 | + this->FreeTempMatricesRotateDiatomicTwoElecsTwoCores1stDerivs(&twiceRotatingMatrix, | |
4196 | + &twiceRotatingMatrixDerivA, | |
4197 | + &twiceRotatingMatrixDerivB, | |
4198 | + &oldMatrix, | |
4199 | + &rotatedMatrix, | |
4200 | + &tmpRotatedVec, | |
4201 | + &tmpMatrix, | |
4202 | + &tmpVector, | |
4203 | + &ptrDiatomic); | |
4079 | 4204 | throw ex; |
4080 | 4205 | } |
4081 | - this->FreeTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(&twiceRotatingMatrix, | |
4082 | - &twiceRotatingMatrixDerivA, | |
4083 | - &twiceRotatingMatrixDerivB, | |
4084 | - &oldMatrix, | |
4085 | - &rotatedMatrix, | |
4086 | - &tmpRotatedVec, | |
4087 | - &tmpMatrix, | |
4088 | - &tmpVector, | |
4089 | - &ptrDiatomic); | |
4206 | + this->FreeTempMatricesRotateDiatomicTwoElecsTwoCores1stDerivs(&twiceRotatingMatrix, | |
4207 | + &twiceRotatingMatrixDerivA, | |
4208 | + &twiceRotatingMatrixDerivB, | |
4209 | + &oldMatrix, | |
4210 | + &rotatedMatrix, | |
4211 | + &tmpRotatedVec, | |
4212 | + &tmpMatrix, | |
4213 | + &tmpVector, | |
4214 | + &ptrDiatomic); | |
4090 | 4215 | |
4091 | 4216 | /* |
4092 | 4217 | // rotate (slow algorithm) |
@@ -4107,25 +4232,25 @@ void Mndo::RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame( | ||
4107 | 4232 | *rotatingMatrix[lambda][k] |
4108 | 4233 | *rotatingMatrix[sigma][l]; |
4109 | 4234 | matrix[mu][nu][lambda][sigma][c] |
4110 | - += diatomicTwoElecTwoCore[i][j][k][l] | |
4235 | + += diatomicTwoElecsTwoCores[i][j][k][l] | |
4111 | 4236 | *rotMat1stDerivatives[mu][i][c] |
4112 | 4237 | *rotatingMatrix[nu][j] |
4113 | 4238 | *rotatingMatrix[lambda][k] |
4114 | 4239 | *rotatingMatrix[sigma][l]; |
4115 | 4240 | matrix[mu][nu][lambda][sigma][c] |
4116 | - += diatomicTwoElecTwoCore[i][j][k][l] | |
4241 | + += diatomicTwoElecsTwoCores[i][j][k][l] | |
4117 | 4242 | *rotatingMatrix[mu][i] |
4118 | 4243 | *rotMat1stDerivatives[nu][j][c] |
4119 | 4244 | *rotatingMatrix[lambda][k] |
4120 | 4245 | *rotatingMatrix[sigma][l]; |
4121 | 4246 | matrix[mu][nu][lambda][sigma][c] |
4122 | - += diatomicTwoElecTwoCore[i][j][k][l] | |
4247 | + += diatomicTwoElecsTwoCores[i][j][k][l] | |
4123 | 4248 | *rotatingMatrix[mu][i] |
4124 | 4249 | *rotatingMatrix[nu][j] |
4125 | 4250 | *rotMat1stDerivatives[lambda][k][c] |
4126 | 4251 | *rotatingMatrix[sigma][l]; |
4127 | 4252 | matrix[mu][nu][lambda][sigma][c] |
4128 | - += diatomicTwoElecTwoCore[i][j][k][l] | |
4253 | + += diatomicTwoElecsTwoCores[i][j][k][l] | |
4129 | 4254 | *rotatingMatrix[mu][i] |
4130 | 4255 | *rotatingMatrix[nu][j] |
4131 | 4256 | *rotatingMatrix[lambda][k] |
@@ -4142,15 +4267,15 @@ void Mndo::RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame( | ||
4142 | 4267 | */ |
4143 | 4268 | } |
4144 | 4269 | |
4145 | -void Mndo::MallocTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(double*** twiceRotatingMatrix, | |
4146 | - double*** twiceRotatingMatrixDerivA, | |
4147 | - double*** twiceRotatingMatrixDerivB, | |
4148 | - double*** oldMatrix, | |
4149 | - double*** rotatedMatrix, | |
4150 | - double** tmpRotatedVec, | |
4151 | - double*** tmpMatrix, | |
4152 | - double** tmpVector, | |
4153 | - double*** ptrDiatomic) const{ | |
4270 | +void Mndo::MallocTempMatricesRotateDiatomicTwoElecsTwoCores1stDerivs(double*** twiceRotatingMatrix, | |
4271 | + double*** twiceRotatingMatrixDerivA, | |
4272 | + double*** twiceRotatingMatrixDerivB, | |
4273 | + double*** oldMatrix, | |
4274 | + double*** rotatedMatrix, | |
4275 | + double** tmpRotatedVec, | |
4276 | + double*** tmpMatrix, | |
4277 | + double** tmpVector, | |
4278 | + double*** ptrDiatomic) const{ | |
4154 | 4279 | MallocerFreer::GetInstance()->Malloc<double>(twiceRotatingMatrix, dxy*dxy, dxy*dxy); |
4155 | 4280 | MallocerFreer::GetInstance()->Malloc<double>(twiceRotatingMatrixDerivA, dxy*dxy, dxy*dxy); |
4156 | 4281 | MallocerFreer::GetInstance()->Malloc<double>(twiceRotatingMatrixDerivB, dxy*dxy, dxy*dxy); |
@@ -4162,15 +4287,15 @@ void Mndo::MallocTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(double*** twi | ||
4162 | 4287 | MallocerFreer::GetInstance()->Malloc<double*>(ptrDiatomic, dxy*dxy); |
4163 | 4288 | } |
4164 | 4289 | |
4165 | -void Mndo::FreeTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(double*** twiceRotatingMatrix, | |
4166 | - double*** twiceRotatingMatrixDerivA, | |
4167 | - double*** twiceRotatingMatrixDerivB, | |
4168 | - double*** oldMatrix, | |
4169 | - double*** rotatedMatrix, | |
4170 | - double** tmpRotatedVec, | |
4171 | - double*** tmpMatrix, | |
4172 | - double** tmpVector, | |
4173 | - double*** ptrDiatomic) const{ | |
4290 | +void Mndo::FreeTempMatricesRotateDiatomicTwoElecsTwoCores1stDerivs(double*** twiceRotatingMatrix, | |
4291 | + double*** twiceRotatingMatrixDerivA, | |
4292 | + double*** twiceRotatingMatrixDerivB, | |
4293 | + double*** oldMatrix, | |
4294 | + double*** rotatedMatrix, | |
4295 | + double** tmpRotatedVec, | |
4296 | + double*** tmpMatrix, | |
4297 | + double** tmpVector, | |
4298 | + double*** ptrDiatomic) const{ | |
4174 | 4299 | MallocerFreer::GetInstance()->Free<double>(twiceRotatingMatrix, dxy*dxy, dxy*dxy); |
4175 | 4300 | MallocerFreer::GetInstance()->Free<double>(twiceRotatingMatrixDerivA, dxy*dxy, dxy*dxy); |
4176 | 4301 | MallocerFreer::GetInstance()->Free<double>(twiceRotatingMatrixDerivB, dxy*dxy, dxy*dxy); |
@@ -4184,10 +4309,10 @@ void Mndo::FreeTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(double*** twice | ||
4184 | 4309 | |
4185 | 4310 | // Rotate 6-dimensional matrix from diatomic frame to space frame |
4186 | 4311 | // Note tha in this method d-orbitals can not be treatable. |
4187 | -void Mndo::RotateDiatomicTwoElecTwoCore2ndDerivativesToSpaceFrame( | |
4312 | +void Mndo::RotateDiatomicTwoElecsTwoCores2ndDerivativesToSpaceFrame( | |
4188 | 4313 | double****** matrix, |
4189 | - double const* const* const* const* diatomicTwoElecTwoCore, | |
4190 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivatives, | |
4314 | + double const* const* const* const* diatomicTwoElecsTwoCores, | |
4315 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivatives, | |
4191 | 4316 | double const* const* rotatingMatrix, |
4192 | 4317 | double const* const* const* rotMat1stDerivatives, |
4193 | 4318 | double const* const* const* const* rotMat2ndDerivatives) const{ |
@@ -4231,18 +4356,18 @@ void Mndo::RotateDiatomicTwoElecTwoCore2ndDerivativesToSpaceFrame( | ||
4231 | 4356 | MallocerFreer::GetInstance()->Initialize<double>(tempIJK, numberTerms); |
4232 | 4357 | for(int l=s; l<dxy; l++){ |
4233 | 4358 | |
4234 | - tempIJK[0] += oldMatrix [i][j][k][l][dimA1][dimA2]*rotatingMatrix [sigma][l]; | |
4235 | - tempIJK[1] += diatomicTwoElecTwoCore[i][j][k][l] *rotatingMatrix [sigma][l]; | |
4236 | - tempIJK[4] += diatomicTwoElecTwoCore[i][j][k][l] *rotMat2ndDerivatives[sigma][l][dimA1][dimA2]; | |
4359 | + tempIJK[0] += oldMatrix [i][j][k][l][dimA1][dimA2]*rotatingMatrix [sigma][l]; | |
4360 | + tempIJK[1] += diatomicTwoElecsTwoCores[i][j][k][l] *rotatingMatrix [sigma][l]; | |
4361 | + tempIJK[4] += diatomicTwoElecsTwoCores[i][j][k][l] *rotMat2ndDerivatives[sigma][l][dimA1][dimA2]; | |
4237 | 4362 | |
4238 | - tempIJK[5] += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA1]*rotatingMatrix [sigma][l]; | |
4239 | - tempIJK[8] += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA1]*rotMat1stDerivatives[sigma][l][dimA2]; | |
4363 | + tempIJK[5] += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA1]*rotatingMatrix [sigma][l]; | |
4364 | + tempIJK[8] += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA1]*rotMat1stDerivatives[sigma][l][dimA2]; | |
4240 | 4365 | |
4241 | - tempIJK[9] += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA2]*rotatingMatrix [sigma][l]; | |
4242 | - tempIJK[12] += diatomicTwoElecTwoCore [i][j][k][l] *rotMat1stDerivatives[sigma][l][dimA2]; | |
4366 | + tempIJK[9] += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA2]*rotatingMatrix [sigma][l]; | |
4367 | + tempIJK[12] += diatomicTwoElecsTwoCores [i][j][k][l] *rotMat1stDerivatives[sigma][l][dimA2]; | |
4243 | 4368 | |
4244 | - tempIJK[21] += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA2]*rotMat1stDerivatives[sigma][l][dimA1]; | |
4245 | - tempIJK[22] += diatomicTwoElecTwoCore [i][j][k][l] *rotMat1stDerivatives[sigma][l][dimA1]; | |
4369 | + tempIJK[21] += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA2]*rotMat1stDerivatives[sigma][l][dimA1]; | |
4370 | + tempIJK[22] += diatomicTwoElecsTwoCores [i][j][k][l] *rotMat1stDerivatives[sigma][l][dimA1]; | |
4246 | 4371 | } |
4247 | 4372 | tempIJ[0] += tempIJK[0] *rotatingMatrix [lambda][k]; |
4248 | 4373 | tempIJ[1] += tempIJK[1] *rotatingMatrix [lambda][k]; |
@@ -4353,154 +4478,154 @@ void Mndo::RotateDiatomicTwoElecTwoCore2ndDerivativesToSpaceFrame( | ||
4353 | 4478 | *rotatingMatrix [lambda][k] |
4354 | 4479 | *rotatingMatrix [sigma ][l]; |
4355 | 4480 | // term1 |
4356 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4357 | - *rotMat2ndDerivatives[mu ][i][dimA1][dimA2] | |
4481 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4482 | + *rotMat2ndDerivatives [mu ][i][dimA1][dimA2] | |
4358 | 4483 | *rotatingMatrix [nu ][j] |
4359 | 4484 | *rotatingMatrix [lambda][k] |
4360 | 4485 | *rotatingMatrix [sigma ][l]; |
4361 | 4486 | // term2 |
4362 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4487 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4363 | 4488 | *rotatingMatrix [mu ][i] |
4364 | - *rotMat2ndDerivatives[nu ][j][dimA1][dimA2] | |
4489 | + *rotMat2ndDerivatives [nu ][j][dimA1][dimA2] | |
4365 | 4490 | *rotatingMatrix [lambda][k] |
4366 | 4491 | *rotatingMatrix [sigma ][l]; |
4367 | 4492 | // term3 |
4368 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4493 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4369 | 4494 | *rotatingMatrix [mu ][i] |
4370 | 4495 | *rotatingMatrix [nu ][j] |
4371 | - *rotMat2ndDerivatives[lambda][k][dimA1][dimA2] | |
4496 | + *rotMat2ndDerivatives [lambda][k][dimA1][dimA2] | |
4372 | 4497 | *rotatingMatrix [sigma ][l]; |
4373 | 4498 | // term4 |
4374 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4499 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4375 | 4500 | *rotatingMatrix [mu ][i] |
4376 | 4501 | *rotatingMatrix [nu ][j] |
4377 | 4502 | *rotatingMatrix [lambda][k] |
4378 | - *rotMat2ndDerivatives[sigma ][l][dimA1][dimA2]; | |
4503 | + *rotMat2ndDerivatives [sigma ][l][dimA1][dimA2]; | |
4379 | 4504 | |
4380 | 4505 | // term5 |
4381 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA1] | |
4382 | - *rotMat1stDerivatives[mu ][i][dimA2] | |
4383 | - *rotatingMatrix [nu ][j] | |
4384 | - *rotatingMatrix [lambda][k] | |
4385 | - *rotatingMatrix [sigma ][l]; | |
4506 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA1] | |
4507 | + *rotMat1stDerivatives [mu ][i][dimA2] | |
4508 | + *rotatingMatrix [nu ][j] | |
4509 | + *rotatingMatrix [lambda][k] | |
4510 | + *rotatingMatrix [sigma ][l]; | |
4386 | 4511 | // term6 |
4387 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA1] | |
4388 | - *rotatingMatrix [mu ][i] | |
4389 | - *rotMat1stDerivatives[nu ][j][dimA2] | |
4390 | - *rotatingMatrix [lambda][k] | |
4391 | - *rotatingMatrix [sigma ][l]; | |
4512 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA1] | |
4513 | + *rotatingMatrix [mu ][i] | |
4514 | + *rotMat1stDerivatives [nu ][j][dimA2] | |
4515 | + *rotatingMatrix [lambda][k] | |
4516 | + *rotatingMatrix [sigma ][l]; | |
4392 | 4517 | // term7 |
4393 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA1] | |
4394 | - *rotatingMatrix [mu ][i] | |
4395 | - *rotatingMatrix [nu ][j] | |
4396 | - *rotMat1stDerivatives[lambda][k][dimA2] | |
4397 | - *rotatingMatrix [sigma ][l]; | |
4518 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA1] | |
4519 | + *rotatingMatrix [mu ][i] | |
4520 | + *rotatingMatrix [nu ][j] | |
4521 | + *rotMat1stDerivatives [lambda][k][dimA2] | |
4522 | + *rotatingMatrix [sigma ][l]; | |
4398 | 4523 | // term8 |
4399 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA1] | |
4400 | - *rotatingMatrix [mu ][i] | |
4401 | - *rotatingMatrix [nu ][j] | |
4402 | - *rotatingMatrix [lambda][k] | |
4403 | - *rotMat1stDerivatives[sigma ][l][dimA2]; | |
4524 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA1] | |
4525 | + *rotatingMatrix [mu ][i] | |
4526 | + *rotatingMatrix [nu ][j] | |
4527 | + *rotatingMatrix [lambda][k] | |
4528 | + *rotMat1stDerivatives [sigma ][l][dimA2]; | |
4404 | 4529 | |
4405 | 4530 | // term9 |
4406 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA2] | |
4407 | - *rotMat1stDerivatives[mu ][i][dimA1] | |
4408 | - *rotatingMatrix [nu ][j] | |
4409 | - *rotatingMatrix [lambda][k] | |
4410 | - *rotatingMatrix [sigma ][l]; | |
4531 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA2] | |
4532 | + *rotMat1stDerivatives [mu ][i][dimA1] | |
4533 | + *rotatingMatrix [nu ][j] | |
4534 | + *rotatingMatrix [lambda][k] | |
4535 | + *rotatingMatrix [sigma ][l]; | |
4411 | 4536 | // term10 |
4412 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4413 | - *rotMat1stDerivatives[mu ][i][dimA1] | |
4414 | - *rotMat1stDerivatives[nu ][j][dimA2] | |
4415 | - *rotatingMatrix [lambda][k] | |
4416 | - *rotatingMatrix [sigma ][l]; | |
4537 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4538 | + *rotMat1stDerivatives [mu ][i][dimA1] | |
4539 | + *rotMat1stDerivatives [nu ][j][dimA2] | |
4540 | + *rotatingMatrix [lambda][k] | |
4541 | + *rotatingMatrix [sigma ][l]; | |
4417 | 4542 | // term11 |
4418 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4419 | - *rotMat1stDerivatives[mu ][i][dimA1] | |
4420 | - *rotatingMatrix [nu ][j] | |
4421 | - *rotMat1stDerivatives[lambda][k][dimA2] | |
4422 | - *rotatingMatrix [sigma ][l]; | |
4543 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4544 | + *rotMat1stDerivatives [mu ][i][dimA1] | |
4545 | + *rotatingMatrix [nu ][j] | |
4546 | + *rotMat1stDerivatives [lambda][k][dimA2] | |
4547 | + *rotatingMatrix [sigma ][l]; | |
4423 | 4548 | // term12 |
4424 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4425 | - *rotMat1stDerivatives[mu ][i][dimA1] | |
4426 | - *rotatingMatrix [nu ][j] | |
4427 | - *rotatingMatrix [lambda][k] | |
4428 | - *rotMat1stDerivatives[sigma ][l][dimA2]; | |
4549 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4550 | + *rotMat1stDerivatives [mu ][i][dimA1] | |
4551 | + *rotatingMatrix [nu ][j] | |
4552 | + *rotatingMatrix [lambda][k] | |
4553 | + *rotMat1stDerivatives [sigma ][l][dimA2]; | |
4429 | 4554 | |
4430 | 4555 | // term13 |
4431 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA2] | |
4432 | - *rotatingMatrix [mu ][i] | |
4433 | - *rotMat1stDerivatives[nu ][j][dimA1] | |
4434 | - *rotatingMatrix [lambda][k] | |
4435 | - *rotatingMatrix [sigma ][l]; | |
4556 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA2] | |
4557 | + *rotatingMatrix [mu ][i] | |
4558 | + *rotMat1stDerivatives [nu ][j][dimA1] | |
4559 | + *rotatingMatrix [lambda][k] | |
4560 | + *rotatingMatrix [sigma ][l]; | |
4436 | 4561 | // term14 |
4437 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4438 | - *rotMat1stDerivatives[mu ][i][dimA2] | |
4439 | - *rotMat1stDerivatives[nu ][j][dimA1] | |
4440 | - *rotatingMatrix [lambda][k] | |
4441 | - *rotatingMatrix [sigma ][l]; | |
4562 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4563 | + *rotMat1stDerivatives [mu ][i][dimA2] | |
4564 | + *rotMat1stDerivatives [nu ][j][dimA1] | |
4565 | + *rotatingMatrix [lambda][k] | |
4566 | + *rotatingMatrix [sigma ][l]; | |
4442 | 4567 | // term15 |
4443 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4444 | - *rotatingMatrix [mu ][i] | |
4445 | - *rotMat1stDerivatives[nu ][j][dimA1] | |
4446 | - *rotMat1stDerivatives[lambda][k][dimA2] | |
4447 | - *rotatingMatrix [sigma ][l]; | |
4568 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4569 | + *rotatingMatrix [mu ][i] | |
4570 | + *rotMat1stDerivatives [nu ][j][dimA1] | |
4571 | + *rotMat1stDerivatives [lambda][k][dimA2] | |
4572 | + *rotatingMatrix [sigma ][l]; | |
4448 | 4573 | // term16 |
4449 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4450 | - *rotatingMatrix [mu ][i] | |
4451 | - *rotMat1stDerivatives[nu ][j][dimA1] | |
4452 | - *rotatingMatrix [lambda][k] | |
4453 | - *rotMat1stDerivatives[sigma ][l][dimA2]; | |
4574 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4575 | + *rotatingMatrix [mu ][i] | |
4576 | + *rotMat1stDerivatives [nu ][j][dimA1] | |
4577 | + *rotatingMatrix [lambda][k] | |
4578 | + *rotMat1stDerivatives [sigma ][l][dimA2]; | |
4454 | 4579 | |
4455 | 4580 | // term17 |
4456 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA2] | |
4457 | - *rotatingMatrix [mu ][i] | |
4458 | - *rotatingMatrix [nu ][j] | |
4459 | - *rotMat1stDerivatives[lambda][k][dimA1] | |
4460 | - *rotatingMatrix [sigma ][l]; | |
4581 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA2] | |
4582 | + *rotatingMatrix [mu ][i] | |
4583 | + *rotatingMatrix [nu ][j] | |
4584 | + *rotMat1stDerivatives [lambda][k][dimA1] | |
4585 | + *rotatingMatrix [sigma ][l]; | |
4461 | 4586 | // term18 |
4462 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4463 | - *rotMat1stDerivatives[mu ][i][dimA2] | |
4464 | - *rotatingMatrix [nu ][j] | |
4465 | - *rotMat1stDerivatives[lambda][k][dimA1] | |
4466 | - *rotatingMatrix [sigma ][l]; | |
4587 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4588 | + *rotMat1stDerivatives [mu ][i][dimA2] | |
4589 | + *rotatingMatrix [nu ][j] | |
4590 | + *rotMat1stDerivatives [lambda][k][dimA1] | |
4591 | + *rotatingMatrix [sigma ][l]; | |
4467 | 4592 | // term19 |
4468 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4469 | - *rotatingMatrix [mu ][i] | |
4470 | - *rotMat1stDerivatives[nu ][j][dimA2] | |
4471 | - *rotMat1stDerivatives[lambda][k][dimA1] | |
4472 | - *rotatingMatrix [sigma ][l]; | |
4593 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4594 | + *rotatingMatrix [mu ][i] | |
4595 | + *rotMat1stDerivatives [nu ][j][dimA2] | |
4596 | + *rotMat1stDerivatives [lambda][k][dimA1] | |
4597 | + *rotatingMatrix [sigma ][l]; | |
4473 | 4598 | // term20 |
4474 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4475 | - *rotatingMatrix [mu ][i] | |
4476 | - *rotatingMatrix [nu ][j] | |
4477 | - *rotMat1stDerivatives[lambda][k][dimA1] | |
4478 | - *rotMat1stDerivatives[sigma ][l][dimA2]; | |
4599 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4600 | + *rotatingMatrix [mu ][i] | |
4601 | + *rotatingMatrix [nu ][j] | |
4602 | + *rotMat1stDerivatives [lambda][k][dimA1] | |
4603 | + *rotMat1stDerivatives [sigma ][l][dimA2]; | |
4479 | 4604 | |
4480 | 4605 | // term21 |
4481 | - value += diatomicTwoElecTwoCore1stDerivatives[i][j][k][l][dimA2] | |
4482 | - *rotatingMatrix [mu ][i] | |
4483 | - *rotatingMatrix [nu ][j] | |
4484 | - *rotatingMatrix [lambda][k] | |
4485 | - *rotMat1stDerivatives[sigma ][l][dimA1]; | |
4606 | + value += diatomicTwoElecsTwoCores1stDerivatives[i][j][k][l][dimA2] | |
4607 | + *rotatingMatrix [mu ][i] | |
4608 | + *rotatingMatrix [nu ][j] | |
4609 | + *rotatingMatrix [lambda][k] | |
4610 | + *rotMat1stDerivatives [sigma ][l][dimA1]; | |
4486 | 4611 | // term22 |
4487 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4488 | - *rotMat1stDerivatives[mu ][i][dimA2] | |
4489 | - *rotatingMatrix [nu ][j] | |
4490 | - *rotatingMatrix [lambda][k] | |
4491 | - *rotMat1stDerivatives[sigma ][l][dimA1]; | |
4612 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4613 | + *rotMat1stDerivatives [mu ][i][dimA2] | |
4614 | + *rotatingMatrix [nu ][j] | |
4615 | + *rotatingMatrix [lambda][k] | |
4616 | + *rotMat1stDerivatives [sigma ][l][dimA1]; | |
4492 | 4617 | // term23 |
4493 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4494 | - *rotatingMatrix [mu ][i] | |
4495 | - *rotMat1stDerivatives[nu ][j][dimA2] | |
4496 | - *rotatingMatrix [lambda][k] | |
4497 | - *rotMat1stDerivatives[sigma ][l][dimA1]; | |
4618 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4619 | + *rotatingMatrix [mu ][i] | |
4620 | + *rotMat1stDerivatives [nu ][j][dimA2] | |
4621 | + *rotatingMatrix [lambda][k] | |
4622 | + *rotMat1stDerivatives [sigma ][l][dimA1]; | |
4498 | 4623 | // term24 |
4499 | - value += diatomicTwoElecTwoCore[i][j][k][l] | |
4500 | - *rotatingMatrix [mu ][i] | |
4501 | - *rotatingMatrix [nu ][j] | |
4502 | - *rotMat1stDerivatives[lambda][k][dimA2] | |
4503 | - *rotMat1stDerivatives[sigma ][l][dimA1]; | |
4624 | + value += diatomicTwoElecsTwoCores[i][j][k][l] | |
4625 | + *rotatingMatrix [mu ][i] | |
4626 | + *rotatingMatrix [nu ][j] | |
4627 | + *rotMat1stDerivatives [lambda][k][dimA2] | |
4628 | + *rotMat1stDerivatives [sigma ][l][dimA1]; | |
4504 | 4629 | } |
4505 | 4630 | } |
4506 | 4631 | } |
@@ -4519,6 +4644,101 @@ void Mndo::RotateDiatomicTwoElecTwoCore2ndDerivativesToSpaceFrame( | ||
4519 | 4644 | // See Apendix in [DT_1977] |
4520 | 4645 | // Orbital mu and nu belong atom A, |
4521 | 4646 | // orbital lambda and sigma belong atomB. |
4647 | +double Mndo::GetNddoRepulsionIntegralPointCharge(const Atom& atomA, | |
4648 | + OrbitalType mu, | |
4649 | + OrbitalType nu, | |
4650 | + const Atom& atomB, // Point Charge | |
4651 | + OrbitalType lambda, | |
4652 | + OrbitalType sigma) const{ | |
4653 | + double value = 0.0; | |
4654 | + double DA=0.0; | |
4655 | + double DB=0.0; | |
4656 | + double rhoA = 0.0; | |
4657 | + double rhoB = 0.0; | |
4658 | + double x = atomA.GetXyz()[0]; | |
4659 | + double y = atomA.GetXyz()[1]; | |
4660 | + double z = atomA.GetXyz()[2]; | |
4661 | + double rAB = sqrt(pow(x,2.0) + pow(y,2.0) + pow(z,2.0)); | |
4662 | + int lA = 0; | |
4663 | + int lB = 0; | |
4664 | + // (28) in [DT_1977] | |
4665 | + if(mu == s && nu == s && lambda == s && sigma == s){ | |
4666 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, sQ, rAB); | |
4667 | + } | |
4668 | + // (29) in [DT_1977] | |
4669 | + else if(mu == s && nu == s && lambda == px && sigma == px){ | |
4670 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, sQ, rAB); | |
4671 | + double temp2 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, Qxx, rAB); | |
4672 | + value = temp1 + temp2; | |
4673 | + } | |
4674 | + else if(mu == s && nu == s && lambda == py && sigma == py){ | |
4675 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, sQ, rAB); | |
4676 | + double temp2 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, Qyy, rAB); | |
4677 | + value = temp1 + temp2; | |
4678 | + } | |
4679 | + // (30) in [DT_1977] | |
4680 | + else if(mu == s && nu == s && lambda == pz && sigma == pz){ | |
4681 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, sQ, rAB); | |
4682 | + double temp2 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, Qzz, rAB); | |
4683 | + value = temp1 + temp2; | |
4684 | + } | |
4685 | + // (31) in [DT_1977] | |
4686 | + else if(mu == px && nu == px && lambda == s && sigma == s){ | |
4687 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, sQ, rAB); | |
4688 | + double temp2 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, Qxx, sQ, rAB); | |
4689 | + value = temp1 + temp2; | |
4690 | + } | |
4691 | + else if(mu == py && nu == py && lambda == s && sigma == s){ | |
4692 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, sQ, rAB); | |
4693 | + double temp2 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, Qyy, sQ, rAB); | |
4694 | + value = temp1 + temp2; | |
4695 | + } | |
4696 | + // (32) in [DT_1977] | |
4697 | + else if(mu == pz && nu == pz && lambda == s && sigma == s){ | |
4698 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, sQ, rAB); | |
4699 | + double temp2 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, Qzz, sQ, rAB); | |
4700 | + value = temp1 + temp2; | |
4701 | + } | |
4702 | + // (38) in [DT_1977] | |
4703 | + else if(mu == s && nu == pz && lambda == s && sigma == s){ | |
4704 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, muz, sQ, rAB); | |
4705 | + value = temp1; | |
4706 | + } | |
4707 | + else if(mu == pz && nu == s && lambda == s && sigma == s){ | |
4708 | + value = this->GetNddoRepulsionIntegralPointCharge(atomA, nu, mu, atomB, lambda, sigma); | |
4709 | + } | |
4710 | + // (41) in [DT_1977] | |
4711 | + else if(mu == s && nu == s && lambda == s && sigma == pz){ | |
4712 | + double temp1 = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, sQ, muz, rAB); | |
4713 | + value = temp1; | |
4714 | + } | |
4715 | + else if(mu == s && nu == s && lambda == pz && sigma == s){ | |
4716 | + value = this->GetNddoRepulsionIntegralPointCharge(atomA, mu, nu, atomB, sigma, lambda); | |
4717 | + } | |
4718 | + // d-orbitals | |
4719 | + else if(mu == dxy || mu == dyz || mu == dzz || mu == dzx || mu == dxxyy || | |
4720 | + nu == dxy || nu == dyz || nu == dzz || nu == dzx || nu == dxxyy || | |
4721 | + lambda == dxy || lambda == dyz || lambda == dzz || lambda == dzx || lambda == dxxyy || | |
4722 | + sigma == dxy || sigma == dyz || sigma == dzz || sigma == dzx || sigma == dxxyy){ | |
4723 | + | |
4724 | + stringstream ss; | |
4725 | + ss << this->errorMessageGetNddoRepulsionIntegral; | |
4726 | + ss << this->errorMessageAtomA << AtomTypeStr(atomA.GetAtomType()) << endl; | |
4727 | + ss << "\t" << this->errorMessageOrbitalType << OrbitalTypeStr(mu) << endl; | |
4728 | + ss << "\t" << this->errorMessageOrbitalType << OrbitalTypeStr(nu) << endl; | |
4729 | + ss << this->errorMessageAtomB << AtomTypeStr(atomB.GetAtomType()) << endl; | |
4730 | + ss << "\t" << this->errorMessageOrbitalType << OrbitalTypeStr(lambda) << endl; | |
4731 | + ss << "\t" << this->errorMessageOrbitalType << OrbitalTypeStr(sigma) << endl; | |
4732 | + throw MolDSException(ss.str()); | |
4733 | + } | |
4734 | + else{ | |
4735 | + value = 0.0; | |
4736 | + } | |
4737 | + return value; | |
4738 | +} | |
4739 | +// See Apendix in [DT_1977] | |
4740 | +// Orbital mu and nu belong atom A, | |
4741 | +// orbital lambda and sigma belong atomB. | |
4522 | 4742 | double Mndo::GetNddoRepulsionIntegral(const Atom& atomA, |
4523 | 4743 | OrbitalType mu, |
4524 | 4744 | OrbitalType nu, |
@@ -6228,6 +6448,230 @@ double Mndo::GetNddoRepulsionIntegral2ndDerivative( | ||
6228 | 6448 | } |
6229 | 6449 | |
6230 | 6450 | // See Apendix in [DT_1977] |
6451 | +double Mndo::GetSemiEmpiricalMultipoleInteractionPointCharge(const Atom& atomA, | |
6452 | + const Atom& atomB, | |
6453 | + MultipoleType multipoleA, | |
6454 | + MultipoleType multipoleB, | |
6455 | + double rAB) const{ | |
6456 | + double value = 0.0; | |
6457 | + double DA = atomA.GetNddoDerivedParameterD(this->theory, multipoleA); | |
6458 | + double DB = atomB.GetNddoDerivedParameterD(this->theory, multipoleB); | |
6459 | + double rhoA = 0.0; | |
6460 | + double rhoB = 0.0; | |
6461 | + double a = rhoA + rhoB; | |
6462 | + | |
6463 | + // Eq. (52) in [DT_1977] | |
6464 | + if(multipoleA == sQ && multipoleB == sQ){ | |
6465 | + value = 1.0/sqrt(rAB*rAB + a*a); | |
6466 | + } | |
6467 | + // Eq. (53) in [DT_1977] | |
6468 | + else if(multipoleA == sQ && multipoleB == muz){ | |
6469 | + double temp1 = ((rAB+DB)*(rAB+DB)) + (a*a); | |
6470 | + double temp2 = ((rAB-DB)*(rAB-DB)) + (a*a); | |
6471 | + value = 1.0/sqrt(temp1)/2.0 - 1.0/sqrt(temp2)/2.0; | |
6472 | + } | |
6473 | + else if(multipoleA == muz && multipoleB == sQ){ | |
6474 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6475 | + value *= -1.0; | |
6476 | + } | |
6477 | + // Eq. (54) in [DT_1977] | |
6478 | + else if(multipoleA == sQ && multipoleB == Qxx){ | |
6479 | + double temp1 = (rAB*rAB) + (4.0*DB*DB) + (a*a); | |
6480 | + double temp2 = (rAB*rAB) + (a*a); | |
6481 | + value = 1.0/sqrt(temp1)/2.0 - 1.0/sqrt(temp2)/2.0; | |
6482 | + } | |
6483 | + else if(multipoleA == Qxx && multipoleB == sQ){ | |
6484 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6485 | + } | |
6486 | + else if(multipoleA == sQ && multipoleB == Qyy){ | |
6487 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, multipoleA, Qxx, rAB); | |
6488 | + } | |
6489 | + else if(multipoleA == Qyy && multipoleB == sQ){ | |
6490 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6491 | + } | |
6492 | + // Eq. (55) in [DT_1977] | |
6493 | + else if(multipoleA == sQ && multipoleB == Qzz){ | |
6494 | + double temp1 = ((rAB+2.0*DB)*(rAB+2.0*DB)) + (a*a); | |
6495 | + double temp2 = (rAB*rAB) + (a*a); | |
6496 | + double temp3 = ((rAB-2.0*DB)*(rAB-2.0*DB)) + (a*a); | |
6497 | + value = 1.0/sqrt(temp1)/4.0 - 1.0/sqrt(temp2)/2.0 + 1.0/sqrt(temp3)/4.0; | |
6498 | + } | |
6499 | + else if(multipoleA == Qzz && multipoleB == sQ){ | |
6500 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6501 | + } | |
6502 | + // Eq. (56) in [DT_1977] | |
6503 | + else if(multipoleA == mux && multipoleB == mux){ | |
6504 | + double temp1 = (rAB*rAB) + ((DA-DB)*(DA-DB)) + (a*a); | |
6505 | + double temp2 = (rAB*rAB) + ((DA+DB)*(DA+DB)) + (a*a); | |
6506 | + value = 1.0/sqrt(temp1)/2.0 - 1.0/sqrt(temp2)/2.0; | |
6507 | + } | |
6508 | + else if(multipoleA == muy && multipoleB == muy){ | |
6509 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, mux, mux, rAB); | |
6510 | + } | |
6511 | + // Eq. (57) in [DT_1977] | |
6512 | + else if(multipoleA == muz && multipoleB == muz){ | |
6513 | + double temp1 = ((rAB+DA-DB)*(rAB+DA-DB)) + (a*a); | |
6514 | + double temp2 = ((rAB+DA+DB)*(rAB+DA+DB)) + (a*a); | |
6515 | + double temp3 = ((rAB-DA-DB)*(rAB-DA-DB)) + (a*a); | |
6516 | + double temp4 = ((rAB-DA+DB)*(rAB-DA+DB)) + (a*a); | |
6517 | + value = 1.0/sqrt(temp1)/4.0 - 1.0/sqrt(temp2)/4.0 | |
6518 | + -1.0/sqrt(temp3)/4.0 + 1.0/sqrt(temp4)/4.0; | |
6519 | + } | |
6520 | + // Eq. (58) in [DT_1977] | |
6521 | + else if(multipoleA == mux && multipoleB == Qxz){ | |
6522 | + double temp1 = ((rAB-DB)*(rAB-DB)) + ((DA-DB)*(DA-DB)) + (a*a); | |
6523 | + double temp2 = ((rAB-DB)*(rAB-DB)) + ((DA+DB)*(DA+DB)) + (a*a); | |
6524 | + double temp3 = ((rAB+DB)*(rAB+DB)) + ((DA-DB)*(DA-DB)) + (a*a); | |
6525 | + double temp4 = ((rAB+DB)*(rAB+DB)) + ((DA+DB)*(DA+DB)) + (a*a); | |
6526 | + value =-1.0/sqrt(temp1)/4.0 + 1.0/sqrt(temp2)/4.0 | |
6527 | + +1.0/sqrt(temp3)/4.0 - 1.0/sqrt(temp4)/4.0; | |
6528 | + } | |
6529 | + else if(multipoleA == Qxz && multipoleB == mux){ | |
6530 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6531 | + value *= -1.0; | |
6532 | + } | |
6533 | + else if(multipoleA == muy && multipoleB == Qyz){ | |
6534 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, mux, Qxz, rAB); | |
6535 | + } | |
6536 | + else if(multipoleA == Qyz && multipoleB == muy){ | |
6537 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6538 | + value *= -1.0; | |
6539 | + } | |
6540 | + // Eq. (59) in [DT_1977] | |
6541 | + else if(multipoleA == muz && multipoleB == Qxx){ | |
6542 | + double temp1 = ((rAB+DA)*(rAB+DA)) + (4.0*DB*DB) + (a*a); | |
6543 | + double temp2 = ((rAB-DA)*(rAB-DA)) + (4.0*DB*DB) + (a*a); | |
6544 | + double temp3 = ((rAB+DA)*(rAB+DA)) + (a*a); | |
6545 | + double temp4 = ((rAB-DA)*(rAB-DA)) + (a*a); | |
6546 | + value =-1.0/sqrt(temp1)/4.0 + 1.0/sqrt(temp2)/4.0 | |
6547 | + +1.0/sqrt(temp3)/4.0 - 1.0/sqrt(temp4)/4.0; | |
6548 | + } | |
6549 | + else if(multipoleA == Qxx && multipoleB == muz){ | |
6550 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6551 | + value *= -1.0; | |
6552 | + } | |
6553 | + else if(multipoleA == muz && multipoleB == Qyy){ | |
6554 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, muz, Qxx, rAB); | |
6555 | + } | |
6556 | + else if(multipoleA == Qyy && multipoleB == muz){ | |
6557 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6558 | + value *= -1.0; | |
6559 | + } | |
6560 | + // Eq. (60) in [DT_1977] | |
6561 | + else if(multipoleA == muz && multipoleB == Qzz){ | |
6562 | + double temp1 = ((rAB+DA-2.0*DB)*(rAB+DA-2.0*DB)) + (a*a); | |
6563 | + double temp2 = ((rAB-DA-2.0*DB)*(rAB-DA-2.0*DB)) + (a*a); | |
6564 | + double temp3 = ((rAB+DA+2.0*DB)*(rAB+DA+2.0*DB)) + (a*a); | |
6565 | + double temp4 = ((rAB-DA+2.0*DB)*(rAB-DA+2.0*DB)) + (a*a); | |
6566 | + double temp5 = ((rAB+DA)*(rAB+DA)) + (a*a); | |
6567 | + double temp6 = ((rAB-DA)*(rAB-DA)) + (a*a); | |
6568 | + value =-1.0/sqrt(temp1)/8.0 + 1.0/sqrt(temp2)/8.0 | |
6569 | + -1.0/sqrt(temp3)/8.0 + 1.0/sqrt(temp4)/8.0 | |
6570 | + +1.0/sqrt(temp5)/4.0 - 1.0/sqrt(temp6)/4.0; | |
6571 | + } | |
6572 | + else if(multipoleA == Qzz && multipoleB == muz){ | |
6573 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6574 | + value *= -1.0; | |
6575 | + } | |
6576 | + // Eq. (61) in [DT_1977] | |
6577 | + else if(multipoleA == Qxx && multipoleB == Qxx){ | |
6578 | + double temp1 = (rAB*rAB) + 4.0*((DA-DB)*(DA-DB)) + (a*a); | |
6579 | + double temp2 = (rAB*rAB) + 4.0*((DA+DB)*(DA+DB)) + (a*a); | |
6580 | + double temp3 = (rAB*rAB) + (4.0*DA*DA) + (a*a); | |
6581 | + double temp4 = (rAB*rAB) + (4.0*DB*DB) + (a*a); | |
6582 | + double temp5 = (rAB*rAB) + (a*a); | |
6583 | + value = 1.0/sqrt(temp1)/8.0 + 1.0/sqrt(temp2)/8.0 | |
6584 | + -1.0/sqrt(temp3)/4.0 - 1.0/sqrt(temp4)/4.0 | |
6585 | + +1.0/sqrt(temp5)/4.0; | |
6586 | + } | |
6587 | + else if(multipoleA == Qyy && multipoleB == Qyy){ | |
6588 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, Qxx, Qxx, rAB); | |
6589 | + } | |
6590 | + // Eq. (62) in [DT_1977] | |
6591 | + else if(multipoleA == Qxx && multipoleB == Qyy){ | |
6592 | + double temp1 = (rAB*rAB) + (4.0*DA*DA) + (4.0*DB*DB)+ (a*a); | |
6593 | + double temp2 = (rAB*rAB) + (4.0*DA*DA) + (a*a); | |
6594 | + double temp3 = (rAB*rAB) + (4.0*DB*DB) + (a*a); | |
6595 | + double temp4 = (rAB*rAB) + (a*a); | |
6596 | + value = 1.0/sqrt(temp1)/4.0 - 1.0/sqrt(temp2)/4.0 | |
6597 | + -1.0/sqrt(temp3)/4.0 + 1.0/sqrt(temp4)/4.0; | |
6598 | + } | |
6599 | + else if(multipoleA == Qyy && multipoleB == Qxx){ | |
6600 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6601 | + } | |
6602 | + // Eq. (63) in [DT_1977] | |
6603 | + else if(multipoleA == Qxx && multipoleB == Qzz){ | |
6604 | + double temp1 = ((rAB-2.0*DB)*(rAB-2.0*DB)) + (4.0*DA*DA) + (a*a); | |
6605 | + double temp2 = ((rAB+2.0*DB)*(rAB+2.0*DB)) + (4.0*DA*DA) + (a*a); | |
6606 | + double temp3 = ((rAB-2.0*DB)*(rAB-2.0*DB)) + (a*a); | |
6607 | + double temp4 = ((rAB+2.0*DB)*(rAB+2.0*DB)) + (a*a); | |
6608 | + double temp5 = (rAB*rAB) + (4.0*DA*DA) + (a*a); | |
6609 | + double temp6 = (rAB*rAB) + (a*a); | |
6610 | + value = 1.0/sqrt(temp1)/8.0 + 1.0/sqrt(temp2)/8.0 | |
6611 | + -1.0/sqrt(temp3)/8.0 - 1.0/sqrt(temp4)/8.0 | |
6612 | + -1.0/sqrt(temp5)/4.0 + 1.0/sqrt(temp6)/4.0; | |
6613 | + } | |
6614 | + else if(multipoleA == Qzz && multipoleB == Qxx){ | |
6615 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6616 | + } | |
6617 | + else if(multipoleA == Qyy && multipoleB == Qzz){ | |
6618 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, Qxx, multipoleB, rAB); | |
6619 | + } | |
6620 | + else if(multipoleA == Qzz && multipoleB == Qyy){ | |
6621 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomB, atomA, multipoleB, multipoleA, rAB); | |
6622 | + } | |
6623 | + // Eq. (64) in [DT_1977] | |
6624 | + else if(multipoleA == Qzz && multipoleB == Qzz){ | |
6625 | + double temp1 = ((rAB+2.0*DA-2.0*DB)*(rAB+2.0*DA-2.0*DB)) + (a*a); | |
6626 | + double temp2 = ((rAB+2.0*DA+2.0*DB)*(rAB+2.0*DA+2.0*DB)) + (a*a); | |
6627 | + double temp3 = ((rAB-2.0*DA-2.0*DB)*(rAB-2.0*DA-2.0*DB)) + (a*a); | |
6628 | + double temp4 = ((rAB-2.0*DA+2.0*DB)*(rAB-2.0*DA+2.0*DB)) + (a*a); | |
6629 | + double temp5 = ((rAB+2.0*DA)*(rAB+2.0*DA)) + (a*a); | |
6630 | + double temp6 = ((rAB-2.0*DA)*(rAB-2.0*DA)) + (a*a); | |
6631 | + double temp7 = ((rAB+2.0*DB)*(rAB+2.0*DB)) + (a*a); | |
6632 | + double temp8 = ((rAB-2.0*DB)*(rAB-2.0*DB)) + (a*a); | |
6633 | + double temp9 = (rAB*rAB) + (a*a); | |
6634 | + value = 1.0/sqrt(temp1)/16.0 + 1.0/sqrt(temp2)/16.0 | |
6635 | + +1.0/sqrt(temp3)/16.0 + 1.0/sqrt(temp4)/16.0 | |
6636 | + -1.0/sqrt(temp5)/8.0 - 1.0/sqrt(temp6)/8.0 | |
6637 | + -1.0/sqrt(temp7)/8.0 - 1.0/sqrt(temp8)/8.0 | |
6638 | + +1.0/sqrt(temp9)/4.0; | |
6639 | + } | |
6640 | + // Eq. (65) in [DT_1977] | |
6641 | + else if(multipoleA == Qxz && multipoleB == Qxz){ | |
6642 | + double temp1 = ((rAB+DA-DB)*(rAB+DA-DB)) + ((DA-DB)*(DA-DB)) + (a*a); | |
6643 | + double temp2 = ((rAB+DA-DB)*(rAB+DA-DB)) + ((DA+DB)*(DA+DB)) + (a*a); | |
6644 | + double temp3 = ((rAB+DA+DB)*(rAB+DA+DB)) + ((DA-DB)*(DA-DB)) + (a*a); | |
6645 | + double temp4 = ((rAB+DA+DB)*(rAB+DA+DB)) + ((DA+DB)*(DA+DB)) + (a*a); | |
6646 | + double temp5 = ((rAB-DA-DB)*(rAB-DA-DB)) + ((DA-DB)*(DA-DB)) + (a*a); | |
6647 | + double temp6 = ((rAB-DA-DB)*(rAB-DA-DB)) + ((DA+DB)*(DA+DB)) + (a*a); | |
6648 | + double temp7 = ((rAB-DA+DB)*(rAB-DA+DB)) + ((DA-DB)*(DA-DB)) + (a*a); | |
6649 | + double temp8 = ((rAB-DA+DB)*(rAB-DA+DB)) + ((DA+DB)*(DA+DB)) + (a*a); | |
6650 | + value = 1.0/sqrt(temp1)/8.0 - 1.0/sqrt(temp2)/8.0 | |
6651 | + -1.0/sqrt(temp3)/8.0 + 1.0/sqrt(temp4)/8.0 | |
6652 | + -1.0/sqrt(temp5)/8.0 + 1.0/sqrt(temp6)/8.0 | |
6653 | + +1.0/sqrt(temp7)/8.0 - 1.0/sqrt(temp8)/8.0; | |
6654 | + } | |
6655 | + else if(multipoleA == Qyz && multipoleB == Qyz){ | |
6656 | + value = this->GetSemiEmpiricalMultipoleInteractionPointCharge(atomA, atomB, Qxz, Qxz, rAB); | |
6657 | + } | |
6658 | + // Eq. (66) in [DT_1977] | |
6659 | + else if(multipoleA == Qxy && multipoleB == Qxy){ | |
6660 | + double temp1 = (rAB*rAB) + 2.0*((DA-DB)*(DA-DB)) + (a*a); | |
6661 | + double temp2 = (rAB*rAB) + 2.0*((DA+DB)*(DA+DB)) + (a*a); | |
6662 | + double temp3 = (rAB*rAB) + 2.0*(DA*DA) + 2.0*(DB*DB) + (a*a); | |
6663 | + value = 1.0/sqrt(temp1)/4.0 + 1.0/sqrt(temp2)/4.0 | |
6664 | + -1.0/sqrt(temp3)/2.0; | |
6665 | + } | |
6666 | + else{ | |
6667 | + stringstream ss; | |
6668 | + ss << this->errorMessageGetSemiEmpiricalMultipoleInteractionBadMultipoles; | |
6669 | + ss << this->errorMessageMultipoleA << MultipoleTypeStr(multipoleA) << endl; | |
6670 | + ss << this->errorMessageMultipoleB << MultipoleTypeStr(multipoleB) << endl; | |
6671 | + throw MolDSException(ss.str()); | |
6672 | + } | |
6673 | + return value; | |
6674 | +} | |
6231 | 6675 | double Mndo::GetSemiEmpiricalMultipoleInteraction(const Atom& atomA, |
6232 | 6676 | const Atom& atomB, |
6233 | 6677 | MultipoleType multipoleA, |
@@ -36,13 +36,13 @@ protected: | ||
36 | 36 | std::string errorMessageGetNddoRepulsionIntegral; |
37 | 37 | std::string errorMessageGetNddoRepulsionIntegral1stDerivative; |
38 | 38 | std::string errorMessageGetNddoRepulsionIntegral2ndDerivative; |
39 | - std::string errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix; | |
40 | - std::string errorMessageCalcTwoElecTwoCoreNullMatrix; | |
41 | - std::string errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms; | |
42 | - std::string errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms; | |
43 | - std::string errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms; | |
44 | - std::string errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix; | |
45 | - std::string errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix; | |
39 | + std::string errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix; | |
40 | + std::string errorMessageCalcTwoElecsTwoCoresNullMatrix; | |
41 | + std::string errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms; | |
42 | + std::string errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms; | |
43 | + std::string errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms; | |
44 | + std::string errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix; | |
45 | + std::string errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix; | |
46 | 46 | virtual void SetMessages(); |
47 | 47 | virtual void SetEnableAtomTypes(); |
48 | 48 | virtual void CalcSCFProperties(); |
@@ -63,7 +63,7 @@ protected: | ||
63 | 63 | double const* const* gammaAB, |
64 | 64 | double const* const* orbitalElectronPopulation, |
65 | 65 | double const* atomicElectronPopulation, |
66 | - double const* const* const* const* const* const* twoElecTwoCore, | |
66 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
67 | 67 | bool isGuess) const; |
68 | 68 | virtual double GetFockOffDiagElement(const MolDS_base_atoms::Atom& atomA, |
69 | 69 | const MolDS_base_atoms::Atom& atomB, |
@@ -74,7 +74,7 @@ protected: | ||
74 | 74 | double const* const* gammaAB, |
75 | 75 | double const* const* overelap, |
76 | 76 | double const* const* orbitalElectronPopulation, |
77 | - double const* const* const* const* const* const* twoElecTwoCore, | |
77 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
78 | 78 | bool isGuess) const; |
79 | 79 | virtual void CalcDiatomicOverlapAOsInDiatomicFrame(double** diatomicOverlapAOs, |
80 | 80 | const MolDS_base_atoms::Atom& atomA, |
@@ -91,8 +91,8 @@ protected: | ||
91 | 91 | virtual double GetExchangeInt(MolDS_base::OrbitalType orbital1, |
92 | 92 | MolDS_base::OrbitalType orbital2, |
93 | 93 | const MolDS_base_atoms::Atom& atom) const; |
94 | - virtual void CalcTwoElecTwoCore(double****** twoElecTwoCore, | |
95 | - const MolDS_base::Molecule& molecule) const; | |
94 | + virtual void CalcTwoElecsTwoCores(double****** twoElecsTwoAtomCores, | |
95 | + const MolDS_base::Molecule& molecule) const; | |
96 | 96 | virtual double GetMolecularIntegralElement(int moI, |
97 | 97 | int moJ, |
98 | 98 | int moK, |
@@ -112,7 +112,7 @@ private: | ||
112 | 112 | std::string errorMessageMultipoleB; |
113 | 113 | std::string messageHeatsFormation; |
114 | 114 | std::string messageHeatsFormationTitle; |
115 | - double**** twoElecTwoCoreMpiBuff; | |
115 | + double**** twoElecsTwoAtomCoresMpiBuff; | |
116 | 116 | double heatsFormation; |
117 | 117 | double GetAuxiliaryDiatomCoreRepulsionEnergy(const MolDS_base_atoms::Atom& atomA, |
118 | 118 | const MolDS_base_atoms::Atom& atomB, |
@@ -136,8 +136,8 @@ private: | ||
136 | 136 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
137 | 137 | double const* const* const* const* diatomicOverlapAOs1stDerivs, |
138 | 138 | double const* const* const* const* const* diatomicOverlapAOs2ndDerivs, |
139 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs, | |
140 | - double const* const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const; | |
139 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs, | |
140 | + double const* const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const; | |
141 | 141 | double GetHessianElementDifferentAtomsSCF(int indexAtomA, |
142 | 142 | int indexAtomB, |
143 | 143 | MolDS_base::CartesianType axisA, |
@@ -146,18 +146,18 @@ private: | ||
146 | 146 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
147 | 147 | double const* const* const* const* diatomicOverlapAOs1stDerivs, |
148 | 148 | double const* const* const* const* const* diatomicOverlapAOs2ndDerivs, |
149 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs, | |
150 | - double const* const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const; | |
149 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs, | |
150 | + double const* const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const; | |
151 | 151 | void MallocTempMatricesEachThreadCalcHessianSCF(double***** diatomicOverlapAOs1stDerivs, |
152 | 152 | double****** diatomicOverlapAOs2ndDerivs, |
153 | - double******* diatomicTwoElecTwoCore1stDerivs, | |
154 | - double******** diatomicTwoElecTwoCore2ndDerivs, | |
153 | + double******* diatomicTwoElecsTwoCores1stDerivs, | |
154 | + double******** diatomicTwoElecsTwoCores2ndDerivs, | |
155 | 155 | double*** tmpRotMat, |
156 | 156 | double*** tmpRotMat1stDeriv, |
157 | 157 | double**** tmpRotMat1stDerivs, |
158 | 158 | double***** tmpRotMat2ndDerivs, |
159 | - double***** tmpDiatomicTwoElecTwoCore, | |
160 | - double****** tmpDiatomicTwoElecTwoCore1stDerivs, | |
159 | + double***** tmpDiatomicTwoElecsTwoCores, | |
160 | + double****** tmpDiatomicTwoElecsTwoCores1stDerivs, | |
161 | 161 | double*** tmpDiaOverlapAOsInDiaFrame, |
162 | 162 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
163 | 163 | double*** tmpDiaOverlapAOs2ndDerivInDiaFrame, |
@@ -169,14 +169,14 @@ private: | ||
169 | 169 | double** tmpVectorBC) const; |
170 | 170 | void FreeTempMatricesEachThreadCalcHessianSCF(double***** diatomicOverlapAOs1stDerivs, |
171 | 171 | double****** diatomicOverlapAOs2ndDerivs, |
172 | - double******* diatomicTwoElecTwoCore1stDerivs, | |
173 | - double******** diatomicTwoElecTwoCore2ndDerivs, | |
172 | + double******* diatomicTwoElecsTwoCores1stDerivs, | |
173 | + double******** diatomicTwoElecsTwoCores2ndDerivs, | |
174 | 174 | double*** tmpRotMat, |
175 | 175 | double*** tmpRotMat1stDeriv, |
176 | 176 | double**** tmpRotMat1stDerivs, |
177 | 177 | double***** tmpRotMat2ndDerivs, |
178 | - double***** tmpDiatomicTwoElecTwoCore, | |
179 | - double****** tmpDiatomicTwoElecTwoCore1stDerivs, | |
178 | + double***** tmpDiatomicTwoElecsTwoCores, | |
179 | + double****** tmpDiatomicTwoElecsTwoCores1stDerivs, | |
180 | 180 | double*** tmpDiaOverlapAOsInDiaFrame, |
181 | 181 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
182 | 182 | double*** tmpDiaOverlapAOs2ndDerivInDiaFrame, |
@@ -193,7 +193,7 @@ private: | ||
193 | 193 | MolDS_base::CartesianType axisA1, |
194 | 194 | MolDS_base::CartesianType axisA2, |
195 | 195 | double const* const* orbitalElectronPopulation, |
196 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const; | |
196 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const; | |
197 | 197 | double GetAuxiliaryHessianElement2(int mu, |
198 | 198 | int nu, |
199 | 199 | int indexAtomA, |
@@ -202,7 +202,7 @@ private: | ||
202 | 202 | MolDS_base::CartesianType axisA, |
203 | 203 | MolDS_base::CartesianType axisB, |
204 | 204 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
205 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
205 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
206 | 206 | double GetAuxiliaryHessianElement3(int lambda, |
207 | 207 | int sigma, |
208 | 208 | int indexAtomA, |
@@ -210,7 +210,7 @@ private: | ||
210 | 210 | MolDS_base::CartesianType axisA1, |
211 | 211 | MolDS_base::CartesianType axisA2, |
212 | 212 | double const* const* orbitalElectronPopulation, |
213 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const; | |
213 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const; | |
214 | 214 | double GetAuxiliaryHessianElement4(int lambda, |
215 | 215 | int sigma, |
216 | 216 | int indexAtomA, |
@@ -219,7 +219,7 @@ private: | ||
219 | 219 | MolDS_base::CartesianType axisA, |
220 | 220 | MolDS_base::CartesianType axisB, |
221 | 221 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
222 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
222 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
223 | 223 | double GetAuxiliaryHessianElement5(int mu, |
224 | 224 | int lambda, |
225 | 225 | int indexAtomA, |
@@ -246,7 +246,7 @@ private: | ||
246 | 246 | MolDS_base::CartesianType axisA1, |
247 | 247 | MolDS_base::CartesianType axisA2, |
248 | 248 | double const* const* orbitalElectronPopulation, |
249 | - double const* const* const* const* const* const* diatomicTwoElecTwoCore2ndDerivs) const; | |
249 | + double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const; | |
250 | 250 | double GetAuxiliaryHessianElement8(int mu, |
251 | 251 | int nu, |
252 | 252 | int lambda, |
@@ -258,7 +258,7 @@ private: | ||
258 | 258 | MolDS_base::CartesianType axisB, |
259 | 259 | double const* const* orbitalElectronPopulation, |
260 | 260 | double const* const* const* const* orbitalElectronPopulation1stDerivs, |
261 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
261 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
262 | 262 | void CalcOrbitalElectronPopulation1stDerivatives(double**** orbitalElectronPopulation1stDerivatives) const; |
263 | 263 | void SolveCPHF(double** solutionsCPHF, |
264 | 264 | const std::vector<MoIndexPair>& nonRedundantQIndeces, |
@@ -271,12 +271,12 @@ private: | ||
271 | 271 | const std::vector<MoIndexPair>& redundantQIndeces, |
272 | 272 | int indexAtomA, |
273 | 273 | MolDS_base::CartesianType axisA) const; |
274 | - void MallocTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecTwoCore1stDeriv, | |
274 | + void MallocTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecsTwoCores1stDeriv, | |
275 | 275 | double**** diatomicOverlapAOs1stDeriv, |
276 | 276 | double*** tmpRotMat, |
277 | 277 | double**** tmpRotMat1stDerivs, |
278 | 278 | double***** tmpDiatomicTwoElecTwo) const; |
279 | - void FreeTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecTwoCore1stDeriv, | |
279 | + void FreeTempMatricesStaticFirstOrderFock(double****** diatomicTwoElecsTwoCores1stDeriv, | |
280 | 280 | double**** diatomicOverlapAOs1stDeriv, |
281 | 281 | double*** tmpRotMat, |
282 | 282 | double**** tmpRotMat1stDerivs, |
@@ -294,50 +294,66 @@ private: | ||
294 | 294 | int indexAtomB, |
295 | 295 | int mu, |
296 | 296 | int nu, |
297 | - double const* const* const* const* const* const* twoElecTwoCore) const; | |
297 | + double const* const* const* const* const* const* twoElecsTwoAtomCores) const; | |
298 | 298 | double GetElectronCoreAttraction1stDerivative(int indexAtomA, |
299 | 299 | int indexAtomB, |
300 | 300 | int mu, |
301 | 301 | int nu, |
302 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivatives, | |
302 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivatives, | |
303 | 303 | MolDS_base::CartesianType axisA) const; |
304 | - void CalcDiatomicTwoElecTwoCore(double**** matrix, | |
304 | + void CalcDiatomicTwoElecsTwoCoresPointCharge(double**** matrix, | |
305 | 305 | double* tmpVec, |
306 | 306 | double** tmpRotMat, |
307 | 307 | double** tmpMatrixBC, |
308 | 308 | double* tmpVectorBC, |
309 | - int indexAtomA, | |
310 | - int indexAtomB) const; | |
311 | - void CalcDiatomicTwoElecTwoCore1stDerivatives(double***** matrix, | |
312 | - double** tmpRotMat, | |
313 | - double*** tmpRotMat1stDerivs, | |
314 | - double**** tmpDiatomicTwoElecTwoCore, | |
315 | - int indexAtomA, | |
316 | - int indexAtomB) const; | |
317 | - void CalcDiatomicTwoElecTwoCore2ndDerivatives(double****** matrix, | |
318 | - double** tmpRotMat, | |
319 | - double*** tmpRotMat1stDerivs, | |
320 | - double**** tmpRotMat2ndDerivs, | |
321 | - double**** tmpDiatomicTwoElecTwoCore, | |
322 | - double***** tmpDiatomicTwoElecTwoCore1stDerivs, | |
323 | - int indexAtomA, | |
324 | - int indexAtomB) const; | |
325 | - void RotateDiatomicTwoElecTwoCoreToSpaceFrame(double**** matrix, | |
326 | - double* tmpVec, | |
327 | - double const* const* rotatingMatrix, | |
328 | - double** tmpMatrixBC, | |
329 | - double* tmpVectorBC) const; | |
330 | - void RotateDiatomicTwoElecTwoCore1stDerivativesToSpaceFrame(double***** matrix, | |
331 | - double const* const* const* const* diatomicTwoElecTwoCore, | |
332 | - double const* const* rotatingMatrix, | |
333 | - double const* const* const* rotMat1stDerivatives) const; | |
334 | - void RotateDiatomicTwoElecTwoCore2ndDerivativesToSpaceFrame(double****** matrix, | |
335 | - double const* const* const* const* diatomicTwoElecTwoCore, | |
336 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivatives, | |
337 | - double const* const* rotatingMatrix, | |
338 | - double const* const* const* rotMat1stDerivatives, | |
339 | - double const* const* const* const* rotMat2ndDerivatives) const; | |
340 | - void MallocTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(double*** twiceRotatingMatrix, | |
309 | + const MolDS_base_atoms::Atom& atomA, | |
310 | + const MolDS_base_atoms::Atom& pc) const; | |
311 | + void CalcDiatomicTwoElecsTwoCores(double**** matrix, | |
312 | + double* tmpVec, | |
313 | + double** tmpRotMat, | |
314 | + double** tmpMatrixBC, | |
315 | + double* tmpVectorBC, | |
316 | + int indexAtomA, | |
317 | + int indexAtomB) const; | |
318 | + void CalcDiatomicTwoElecsTwoCores1stDerivatives(double***** matrix, | |
319 | + double** tmpRotMat, | |
320 | + double*** tmpRotMat1stDerivs, | |
321 | + double**** tmpDiatomicTwoElecsTwoCores, | |
322 | + int indexAtomA, | |
323 | + int indexAtomB) const; | |
324 | + void CalcDiatomicTwoElecsTwoCores2ndDerivatives(double****** matrix, | |
325 | + double** tmpRotMat, | |
326 | + double*** tmpRotMat1stDerivs, | |
327 | + double**** tmpRotMat2ndDerivs, | |
328 | + double**** tmpDiatomicTwoElecsTwoCores, | |
329 | + double***** tmpDiatomicTwoElecsTwoCores1stDerivs, | |
330 | + int indexAtomA, | |
331 | + int indexAtomB) const; | |
332 | + void RotateDiatomicTwoElecsTwoCoresToSpaceFrame(double**** matrix, | |
333 | + double* tmpVec, | |
334 | + double const* const* rotatingMatrix, | |
335 | + double** tmpMatrixBC, | |
336 | + double* tmpVectorBC) const; | |
337 | + void RotateDiatomicTwoElecsTwoCores1stDerivativesToSpaceFrame(double***** matrix, | |
338 | + double const* const* const* const* diatomicTwoElecsTwoCores, | |
339 | + double const* const* rotatingMatrix, | |
340 | + double const* const* const* rotMat1stDerivatives) const; | |
341 | + void RotateDiatomicTwoElecsTwoCores2ndDerivativesToSpaceFrame(double****** matrix, | |
342 | + double const* const* const* const* diatomicTwoElecsTwoCores, | |
343 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivatives, | |
344 | + double const* const* rotatingMatrix, | |
345 | + double const* const* const* rotMat1stDerivatives, | |
346 | + double const* const* const* const* rotMat2ndDerivatives) const; | |
347 | + void MallocTempMatricesRotateDiatomicTwoElecsTwoCores1stDerivs(double*** twiceRotatingMatrix, | |
348 | + double*** twiceRotatingMatrixDerivA, | |
349 | + double*** twiceRotatingMatrixDerivB, | |
350 | + double*** oldMatrix, | |
351 | + double*** rotatedMatrix, | |
352 | + double** tmpRotatedVec, | |
353 | + double*** tmpMatrix, | |
354 | + double** tmpVector, | |
355 | + double*** ptrDiatomic) const; | |
356 | + void FreeTempMatricesRotateDiatomicTwoElecsTwoCores1stDerivs(double*** twiceRotatingMatrix, | |
341 | 357 | double*** twiceRotatingMatrixDerivA, |
342 | 358 | double*** twiceRotatingMatrixDerivB, |
343 | 359 | double*** oldMatrix, |
@@ -346,15 +362,12 @@ private: | ||
346 | 362 | double*** tmpMatrix, |
347 | 363 | double** tmpVector, |
348 | 364 | double*** ptrDiatomic) const; |
349 | - void FreeTempMatricesRotateDiatomicTwoElecTwoCore1stDerivs(double*** twiceRotatingMatrix, | |
350 | - double*** twiceRotatingMatrixDerivA, | |
351 | - double*** twiceRotatingMatrixDerivB, | |
352 | - double*** oldMatrix, | |
353 | - double*** rotatedMatrix, | |
354 | - double** tmpRotatedVec, | |
355 | - double*** tmpMatrix, | |
356 | - double** tmpVector, | |
357 | - double*** ptrDiatomic) const; | |
365 | + double GetNddoRepulsionIntegralPointCharge(const MolDS_base_atoms::Atom& atomA, | |
366 | + MolDS_base::OrbitalType mu, | |
367 | + MolDS_base::OrbitalType nu, | |
368 | + const MolDS_base_atoms::Atom& atomB, | |
369 | + MolDS_base::OrbitalType lambda, | |
370 | + MolDS_base::OrbitalType sigma) const; | |
358 | 371 | double GetNddoRepulsionIntegral(const MolDS_base_atoms::Atom& atomA, |
359 | 372 | MolDS_base::OrbitalType mu, |
360 | 373 | MolDS_base::OrbitalType nu, |
@@ -376,6 +389,11 @@ private: | ||
376 | 389 | MolDS_base::OrbitalType sigma, |
377 | 390 | MolDS_base::CartesianType axisA1, |
378 | 391 | MolDS_base::CartesianType axisA2) const; |
392 | + double GetSemiEmpiricalMultipoleInteractionPointCharge(const MolDS_base_atoms::Atom& atomA, | |
393 | + const MolDS_base_atoms::Atom& atomB, | |
394 | + MolDS_base::MultipoleType multipoleA, | |
395 | + MolDS_base::MultipoleType multipoleB, | |
396 | + double rAB) const; | |
379 | 397 | double GetSemiEmpiricalMultipoleInteraction(const MolDS_base_atoms::Atom& atomA, |
380 | 398 | const MolDS_base_atoms::Atom& atomB, |
381 | 399 | MolDS_base::MultipoleType multipoleA, |
@@ -392,7 +410,7 @@ private: | ||
392 | 410 | MolDS_base::MultipoleType multipoleB, |
393 | 411 | double rAB) const; |
394 | 412 | void MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
395 | - double****** diatomicTwoElecTwoCore1stDerivs, | |
413 | + double****** diatomicTwoElecsTwoCores1stDerivs, | |
396 | 414 | double*** tmpDiaOverlapAOsInDiaFrame, |
397 | 415 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
398 | 416 | double*** tmpRotMat, |
@@ -402,9 +420,9 @@ private: | ||
402 | 420 | double** tmpRotatedDiatomicOverlapVec, |
403 | 421 | double*** tmpMatrixBC, |
404 | 422 | double** tmpVectorBC, |
405 | - double***** tmpDiatomicTwoElecTwoCore) const; | |
423 | + double***** tmpDiatomicTwoElecsTwoCores) const; | |
406 | 424 | void FreeTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
407 | - double****** diatomicTwoElecTwoCore1stDerivs, | |
425 | + double****** diatomicTwoElecsTwoCores1stDerivs, | |
408 | 426 | double*** tmpDiaOverlapAOsInDiaFrame, |
409 | 427 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
410 | 428 | double*** tmpRotMat, |
@@ -414,11 +432,11 @@ private: | ||
414 | 432 | double** tmpRotatedDiatomicOverlapVec, |
415 | 433 | double*** tmpMatrixBC, |
416 | 434 | double** tmpVectorBC, |
417 | - double***** tmpDiatomicTwoElecTwoCore) const; | |
435 | + double***** tmpDiatomicTwoElecsTwoCores) const; | |
418 | 436 | void CalcForceSCFElecCoreAttractionPart(double* force, |
419 | 437 | int indexAtomA, |
420 | 438 | int indexAtomB, |
421 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
439 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
422 | 440 | void CalcForceSCFOverlapAOsPart(double* force, |
423 | 441 | int indexAtomA, |
424 | 442 | int indexAtomB, |
@@ -426,22 +444,22 @@ private: | ||
426 | 444 | void CalcForceSCFTwoElecPart(double* force, |
427 | 445 | int indexAtomA, |
428 | 446 | int indexAtomB, |
429 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
447 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
430 | 448 | void CalcForceExcitedStaticPart(double* force, |
431 | 449 | int elecStateIndex, |
432 | 450 | int indexAtomA, |
433 | 451 | int indexAtomB, |
434 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
452 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
435 | 453 | void CalcForceExcitedElecCoreAttractionPart(double* force, |
436 | 454 | int elecStateIndex, |
437 | 455 | int indexAtomA, |
438 | 456 | int indexAtomB, |
439 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
457 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
440 | 458 | void CalcForceExcitedTwoElecPart(double* force, |
441 | 459 | int elecStateIndex, |
442 | 460 | int indexAtomA, |
443 | 461 | int indexAtomB, |
444 | - double const* const* const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
462 | + double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
445 | 463 | |
446 | 464 | }; |
447 | 465 |
@@ -94,20 +94,20 @@ void Pm3::SetMessages(){ | ||
94 | 94 | = "Error in pm3::Pm3::GetNddoRepulsionIntegral1stDerivative: Bad orbital is set.\n"; |
95 | 95 | this->errorMessageGetNddoRepulsionIntegral2ndDerivative |
96 | 96 | = "Error in pm3::Pm3::GetNddoRepulsionIntegral2ndDerivative: Bad orbital is set.\n"; |
97 | - this->errorMessageCalcTwoElecTwoCoreNullMatrix | |
98 | - = "Error in pm3::Pm3::CalcTwoElecTwoCore: The two elec two core matrix is NULL.\n"; | |
99 | - this->errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms | |
100 | - = "Error in pm3::Pm3::CalcDiatomicTwoElecTwoCore: Atom A and B is same.\n"; | |
101 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms | |
102 | - = "Error in pm3::Pm3::CalcDiatomicTwoElecTwoCore1stDerivatives: Atom A and B is same.\n"; | |
103 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms | |
104 | - = "Error in pm3::Pm3::CalcDiatomicTwoElecTwoCore2ndDerivatives: Atom A and B is same.\n"; | |
105 | - this->errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix | |
106 | - = "Error in pm3::Pm3::CalcDiatomicTwoElecTwoCore: The two elec two core diatomic matrix is NULL.\n"; | |
107 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix | |
108 | - = "Error in pm3::Pm3::CalcDiatomicTwoElecTwoCore1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
109 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix | |
110 | - = "Error in pm3::Pm3::CalcDiatomicTwoElecTwoCore2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
97 | + this->errorMessageCalcTwoElecsTwoCoresNullMatrix | |
98 | + = "Error in pm3::Pm3::CalcTwoElecsTwoCores: The two elec two core matrix is NULL.\n"; | |
99 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms | |
100 | + = "Error in pm3::Pm3::CalcDiatomicTwoElecsTwoCores: Atom A and B is same.\n"; | |
101 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms | |
102 | + = "Error in pm3::Pm3::CalcDiatomicTwoElecsTwoCores1stDerivatives: Atom A and B is same.\n"; | |
103 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms | |
104 | + = "Error in pm3::Pm3::CalcDiatomicTwoElecsTwoCores2ndDerivatives: Atom A and B is same.\n"; | |
105 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix | |
106 | + = "Error in pm3::Pm3::CalcDiatomicTwoElecsTwoCores: The two elec two core diatomic matrix is NULL.\n"; | |
107 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix | |
108 | + = "Error in pm3::Pm3::CalcDiatomicTwoElecsTwoCores1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
109 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix | |
110 | + = "Error in pm3::Pm3::CalcDiatomicTwoElecsTwoCores2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
111 | 111 | this->errorMessageGetElectronicEnergyEnergyNotCalculated |
112 | 112 | = "Error in pm3::Pm3::GetElectronicEnergy: Set electronic state is not calculated by CIS.\n"; |
113 | 113 | this->errorMessageGetElectronicEnergyNULLCISEnergy |
@@ -95,20 +95,20 @@ void Pm3D::SetMessages(){ | ||
95 | 95 | = "Error in pm3::Pm3D::GetNddoRepulsionIntegral1stDerivative: Bad orbital is set.\n"; |
96 | 96 | this->errorMessageGetNddoRepulsionIntegral2ndDerivative |
97 | 97 | = "Error in pm3::Pm3D::GetNddoRepulsionIntegral2ndDerivative: Bad orbital is set.\n"; |
98 | - this->errorMessageCalcTwoElecTwoCoreNullMatrix | |
99 | - = "Error in pm3::Pm3D::CalcTwoElecTwoCore: The two elec two core matrix is NULL.\n"; | |
100 | - this->errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms | |
101 | - = "Error in pm3::Pm3D::CalcDiatomicTwoElecTwoCore: Atom A and B is same.\n"; | |
102 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms | |
103 | - = "Error in pm3::Pm3D::CalcDiatomicTwoElecTwoCore1stDerivatives: Atom A and B is same.\n"; | |
104 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms | |
105 | - = "Error in pm3::Pm3D::CalcDiatomicTwoElecTwoCore2ndDerivatives: Atom A and B is same.\n"; | |
106 | - this->errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix | |
107 | - = "Error in pm3::Pm3D::CalcDiatomicTwoElecTwoCore: The two elec two core diatomic matrix is NULL.\n"; | |
108 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix | |
109 | - = "Error in pm3::Pm3D::CalcDiatomicTwoElecTwoCore1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
110 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix | |
111 | - = "Error in pm3::Pm3D::CalcDiatomicTwoElecTwoCore2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
98 | + this->errorMessageCalcTwoElecsTwoCoresNullMatrix | |
99 | + = "Error in pm3::Pm3D::CalcTwoElecsTwoCores: The two elec two core matrix is NULL.\n"; | |
100 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms | |
101 | + = "Error in pm3::Pm3D::CalcDiatomicTwoElecsTwoCores: Atom A and B is same.\n"; | |
102 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms | |
103 | + = "Error in pm3::Pm3D::CalcDiatomicTwoElecsTwoCores1stDerivatives: Atom A and B is same.\n"; | |
104 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms | |
105 | + = "Error in pm3::Pm3D::CalcDiatomicTwoElecsTwoCores2ndDerivatives: Atom A and B is same.\n"; | |
106 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix | |
107 | + = "Error in pm3::Pm3D::CalcDiatomicTwoElecsTwoCores: The two elec two core diatomic matrix is NULL.\n"; | |
108 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix | |
109 | + = "Error in pm3::Pm3D::CalcDiatomicTwoElecsTwoCores1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
110 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix | |
111 | + = "Error in pm3::Pm3D::CalcDiatomicTwoElecsTwoCores2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
112 | 112 | this->errorMessageGetElectronicEnergyEnergyNotCalculated |
113 | 113 | = "Error in pm3::Pm3D::GetElectronicEnergy: Set electronic state is not calculated by CIS.\n"; |
114 | 114 | this->errorMessageGetElectronicEnergyNULLCISEnergy |
@@ -95,20 +95,20 @@ void Pm3Pddg::SetMessages(){ | ||
95 | 95 | = "Error in pm3::Pm3Pddg::GetNddoRepulsionIntegral1stDerivative: Bad orbital is set.\n"; |
96 | 96 | this->errorMessageGetNddoRepulsionIntegral2ndDerivative |
97 | 97 | = "Error in pm3::Pm3Pddg::GetNddoRepulsionIntegral2ndDerivative: Bad orbital is set.\n"; |
98 | - this->errorMessageCalcTwoElecTwoCoreNullMatrix | |
99 | - = "Error in pm3::Pm3Pddg::CalcTwoElecTwoCore: The two elec two core matrix is NULL.\n"; | |
100 | - this->errorMessageCalcDiatomicTwoElecTwoCoreSameAtoms | |
101 | - = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecTwoCore: Atom A and B is same.\n"; | |
102 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesSameAtoms | |
103 | - = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecTwoCore1stDerivatives: Atom A and B is same.\n"; | |
104 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesSameAtoms | |
105 | - = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecTwoCore2ndDerivatives: Atom A and B is same.\n"; | |
106 | - this->errorMessageCalcDiatomicTwoElecTwoCoreNullMatrix | |
107 | - = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecTwoCore: The two elec two core diatomic matrix is NULL.\n"; | |
108 | - this->errorMessageCalcDiatomicTwoElecTwoCore1stDerivativesNullMatrix | |
109 | - = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecTwoCore1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
110 | - this->errorMessageCalcDiatomicTwoElecTwoCore2ndDerivativesNullMatrix | |
111 | - = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecTwoCore2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
98 | + this->errorMessageCalcTwoElecsTwoCoresNullMatrix | |
99 | + = "Error in pm3::Pm3Pddg::CalcTwoElecsTwoCores: The two elec two core matrix is NULL.\n"; | |
100 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresSameAtoms | |
101 | + = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecsTwoCores: Atom A and B is same.\n"; | |
102 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms | |
103 | + = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecsTwoCores1stDerivatives: Atom A and B is same.\n"; | |
104 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms | |
105 | + = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecsTwoCores2ndDerivatives: Atom A and B is same.\n"; | |
106 | + this->errorMessageCalcDiatomicTwoElecsTwoCoresNullMatrix | |
107 | + = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecsTwoCores: The two elec two core diatomic matrix is NULL.\n"; | |
108 | + this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesNullMatrix | |
109 | + = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecsTwoCores1stDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
110 | + this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesNullMatrix | |
111 | + = "Error in pm3::Pm3Pddg::CalcDiatomicTwoElecsTwoCores2ndDerivatives: The two elec two core diatomic matrix is NULL.\n"; | |
112 | 112 | this->errorMessageGetElectronicEnergyEnergyNotCalculated |
113 | 113 | = "Error in pm3::Pm3Pddg::GetElectronicEnergy: Set electronic state is not calculated by CIS.\n"; |
114 | 114 | this->errorMessageGetElectronicEnergyNULLCISEnergy |
@@ -224,7 +224,7 @@ double ZindoS::GetFockDiagElement(const Atom& atomA, | ||
224 | 224 | double const* const* gammaAB, |
225 | 225 | double const* const* orbitalElectronPopulation, |
226 | 226 | double const* atomicElectronPopulation, |
227 | - double const* const* const* const* const* const* twoElecTwoCore, | |
227 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
228 | 228 | bool isGuess) const{ |
229 | 229 | double value=0.0; |
230 | 230 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -289,7 +289,7 @@ double ZindoS::GetFockOffDiagElement(const Atom& atomA, | ||
289 | 289 | double const* const* gammaAB, |
290 | 290 | double const* const* overlapAOs, |
291 | 291 | double const* const* orbitalElectronPopulation, |
292 | - double const* const* const* const* const* const* twoElecTwoCore, | |
292 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
293 | 293 | bool isGuess) const{ |
294 | 294 | double value = 0.0; |
295 | 295 | OrbitalType orbitalMu = atomA.GetValence(mu-atomA.GetFirstAOIndex()); |
@@ -585,8 +585,8 @@ double ZindoS::GetExchangeInt(OrbitalType orbital1, OrbitalType orbital2, const | ||
585 | 585 | return value; |
586 | 586 | } |
587 | 587 | |
588 | -void ZindoS::CalcTwoElecTwoCore(double****** twoElecTwoCore, | |
589 | - const Molecule& molecule) const{ | |
588 | +void ZindoS::CalcTwoElecsTwoCores(double****** twoElecsTwoAtomCores, | |
589 | + const Molecule& molecule) const{ | |
590 | 590 | this->CalcNishimotoMatagaMatrix(this->nishimotoMatagaMatrix, molecule); |
591 | 591 | } |
592 | 592 |
@@ -3620,9 +3620,9 @@ double ZindoS::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) cons | ||
3620 | 3620 | return value; |
3621 | 3621 | } |
3622 | 3622 | |
3623 | -void ZindoS::CalcDiatomicTwoElecTwoCore1stDerivatives(double*** matrix, | |
3624 | - int indexAtomA, | |
3625 | - int indexAtomB) const{ | |
3623 | +void ZindoS::CalcDiatomicTwoElecsTwoCores1stDerivatives(double*** matrix, | |
3624 | + int indexAtomA, | |
3625 | + int indexAtomB) const{ | |
3626 | 3626 | const Atom& atomA = *molecule->GetAtom(indexAtomA); |
3627 | 3627 | const int firstAOIndexA = atomA.GetFirstAOIndex(); |
3628 | 3628 | const int lastAOIndexA = atomA.GetLastAOIndex(); |
@@ -3665,7 +3665,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3665 | 3665 | #pragma omp parallel |
3666 | 3666 | { |
3667 | 3667 | double*** diatomicOverlapAOs1stDerivs = NULL; |
3668 | - double*** diatomicTwoElecTwoCore1stDerivs = NULL; | |
3668 | + double*** diatomicTwoElecsTwoCores1stDerivs = NULL; | |
3669 | 3669 | double** tmpDiaOverlapAOsInDiaFrame = NULL; // diatomic overlapAOs in diatomic frame |
3670 | 3670 | double** tmpDiaOverlapAOs1stDerivInDiaFrame = NULL; // first derivative of the diaOverlapAOs. This derivative is related to the distance between two atoms. |
3671 | 3671 | double** tmpRotMat = NULL; // rotating Matrix from the diatomic frame to space fixed frame. |
@@ -3677,7 +3677,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3677 | 3677 | double* tmpVectorBC = NULL; // used in dgemmm |
3678 | 3678 | try{ |
3679 | 3679 | MallocTempMatricesCalcForce(&diatomicOverlapAOs1stDerivs, |
3680 | - &diatomicTwoElecTwoCore1stDerivs, | |
3680 | + &diatomicTwoElecsTwoCores1stDerivs, | |
3681 | 3681 | &tmpDiaOverlapAOsInDiaFrame, |
3682 | 3682 | &tmpDiaOverlapAOs1stDerivInDiaFrame, |
3683 | 3683 | &tmpRotMat, |
@@ -3710,7 +3710,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3710 | 3710 | atomB); |
3711 | 3711 | |
3712 | 3712 | // calc. first derivative of two elec two core interaction by Nishimoto-Mataga |
3713 | - this->CalcDiatomicTwoElecTwoCore1stDerivatives(diatomicTwoElecTwoCore1stDerivs, a, b); | |
3713 | + this->CalcDiatomicTwoElecsTwoCores1stDerivatives(diatomicTwoElecsTwoCores1stDerivs, a, b); | |
3714 | 3714 | |
3715 | 3715 | double coreRepulsion [CartesianType_end] = {0.0,0.0,0.0}; |
3716 | 3716 | double forceElecCoreAttPart[CartesianType_end] = {0.0,0.0,0.0}; |
@@ -3723,7 +3723,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3723 | 3723 | // electron core attraction part (ground state) |
3724 | 3724 | forceElecCoreAttPart[i] = ( atomA.GetCoreCharge()*atomicElectronPopulation[b] |
3725 | 3725 | +atomB.GetCoreCharge()*atomicElectronPopulation[a]) |
3726 | - *diatomicTwoElecTwoCore1stDerivs[s][s][i]; | |
3726 | + *diatomicTwoElecsTwoCores1stDerivs[s][s][i]; | |
3727 | 3727 | } |
3728 | 3728 | double forceOverlapAOsPart [CartesianType_end] = {0.0,0.0,0.0}; |
3729 | 3729 | double forceTwoElecPart [CartesianType_end] = {0.0,0.0,0.0}; |
@@ -3742,7 +3742,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3742 | 3742 | forceTwoElecPart[i] += (this->orbitalElectronPopulation[mu][mu] |
3743 | 3743 | *this->orbitalElectronPopulation[nu][nu] |
3744 | 3744 | -0.5*pow(this->orbitalElectronPopulation[mu][nu],2.0)) |
3745 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA][nu-firstAOIndexB][i]; | |
3745 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA][nu-firstAOIndexB][i]; | |
3746 | 3746 | } |
3747 | 3747 | } |
3748 | 3748 | } |
@@ -3767,7 +3767,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3767 | 3767 | n, |
3768 | 3768 | a, |
3769 | 3769 | b, |
3770 | - diatomicTwoElecTwoCore1stDerivs); | |
3770 | + diatomicTwoElecsTwoCores1stDerivs); | |
3771 | 3771 | // sum up contributions from static part (excited state) |
3772 | 3772 | #pragma omp critical |
3773 | 3773 | { |
@@ -3785,7 +3785,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3785 | 3785 | n, |
3786 | 3786 | a, |
3787 | 3787 | b, |
3788 | - diatomicTwoElecTwoCore1stDerivs); | |
3788 | + diatomicTwoElecsTwoCores1stDerivs); | |
3789 | 3789 | // overlapAOs part (excited states) |
3790 | 3790 | double forceExcitedOverlapAOsPart[CartesianType_end] = {0.0,0.0,0.0}; |
3791 | 3791 | this->CalcForceExcitedOverlapAOsPart(forceExcitedOverlapAOsPart, |
@@ -3799,7 +3799,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3799 | 3799 | n, |
3800 | 3800 | a, |
3801 | 3801 | b, |
3802 | - diatomicTwoElecTwoCore1stDerivs); | |
3802 | + diatomicTwoElecsTwoCores1stDerivs); | |
3803 | 3803 | // sum up contributions from response part (excited state) |
3804 | 3804 | #pragma omp critical |
3805 | 3805 | { |
@@ -3820,7 +3820,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3820 | 3820 | ex.Serialize(ompErrors); |
3821 | 3821 | } |
3822 | 3822 | FreeTempMatricesCalcForce(&diatomicOverlapAOs1stDerivs, |
3823 | - &diatomicTwoElecTwoCore1stDerivs, | |
3823 | + &diatomicTwoElecsTwoCores1stDerivs, | |
3824 | 3824 | &tmpDiaOverlapAOsInDiaFrame, |
3825 | 3825 | &tmpDiaOverlapAOs1stDerivInDiaFrame, |
3826 | 3826 | &tmpRotMat, |
@@ -3925,7 +3925,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){ | ||
3925 | 3925 | } |
3926 | 3926 | |
3927 | 3927 | void ZindoS::MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
3928 | - double**** diatomicTwoElecTwoCore1stDerivs, | |
3928 | + double**** diatomicTwoElecsTwoCores1stDerivs, | |
3929 | 3929 | double*** tmpDiaOverlapAOsInDiaFrame, |
3930 | 3930 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
3931 | 3931 | double*** tmpRotMat, |
@@ -3936,7 +3936,7 @@ void ZindoS::MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
3936 | 3936 | double*** tmpMatrixBC, |
3937 | 3937 | double** tmpVectorBC) const{ |
3938 | 3938 | MallocerFreer::GetInstance()->Malloc<double>(diatomicOverlapAOs1stDerivs, OrbitalType_end, OrbitalType_end, CartesianType_end); |
3939 | - MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecTwoCore1stDerivs, OrbitalType_end, OrbitalType_end, CartesianType_end); | |
3939 | + MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecsTwoCores1stDerivs, OrbitalType_end, OrbitalType_end, CartesianType_end); | |
3940 | 3940 | MallocerFreer::GetInstance()->Malloc<double>(tmpDiaOverlapAOsInDiaFrame, OrbitalType_end, OrbitalType_end); |
3941 | 3941 | MallocerFreer::GetInstance()->Malloc<double>(tmpDiaOverlapAOs1stDerivInDiaFrame, OrbitalType_end, OrbitalType_end); |
3942 | 3942 | MallocerFreer::GetInstance()->Malloc<double>(tmpRotMat, OrbitalType_end, OrbitalType_end); |
@@ -3949,7 +3949,7 @@ void ZindoS::MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
3949 | 3949 | } |
3950 | 3950 | |
3951 | 3951 | void ZindoS::FreeTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
3952 | - double**** diatomicTwoElecTwoCore1stDerivs, | |
3952 | + double**** diatomicTwoElecsTwoCores1stDerivs, | |
3953 | 3953 | double*** tmpDiaOverlapAOsInDiaFrame, |
3954 | 3954 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
3955 | 3955 | double*** tmpRotMat, |
@@ -3960,7 +3960,7 @@ void ZindoS::FreeTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, | ||
3960 | 3960 | double*** tmpMatrixBC, |
3961 | 3961 | double** tmpVectorBC) const{ |
3962 | 3962 | MallocerFreer::GetInstance()->Free<double>(diatomicOverlapAOs1stDerivs, OrbitalType_end, OrbitalType_end, CartesianType_end); |
3963 | - MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecTwoCore1stDerivs, OrbitalType_end, OrbitalType_end, CartesianType_end); | |
3963 | + MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecsTwoCores1stDerivs, OrbitalType_end, OrbitalType_end, CartesianType_end); | |
3964 | 3964 | MallocerFreer::GetInstance()->Free<double>(tmpDiaOverlapAOsInDiaFrame, OrbitalType_end, OrbitalType_end); |
3965 | 3965 | MallocerFreer::GetInstance()->Free<double>(tmpDiaOverlapAOs1stDerivInDiaFrame, OrbitalType_end, OrbitalType_end); |
3966 | 3966 | MallocerFreer::GetInstance()->Free<double>(tmpRotMat, OrbitalType_end, OrbitalType_end); |
@@ -3976,7 +3976,7 @@ void ZindoS::CalcForceExcitedStaticPart(double* force, | ||
3976 | 3976 | int elecStateIndex, |
3977 | 3977 | int indexAtomA, |
3978 | 3978 | int indexAtomB, |
3979 | - double const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
3979 | + double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
3980 | 3980 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
3981 | 3981 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
3982 | 3982 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -3991,9 +3991,9 @@ void ZindoS::CalcForceExcitedStaticPart(double* force, | ||
3991 | 3991 | -1.0*this->etaMatrixForce[elecStateIndex][mu][lambda] |
3992 | 3992 | *this->etaMatrixForce[elecStateIndex][mu][lambda]; |
3993 | 3993 | force[i] += temp |
3994 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
3995 | - [lambda-firstAOIndexB] | |
3996 | - [i]; | |
3994 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
3995 | + [lambda-firstAOIndexB] | |
3996 | + [i]; | |
3997 | 3997 | } |
3998 | 3998 | } |
3999 | 3999 | } |
@@ -4003,7 +4003,7 @@ void ZindoS::CalcForceExcitedElecCoreAttractionPart(double* force, | ||
4003 | 4003 | int elecStateIndex, |
4004 | 4004 | int indexAtomA, |
4005 | 4005 | int indexAtomB, |
4006 | - double const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
4006 | + double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
4007 | 4007 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
4008 | 4008 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
4009 | 4009 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -4012,7 +4012,7 @@ void ZindoS::CalcForceExcitedElecCoreAttractionPart(double* force, | ||
4012 | 4012 | for(int i=0; i<CartesianType_end; i++){ |
4013 | 4013 | force[i] += this->zMatrixForce[elecStateIndex][mu][mu] |
4014 | 4014 | *atomB.GetCoreCharge() |
4015 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA][s][i]; | |
4015 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA][s][i]; | |
4016 | 4016 | } |
4017 | 4017 | } |
4018 | 4018 | } |
@@ -4051,7 +4051,7 @@ void ZindoS::CalcForceExcitedTwoElecPart(double* force, | ||
4051 | 4051 | int elecStateIndex, |
4052 | 4052 | int indexAtomA, |
4053 | 4053 | int indexAtomB, |
4054 | - double const* const* const* diatomicTwoElecTwoCore1stDerivs) const{ | |
4054 | + double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{ | |
4055 | 4055 | const Atom& atomA = *this->molecule->GetAtom(indexAtomA); |
4056 | 4056 | const Atom& atomB = *this->molecule->GetAtom(indexAtomB); |
4057 | 4057 | int firstAOIndexA = atomA.GetFirstAOIndex(); |
@@ -4063,15 +4063,15 @@ void ZindoS::CalcForceExcitedTwoElecPart(double* force, | ||
4063 | 4063 | for(int i=0; i<CartesianType_end; i++){ |
4064 | 4064 | force[i] -= this->zMatrixForce[elecStateIndex][mu][mu] |
4065 | 4065 | *this->orbitalElectronPopulation[lambda][lambda] |
4066 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
4067 | - [lambda-firstAOIndexB] | |
4068 | - [i]; | |
4066 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
4067 | + [lambda-firstAOIndexB] | |
4068 | + [i]; | |
4069 | 4069 | force[i] += 0.50 |
4070 | 4070 | *this->zMatrixForce[elecStateIndex][mu][lambda] |
4071 | 4071 | *this->orbitalElectronPopulation[mu][lambda] |
4072 | - *diatomicTwoElecTwoCore1stDerivs[mu-firstAOIndexA] | |
4073 | - [lambda-firstAOIndexB] | |
4074 | - [i]; | |
4072 | + *diatomicTwoElecsTwoCores1stDerivs[mu-firstAOIndexA] | |
4073 | + [lambda-firstAOIndexB] | |
4074 | + [i]; | |
4075 | 4075 | } |
4076 | 4076 | } |
4077 | 4077 | } |
@@ -70,7 +70,7 @@ protected: | ||
70 | 70 | double const* const* gammaAB, |
71 | 71 | double const* const* orbitalElectronPopulation, |
72 | 72 | double const* atomicElectronPopulation, |
73 | - double const* const* const* const* const* const* twoElecTwoCore, | |
73 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
74 | 74 | bool isGuess) const; |
75 | 75 | virtual double GetFockOffDiagElement(const MolDS_base_atoms::Atom& atomA, |
76 | 76 | const MolDS_base_atoms::Atom& atomB, |
@@ -81,7 +81,7 @@ protected: | ||
81 | 81 | double const* const* gammaAB, |
82 | 82 | double const* const* overelap, |
83 | 83 | double const* const* orbitalElectronPopulation, |
84 | - double const* const* const* const* const* const* twoElecTwoCore, | |
84 | + double const* const* const* const* const* const* twoElecsTwoAtomCores, | |
85 | 85 | bool isGuess) const; |
86 | 86 | virtual void CalcDiatomicOverlapAOsInDiatomicFrame(double** diatomicOverlapAOs, |
87 | 87 | const MolDS_base_atoms::Atom& atomA, |
@@ -98,8 +98,8 @@ protected: | ||
98 | 98 | virtual double GetExchangeInt(MolDS_base::OrbitalType orbital1, |
99 | 99 | MolDS_base::OrbitalType orbital2, |
100 | 100 | const MolDS_base_atoms::Atom& atom) const; // Apendix in [BZ_1979] |
101 | - virtual void CalcTwoElecTwoCore(double****** twoElecTwoCore, | |
102 | - const MolDS_base::Molecule& molecule) const; | |
101 | + virtual void CalcTwoElecsTwoCores(double****** twoElecsTwoAtomCores, | |
102 | + const MolDS_base::Molecule& molecule) const; | |
103 | 103 | virtual double GetMolecularIntegralElement(int moI, |
104 | 104 | int moJ, |
105 | 105 | int moK, |
@@ -268,11 +268,11 @@ private: | ||
268 | 268 | void FreeDavidsonRoopCISTemporaryMtrices(double*** interactionMatrix, |
269 | 269 | int interactionMatrixDimension, |
270 | 270 | double** interactionEigenEnergies) const; |
271 | - void CalcDiatomicTwoElecTwoCore1stDerivatives(double*** matrix, | |
272 | - int indexAtomA, | |
273 | - int indexAtomB) const; | |
271 | + void CalcDiatomicTwoElecsTwoCores1stDerivatives(double*** matrix, | |
272 | + int indexAtomA, | |
273 | + int indexAtomB) const; | |
274 | 274 | void MallocTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
275 | - double**** diatomicTwoElecTwoCore1stDerivs, | |
275 | + double**** diatomicTwoElecsTwoCores1stDerivs, | |
276 | 276 | double*** tmpDiaOverlapAOsInDiaFrame, |
277 | 277 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
278 | 278 | double*** tmpRotMat, |
@@ -283,7 +283,7 @@ private: | ||
283 | 283 | double*** tmpMatrixBC, |
284 | 284 | double** tmpVectorBC) const; |
285 | 285 | void FreeTempMatricesCalcForce(double**** diatomicOverlapAOs1stDerivs, |
286 | - double**** diatomicTwoElecTwoCore1stDerivs, | |
286 | + double**** diatomicTwoElecsTwoCores1stDerivs, | |
287 | 287 | double*** tmpDiaOverlapAOsInDiaFrame, |
288 | 288 | double*** tmpDiaOverlapAOs1stDerivInDiaFrame, |
289 | 289 | double*** tmpRotMat, |
@@ -297,17 +297,17 @@ private: | ||
297 | 297 | int elecStateIndex, |
298 | 298 | int indexAtomA, |
299 | 299 | int indexAtomB, |
300 | - double const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
300 | + double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
301 | 301 | void CalcForceExcitedElecCoreAttractionPart(double* force, |
302 | 302 | int elecStateIndex, |
303 | 303 | int indexAtomA, |
304 | 304 | int indexAtomB, |
305 | - double const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
305 | + double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
306 | 306 | void CalcForceExcitedTwoElecPart(double* force, |
307 | 307 | int elecStateIndex, |
308 | 308 | int indexAtomA, |
309 | 309 | int indexAtomB, |
310 | - double const* const* const* diatomicTwoElecTwoCore1stDerivs) const; | |
310 | + double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const; | |
311 | 311 | void CheckZMatrixForce(const std::vector<int>& elecStates); |
312 | 312 | void CheckEtaMatrixForce(const std::vector<int>& elecStates); |
313 | 313 | double GetZMatrixForceElement(double const* y, |