• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版03a53ba3358a419e44799fb3fcec35f75b1cff6d (tree)
时间2013-01-22 05:19:07
作者Katsuhiko Nishimra <ktns.87@gmai...>
CommiterKatsuhiko Nishimra

Log Message

Merge trunk into automake. #28588

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/branches/automake@1241 1136aad2-a195-0410-b898-f5ea1d11b9d8

更改概述

差异

--- a/src/base/InputParser.cpp
+++ b/src/base/InputParser.cpp
@@ -311,6 +311,7 @@ void InputParser::SetMessages(){
311311 this->stringCISAllTransitionDipoleMoments = "all_transition_dipole_moments";
312312 this->stringCISNumPrintCoefficients = "num_print_coefficients";
313313 this->stringCISMulliken = "mulliken";
314+ this->stringCISUnpairedPop = "unpaired_electron_population";
314315
315316 // Memory
316317 this->stringMemory = "memory";
@@ -823,6 +824,16 @@ int InputParser::ParseConditionsCIS(vector<string>* inputTerms, int parseIndex)
823824 }
824825 parseIndex++;
825826 }
827+ // unpaired electron population
828+ if((*inputTerms)[parseIndex].compare(this->stringCISUnpairedPop) == 0){
829+ if((*inputTerms)[parseIndex+1].compare(this->stringYES) == 0){
830+ Parameters::GetInstance()->SetRequiresUnpairedPopCIS(true);
831+ }
832+ else {
833+ Parameters::GetInstance()->SetRequiresUnpairedPopCIS(false);
834+ }
835+ parseIndex++;
836+ }
826837 parseIndex++;
827838 }
828839 return parseIndex;
--- a/src/base/InputParser.h
+++ b/src/base/InputParser.h
@@ -236,6 +236,7 @@ private:
236236 std::string stringCISAllTransitionDipoleMoments;
237237 std::string stringCISNumPrintCoefficients;
238238 std::string stringCISMulliken;
239+ std::string stringCISUnpairedPop;
239240 // Memory
240241 std::string stringMemory;
241242 std::string stringMemoryEnd;
--- a/src/base/MathUtilities.cpp
+++ b/src/base/MathUtilities.cpp
@@ -100,40 +100,40 @@ template <typename T> T min(T a, T b){
100100 }
101101
102102 // rotating matrix
103-void CalcRotatingMatrix(double matrix[][3], double sita, CartesianType cartesianType){
103+void CalcRotatingMatrix(double matrix[][3], double theta, CartesianType cartesianType){
104104 if(cartesianType == XAxis){
105105 matrix[0][0] = 1.0;
106106 matrix[0][1] = 0.0;
107107 matrix[0][2] = 0.0;
108108
109109 matrix[1][0] = 0.0;
110- matrix[1][1] = cos(sita);
111- matrix[1][2] = sin(sita);
110+ matrix[1][1] = cos(theta);
111+ matrix[1][2] = sin(theta);
112112
113113 matrix[2][0] = 0.0;
114- matrix[2][1] = -sin(sita);
115- matrix[2][2] = cos(sita);
114+ matrix[2][1] = -sin(theta);
115+ matrix[2][2] = cos(theta);
116116 }
117117 else if(cartesianType == YAxis){
118- matrix[0][0] = cos(sita);
118+ matrix[0][0] = cos(theta);
119119 matrix[0][1] = 0.0;
120- matrix[0][2] = -sin(sita);
120+ matrix[0][2] = -sin(theta);
121121
122122 matrix[1][0] = 0.0;
123123 matrix[1][1] = 1.0;
124124 matrix[1][2] = 0.0;
125125
126- matrix[2][0] = sin(sita);
126+ matrix[2][0] = sin(theta);
127127 matrix[2][1] = 0.0;
128- matrix[2][2] = cos(sita);
128+ matrix[2][2] = cos(theta);
129129 }
130130 else if(cartesianType == ZAxis){
131- matrix[0][0] = cos(sita);
132- matrix[0][1] = sin(sita);
131+ matrix[0][0] = cos(theta);
132+ matrix[0][1] = sin(theta);
133133 matrix[0][2] = 0.0;
134134
135- matrix[1][0] = -sin(sita);
136- matrix[1][1] = cos(sita);
135+ matrix[1][0] = -sin(theta);
136+ matrix[1][1] = cos(theta);
137137 matrix[1][2] = 0.0;
138138
139139 matrix[2][0] = 0.0;
--- a/src/base/MathUtilities.h
+++ b/src/base/MathUtilities.h
@@ -28,7 +28,7 @@ template <typename T> T Max(T a, T b);
2828 // min
2929 template <typename T> T min(T a, T b);
3030 // rotating matrix
31-void CalcRotatingMatrix(double matrix[][3], double sita, CartesianType cartesianType);
31+void CalcRotatingMatrix(double matrix[][3], double theta, CartesianType cartesianType);
3232 // calculate determinant of the matrix. Note taht the matrix will be destroid
3333 double GetDeterminant(double** matrix, int dim);
3434 }
--- a/src/base/Parameters.cpp
+++ b/src/base/Parameters.cpp
@@ -1,6 +1,7 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
33 // Copyright (C) 2012-2012 Katsuhiko Nishimra //
4+// Copyright (C) 2012-2013 Michihiro Okuyama
45 // //
56 // This file is part of MolDS. //
67 // //
@@ -171,6 +172,7 @@ void Parameters::SetDefaultValues(){
171172 this->numberPrintCoefficientsCIS = 1;
172173 this->requiresExcitonEnergiesCIS = false;
173174 this->requiresAllTransitionDipoleMomentsCIS = false;
175+ this->requiresUnpairedPopCIS = false;
174176 // Memory
175177 this->limitHeapMemory = 256;
176178 // MD
@@ -705,6 +707,14 @@ bool Parameters::RequiresMullikenCIS() const{
705707 0<this->electronicStateIndecesMullikenCIS->size());
706708 }
707709
710+void Parameters::SetRequiresUnpairedPopCIS(bool requiresUnpairedPopCIS){
711+ this->requiresUnpairedPopCIS = requiresUnpairedPopCIS;
712+}
713+
714+bool Parameters::RequiresUnpairedPopCIS() const{
715+ return this->requiresUnpairedPopCIS;
716+}
717+
708718 // methods for Memory
709719 double Parameters::GetLimitHeapMemory() const{
710720 return this->limitHeapMemory;
--- a/src/base/Parameters.h
+++ b/src/base/Parameters.h
@@ -1,6 +1,7 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
33 // Copyright (C) 2012-2012 Katsuhiko Nishimra //
4+// Copyright (C) 2012-2013 Michihiro Okuyama
45 // //
56 // This file is part of MolDS. //
67 // //
@@ -141,6 +142,8 @@ public:
141142 std::vector<int>* GetElectronicStateIndecesMullikenCIS() const;
142143 void AddElectronicStateIndexMullikenCIS(int electronicStateIndex);
143144 bool RequiresMullikenCIS() const;
145+ void SetRequiresUnpairedPopCIS(bool requiresUnpairedPopCIS);
146+ bool RequiresUnpairedPopCIS() const;
144147 // Memory
145148 double GetLimitHeapMemory() const;
146149 void SetLimitHeapMemory(double limitHeap);
@@ -285,6 +288,7 @@ private:
285288 bool requiresExcitonEnergiesCIS;
286289 bool requiresAllTransitionDipoleMomentsCIS;
287290 std::vector<int>* electronicStateIndecesMullikenCIS;
291+ bool requiresUnpairedPopCIS;
288292 // Memory
289293 double limitHeapMemory;
290294 // MD
--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -73,6 +74,7 @@ Cndo2::Cndo2(){
7374 this->orbitalElectronPopulationCIS = NULL;
7475 this->atomicElectronPopulation = NULL;
7576 this->atomicElectronPopulationCIS = NULL;
77+ this->atomicUnpairedPopulationCIS = NULL;
7678 this->overlapAOs = NULL;
7779 this->twoElecTwoCore = NULL;
7880 this->cartesianMatrix = NULL;
@@ -206,6 +208,8 @@ void Cndo2::SetMessages(){
206208 this->messageMullikenAtomsSCF = "\tMulliken charge(SCF):";
207209 this->messageMullikenAtoms = "\tMulliken charge:";
208210 this->messageMullikenAtomsTitle = "\t\t\t\t| k-th eigenstate | i-th atom | atom type | core charge[a.u.] | Mulliken charge[a.u.]| \n";
211+ this->messageUnpairedAtoms = "\tUnpaired electron population:";
212+ this->messageUnpairedAtomsTitle = "\t\t\t\t| k-th eigenstate | i-th atom | atom type | Unpaired electron population[a.u.]| \n";
209213 this->messageElecEnergy = "\tElectronic energy(SCF):";
210214 this->messageNoteElecEnergy = "\tNote that this electronic energy includes core-repulsions.\n\n";
211215 this->messageNoteElecEnergyVdW = "\tNote that this electronic energy includes core-repulsions and vdW correction.\n\n";
--- a/src/cndo/Cndo2.h
+++ b/src/cndo/Cndo2.h
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -86,6 +87,8 @@ protected:
8687 std::string messageOmpElapsedTimeSCF;
8788 std::string messageMullikenAtoms;
8889 std::string messageMullikenAtomsTitle;
90+ std::string messageUnpairedAtoms;
91+ std::string messageUnpairedAtomsTitle;
8992 std::string messageUnitSec;
9093 std::vector<MolDS_base::AtomType> enableAtomTypes;
9194 MolDS_base::Molecule* molecule;
@@ -99,6 +102,7 @@ protected:
99102 double*** orbitalElectronPopulationCIS;
100103 double* atomicElectronPopulation; //P_{AB} of (3.21) in J. A. Pople book.
101104 double** atomicElectronPopulationCIS;
105+ double** atomicUnpairedPopulationCIS;
102106 double** overlapAOs; // overlap integral between AOs
103107 double****** twoElecTwoCore;
104108 double*** cartesianMatrix; // cartesian matrix represented by AOs
--- a/src/zindo/ZindoS.cpp
+++ b/src/zindo/ZindoS.cpp
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -1021,6 +1022,10 @@ void ZindoS::CalcCISProperties(){
10211022 this->CalcAtomicElectronPopulationCIS(&this->atomicElectronPopulationCIS,
10221023 this->orbitalElectronPopulationCIS,
10231024 *this->molecule);
1025+ // atomic unpaired electron population
1026+ this->CalcAtomicUnpairedPopulationCIS(&this->atomicUnpairedPopulationCIS,
1027+ this->orbitalElectronPopulationCIS,
1028+ *this->molecule);
10241029 }
10251030
10261031 void ZindoS::CalcElectronicDipoleMomentsExcitedState(double*** electronicTransitionDipoleMoments,
@@ -1407,6 +1412,58 @@ void ZindoS::CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationC
14071412 }
14081413 }
14091414
1415+void ZindoS::CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationCIS,
1416+ double const* const* const* orbitalElectronPopulationCIS,
1417+ const Molecule& molecule) const{
1418+ if(!Parameters::GetInstance()->RequiresMullikenCIS()){
1419+ return;
1420+ }
1421+ if(!Parameters::GetInstance()->RequiresUnpairedPopCIS()){
1422+ return;
1423+ }
1424+ int totalNumberAtoms = molecule.GetNumberAtoms();
1425+ vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS();
1426+ // malloc or initialize free exciton energies
1427+ if(*atomicUnpairedPopulationCIS == NULL){
1428+ MallocerFreer::GetInstance()->Malloc<double>(atomicUnpairedPopulationCIS,
1429+ elecStates->size(),
1430+ totalNumberAtoms);
1431+ }
1432+ else{
1433+ MallocerFreer::GetInstance()->Initialize<double>(*atomicUnpairedPopulationCIS,
1434+ elecStates->size(),
1435+ totalNumberAtoms);
1436+ }
1437+ // calc atomic electron population
1438+ for(int k=0; k<elecStates->size(); k++){
1439+ stringstream ompErrors;
1440+#pragma omp parallel for schedule(auto)
1441+ for(int a=0; a<totalNumberAtoms; a++){
1442+ try{
1443+ int firstAOIndex = molecule.GetAtom(a)->GetFirstAOIndex();
1444+ int numberAOs = molecule.GetAtom(a)->GetValenceSize();
1445+ (*atomicUnpairedPopulationCIS)[k][a] = 0.0;
1446+ for(int i=firstAOIndex; i<firstAOIndex+numberAOs; i++){
1447+ double orbitalSquarePopulation = 0.0;
1448+ int totalNumberAOs = molecule.GetTotalNumberAOs();
1449+ for(int j=0; j<totalNumberAOs; j++) {
1450+ orbitalSquarePopulation += orbitalElectronPopulationCIS[k][i][j] * orbitalElectronPopulationCIS[k][j][i];
1451+ }
1452+ (*atomicUnpairedPopulationCIS)[k][a] += 2.0 * orbitalElectronPopulationCIS[k][i][i] - orbitalSquarePopulation;
1453+ }
1454+ }
1455+ catch(MolDSException ex){
1456+#pragma omp critical
1457+ ompErrors << ex.what() << endl ;
1458+ }
1459+ }
1460+ // Exception throwing for omp-region
1461+ if(!ompErrors.str().empty()){
1462+ throw MolDSException(ompErrors.str());
1463+ }
1464+ }
1465+}
1466+
14101467 void ZindoS::OutputCISResults() const{
14111468 int numberActiveOcc = Parameters::GetInstance()->GetActiveOccCIS();
14121469 int numberActiveVir = Parameters::GetInstance()->GetActiveVirCIS();
@@ -1442,6 +1499,9 @@ void ZindoS::OutputCISResults() const{
14421499 // output mulliken population
14431500 this->OutputCISMulliken();
14441501
1502+ // output unpaired electron population
1503+ this->OutputCISUnpairedPop();
1504+
14451505 // output exciton energies
14461506 if(Parameters::GetInstance()->RequiresExcitonEnergiesCIS()){
14471507 this->OutputLog(this->messageExcitonEnergiesCIS);
@@ -1589,6 +1649,29 @@ void ZindoS::OutputCISMulliken() const{
15891649 }
15901650 }
15911651
1652+void ZindoS::OutputCISUnpairedPop() const{
1653+ if(!Parameters::GetInstance()->RequiresMullikenCIS()){
1654+ return;
1655+ }
1656+ if(!Parameters::GetInstance()->RequiresUnpairedPopCIS()){
1657+ return;
1658+ }
1659+ int totalNumberAtoms = this->molecule->GetNumberAtoms();
1660+ this->OutputLog(this->messageUnpairedAtomsTitle);
1661+ vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS();
1662+ for(int k=0; k<elecStates->size(); k++){
1663+ for(int a=0; a<totalNumberAtoms; a++){
1664+ const Atom& atom = *this->molecule->GetAtom(a);
1665+ this->OutputLog(boost::format("%s\t%d\t%d\t%s\t%e\n") % this->messageUnpairedAtoms
1666+ % (*elecStates)[k]
1667+ % a
1668+ % AtomTypeStr(atom.GetAtomType())
1669+ % this->atomicUnpairedPopulationCIS[k][a]);
1670+ }
1671+ this->OutputLog("\n");
1672+ }
1673+}
1674+
15921675 void ZindoS::SortCISEigenVectorCoefficients(vector<CISEigenVectorCoefficient>* cisEigenVectorCoefficients,
15931676 double* cisEigenVector) const{
15941677 for(int l=0; l<this->matrixCISdimension; l++){
--- a/src/zindo/ZindoS.h
+++ b/src/zindo/ZindoS.h
@@ -1,5 +1,6 @@
11 //************************************************************************//
22 // Copyright (C) 2011-2012 Mikiya Fujii //
3+// Copyright (C) 2012-2013 Michihiro Okuyama
34 // //
45 // This file is part of MolDS. //
56 // //
@@ -139,6 +140,7 @@ private:
139140 void OutputCISDipole() const;
140141 void OutputCISTransitionDipole() const;
141142 void OutputCISMulliken() const;
143+ void OutputCISUnpairedPop() const;
142144 void CalcFreeExcitonEnergies(double** freeExcitonEnergiesCIS,
143145 const MolDS_base::Molecule& molecule,
144146 double const* energiesMO,
@@ -152,6 +154,9 @@ private:
152154 void CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationCIS,
153155 double const* const* const* orbitalElectronPopulationCIS,
154156 const MolDS_base::Molecule& molecule) const;
157+ void CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationCIS,
158+ double const* const* const* orbitalElectronPopulationCIS,
159+ const MolDS_base::Molecule& molecule) const;
155160 void CalcElectronicDipoleMomentsExcitedState(double*** electronicTransitionDipoleMoments,
156161 double const* const* fockMatrix,
157162 double const* const* matrixCIS,