• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

Commit MetaInfo

Révision82f9cbd8ff2b6cfe0642b380a6348ce7caaf9454 (tree)
l'heure2013-12-31 17:19:34
Auteurmikiya_fujii <mikiya_fujii@1136...>
Commitermikiya_fujii

Message de Log

Refactring of access to Molecule::atomVect and Molecule::epcVect #32752

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1605 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Modification

--- a/src/am1/Am1.cpp
+++ b/src/am1/Am1.cpp
@@ -140,8 +140,8 @@ double Am1::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) const{
140140 double mndoTerm = Mndo::GetDiatomCoreRepulsionEnergy(indexAtomA, indexAtomB);
141141
142142 // additional term, Eq. (4) in [S_1989].
143- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
144- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
143+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
144+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
145145 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
146146 double ang2AU = Parameters::GetInstance()->GetAngstrom2AU();
147147 double alphaA = atomA.GetNddoAlpha(this->theory);
@@ -174,8 +174,8 @@ double Am1::GetDiatomCoreRepulsion1stDerivative(int indexAtomA,
174174
175175 // additional term, first derivative of eq. (4) in [S_1989]
176176 double ang2AU = Parameters::GetInstance()->GetAngstrom2AU();
177- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
178- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
177+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
178+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
179179 double alphaA = atomA.GetNddoAlpha(this->theory);
180180 double alphaB = atomB.GetNddoAlpha(this->theory);
181181 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
@@ -215,8 +215,8 @@ double Am1::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA,
215215
216216 // additional term, first derivative of eq. (4) in [S_1989]
217217 double ang2AU = Parameters::GetInstance()->GetAngstrom2AU();
218- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
219- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
218+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
219+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
220220 double alphaA = atomA.GetNddoAlpha(this->theory);
221221 double alphaB = atomB.GetNddoAlpha(this->theory);
222222 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
--- a/src/base/InputParser.cpp
+++ b/src/base/InputParser.cpp
@@ -487,7 +487,7 @@ int InputParser::ParseMolecularGeometry(Molecule* molecule, vector<string>* inpu
487487 else if((*inputTerms)[parseIndex] == "s"){
488488 atomType = S;
489489 }
490- int index = molecule->GetNumberAtoms();
490+ int index = molecule->GetAtomVect().size();
491491 Atom* atom = AtomFactory::Create(atomType, index, x, y, z);
492492 molecule->AddAtom(atom);
493493 parseIndex += 4;
@@ -508,7 +508,7 @@ int InputParser::ParseEpcsConfiguration(Molecule* molecule, vector<string>* inpu
508508 parseIndex += 2;
509509 }
510510 AtomType atomType = EPC;
511- int index = molecule->GetNumberEpcs();
511+ int index = molecule->GetEpcVect().size();
512512 Atom* atom = AtomFactory::Create(atomType, index, x, y, z, charge);
513513 molecule->AddEpc(atom);
514514 }
@@ -1360,7 +1360,7 @@ void InputParser::ValidateVdWConditions() const{
13601360 }
13611361
13621362 void InputParser::ValidateEpcConditions(const Molecule& molecule) const{
1363- if(molecule.GetNumberEpcs()<=0){return;}
1363+ if(molecule.GetEpcVect().empty()){return;}
13641364 TheoryType theory = Parameters::GetInstance()->GetCurrentTheory();
13651365 // Validate theory
13661366 if(theory == MNDO ||
--- a/src/base/Molecule.cpp
+++ b/src/base/Molecule.cpp
@@ -223,12 +223,10 @@ void Molecule::Finalize(vector<Atom*>** atomVect,
223223 }
224224
225225 void Molecule::SetMessages(){
226- this->errorMessageGetAtomNull = "Error in base::Molecule::GetAtom: atomVect is NULL.\n";
227- this->errorMessageGetEPCNull = "Error in base::Molecule::GetEnviromentalPointCharge: enviromentalPointChargeVect is NULL.\n";
226+ this->errorMessageGetAtomVectNull = "Error in base::Molecule::GetAtomVect: atomVect is NULL.\n";
227+ this->errorMessageGetEPCVectNull = "Error in base::Molecule::GetEpcVect: epcVect is NULL.\n";
228228 this->errorMessageAddAtomNull = "Error in base::Molecule::AddAtom: atomVect is NULL.\n";
229- this->errorMessageAddEPCNull = "Error in base::Molecule::AddEnviromentalPointCharge: enviromentalPointChargeVect is NULL.\n";
230- this->errorMessageGetNumberAtomsNull = "Error in base::Molecule::GetNumberAtoms: atomVect is NULL.\n";
231- this->errorMessageGetNumberEPCsNull = "Error in base::Molecule::GetNumberEnviromentalPointChargess: epcVect is NULL.\n";
229+ this->errorMessageAddEPCNull = "Error in base::Molecule::AddEnviromentalPointCharge: epcVect is NULL.\n";
232230 this->errorMessageGetXyzCOMNull = "Error in base::Molecule::GetXyzCOM: xyzCOM is NULL.\n";
233231 this->errorMessageGetXyzCOCNull = "Error in base::Molecule::GetXyzCOC: xyzCOC is NULL.\n";
234232 this->errorMessageCalcXyzCOMNull = "Error in base::Molecule::CalcXyzCOM: xyzCOM is NULL.\n";
@@ -832,9 +830,9 @@ void Molecule::OutputTranslatingConditions(double const* translatingDifference)
832830 }
833831
834832 void Molecule::SynchronizeConfigurationTo(const Molecule& ref){
835- for(int a=0; a<this->GetNumberAtoms(); a++){
836- Atom& atom = *this->GetAtom(a);
837- const Atom& refAtom = *ref.GetAtom(a);
833+ for(int a=0; a<this->GetAtomVect().size(); a++){
834+ Atom& atom = *this->GetAtomVect()[a];
835+ const Atom& refAtom = *ref.GetAtomVect()[a];
838836 for(int i=0; i<CartesianType_end; i++){
839837 atom.GetXyz()[i] = refAtom.GetXyz()[i];
840838 }
@@ -843,9 +841,9 @@ void Molecule::SynchronizeConfigurationTo(const Molecule& ref){
843841 }
844842
845843 void Molecule::SynchronizeMomentaTo(const Molecule& ref){
846- for(int a=0; a<this->GetNumberAtoms(); a++){
847- Atom& atom = *this->GetAtom(a);
848- const Atom& refAtom = *ref.GetAtom(a);
844+ for(int a=0; a<this->GetAtomVect().size(); a++){
845+ Atom& atom = *this->GetAtomVect()[a];
846+ const Atom& refAtom = *ref.GetAtomVect()[a];
849847 for(int i=0; i<CartesianType_end; i++){
850848 atom.GetPxyz()[i] = refAtom.GetPxyz()[i];
851849 }
@@ -853,9 +851,9 @@ void Molecule::SynchronizeMomentaTo(const Molecule& ref){
853851 }
854852
855853 void Molecule::SynchronizePhaseSpacePointTo(const Molecule& ref){
856- for(int a=0; a<this->GetNumberAtoms(); a++){
857- Atom& atom = *this->GetAtom(a);
858- const Atom& refAtom = *ref.GetAtom(a);
854+ for(int a=0; a<this->GetAtomVect().size(); a++){
855+ Atom& atom = *this->GetAtomVect()[a];
856+ const Atom& refAtom = *ref.GetAtomVect()[a];
859857 for(int i=0; i<CartesianType_end; i++){
860858 atom.GetXyz() [i] = refAtom.GetXyz() [i];
861859 atom.GetPxyz()[i] = refAtom.GetPxyz()[i];
@@ -865,19 +863,19 @@ void Molecule::SynchronizePhaseSpacePointTo(const Molecule& ref){
865863 }
866864
867865 void Molecule::BroadcastConfigurationToAllProcesses(int root) const{
868- int numTransported = this->GetNumberAtoms()*CartesianType_end;
866+ int numTransported = this->GetAtomVect().size()*CartesianType_end;
869867 double* tmp=NULL;
870868 try{
871869 MolDS_base::MallocerFreer::GetInstance()->Malloc<double>(&tmp, numTransported);
872- for(int a=0; a<this->GetNumberAtoms(); a++){
873- Atom& atom = *this->GetAtom(a);
870+ for(int a=0; a<this->GetAtomVect().size(); a++){
871+ Atom& atom = *this->GetAtomVect()[a];
874872 for(int i=0; i<CartesianType_end; i++){
875873 tmp[a*CartesianType_end+i] = atom.GetXyz()[i];
876874 }
877875 }
878876 MolDS_mpi::MpiProcess::GetInstance()->Broadcast(tmp, numTransported, root);
879- for(int a=0; a<this->GetNumberAtoms(); a++){
880- Atom& atom = *this->GetAtom(a);
877+ for(int a=0; a<this->GetAtomVect().size(); a++){
878+ Atom& atom = *this->GetAtomVect()[a];
881879 for(int i=0; i<CartesianType_end; i++){
882880 atom.GetXyz()[i] = tmp[a*CartesianType_end+i];
883881 }
@@ -891,19 +889,19 @@ void Molecule::BroadcastConfigurationToAllProcesses(int root) const{
891889 }
892890
893891 void Molecule::BroadcastMomentaToAllProcesses(int root) const{
894- int numTransported = this->GetNumberAtoms()*CartesianType_end;
892+ int numTransported = this->GetAtomVect().size()*CartesianType_end;
895893 double* tmp=NULL;
896894 try{
897895 MolDS_base::MallocerFreer::GetInstance()->Malloc<double>(&tmp, numTransported);
898- for(int a=0; a<this->GetNumberAtoms(); a++){
899- Atom& atom = *this->GetAtom(a);
896+ for(int a=0; a<this->GetAtomVect().size(); a++){
897+ Atom& atom = *this->GetAtomVect()[a];
900898 for(int i=0; i<CartesianType_end; i++){
901899 tmp[a*CartesianType_end+i] = atom.GetPxyz()[i];
902900 }
903901 }
904902 MolDS_mpi::MpiProcess::GetInstance()->Broadcast(tmp, numTransported, root);
905- for(int a=0; a<this->GetNumberAtoms(); a++){
906- Atom& atom = *this->GetAtom(a);
903+ for(int a=0; a<this->GetAtomVect().size(); a++){
904+ Atom& atom = *this->GetAtomVect()[a];
907905 for(int i=0; i<CartesianType_end; i++){
908906 atom.GetPxyz()[i] = tmp[a*CartesianType_end+i];
909907 }
@@ -917,12 +915,12 @@ void Molecule::BroadcastMomentaToAllProcesses(int root) const{
917915 }
918916
919917 void Molecule::BroadcastPhaseSpacePointToAllProcesses(int root) const{
920- int numTransported = 2*this->GetNumberAtoms()*CartesianType_end;
918+ int numTransported = 2*this->GetAtomVect().size()*CartesianType_end;
921919 double* tmp=NULL;
922920 try{
923921 MolDS_base::MallocerFreer::GetInstance()->Malloc<double>(&tmp, numTransported);
924- for(int a=0; a<this->GetNumberAtoms(); a++){
925- Atom& atom = *this->GetAtom(a);
922+ for(int a=0; a<this->GetAtomVect().size(); a++){
923+ Atom& atom = *this->GetAtomVect()[a];
926924 for(int i=0; i<CartesianType_end; i++){
927925 int k = a*CartesianType_end+i;
928926 tmp[2*k ] = atom.GetXyz() [i];
@@ -930,8 +928,8 @@ void Molecule::BroadcastPhaseSpacePointToAllProcesses(int root) const{
930928 }
931929 }
932930 MolDS_mpi::MpiProcess::GetInstance()->Broadcast(tmp, numTransported, root);
933- for(int a=0; a<this->GetNumberAtoms(); a++){
934- Atom& atom = *this->GetAtom(a);
931+ for(int a=0; a<this->GetAtomVect().size(); a++){
932+ Atom& atom = *this->GetAtomVect()[a];
935933 for(int i=0; i<CartesianType_end; i++){
936934 int k = a*CartesianType_end+i;
937935 atom.GetXyz() [i] = tmp[2*k ];
--- a/src/base/Molecule.h
+++ b/src/base/Molecule.h
@@ -26,29 +26,17 @@ public:
2626 explicit Molecule(const Molecule& rhs);
2727 Molecule& operator=(const Molecule& rhs);
2828 ~Molecule();
29- inline int GetNumberAtoms() const{
29+ inline const std::vector<MolDS_base_atoms::Atom*>& GetAtomVect() const{
3030 #ifdef MOLDS_DBG
31- if(this->atomVect==NULL) throw MolDS_base::MolDSException(this->errorMessageGetNumberAtomsNull);
31+ if(this->atomVect==NULL) throw MolDS_base::MolDSException(this->errorMessageGetAtomVectNull);
3232 #endif
33- return this->atomVect->size();
33+ return *this->atomVect;
3434 }
35- inline MolDS_base_atoms::Atom* GetAtom(int atomIndex) const{
35+ inline const std::vector<MolDS_base_atoms::Atom*>& GetEpcVect() const{
3636 #ifdef MOLDS_DBG
37- if(this->atomVect==NULL) throw MolDS_base::MolDSException(this->errorMessageGetAtomNull);
37+ if(this->epcVect==NULL) throw MolDS_base::MolDSException(this->errorMessageGetEpcVectNull);
3838 #endif
39- return (*this->atomVect)[atomIndex];
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];
39+ return *this->epcVect;
5240 }
5341 void AddAtom(MolDS_base_atoms::Atom* atom);
5442 void AddEpc(MolDS_base_atoms::Atom* epc);
@@ -128,12 +116,10 @@ private:
128116 double rotatingAngle,
129117 MolDS_base::EularAngle rotatingEularAngles)const;
130118 void OutputTranslatingConditions(double const* translatingDifference) const;
131- std::string errorMessageGetAtomNull;
132- std::string errorMessageGetEPCNull;
119+ std::string errorMessageGetAtomVectNull;
120+ std::string errorMessageGetEPCVectNull;
133121 std::string errorMessageAddAtomNull;
134122 std::string errorMessageAddEPCNull;
135- std::string errorMessageGetNumberAtomsNull;
136- std::string errorMessageGetNumberEPCsNull;
137123 std::string errorMessageGetXyzCOMNull;
138124 std::string errorMessageGetXyzCOCNull;
139125 std::string errorMessageCalcXyzCOMNull;
--- a/src/base/loggers/DensityLogger.cpp
+++ b/src/base/loggers/DensityLogger.cpp
@@ -257,8 +257,8 @@ double DensityLogger::GetMOValue(int moIndex,
257257 double const* const* forckMatrix,
258258 double x, double y, double z) const{
259259 double moValue = 0.0;
260- for(int a=0; a<this->molecule->GetNumberAtoms(); a++){
261- Atom* atomA = this->molecule->GetAtom(a);
260+ for(int a=0; a<this->molecule->GetAtomVect().size(); a++){
261+ Atom* atomA = this->molecule->GetAtomVect()[a];
262262 int firstAOIndexA = atomA->GetFirstAOIndex();
263263 int numberAOsA = atomA->GetValenceSize();
264264 for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){
@@ -281,10 +281,10 @@ void DensityLogger::OutputHeaderToFile(ofstream& ofs, double const* origin, doub
281281 // output header to the cube file
282282 ofs << this->messageCubeHeaderComment1;
283283 ofs << this->messageCubeHeaderComment2;
284- sprintf(data,"\t%d\t%e\t%e\t%e\n", this->molecule->GetNumberAtoms(),
285- origin[XAxis],
286- origin[YAxis],
287- origin[ZAxis]);
284+ sprintf(data,"\t%ld\t%e\t%e\t%e\n", this->molecule->GetAtomVect().size(),
285+ origin[XAxis],
286+ origin[YAxis],
287+ origin[ZAxis]);
288288 ofs << string(data);
289289 memset(data,0,sizeof(data));
290290 sprintf(data,"\t%d\t%e\t%e\t%e\n", gridNumber[XAxis], dx, 0.0, 0.0);
@@ -300,8 +300,8 @@ void DensityLogger::OutputHeaderToFile(ofstream& ofs, double const* origin, doub
300300 void DensityLogger::OutputMoleculeToFile(ofstream& ofs, const Molecule& molecule) const{
301301 char data[1000] = "";
302302 // output molecule to the cube file
303- for(int a=0; a<molecule.GetNumberAtoms(); a++){
304- const Atom& atomA = *molecule.GetAtom(a);
303+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
304+ const Atom& atomA = *molecule.GetAtomVect()[a];
305305 memset(data,0,sizeof(data));
306306 sprintf(data,"\t%d\t%d\t%e\t%e\t%e\n", atomA.GetAtomType()+1,
307307 atomA.GetNumberValenceElectrons(),
--- a/src/base/loggers/MOLogger.cpp
+++ b/src/base/loggers/MOLogger.cpp
@@ -165,10 +165,10 @@ void MOLogger::OutputHeaderToFile(ofstream& ofs, double const* origin, double dx
165165 // output header to the cube file
166166 ofs << this->messageCubeHeaderComment1;
167167 ofs << this->messageCubeHeaderComment2;
168- sprintf(data,"\t%d\t%e\t%e\t%e\n", this->molecule->GetNumberAtoms(),
169- origin[XAxis],
170- origin[YAxis],
171- origin[ZAxis]);
168+ sprintf(data,"\t%ld\t%e\t%e\t%e\n", this->molecule->GetAtomVect().size(),
169+ origin[XAxis],
170+ origin[YAxis],
171+ origin[ZAxis]);
172172 ofs << string(data);
173173 memset(data,0,sizeof(data));
174174 sprintf(data,"\t%d\t%e\t%e\t%e\n", gridNumber[XAxis], dx, 0.0, 0.0);
@@ -184,8 +184,8 @@ void MOLogger::OutputHeaderToFile(ofstream& ofs, double const* origin, double dx
184184 void MOLogger::OutputMoleculeToFile(ofstream& ofs, const Molecule& molecule) const{
185185 char data[1000] = "";
186186 // output molecule to the cube file
187- for(int a=0; a<molecule.GetNumberAtoms(); a++){
188- Atom* atomA = molecule.GetAtom(a);
187+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
188+ Atom* atomA = molecule.GetAtomVect()[a];
189189 memset(data,0,sizeof(data));
190190 sprintf(data,"\t%d\t%d\t%e\t%e\t%e\n", atomA->GetAtomType()+1,
191191 atomA->GetNumberValenceElectrons(),
@@ -228,8 +228,8 @@ double MOLogger::GetMoValue(int moIndex,
228228 double y,
229229 double z) const{
230230 double moValue = 0.0;
231- for(int a=0; a<molecule.GetNumberAtoms(); a++){
232- Atom* atomA = molecule.GetAtom(a);
231+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
232+ Atom* atomA = molecule.GetAtomVect()[a];
233233 int firstAOIndexA = atomA->GetFirstAOIndex();
234234 int numberAOsA = atomA->GetValenceSize();
235235 for(int mu=firstAOIndexA; mu<firstAOIndexA+numberAOsA; mu++){
--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -117,7 +117,7 @@ Cndo2::~Cndo2(){
117117 this->molecule->GetTotalNumberAOs(),
118118 this->molecule->GetTotalNumberAOs());
119119 MallocerFreer::GetInstance()->Free<double>(&this->atomicElectronPopulation,
120- this->molecule->GetNumberAtoms());
120+ this->molecule->GetAtomVect().size());
121121 MallocerFreer::GetInstance()->Free<double>(&this->overlapAOs,
122122 this->molecule->GetTotalNumberAOs(),
123123 this->molecule->GetTotalNumberAOs());
@@ -136,8 +136,8 @@ Cndo2::~Cndo2(){
136136 MallocerFreer::GetInstance()->Free<double>(&this->coreDipoleMoment,
137137 CartesianType_end);
138138 MallocerFreer::GetInstance()->Free<double>(&this->gammaAB,
139- this->molecule->GetNumberAtoms(),
140- this->molecule->GetNumberAtoms());
139+ this->molecule->GetAtomVect().size(),
140+ this->molecule->GetAtomVect().size());
141141 //this->OutputLog("cndo deleted\n");
142142 }
143143
@@ -293,7 +293,7 @@ void Cndo2::SetMolecule(Molecule* molecule){
293293 this->molecule->GetTotalNumberAOs(),
294294 this->molecule->GetTotalNumberAOs());
295295 MallocerFreer::GetInstance()->Malloc<double>(&this->atomicElectronPopulation,
296- this->molecule->GetNumberAtoms());
296+ this->molecule->GetAtomVect().size());
297297 MallocerFreer::GetInstance()->Malloc<double>(&this->overlapAOs,
298298 this->molecule->GetTotalNumberAOs(),
299299 this->molecule->GetTotalNumberAOs());
@@ -313,8 +313,8 @@ void Cndo2::SetMolecule(Molecule* molecule){
313313 CartesianType_end);
314314 if(this->theory == CNDO2 || this->theory == INDO){
315315 MallocerFreer::GetInstance()->Malloc<double>(&this->gammaAB,
316- this->molecule->GetNumberAtoms(),
317- this->molecule->GetNumberAtoms());
316+ this->molecule->GetAtomVect().size(),
317+ this->molecule->GetAtomVect().size());
318318 }
319319 }
320320
@@ -327,8 +327,8 @@ void Cndo2::CheckNumberValenceElectrons(const Molecule& molecule) const{
327327 }
328328
329329 void Cndo2::CheckEnableAtomType(const Molecule& molecule) const{
330- for(int i=0; i<molecule.GetNumberAtoms(); i++){
331- AtomType atomType = molecule.GetAtom(i)->GetAtomType();
330+ for(int i=0; i<molecule.GetAtomVect().size(); i++){
331+ AtomType atomType = molecule.GetAtomVect()[i]->GetAtomType();
332332 bool enable = false;
333333 for(int j=0; j<this->enableAtomTypes.size(); j++){
334334 if(atomType == this->enableAtomTypes[j]){
@@ -348,18 +348,18 @@ void Cndo2::CheckEnableAtomType(const Molecule& molecule) const{
348348 void Cndo2::CalcCoreRepulsionEnergy(){
349349 // interaction between atoms
350350 double energy = 0.0;
351- for(int i=0; i<this->molecule->GetNumberAtoms(); i++){
352- for(int j=i+1; j<this->molecule->GetNumberAtoms(); j++){
351+ for(int i=0; i<this->molecule->GetAtomVect().size(); i++){
352+ for(int j=i+1; j<this->molecule->GetAtomVect().size(); j++){
353353 energy += this->GetDiatomCoreRepulsionEnergy(i, j);
354354 }
355355 }
356356 this->coreRepulsionEnergy = energy;
357357
358358 // interaction between atoms and epcs
359- if(this->molecule->GetNumberEpcs()<=0){return;}
359+ if(this->molecule->GetEpcVect().empty()){return;}
360360 energy = 0.0;
361- for(int i=0; i<this->molecule->GetNumberAtoms(); i++){
362- for(int j=0; j<this->molecule->GetNumberEpcs(); j++){
361+ for(int i=0; i<this->molecule->GetAtomVect().size(); i++){
362+ for(int j=0; j<this->molecule->GetEpcVect().size(); j++){
363363 energy += this->GetAtomCoreEpcCoulombEnergy(i, j);
364364 }
365365 }
@@ -368,8 +368,8 @@ void Cndo2::CalcCoreRepulsionEnergy(){
368368 }
369369
370370 double Cndo2::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) const{
371- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
372- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
371+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
372+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
373373 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
374374 return atomA.GetCoreCharge()*atomB.GetCoreCharge()/distance;
375375 }
@@ -384,8 +384,8 @@ double Cndo2::GetAtomCoreEpcCoulombEnergy(int indexAtom, int indexEpc) const{
384384 double Cndo2::GetDiatomCoreRepulsion1stDerivative(int indexAtomA, int indexAtomB,
385385 CartesianType axisA) const{
386386 double value=0.0;
387- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
388- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
387+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
388+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
389389 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
390390 value = atomA.GetCoreCharge()*atomB.GetCoreCharge();
391391 value *= (atomA.GetXyz()[axisA] - atomB.GetXyz()[axisA])/distance;
@@ -407,8 +407,8 @@ double Cndo2::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA,
407407 // See (2) in [G_2004] ((11) in [G_2006])
408408 void Cndo2::CalcVdWCorrectionEnergy(){
409409 double value = 0.0;
410- for(int i=0; i<this->molecule->GetNumberAtoms(); i++){
411- for(int j=i+1; j<this->molecule->GetNumberAtoms(); j++){
410+ for(int i=0; i<this->molecule->GetAtomVect().size(); i++){
411+ for(int j=i+1; j<this->molecule->GetAtomVect().size(); j++){
412412 value += this->GetDiatomVdWCorrectionEnergy(i, j);
413413 }
414414 }
@@ -442,8 +442,8 @@ double Cndo2::GetVdwDampingValue2ndDerivative(double vdWDistance, double distanc
442442
443443 // See (2) in [G_2004] ((11) in [G_2006])
444444 double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const{
445- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
446- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
445+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
446+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
447447 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
448448 double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii();
449449 double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()
@@ -458,8 +458,8 @@ double Cndo2::GetDiatomVdWCorrectionEnergy(int indexAtomA, int indexAtomB) const
458458 // See (2) in [G_2004] ((11) in [G_2006]).
459459 double Cndo2::GetDiatomVdWCorrection1stDerivative(int indexAtomA, int indexAtomB,
460460 CartesianType axisA) const{
461- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
462- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
461+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
462+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
463463 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
464464 double vdWDistance = atomA.GetVdWRadii() + atomB.GetVdWRadii();
465465 double vdWCoefficients = 2.0*atomA.GetVdWCoefficient()*atomB.GetVdWCoefficient()
@@ -484,8 +484,8 @@ double Cndo2::GetDiatomVdWCorrection2ndDerivative(int indexAtomA,
484484 int indexAtomB,
485485 CartesianType axisA1,
486486 CartesianType axisA2) const{
487- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
488- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
487+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
488+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
489489 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
490490 double dCartesian1 = atomA.GetXyz()[axisA1] - atomB.GetXyz()[axisA1];
491491 double dCartesian2 = atomA.GetXyz()[axisA2] - atomB.GetXyz()[axisA2];
@@ -1013,13 +1013,13 @@ void Cndo2::OutputSCFEnergies() const{
10131013 this->OutputLog(boost::format("%s\t%e\t%e\n") % this->messageElecEnergy
10141014 % this->elecSCFEnergy
10151015 % (this->elecSCFEnergy/eV2AU));
1016- if(Parameters::GetInstance()->RequiresVdWSCF() && this->molecule->GetNumberEpcs()<=0){
1016+ if(Parameters::GetInstance()->RequiresVdWSCF() && this->molecule->GetEpcVect().empty()){
10171017 this->OutputLog(this->messageNoteElecEnergyVdW);
10181018 }
1019- else if(Parameters::GetInstance()->RequiresVdWSCF() && 0<this->molecule->GetNumberEpcs()){
1019+ else if(Parameters::GetInstance()->RequiresVdWSCF() && !this->molecule->GetEpcVect().empty()){
10201020 this->OutputLog(this->messageNoteElecEnergyEpcVdW);
10211021 }
1022- else if(!Parameters::GetInstance()->RequiresVdWSCF() && 0<this->molecule->GetNumberEpcs()){
1022+ else if(!Parameters::GetInstance()->RequiresVdWSCF() && !this->molecule->GetEpcVect().empty()){
10231023 this->OutputLog(this->messageNoteElecEnergyEpc);
10241024 }
10251025 else{
@@ -1033,7 +1033,7 @@ void Cndo2::OutputSCFEnergies() const{
10331033 % (this->coreRepulsionEnergy/eV2AU));
10341034
10351035 // output coulomb interaction between atoms and epcs
1036- if(0<this->molecule->GetNumberEpcs()){
1036+ if(!this->molecule->GetEpcVect().empty()){
10371037 this->OutputLog(this->messageCoreEpcCoulombTitle);
10381038 this->OutputLog(boost::format("%s\t%e\t%e\n\n") % this->messageCoreEpcCoulomb
10391039 % this->coreEpcCoulombEnergy
@@ -1113,8 +1113,8 @@ void Cndo2::OutputSCFDipole() const{
11131113 void Cndo2::OutputSCFMulliken() const{
11141114 int groundState = 0;
11151115 this->OutputLog(this->messageMullikenAtomsTitle);
1116- for(int a=0; a<this->molecule->GetNumberAtoms(); a++){
1117- Atom* atom = this->molecule->GetAtom(a);
1116+ for(int a=0; a<this->molecule->GetAtomVect().size(); a++){
1117+ Atom* atom = this->molecule->GetAtomVect()[a];
11181118 this->OutputLog(boost::format("%s\t%d\t%d\t%s\t%e\t%e\n") % this->messageMullikenAtomsSCF
11191119 % groundState
11201120 % a
@@ -1129,7 +1129,7 @@ void Cndo2::OutputNormalModes(double const* const* normalModes,
11291129 double const* normalForceConstants,
11301130 const Molecule& molecule) const{
11311131
1132- int hessianDim = CartesianType_end*molecule.GetNumberAtoms();
1132+ int hessianDim = CartesianType_end*molecule.GetAtomVect().size();
11331133 double ang2AU = Parameters::GetInstance()->GetAngstrom2AU();
11341134 double kayser2AU = Parameters::GetInstance()->GetKayser2AU();
11351135
@@ -1149,8 +1149,8 @@ void Cndo2::OutputNormalModes(double const* const* normalModes,
11491149 % sqrt(fabs(normalForceConstants[i]))
11501150 % (sqrt(fabs(normalForceConstants[i]))/kayser2AU));
11511151 // normal modes
1152- for(int a=0; a<molecule.GetNumberAtoms(); a++){
1153- const double sqrtCoreMass = sqrt(molecule.GetAtom(a)->GetCoreMass());
1152+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
1153+ const double sqrtCoreMass = sqrt(molecule.GetAtomVect()[a]->GetCoreMass());
11541154 for(int j=XAxis; j<CartesianType_end; j++){
11551155 int hessianIndex = CartesianType_end*a+j;
11561156 this->OutputLog(boost::format("\t%e") % normalModes[i][hessianIndex]);
@@ -1178,8 +1178,8 @@ void Cndo2::OutputNormalModes(double const* const* normalModes,
11781178 % (sqrt(fabs(normalForceConstants[i]))/kayser2AU));
11791179
11801180 double normSquare=0.0;
1181- for(int a=0; a<molecule.GetNumberAtoms(); a++){
1182- const double sqrtCoreMass = sqrt(molecule.GetAtom(a)->GetCoreMass());
1181+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
1182+ const double sqrtCoreMass = sqrt(molecule.GetAtomVect()[a]->GetCoreMass());
11831183 for(int j=XAxis; j<CartesianType_end; j++){
11841184 int hessianIndex = CartesianType_end*a+j;
11851185 normSquare += pow(normalModes[i][hessianIndex]/(sqrtCoreMass*ang2AU),2.0);
@@ -1188,8 +1188,8 @@ void Cndo2::OutputNormalModes(double const* const* normalModes,
11881188 double norm = sqrt(normSquare);
11891189
11901190 // normal modes
1191- for(int a=0; a<molecule.GetNumberAtoms(); a++){
1192- const double sqrtCoreMass = sqrt(molecule.GetAtom(a)->GetCoreMass());
1191+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
1192+ const double sqrtCoreMass = sqrt(molecule.GetAtomVect()[a]->GetCoreMass());
11931193 for(int j=XAxis; j<CartesianType_end; j++){
11941194 int hessianIndex = CartesianType_end*a+j;
11951195 this->OutputLog(boost::format("\t%e") % (normalModes[i][hessianIndex]/(sqrtCoreMass*ang2AU*norm)));
@@ -1248,7 +1248,7 @@ void Cndo2::CalcElecSCFEnergy(double* elecSCFEnergy,
12481248 totalNumberAOs,
12491249 totalNumberAOs);
12501250 MallocerFreer::GetInstance()->Malloc<double>(&dammyAtomicElectronPopulation,
1251- molecule.GetNumberAtoms());
1251+ molecule.GetAtomVect().size());
12521252 bool isGuess = false;
12531253 this->CalcFockMatrix(fMatrix,
12541254 molecule,
@@ -1328,7 +1328,7 @@ void Cndo2::FreeElecEnergyMatrices(double*** fMatrix,
13281328 totalNumberAOs,
13291329 totalNumberAOs);
13301330 MallocerFreer::GetInstance()->Free<double>(dammyAtomicElectronPopulation,
1331- this->molecule->GetNumberAtoms());
1331+ this->molecule->GetAtomVect().size());
13321332 }
13331333
13341334 // The order of moI, moJ, moK, moL is consistent with Eq. (9) in [RZ_1973]
@@ -1337,13 +1337,13 @@ double Cndo2::GetMolecularIntegralElement(int moI, int moJ, int moK, int moL,
13371337 double const* const* fockMatrix,
13381338 double const* const* gammaAB) const{
13391339 double value = 0.0;
1340- for(int A=0; A<molecule.GetNumberAtoms(); A++){
1341- const Atom& atomA = *molecule.GetAtom(A);
1340+ for(int A=0; A<molecule.GetAtomVect().size(); A++){
1341+ const Atom& atomA = *molecule.GetAtomVect()[A];
13421342 int firstAOIndexA = atomA.GetFirstAOIndex();
13431343 int lastAOIndexA = atomA.GetLastAOIndex();
13441344
1345- for(int B=0; B<molecule.GetNumberAtoms(); B++){
1346- const Atom& atomB = *molecule.GetAtom(B);
1345+ for(int B=0; B<molecule.GetAtomVect().size(); B++){
1346+ const Atom& atomB = *molecule.GetAtomVect()[B];
13471347 int firstAOIndexB = atomB.GetFirstAOIndex();
13481348 int lastAOIndexB = atomB.GetLastAOIndex();
13491349 double gamma = gammaAB[A][B];
@@ -1434,7 +1434,7 @@ void Cndo2::CalcFockMatrix(double** fockMatrix,
14341434 double const* const* const* const* const* const* twoElecsTwoAtomCores,
14351435 bool isGuess) const{
14361436 int totalNumberAOs = molecule.GetTotalNumberAOs();
1437- int totalNumberAtoms = molecule.GetNumberAtoms();
1437+ int totalNumberAtoms = molecule.GetAtomVect().size();
14381438 MallocerFreer::GetInstance()->Initialize<double>(fockMatrix, totalNumberAOs, totalNumberAOs);
14391439
14401440 // MPI setting of each rank
@@ -1446,7 +1446,7 @@ void Cndo2::CalcFockMatrix(double** fockMatrix,
14461446 boost::thread communicationThread( boost::bind(&MolDS_mpi::AsyncCommunicator::Run<double>, &asyncCommunicator) );
14471447
14481448 for(int A=0; A<totalNumberAtoms; A++){
1449- const Atom& atomA = *molecule.GetAtom(A);
1449+ const Atom& atomA = *molecule.GetAtomVect()[A];
14501450 int firstAOIndexA = atomA.GetFirstAOIndex();
14511451 int lastAOIndexA = atomA.GetLastAOIndex();
14521452 for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){
@@ -1455,7 +1455,7 @@ void Cndo2::CalcFockMatrix(double** fockMatrix,
14551455 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
14561456 for(int B=A; B<totalNumberAtoms; B++){
14571457 try{
1458- const Atom& atomB = *molecule.GetAtom(B);
1458+ const Atom& atomB = *molecule.GetAtomVect()[B];
14591459 int firstAOIndexB = atomB.GetFirstAOIndex();
14601460 int lastAOIndexB = atomB.GetLastAOIndex();
14611461 for(int nu=firstAOIndexB; nu<=lastAOIndexB; nu++){
@@ -1553,9 +1553,9 @@ double Cndo2::GetFockDiagElement(const Atom& atomA,
15531553 value += temp*gammaAB[indexAtomA][indexAtomA];
15541554
15551555 temp = 0.0;
1556- for(int BB=0; BB<molecule.GetNumberAtoms(); BB++){
1556+ for(int BB=0; BB<molecule.GetAtomVect().size(); BB++){
15571557 if(BB != indexAtomA){
1558- const Atom& atomBB = *molecule.GetAtom(BB);
1558+ const Atom& atomBB = *molecule.GetAtomVect()[BB];
15591559 temp += ( atomicElectronPopulation[BB] - atomBB.GetCoreCharge() )
15601560 *gammaAB[indexAtomA][BB];
15611561 }
@@ -1631,12 +1631,12 @@ void Cndo2::CalcOrbitalElectronPopulation(double** orbitalElectronPopulation,
16311631 void Cndo2::CalcAtomicElectronPopulation(double* atomicElectronPopulation,
16321632 double const* const* orbitalElectronPopulation,
16331633 const Molecule& molecule) const{
1634- int totalNumberAtoms = molecule.GetNumberAtoms();
1634+ int totalNumberAtoms = molecule.GetAtomVect().size();
16351635 MallocerFreer::GetInstance()->Initialize<double>(atomicElectronPopulation, totalNumberAtoms);
16361636 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
16371637 for(int A=0; A<totalNumberAtoms; A++){
1638- int firstAOIndex = molecule.GetAtom(A)->GetFirstAOIndex();
1639- int numberAOs = molecule.GetAtom(A)->GetValenceSize();
1638+ int firstAOIndex = molecule.GetAtomVect()[A]->GetFirstAOIndex();
1639+ int numberAOs = molecule.GetAtomVect()[A]->GetValenceSize();
16401640 for(int i=firstAOIndex; i<firstAOIndex+numberAOs; i++){
16411641 atomicElectronPopulation[A] += orbitalElectronPopulation[i][i];
16421642 }
@@ -1646,7 +1646,7 @@ void Cndo2::CalcAtomicElectronPopulation(double* atomicElectronPopulation,
16461646
16471647 // calculate gammaAB matrix. (B.56) and (B.62) in J. A. Pople book.
16481648 void Cndo2::CalcGammaAB(double** gammaAB, const Molecule& molecule) const{
1649- int totalAtomNumber = molecule.GetNumberAtoms();
1649+ int totalAtomNumber = molecule.GetAtomVect().size();
16501650
16511651 // MPI setting of each rank
16521652 int mpiRank = MolDS_mpi::MpiProcess::GetInstance()->GetRank();
@@ -1659,14 +1659,14 @@ void Cndo2::CalcGammaAB(double** gammaAB, const Molecule& molecule) const{
16591659 for(int A=0; A<totalAtomNumber; A++){
16601660 int calcRank = A%mpiSize;
16611661 if(mpiRank == calcRank){
1662- const Atom& atomA = *molecule.GetAtom(A);
1662+ const Atom& atomA = *molecule.GetAtomVect()[A];
16631663 int na = atomA.GetValenceShellType() + 1;
16641664 double orbitalExponentA = atomA.GetOrbitalExponent(
16651665 atomA.GetValenceShellType(), s, this->theory);
16661666 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
16671667 for(int B=A; B<totalAtomNumber; B++){
16681668 try{
1669- const Atom& atomB = *molecule.GetAtom(B);
1669+ const Atom& atomB = *molecule.GetAtomVect()[B];
16701670 int nb = atomB.GetValenceShellType() + 1;
16711671 double orbitalExponentB = atomB.GetOrbitalExponent(
16721672 atomB.GetValenceShellType(), s, this->theory);
@@ -1768,9 +1768,9 @@ void Cndo2::CalcCoreDipoleMoment(double* coreDipoleMoment,
17681768
17691769 for(int i=0; i<CartesianType_end; i++){
17701770 coreDipoleMoment[i] = 0.0;
1771- for(int A=0; A<molecule.GetNumberAtoms(); A++){
1772- coreDipoleMoment[i] += molecule.GetAtom(A)->GetCoreCharge()
1773- *(molecule.GetAtom(A)->GetXyz()[i] - molecule.GetXyzCOC()[i]);
1771+ for(int A=0; A<molecule.GetAtomVect().size(); A++){
1772+ coreDipoleMoment[i] += molecule.GetAtomVect()[A]->GetCoreCharge()
1773+ *(molecule.GetAtomVect()[A]->GetXyz()[i] - molecule.GetXyzCOC()[i]);
17741774 }
17751775 }
17761776 }
@@ -1841,7 +1841,7 @@ void Cndo2::CalcCartesianMatrixByGTOExpansion(double*** cartesianMatrix,
18411841 const Molecule& molecule,
18421842 STOnGType stonG) const{
18431843 int totalAONumber = molecule.GetTotalNumberAOs();
1844- int totalAtomNumber = molecule.GetNumberAtoms();
1844+ int totalAtomNumber = molecule.GetAtomVect().size();
18451845
18461846 // MPI setting of each rank
18471847 int mpiRank = MolDS_mpi::MpiProcess::GetInstance()->GetRank();
@@ -1852,7 +1852,7 @@ void Cndo2::CalcCartesianMatrixByGTOExpansion(double*** cartesianMatrix,
18521852 boost::thread communicationThread( boost::bind(&MolDS_mpi::AsyncCommunicator::Run<double>, &asyncCommunicator) );
18531853
18541854 for(int A=0; A<totalAtomNumber; A++){
1855- const Atom& atomA = *molecule.GetAtom(A);
1855+ const Atom& atomA = *molecule.GetAtomVect()[A];
18561856 int firstAOIndexA = atomA.GetFirstAOIndex();
18571857 int numValenceAOsA = atomA.GetValenceSize();
18581858 int calcRank = A%mpiSize;
@@ -1862,7 +1862,7 @@ void Cndo2::CalcCartesianMatrixByGTOExpansion(double*** cartesianMatrix,
18621862 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
18631863 for(int B=0; B<totalAtomNumber; B++){
18641864 try{
1865- const Atom& atomB = *molecule.GetAtom(B);
1865+ const Atom& atomB = *molecule.GetAtomVect()[B];
18661866 int firstAOIndexB = atomB.GetFirstAOIndex();
18671867 int numValenceAOsB = atomB.GetValenceSize();
18681868 for(int b=0; b<numValenceAOsB; b++){
@@ -3804,11 +3804,11 @@ void Cndo2::CalcOverlapAOsWithAnotherConfiguration(double** overlapAOs,
38043804 ss << this->errorMessageRhs << rhsMolecule->GetTotalNumberAOs() << endl;
38053805 throw MolDSException(ss.str());
38063806 }
3807- if(lhsMolecule.GetNumberAtoms() != rhsMolecule->GetNumberAtoms()){
3807+ if(lhsMolecule.GetAtomVect().size() != rhsMolecule->GetAtomVect().size()){
38083808 stringstream ss;
38093809 ss << this->errorMessageCalcOverlapAOsDifferentConfigurationsDiffAtoms;
3810- ss << this->errorMessageLhs << lhsMolecule.GetNumberAtoms() << endl;
3811- ss << this->errorMessageRhs << rhsMolecule->GetNumberAtoms() << endl;
3810+ ss << this->errorMessageLhs << lhsMolecule.GetAtomVect().size() << endl;
3811+ ss << this->errorMessageRhs << rhsMolecule->GetAtomVect().size() << endl;
38123812 throw MolDSException(ss.str());
38133813 }
38143814 #ifdef MOLDS_DBG
@@ -3818,7 +3818,7 @@ void Cndo2::CalcOverlapAOsWithAnotherConfiguration(double** overlapAOs,
38183818 #endif
38193819
38203820 int totalAONumber = lhsMolecule.GetTotalNumberAOs();
3821- int totalAtomNumber = lhsMolecule.GetNumberAtoms();
3821+ int totalAtomNumber = lhsMolecule.GetAtomVect().size();
38223822 MallocerFreer::GetInstance()->Initialize<double>(overlapAOs, totalAONumber, totalAONumber);
38233823
38243824 stringstream ompErrors;
@@ -3841,8 +3841,8 @@ void Cndo2::CalcOverlapAOsWithAnotherConfiguration(double** overlapAOs,
38413841 bool isSymmetricOverlapAOs = false;
38423842 #pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
38433843 for(int A=0; A<totalAtomNumber; A++){
3844- const Atom& lhsAtom = *lhsMolecule.GetAtom(A);
3845- const Atom& rhsAtom = *rhsMolecule->GetAtom(A);
3844+ const Atom& lhsAtom = *lhsMolecule.GetAtomVect()[A];
3845+ const Atom& rhsAtom = *rhsMolecule->GetAtomVect()[A];
38463846 int firstAOIndexLhsAtom = lhsAtom.GetFirstAOIndex();
38473847 int firstAOIndexRhsAtom = rhsAtom.GetFirstAOIndex();
38483848 for(int i=0; i<lhsAtom.GetValenceSize(); i++){
@@ -3939,7 +3939,7 @@ void Cndo2::CalcOverlapESsWithAnotherElectronicStructure(double** overlapESs,
39393939 // calculate OverlapAOs matrix. E.g. S_{\mu\nu} in (3.74) in J. A. Pople book.
39403940 void Cndo2::CalcOverlapAOs(double** overlapAOs, const Molecule& molecule) const{
39413941 int totalAONumber = molecule.GetTotalNumberAOs();
3942- int totalAtomNumber = molecule.GetNumberAtoms();
3942+ int totalAtomNumber = molecule.GetAtomVect().size();
39433943 MallocerFreer::GetInstance()->Initialize<double>(overlapAOs, totalAONumber, totalAONumber);
39443944
39453945 // MPI setting of each rank
@@ -3951,7 +3951,7 @@ void Cndo2::CalcOverlapAOs(double** overlapAOs, const Molecule& molecule) const{
39513951 boost::thread communicationThread( boost::bind(&MolDS_mpi::AsyncCommunicator::Run<double>, &asyncCommunicator) );
39523952
39533953 for(int A=0; A<totalAtomNumber; A++){
3954- const Atom& atomA = *molecule.GetAtom(A);
3954+ const Atom& atomA = *molecule.GetAtomVect()[A];
39553955 int firstAOIndexA = atomA.GetFirstAOIndex();
39563956 int numValenceAOs = atomA.GetValenceSize();
39573957 int calcRank = A%mpiSize;
@@ -3985,7 +3985,7 @@ void Cndo2::CalcOverlapAOs(double** overlapAOs, const Molecule& molecule) const{
39853985 bool symmetrize = false;
39863986 #pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
39873987 for(int B=A+1; B<totalAtomNumber; B++){
3988- const Atom& atomB = *molecule.GetAtom(B);
3988+ const Atom& atomB = *molecule.GetAtomVect()[B];
39893989 this->CalcDiatomicOverlapAOsInDiatomicFrame(diatomicOverlapAOs, atomA, atomB);
39903990 this->CalcRotatingMatrix(rotatingMatrix, atomA, atomB);
39913991 this->RotateDiatmicOverlapAOsToSpaceFrame(diatomicOverlapAOs, rotatingMatrix, tmpDiatomicOverlapAOs, tmpOldDiatomicOverlapAOs, tmpMatrixBC, tmpVectorBC);
@@ -4189,8 +4189,8 @@ void Cndo2::CalcDiatomicOverlapAOs1stDerivatives(double*** diatomicOverlapAOs1st
41894189 tmpRotatedDiatomicOverlapVec,
41904190 tmpMatrixBC,
41914191 tmpVectorBC,
4192- *this->molecule->GetAtom(indexAtomA),
4193- *this->molecule->GetAtom(indexAtomB));
4192+ *this->molecule->GetAtomVect()[indexAtomA],
4193+ *this->molecule->GetAtomVect()[indexAtomB]);
41944194 }
41954195
41964196 // Second derivative of diatomic overlapAOs integrals between AOs in space fixed flame.
@@ -4330,8 +4330,8 @@ void Cndo2::CalcDiatomicOverlapAOs2ndDerivatives(double**** diatomicOverlapAOs2n
43304330 tmpRotMat,
43314331 tmpRotMat1stDerivs,
43324332 tmpRotMat2ndDerivs,
4333- *this->molecule->GetAtom(indexAtomA),
4334- *this->molecule->GetAtom(indexAtomB));
4333+ *this->molecule->GetAtomVect()[indexAtomA],
4334+ *this->molecule->GetAtomVect()[indexAtomB]);
43354335 }
43364336
43374337 double Cndo2::Get2ndDerivativeElementFromDistanceDerivatives(double firstDistanceDeri,
@@ -4358,8 +4358,8 @@ double Cndo2::Get2ndDerivativeElementFromDistanceDerivatives(double firstDistanc
43584358 void Cndo2::CalcOverlapAOsByGTOExpansion(double** overlapAOs,
43594359 const Molecule& molecule,
43604360 STOnGType stonG) const{
4361- int totalAONumber = molecule.GetTotalNumberAOs();
4362- int totalAtomNumber = molecule.GetNumberAtoms();
4361+ int totalAONumber = molecule.GetTotalNumberAOs();
4362+ int totalAtomNumber = molecule.GetAtomVect().size();
43634363
43644364 // calculation overlapAOs matrix
43654365 for(int mu=0; mu<totalAONumber; mu++){
@@ -4370,10 +4370,10 @@ void Cndo2::CalcOverlapAOsByGTOExpansion(double** overlapAOs,
43704370 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
43714371 for(int A=0; A<totalAtomNumber; A++){
43724372 try{
4373- const Atom& atomA = *molecule.GetAtom(A);
4373+ const Atom& atomA = *molecule.GetAtomVect()[A];
43744374 int firstAOIndexAtomA = atomA.GetFirstAOIndex();
43754375 for(int B=A+1; B<totalAtomNumber; B++){
4376- const Atom& atomB = *molecule.GetAtom(B);
4376+ const Atom& atomB = *molecule.GetAtomVect()[B];
43774377 int firstAOIndexAtomB = atomB.GetFirstAOIndex();
43784378 for(int a=0; a<atomA.GetValenceSize(); a++){
43794379 for(int b=0; b<atomB.GetValenceSize(); b++){
--- a/src/indo/Indo.cpp
+++ b/src/indo/Indo.cpp
@@ -137,9 +137,9 @@ double Indo::GetFockDiagElement(const Atom& atomA,
137137 value += temp;
138138
139139 temp = 0.0;
140- for(int B=0; B<molecule.GetNumberAtoms(); B++){
140+ for(int B=0; B<molecule.GetAtomVect().size(); B++){
141141 if(B != indexAtomA){
142- const Atom& atomB = *molecule.GetAtom(B);
142+ const Atom& atomB = *molecule.GetAtomVect()[B];
143143 temp += ( atomicElectronPopulation[B] - atomB.GetCoreCharge() )
144144 *gammaAB[indexAtomA][B];
145145 }
@@ -207,8 +207,8 @@ double Indo::GetMolecularIntegralElement(int moI, int moJ, int moK, int moL,
207207 value = Cndo2::GetMolecularIntegralElement(moI, moJ, moK, moL, molecule, fockMatrix, gammaAB);
208208
209209 // Aditional terms for INDO, see Eq. (10) in [RZ_1973]
210- for(int A=0; A<molecule.GetNumberAtoms(); A++){
211- const Atom& atomA = *molecule.GetAtom(A);
210+ for(int A=0; A<molecule.GetAtomVect().size(); A++){
211+ const Atom& atomA = *molecule.GetAtomVect()[A];
212212 firstAOIndexA = atomA.GetFirstAOIndex();
213213 numberAOsA = atomA.GetValenceSize();
214214
--- a/src/mc/MC.cpp
+++ b/src/mc/MC.cpp
@@ -161,9 +161,9 @@ void MC::CreateTrialConfiguration(Molecule* trial,
161161 > (*realRand),
162162 double stepWidth) const{
163163 // disturb an atom in trial molecule
164- int movedAtomIndex = static_cast<int>((*realRand)()*this->molecule->GetNumberAtoms());
165- const Atom& reffAtom = *current.GetAtom(movedAtomIndex);
166- Atom* trialAtom = trial->GetAtom(movedAtomIndex);
164+ int movedAtomIndex = static_cast<int>((*realRand)()*this->molecule->GetAtomVect().size());
165+ const Atom& reffAtom = *current.GetAtomVect()[movedAtomIndex];
166+ Atom* trialAtom = trial->GetAtomVect()[movedAtomIndex];
167167 double dr[CartesianType_end] = {0.0, 0.0, 0.0};
168168 for(int i=0; i<CartesianType_end; i++){
169169 dr[i] = stepWidth*(2.0*(*realRand)() -1.0);
@@ -177,8 +177,8 @@ void MC::CreateTrialConfiguration(Molecule* trial,
177177 for(int i=0; i<CartesianType_end; i++){
178178 coreCenterShift[i] = dr[i]*trialAtomCoreMass/totalCoreMass;
179179 }
180- for(int a=0; a<current.GetNumberAtoms(); a++){
181- Atom* trialAtom = trial->GetAtom(a);
180+ for(int a=0; a<current.GetAtomVect().size(); a++){
181+ Atom* trialAtom = trial->GetAtomVect()[a];
182182 for(int i=0; i<CartesianType_end; i++){
183183 trialAtom->GetXyz()[i] -= coreCenterShift[i];
184184 }
--- a/src/md/MD.cpp
+++ b/src/md/MD.cpp
@@ -138,8 +138,8 @@ void MD::DoMD(){
138138
139139 void MD::UpdateMomenta(const Molecule& molecule, double const* const* matrixForce, double dt) const{
140140 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
141- for(int a=0; a<molecule.GetNumberAtoms(); a++){
142- Atom* atom = molecule.GetAtom(a);
141+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
142+ Atom* atom = molecule.GetAtomVect()[a];
143143 for(int i=0; i<CartesianType_end; i++){
144144 atom->GetPxyz()[i] += 0.5*dt*(matrixForce[a][i]);
145145 }
@@ -148,8 +148,8 @@ void MD::UpdateMomenta(const Molecule& molecule, double const* const* matrixForc
148148
149149 void MD::UpdateCoordinates(Molecule& molecule, double dt) const{
150150 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
151- for(int a=0; a<molecule.GetNumberAtoms(); a++){
152- Atom* atom = molecule.GetAtom(a);
151+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
152+ Atom* atom = molecule.GetAtomVect()[a];
153153 double coreMass = atom->GetCoreMass();
154154 for(int i=0; i<CartesianType_end; i++){
155155 atom->GetXyz()[i] += dt*atom->GetPxyz()[i]/coreMass;
@@ -183,8 +183,8 @@ double MD::OutputEnergies(boost::shared_ptr<ElectronicStructure> electronicStruc
183183 int elecState = Parameters::GetInstance()->GetElectronicStateIndexMD();
184184 double eV2AU = Parameters::GetInstance()->GetEV2AU();
185185 double coreKineticEnergy = 0.0;
186- for(int a=0; a<this->molecule->GetNumberAtoms(); a++){
187- Atom* atom = this->molecule->GetAtom(a);
186+ for(int a=0; a<this->molecule->GetAtomVect().size(); a++){
187+ Atom* atom = this->molecule->GetAtomVect()[a];
188188 double coreMass = atom->GetCoreMass();
189189 for(int i=0; i<CartesianType_end; i++){
190190 coreKineticEnergy += 0.5*pow(atom->GetPxyz()[i],2.0)/coreMass;
--- a/src/mndo/Mndo.cpp
+++ b/src/mndo/Mndo.cpp
@@ -78,70 +78,70 @@ Mndo::Mndo() : MolDS_zindo::ZindoS(){
7878 Mndo::~Mndo(){
7979 OrbitalType twoElecLimit = dxy;
8080 MallocerFreer::GetInstance()->Free<double>(&this->twoElecsTwoAtomCores,
81- this->molecule->GetNumberAtoms(),
82- this->molecule->GetNumberAtoms(),
81+ this->molecule->GetAtomVect().size(),
82+ this->molecule->GetAtomVect().size(),
8383 twoElecLimit,
8484 twoElecLimit,
8585 twoElecLimit,
8686 twoElecLimit);
8787 MallocerFreer::GetInstance()->Free<double>(&this->twoElecsAtomEpcCores,
88- this->molecule->GetNumberAtoms(),
89- this->molecule->GetNumberEpcs(),
88+ this->molecule->GetAtomVect().size(),
89+ this->molecule->GetEpcVect().size(),
9090 twoElecLimit,
9191 twoElecLimit,
9292 twoElecLimit,
9393 twoElecLimit);
9494 int numBuff = (twoElecLimit+1)*twoElecLimit/2;
9595 MallocerFreer::GetInstance()->Free<double>(&this->twoElecsTwoAtomCoresMpiBuff,
96- this->molecule->GetNumberAtoms(),
97- this->molecule->GetNumberAtoms(),
96+ this->molecule->GetAtomVect().size(),
97+ this->molecule->GetAtomVect().size(),
9898 numBuff,
9999 numBuff);
100100 MallocerFreer::GetInstance()->Free<double>(&this->twoElecsAtomEpcCoresMpiBuff,
101- this->molecule->GetNumberAtoms(),
102- this->molecule->GetNumberEpcs(),
101+ this->molecule->GetAtomVect().size(),
102+ this->molecule->GetEpcVect().size(),
103103 numBuff,
104104 numBuff);
105105 MallocerFreer::GetInstance()->Free<double>(&this->normalForceConstants,
106- CartesianType_end*molecule->GetNumberAtoms());
106+ CartesianType_end*molecule->GetAtomVect().size());
107107 MallocerFreer::GetInstance()->Free<double>(&this->normalModes,
108- CartesianType_end*molecule->GetNumberAtoms(),
109- CartesianType_end*molecule->GetNumberAtoms());
108+ CartesianType_end*molecule->GetAtomVect().size(),
109+ CartesianType_end*molecule->GetAtomVect().size());
110110 }
111111
112112 void Mndo::SetMolecule(Molecule* molecule){
113113 ZindoS::SetMolecule(molecule);
114114 OrbitalType twoElecLimit = dxy;
115115 MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecsTwoAtomCores,
116- molecule->GetNumberAtoms(),
117- molecule->GetNumberAtoms(),
116+ molecule->GetAtomVect().size(),
117+ molecule->GetAtomVect().size(),
118118 twoElecLimit,
119119 twoElecLimit,
120120 twoElecLimit,
121121 twoElecLimit);
122122 MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecsAtomEpcCores,
123- molecule->GetNumberAtoms(),
124- molecule->GetNumberEpcs(),
123+ molecule->GetAtomVect().size(),
124+ molecule->GetEpcVect().size(),
125125 twoElecLimit,
126126 twoElecLimit,
127127 twoElecLimit,
128128 twoElecLimit);
129129 int numBuff = (twoElecLimit+1)*twoElecLimit/2;
130130 MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecsTwoAtomCoresMpiBuff,
131- this->molecule->GetNumberAtoms(),
132- this->molecule->GetNumberAtoms(),
131+ this->molecule->GetAtomVect().size(),
132+ this->molecule->GetAtomVect().size(),
133133 numBuff,
134134 numBuff);
135135 MallocerFreer::GetInstance()->Malloc<double>(&this->twoElecsAtomEpcCoresMpiBuff,
136- this->molecule->GetNumberAtoms(),
137- this->molecule->GetNumberEpcs(),
136+ this->molecule->GetAtomVect().size(),
137+ this->molecule->GetEpcVect().size(),
138138 numBuff,
139139 numBuff);
140140 MallocerFreer::GetInstance()->Malloc<double>(&this->normalForceConstants,
141- CartesianType_end*molecule->GetNumberAtoms());
141+ CartesianType_end*molecule->GetAtomVect().size());
142142 MallocerFreer::GetInstance()->Malloc<double>(&this->normalModes,
143- CartesianType_end*molecule->GetNumberAtoms(),
144- CartesianType_end*molecule->GetNumberAtoms());
143+ CartesianType_end*molecule->GetAtomVect().size(),
144+ CartesianType_end*molecule->GetAtomVect().size());
145145 }
146146 void Mndo::SetMessages(){
147147 this->errorMessageSCFNotConverged
@@ -315,8 +315,8 @@ double Mndo::GetAuxiliaryDiatomCoreRepulsionEnergy2ndDerivative(const Atom& atom
315315 }
316316
317317 double Mndo::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) const{
318- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
319- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
318+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
319+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
320320 double tmp = this->GetAuxiliaryDiatomCoreRepulsionEnergy(atomA,
321321 atomB,
322322 this->molecule->GetDistanceAtoms(atomA, atomB));
@@ -327,8 +327,8 @@ double Mndo::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) const{
327327 }
328328
329329 double Mndo::GetAtomCoreEpcCoulombEnergy(int indexAtom, int indexEpc) const{
330- const Atom& atom = *this->molecule->GetAtom(indexAtom);
331- const Atom& epc = *this->molecule->GetAtom(indexEpc);
330+ const Atom& atom = *this->molecule->GetAtomVect()[indexAtom];
331+ const Atom& epc = *this->molecule->GetAtomVect()[indexEpc];
332332 double distance = this->molecule->GetDistanceAtomEpc(indexAtom, indexEpc);
333333 return atom.GetCoreCharge()*epc.GetCoreCharge()/distance;
334334 }
@@ -339,8 +339,8 @@ double Mndo::GetDiatomCoreRepulsion1stDerivative(int indexAtomA,
339339 int indexAtomB,
340340 CartesianType axisA) const{
341341 double value =0.0;
342- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
343- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
342+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
343+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
344344 double distanceAB = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
345345 double twoElecInt = this->twoElecsTwoAtomCores[indexAtomA][indexAtomB][s][s][s][s];
346346 double twoElecInt1stDeriv = this->GetNddoRepulsionIntegral1stDerivative(
@@ -359,8 +359,8 @@ double Mndo::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA,
359359 CartesianType axisA1,
360360 CartesianType axisA2) const{
361361 double value =0.0;
362- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
363- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
362+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
363+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
364364 double distanceAB = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
365365 double twoElecInt = this->twoElecsTwoAtomCores[indexAtomA][indexAtomB][s][s][s][s];
366366 double twoElecInt1stDeriv1 = this->GetNddoRepulsionIntegral1stDerivative(atomA, s, s,
@@ -403,8 +403,8 @@ void Mndo::CalcHeatsFormation(double* heatsFormation,
403403 const Molecule& molecule) const{
404404 int groundState = 0;
405405 *heatsFormation = this->GetElectronicEnergy(groundState);
406- for(int A=0; A<molecule.GetNumberAtoms(); A++){
407- const Atom& atom = *molecule.GetAtom(A);
406+ for(int A=0; A<molecule.GetAtomVect().size(); A++){
407+ const Atom& atom = *molecule.GetAtomVect()[A];
408408 *heatsFormation -= atom.GetMndoElecEnergyAtom();
409409 *heatsFormation += atom.GetMndoHeatsFormAtom();
410410 }
@@ -420,7 +420,7 @@ void Mndo::CalcNormalModes(double** normalModes, double* normalForceConstants, c
420420 bool isMassWeighted = true;
421421 this->CalcHessianSCF(normalModes, isMassWeighted);
422422 bool calcEigenVectors = true;
423- int hessianDim = CartesianType_end*molecule.GetNumberAtoms();
423+ int hessianDim = CartesianType_end*molecule.GetAtomVect().size();
424424 MolDS_wrappers::Lapack::GetInstance()->Dsyevd(normalModes,
425425 normalForceConstants,
426426 hessianDim,
@@ -464,10 +464,10 @@ double Mndo::GetFockDiagElement(const Atom& atomA,
464464 value += temp;
465465
466466 temp = 0.0;
467- int totalNumberAtoms=molecule.GetNumberAtoms();
467+ int totalNumberAtoms=molecule.GetAtomVect().size();
468468 for(int B=0; B<totalNumberAtoms; B++){
469469 if(B != indexAtomA){
470- const Atom& atomB = *molecule.GetAtom(B);
470+ const Atom& atomB = *molecule.GetAtomVect()[B];
471471 int firstAOIndexB = atomB.GetFirstAOIndex();
472472 int valenceSizeB = atomB.GetValenceSize();
473473 for(int lambda=0; lambda<valenceSizeB; lambda++){
@@ -492,11 +492,11 @@ double Mndo::GetFockDiagElement(const Atom& atomA,
492492 value += temp;
493493
494494 // coulomb repulsion with point charge *
495- int numEpcs = molecule.GetNumberEpcs();
495+ int numEpcs = molecule.GetEpcVect().size();
496496 if(0<numEpcs){
497497 double elecCharge = -1.0;
498498 for(int i=0; i<numEpcs; i++){
499- double epcCharge = molecule.GetEpc(i)->GetCoreCharge();
499+ double epcCharge = molecule.GetEpcVect()[i]->GetCoreCharge();
500500 value += elecCharge*epcCharge*twoElecsAtomEpcCores[indexAtomA][i][mu][mu][s][s];
501501 }
502502 }
@@ -538,10 +538,10 @@ double Mndo::GetFockOffDiagElement(const Atom& atomA,
538538 exchange = this->GetExchangeInt(orbitalMu, orbitalNu, atomA);
539539 temp = (1.5*exchange - 0.5*coulomb)
540540 *orbitalElectronPopulation[mu+firstAOIndexA][nu+firstAOIndexB];
541- int totalNumberAtoms = molecule.GetNumberAtoms();
541+ int totalNumberAtoms = molecule.GetAtomVect().size();
542542 for(int BB=0; BB<totalNumberAtoms; BB++){
543543 if(BB != indexAtomA){
544- const Atom& atomBB = *molecule.GetAtom(BB);
544+ const Atom& atomBB = *molecule.GetAtomVect()[BB];
545545 int firstAOIndexBB = atomBB.GetFirstAOIndex();
546546 int valenceSizeBB = atomBB.GetValenceSize();
547547 for(int lambda=0; lambda<valenceSizeBB; lambda++){
@@ -564,11 +564,11 @@ double Mndo::GetFockOffDiagElement(const Atom& atomA,
564564 }
565565 }
566566 // coulomb repulsion with point charge *
567- int numEpcs = molecule.GetNumberEpcs();
567+ int numEpcs = molecule.GetEpcVect().size();
568568 if(0<numEpcs){
569569 double elecCharge = -1.0;
570570 for(int i=0; i<numEpcs; i++){
571- double epcCharge = molecule.GetEpc(i)->GetCoreCharge();
571+ double epcCharge = molecule.GetEpcVect()[i]->GetCoreCharge();
572572 value += elecCharge*epcCharge*twoElecsAtomEpcCores[indexAtomA][i][mu][nu][s][s];
573573 }
574574 }
@@ -663,7 +663,7 @@ double Mndo::GetElectronCoreAttraction(int indexAtomA,
663663 int mu,
664664 int nu,
665665 double const* const* const* const* const* const* twoElecsTwoAtomCores) const{
666- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
666+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
667667 return -1.0*atomB.GetCoreCharge()*twoElecsTwoAtomCores[indexAtomA][indexAtomB][mu][nu][s][s];
668668 }
669669
@@ -677,7 +677,7 @@ double Mndo::GetElectronCoreAttraction1stDerivative(int indexAtomA,
677677 int nu,
678678 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivatives,
679679 CartesianType axisA) const{
680- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
680+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
681681 double value = -1.0*atomB.GetCoreCharge()
682682 *diatomicTwoElecsTwoCores1stDerivatives[mu][nu][s][s][axisA];
683683 return value;
@@ -711,13 +711,13 @@ double Mndo::GetMolecularIntegralElement(int moI, int moJ, int moK, int moL,
711711 double const* const* fockMatrix,
712712 double const* const* gammaAB) const{
713713 double value = 0.0;
714- for(int A=0; A<molecule.GetNumberAtoms(); A++){
715- const Atom& atomA = *molecule.GetAtom(A);
714+ for(int A=0; A<molecule.GetAtomVect().size(); A++){
715+ const Atom& atomA = *molecule.GetAtomVect()[A];
716716 int firstAOIndexA = atomA.GetFirstAOIndex();
717717 int lastAOIndexA = atomA.GetLastAOIndex();
718718
719- for(int B=A; B<molecule.GetNumberAtoms(); B++){
720- const Atom& atomB = *molecule.GetAtom(B);
719+ for(int B=A; B<molecule.GetAtomVect().size(); B++){
720+ const Atom& atomB = *molecule.GetAtomVect()[B];
721721 int firstAOIndexB = atomB.GetFirstAOIndex();
722722 int lastAOIndexB = atomB.GetLastAOIndex();
723723
@@ -834,13 +834,13 @@ void Mndo::CalcCISMatrix(double** matrixCIS) const{
834834
835835 // Fast algorith, but this is not easy to read.
836836 // Slow algorithm is alos written below.
837- for(int A=0; A<molecule->GetNumberAtoms(); A++){
838- const Atom& atomA = *molecule->GetAtom(A);
837+ for(int A=0; A<molecule->GetAtomVect().size(); A++){
838+ const Atom& atomA = *molecule->GetAtomVect()[A];
839839 int firstAOIndexA = atomA.GetFirstAOIndex();
840840 int lastAOIndexA = atomA.GetLastAOIndex();
841841
842- for(int B=A; B<molecule->GetNumberAtoms(); B++){
843- const Atom& atomB = *molecule->GetAtom(B);
842+ for(int B=A; B<molecule->GetAtomVect().size(); B++){
843+ const Atom& atomB = *molecule->GetAtomVect()[B];
844844 int firstAOIndexB = atomB.GetFirstAOIndex();
845845 int lastAOIndexB = atomB.GetLastAOIndex();
846846
@@ -1073,25 +1073,25 @@ void Mndo::MallocTempMatricesEachThreadCalcHessianSCF(double***** diatomicOve
10731073 double*** tmpMatrixBC,
10741074 double** tmpVectorBC) const{
10751075 MallocerFreer::GetInstance()->Malloc<double>(diatomicOverlapAOs1stDerivs,
1076- this->molecule->GetNumberAtoms(),
1076+ this->molecule->GetAtomVect().size(),
10771077 OrbitalType_end,
10781078 OrbitalType_end,
10791079 CartesianType_end);
10801080 MallocerFreer::GetInstance()->Malloc<double>(diatomicOverlapAOs2ndDerivs,
1081- this->molecule->GetNumberAtoms(),
1081+ this->molecule->GetAtomVect().size(),
10821082 OrbitalType_end,
10831083 OrbitalType_end,
10841084 CartesianType_end,
10851085 CartesianType_end);
10861086 MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecsTwoCores1stDerivs,
1087- this->molecule->GetNumberAtoms(),
1087+ this->molecule->GetAtomVect().size(),
10881088 dxy,
10891089 dxy,
10901090 dxy,
10911091 dxy,
10921092 CartesianType_end);
10931093 MallocerFreer::GetInstance()->Malloc<double>(diatomicTwoElecsTwoCores2ndDerivs,
1094- this->molecule->GetNumberAtoms(),
1094+ this->molecule->GetAtomVect().size(),
10951095 dxy,
10961096 dxy,
10971097 dxy,
@@ -1173,25 +1173,25 @@ void Mndo::FreeTempMatricesEachThreadCalcHessianSCF(double***** diatomicOverl
11731173 double*** tmpMatrixBC,
11741174 double** tmpVectorBC) const{
11751175 MallocerFreer::GetInstance()->Free<double>(diatomicOverlapAOs1stDerivs,
1176- this->molecule->GetNumberAtoms(),
1176+ this->molecule->GetAtomVect().size(),
11771177 OrbitalType_end,
11781178 OrbitalType_end,
11791179 CartesianType_end);
11801180 MallocerFreer::GetInstance()->Free<double>(diatomicOverlapAOs2ndDerivs,
1181- this->molecule->GetNumberAtoms(),
1181+ this->molecule->GetAtomVect().size(),
11821182 OrbitalType_end,
11831183 OrbitalType_end,
11841184 CartesianType_end,
11851185 CartesianType_end);
11861186 MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecsTwoCores1stDerivs,
1187- this->molecule->GetNumberAtoms(),
1187+ this->molecule->GetAtomVect().size(),
11881188 dxy,
11891189 dxy,
11901190 dxy,
11911191 dxy,
11921192 CartesianType_end);
11931193 MallocerFreer::GetInstance()->Free<double>(diatomicTwoElecsTwoCores2ndDerivs,
1194- this->molecule->GetNumberAtoms(),
1194+ this->molecule->GetAtomVect().size(),
11951195 dxy,
11961196 dxy,
11971197 dxy,
@@ -1265,8 +1265,8 @@ double Mndo::GetAuxiliaryHessianElement1(int mu,
12651265 CartesianType axisA2,
12661266 double const* const* orbitalElectronPopulation,
12671267 double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{
1268- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
1269- const Atom& atomC = *this->molecule->GetAtom(indexAtomC);
1268+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
1269+ const Atom& atomC = *this->molecule->GetAtomVect()[indexAtomC];
12701270 int firstAOIndexA = atomA.GetFirstAOIndex();
12711271 double value = orbitalElectronPopulation[mu]
12721272 [nu]
@@ -1291,8 +1291,8 @@ double Mndo::GetAuxiliaryHessianElement2(int mu,
12911291 CartesianType axisB,
12921292 double const* const* const* const* orbitalElectronPopulation1stDerivs,
12931293 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
1294- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
1295- const Atom& atomC = *this->molecule->GetAtom(indexAtomC);
1294+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
1295+ const Atom& atomC = *this->molecule->GetAtomVect()[indexAtomC];
12961296 int firstAOIndexA = atomA.GetFirstAOIndex();
12971297 double value = orbitalElectronPopulation1stDerivs[mu]
12981298 [nu]
@@ -1317,8 +1317,8 @@ double Mndo::GetAuxiliaryHessianElement3(int lambda,
13171317 CartesianType axisA2,
13181318 double const* const* orbitalElectronPopulation,
13191319 double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{
1320- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
1321- const Atom& atomC = *this->molecule->GetAtom(indexAtomC);
1320+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
1321+ const Atom& atomC = *this->molecule->GetAtomVect()[indexAtomC];
13221322 int firstAOIndexC = atomC.GetFirstAOIndex();
13231323 double value = orbitalElectronPopulation[lambda]
13241324 [sigma]
@@ -1343,8 +1343,8 @@ double Mndo::GetAuxiliaryHessianElement4(int lambda,
13431343 CartesianType axisB,
13441344 double const* const* const* const* orbitalElectronPopulation1stDerivs,
13451345 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
1346- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
1347- const Atom& atomC = *this->molecule->GetAtom(indexAtomC);
1346+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
1347+ const Atom& atomC = *this->molecule->GetAtomVect()[indexAtomC];
13481348 int firstAOIndexC = atomC.GetFirstAOIndex();
13491349 double value = orbitalElectronPopulation1stDerivs[lambda]
13501350 [sigma]
@@ -1369,8 +1369,8 @@ double Mndo::GetAuxiliaryHessianElement5(int mu,
13691369 CartesianType axisA2,
13701370 double const* const* orbitalElectronPopulation,
13711371 double const* const* const* const* diatomicOverlapAOs2ndDerivs) const{
1372- const Atom& atomA = *molecule->GetAtom(indexAtomA);
1373- const Atom& atomC = *molecule->GetAtom(indexAtomC);
1372+ const Atom& atomA = *molecule->GetAtomVect()[indexAtomA];
1373+ const Atom& atomC = *molecule->GetAtomVect()[indexAtomC];
13741374 int firstAOIndexA = atomA.GetFirstAOIndex();
13751375 int firstAOIndexC = atomC.GetFirstAOIndex();
13761376 double bondParameterA = atomA.GetBondingParameter(this->theory, atomA.GetValence(mu-firstAOIndexA));
@@ -1397,8 +1397,8 @@ double Mndo::GetAuxiliaryHessianElement6(int mu,
13971397 CartesianType axisB,
13981398 double const* const* const* const* orbitalElectronPopulation1stDerivs,
13991399 double const* const* const* diatomicOverlapAOs1stDerivs) const{
1400- const Atom& atomA = *molecule->GetAtom(indexAtomA);
1401- const Atom& atomC = *molecule->GetAtom(indexAtomC);
1400+ const Atom& atomA = *molecule->GetAtomVect()[indexAtomA];
1401+ const Atom& atomC = *molecule->GetAtomVect()[indexAtomC];
14021402 int firstAOIndexA = atomA.GetFirstAOIndex();
14031403 int firstAOIndexC = atomC.GetFirstAOIndex();
14041404 double bondParameterA = atomA.GetBondingParameter(this->theory, atomA.GetValence(mu-firstAOIndexA));
@@ -1428,8 +1428,8 @@ double Mndo::GetAuxiliaryHessianElement7(int mu,
14281428 CartesianType axisA2,
14291429 double const* const* orbitalElectronPopulation,
14301430 double const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{
1431- const Atom& atomA = *molecule->GetAtom(indexAtomA);
1432- const Atom& atomC = *molecule->GetAtom(indexAtomC);
1431+ const Atom& atomA = *molecule->GetAtomVect()[indexAtomA];
1432+ const Atom& atomC = *molecule->GetAtomVect()[indexAtomC];
14331433 int firstAOIndexA = atomA.GetFirstAOIndex();
14341434 int firstAOIndexC = atomC.GetFirstAOIndex();
14351435 double temp1 = orbitalElectronPopulation[mu][nu]*orbitalElectronPopulation[lambda][sigma];
@@ -1459,8 +1459,8 @@ double Mndo::GetAuxiliaryHessianElement8(int mu,
14591459 double const* const* orbitalElectronPopulation,
14601460 double const* const* const* const* orbitalElectronPopulation1stDerivs,
14611461 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
1462- const Atom& atomA = *molecule->GetAtom(indexAtomA);
1463- const Atom& atomC = *molecule->GetAtom(indexAtomC);
1462+ const Atom& atomA = *molecule->GetAtomVect()[indexAtomA];
1463+ const Atom& atomC = *molecule->GetAtomVect()[indexAtomC];
14641464 int firstAOIndexA = atomA.GetFirstAOIndex();
14651465 int firstAOIndexC = atomC.GetFirstAOIndex();
14661466 double temp1 = orbitalElectronPopulation1stDerivs[mu][nu] [indexAtomB][axisB]
@@ -1494,12 +1494,12 @@ double Mndo::GetHessianElementSameAtomsSCF(int indexAtomA,
14941494 double const* const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{
14951495 double value=0.0;
14961496 int indexAtomB = indexAtomA;
1497- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
1497+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
14981498 int firstAOIndexA = atomA.GetFirstAOIndex();
14991499 int lastAOIndexA = atomA.GetLastAOIndex();
1500- for(int indexAtomC=0; indexAtomC<this->molecule->GetNumberAtoms(); indexAtomC++){
1500+ for(int indexAtomC=0; indexAtomC<this->molecule->GetAtomVect().size(); indexAtomC++){
15011501 if(indexAtomA != indexAtomC){
1502- const Atom& atomC = *this->molecule->GetAtom(indexAtomC);
1502+ const Atom& atomC = *this->molecule->GetAtomVect()[indexAtomC];
15031503 int firstAOIndexC = atomC.GetFirstAOIndex();
15041504 int numberAOsC = atomC.GetValenceSize();
15051505
@@ -1630,8 +1630,8 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA,
16301630 double const* const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs,
16311631 double const* const* const* const* const* const* const* diatomicTwoElecsTwoCores2ndDerivs) const{
16321632 double value=0.0;
1633- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
1634- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
1633+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
1634+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
16351635 int firstAOIndexA = atomA.GetFirstAOIndex();
16361636 int firstAOIndexB = atomB.GetFirstAOIndex();
16371637 int lastAOIndexA = atomA.GetLastAOIndex();
@@ -1693,9 +1693,9 @@ double Mndo::GetHessianElementDifferentAtomsSCF(int indexAtomA,
16931693 }
16941694 }
16951695
1696- for(int indexAtomC=0; indexAtomC<this->molecule->GetNumberAtoms(); indexAtomC++){
1696+ for(int indexAtomC=0; indexAtomC<this->molecule->GetAtomVect().size(); indexAtomC++){
16971697 if(indexAtomA != indexAtomC){
1698- const Atom& atomC = *this->molecule->GetAtom(indexAtomC);
1698+ const Atom& atomC = *this->molecule->GetAtomVect()[indexAtomC];
16991699 int firstAOIndexC = atomC.GetFirstAOIndex();
17001700 int numberAOsC = atomC.GetValenceSize();
17011701
@@ -1786,7 +1786,7 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{
17861786 MallocerFreer::GetInstance()->Malloc<double>(&orbitalElectronPopulation1stDerivs,
17871787 totalNumberAOs,
17881788 totalNumberAOs,
1789- this->molecule->GetNumberAtoms(),
1789+ this->molecule->GetAtomVect().size(),
17901790 CartesianType_end);
17911791 this->CalcOrbitalElectronPopulation1stDerivatives(orbitalElectronPopulation1stDerivs);
17921792
@@ -1834,14 +1834,14 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{
18341834 &tmpMatrixBC,
18351835 &tmpVectorBC);
18361836 #pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
1837- for(int indexAtomA=0; indexAtomA<this->molecule->GetNumberAtoms(); indexAtomA++){
1838- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
1837+ for(int indexAtomA=0; indexAtomA<this->molecule->GetAtomVect().size(); indexAtomA++){
1838+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
18391839 int firstAOIndexA = atomA.GetFirstAOIndex();
18401840 int lastAOIndexA = atomA.GetLastAOIndex();
18411841 for(int axisA = XAxis; axisA<CartesianType_end; axisA++){
18421842
18431843 // calculation of derivatives of the overlapAOss and two electron integrals
1844- for(int indexAtomB=0; indexAtomB<this->molecule->GetNumberAtoms(); indexAtomB++){
1844+ for(int indexAtomB=0; indexAtomB<this->molecule->GetAtomVect().size(); indexAtomB++){
18451845 if(indexAtomA != indexAtomB){
18461846 this->CalcDiatomicOverlapAOs1stDerivatives(diatomicOverlapAOs1stDerivs[indexAtomB],
18471847 tmpDiaOverlapAOsInDiaFrame,
@@ -1885,10 +1885,10 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{
18851885
18861886 // calculation of each hessian element
18871887 int k = indexAtomA*CartesianType_end + axisA; // hessian index, i.e. hessian[k][l]
1888- for(int indexAtomB=indexAtomA; indexAtomB<this->molecule->GetNumberAtoms(); indexAtomB++){
1888+ for(int indexAtomB=indexAtomA; indexAtomB<this->molecule->GetAtomVect().size(); indexAtomB++){
18891889 // hessian element (atomA != atomB)
18901890 if(indexAtomA!=indexAtomB){
1891- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
1891+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
18921892 for(int axisB = XAxis; axisB<CartesianType_end; axisB++){
18931893 int l = indexAtomB*CartesianType_end + axisB; // hessian index, i.e. hessian[k][l]
18941894 hessianSCF[k][l] = this->GetHessianElementDifferentAtomsSCF(indexAtomA,
@@ -1963,23 +1963,23 @@ void Mndo::CalcHessianSCF(double** hessianSCF, bool isMassWeighted) const{
19631963 MallocerFreer::GetInstance()->Free<double>(&orbitalElectronPopulation1stDerivs,
19641964 totalNumberAOs,
19651965 totalNumberAOs,
1966- this->molecule->GetNumberAtoms(),
1966+ this->molecule->GetAtomVect().size(),
19671967 CartesianType_end);
19681968 throw ex;
19691969 }
19701970 MallocerFreer::GetInstance()->Free<double>(&orbitalElectronPopulation1stDerivs,
19711971 totalNumberAOs,
19721972 totalNumberAOs,
1973- this->molecule->GetNumberAtoms(),
1973+ this->molecule->GetAtomVect().size(),
19741974 CartesianType_end);
1975- int hessianDim = this->molecule->GetNumberAtoms()*CartesianType_end;
1975+ int hessianDim = this->molecule->GetAtomVect().size()*CartesianType_end;
19761976 for(int k=0; k<hessianDim; k++){
19771977 for(int l=k; l<hessianDim; l++){
19781978 hessianSCF[l][k] = hessianSCF[k][l];
19791979 }
19801980 }
19811981 /*
1982- int hessianDim = this->molecule->GetNumberAtoms()*CartesianType_end;
1982+ int hessianDim = this->molecule->GetAtomVect().size()*CartesianType_end;
19831983 for(int i=0; i<hessianDim; i++){
19841984 for(int j=0; j<hessianDim; j++){
19851985 printf("hess elem: %d %d %e\n",i,j,hessianSCF[i][j]);
@@ -1999,7 +1999,7 @@ void Mndo::CalcOrbitalElectronPopulation1stDerivatives(double**** orbitalElectro
19991999 vector<MoIndexPair> redundantQIndeces;
20002000 this->CalcActiveSetVariablesQ(&nonRedundantQIndeces, &redundantQIndeces, numberOcc, numberVir);
20012001 int dimensionCPHF = nonRedundantQIndeces.size() + redundantQIndeces.size();
2002- int numberCPHFs = this->molecule->GetNumberAtoms()*CartesianType_end;
2002+ int numberCPHFs = this->molecule->GetAtomVect().size()*CartesianType_end;
20032003 double** solutionsCPHF = NULL; // solutions of CPHF
20042004 double** transposedFockMatrix = NULL; // transposed Fock matrix
20052005 try{
@@ -2012,7 +2012,7 @@ void Mndo::CalcOrbitalElectronPopulation1stDerivatives(double**** orbitalElectro
20122012 for(int mu=0; mu<totalNumberAOs; mu++){
20132013 try{
20142014 for(int nu=0; nu<totalNumberAOs; nu++){
2015- for(int indexAtomA=0; indexAtomA<this->molecule->GetNumberAtoms(); indexAtomA++){
2015+ for(int indexAtomA=0; indexAtomA<this->molecule->GetAtomVect().size(); indexAtomA++){
20162016 for(int axis=XAxis; axis<CartesianType_end; axis++){
20172017
20182018 int moI, moJ;
@@ -2047,7 +2047,7 @@ void Mndo::CalcOrbitalElectronPopulation1stDerivatives(double**** orbitalElectro
20472047
20482048 /*
20492049 // check the CPHF's solutions
2050- for(int indexAtomA=0; indexAtomA<this->molecule->GetNumberAtoms(); indexAtomA++){
2050+ for(int indexAtomA=0; indexAtomA<this->molecule->GetAtomVect().size(); indexAtomA++){
20512051 for(int axis=XAxis; axis<CartesianType_end; axis++){
20522052 double temp=0.0;
20532053 printf("cphf: atom:%d axis:%s start\n ",indexAtomA,CartesianTypeStr(axis));
@@ -2077,7 +2077,7 @@ void Mndo::SolveCPHF(double** solutionsCPHF,
20772077 const vector<MoIndexPair>& nonRedundantQIndeces,
20782078 const vector<MoIndexPair>& redundantQIndeces) const{
20792079 int dimensionCPHF = nonRedundantQIndeces.size() + redundantQIndeces.size();
2080- int numberCPHFs = this->molecule->GetNumberAtoms()*CartesianType_end;
2080+ int numberCPHFs = this->molecule->GetAtomVect().size()*CartesianType_end;
20812081 double** matrixCPHF = NULL; // (Gmamma - K matrix)N, see (40) - (46) to slove (34) in [PT_1996].
20822082 try{
20832083 this->MallocTempMatricesSolveCPHF(&matrixCPHF, dimensionCPHF);
@@ -2100,7 +2100,7 @@ void Mndo::CalcStaticFirstOrderFocks(double** staticFirstOrderFocks,
21002100 const vector<MoIndexPair>& redundantQIndeces) const{
21012101 stringstream ompErrors;
21022102 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
2103- for(int indexAtomA=0; indexAtomA<this->molecule->GetNumberAtoms(); indexAtomA++){
2103+ for(int indexAtomA=0; indexAtomA<this->molecule->GetAtomVect().size(); indexAtomA++){
21042104 try{
21052105 for(int axisA=XAxis; axisA<CartesianType_end; axisA++){
21062106 int k=indexAtomA*CartesianType_end + axisA;
@@ -2158,13 +2158,13 @@ void Mndo::CalcStaticFirstOrderFock(double* staticFirstOrderFock,
21582158 MallocerFreer::GetInstance()->Malloc<double>(&tmpRotatedDiatomicOverlapVec, OrbitalType_end*OrbitalType_end);
21592159 MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrixBC, OrbitalType_end, OrbitalType_end);
21602160 MallocerFreer::GetInstance()->Malloc<double>(&tmpVectorBC, OrbitalType_end*OrbitalType_end);
2161- const Atom& atomA = *molecule->GetAtom(indexAtomA);
2161+ const Atom& atomA = *molecule->GetAtomVect()[indexAtomA];
21622162 int firstAOIndexA = atomA.GetFirstAOIndex();
21632163 int lastAOIndexA = atomA.GetLastAOIndex();
21642164 int coreChargeA = atomA.GetCoreCharge();
2165- for(int indexAtomB=0; indexAtomB<this->molecule->GetNumberAtoms(); indexAtomB++){
2165+ for(int indexAtomB=0; indexAtomB<this->molecule->GetAtomVect().size(); indexAtomB++){
21662166 if(indexAtomA != indexAtomB){
2167- const Atom& atomB = *molecule->GetAtom(indexAtomB);
2167+ const Atom& atomB = *molecule->GetAtomVect()[indexAtomB];
21682168 int firstAOIndexB = atomB.GetFirstAOIndex();
21692169 int lastAOIndexB = atomB.GetLastAOIndex();
21702170 int coreChargeB = atomB.GetCoreCharge();
@@ -2468,7 +2468,7 @@ void Mndo::CalcForceSCFElecCoreAttractionPart(double* force,
24682468 int indexAtomA,
24692469 int indexAtomB,
24702470 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
2471- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
2471+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
24722472 int firstAOIndexA = atomA.GetFirstAOIndex();
24732473 int lastAOIndexA = atomA.GetLastAOIndex();
24742474 for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){
@@ -2491,8 +2491,8 @@ void Mndo::CalcForceSCFOverlapAOsPart(double* force,
24912491 int indexAtomA,
24922492 int indexAtomB,
24932493 double const* const* const* diatomicOverlapAOs1stDerivs) const{
2494- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
2495- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
2494+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
2495+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
24962496 int firstAOIndexA = atomA.GetFirstAOIndex();
24972497 int firstAOIndexB = atomB.GetFirstAOIndex();
24982498 int lastAOIndexA = atomA.GetLastAOIndex();
@@ -2520,8 +2520,8 @@ void Mndo::CalcForceSCFTwoElecPart(double* force,
25202520 int indexAtomA,
25212521 int indexAtomB,
25222522 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
2523- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
2524- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
2523+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
2524+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
25252525 int firstAOIndexA = atomA.GetFirstAOIndex();
25262526 int firstAOIndexB = atomB.GetFirstAOIndex();
25272527 int lastAOIndexA = atomA.GetLastAOIndex();
@@ -2559,8 +2559,8 @@ void Mndo::CalcForceExcitedStaticPart(double* force,
25592559 int indexAtomA,
25602560 int indexAtomB,
25612561 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
2562- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
2563- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
2562+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
2563+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
25642564 int firstAOIndexA = atomA.GetFirstAOIndex();
25652565 int firstAOIndexB = atomB.GetFirstAOIndex();
25662566 int lastAOIndexA = atomA.GetLastAOIndex();
@@ -2592,7 +2592,7 @@ void Mndo::CalcForceExcitedElecCoreAttractionPart(double* force,
25922592 int indexAtomA,
25932593 int indexAtomB,
25942594 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
2595- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
2595+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
25962596 int firstAOIndexA = atomA.GetFirstAOIndex();
25972597 int lastAOIndexA = atomA.GetLastAOIndex();
25982598 for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){
@@ -2616,8 +2616,8 @@ void Mndo::CalcForceExcitedTwoElecPart(double* force,
26162616 int indexAtomA,
26172617 int indexAtomB,
26182618 double const* const* const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
2619- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
2620- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
2619+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
2620+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
26212621 int firstAOIndexA = atomA.GetFirstAOIndex();
26222622 int firstAOIndexB = atomB.GetFirstAOIndex();
26232623 int lastAOIndexA = atomA.GetLastAOIndex();
@@ -2661,9 +2661,9 @@ void Mndo::CalcForce(const vector<int>& elecStates){
26612661 }
26622662
26632663 // this loop is MPI-parallelized
2664- for(int a=0; a<this->molecule->GetNumberAtoms(); a++){
2664+ for(int a=0; a<this->molecule->GetAtomVect().size(); a++){
26652665 if(a%mpiSize != mpiRank){continue;}
2666- const Atom& atomA = *molecule->GetAtom(a);
2666+ const Atom& atomA = *molecule->GetAtomVect()[a];
26672667 int firstAOIndexA = atomA.GetFirstAOIndex();
26682668 int lastAOIndexA = atomA.GetLastAOIndex();
26692669 stringstream ompErrors;
@@ -2697,9 +2697,9 @@ void Mndo::CalcForce(const vector<int>& elecStates){
26972697 &tmpDiatomicTwoElecsTwoCores);
26982698
26992699 #pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
2700- for(int b=0; b<this->molecule->GetNumberAtoms(); b++){
2700+ for(int b=0; b<this->molecule->GetAtomVect().size(); b++){
27012701 if(a == b){continue;}
2702- const Atom& atomB = *molecule->GetAtom(b);
2702+ const Atom& atomB = *molecule->GetAtomVect()[b];
27032703 int firstAOIndexB = atomB.GetFirstAOIndex();
27042704 int lastAOIndexB = atomB.GetLastAOIndex();
27052705
@@ -2848,7 +2848,7 @@ void Mndo::CalcForce(const vector<int>& elecStates){
28482848 }// end of for(int a) with MPI parallelization
28492849
28502850 // communication to reduce thsi->matrixForce on all node (namely, all_reduce)
2851- int numTransported = elecStates.size()*this->molecule->GetNumberAtoms()*CartesianType_end;
2851+ int numTransported = elecStates.size()*this->molecule->GetAtomVect().size()*CartesianType_end;
28522852 MolDS_mpi::MpiProcess::GetInstance()->AllReduce(&this->matrixForce[0][0][0], numTransported, std::plus<double>());
28532853 }
28542854
@@ -2972,13 +2972,13 @@ double Mndo::GetSmallQElement(int moI,
29722972 int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2;
29732973 bool isMoPOcc = moP<numberOcc ? true : false;
29742974
2975- for(int A=0; A<molecule->GetNumberAtoms(); A++){
2976- const Atom& atomA = *molecule->GetAtom(A);
2975+ for(int A=0; A<molecule->GetAtomVect().size(); A++){
2976+ const Atom& atomA = *molecule->GetAtomVect()[A];
29772977 int firstAOIndexA = atomA.GetFirstAOIndex();
29782978 int lastAOIndexA = atomA.GetLastAOIndex();
29792979
2980- for(int B=A; B<molecule->GetNumberAtoms(); B++){
2981- const Atom& atomB = *molecule->GetAtom(B);
2980+ for(int B=A; B<molecule->GetAtomVect().size(); B++){
2981+ const Atom& atomB = *molecule->GetAtomVect()[B];
29822982 int firstAOIndexB = atomB.GetFirstAOIndex();
29832983 int lastAOIndexB = atomB.GetLastAOIndex();
29842984
@@ -3153,8 +3153,8 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
31533153
31543154 // Fast algorith, but this is not easy to read.
31553155 // Slow algorithm is alos written below.
3156- for(int A=0; A<this->molecule->GetNumberAtoms(); A++){
3157- const Atom& atomA = *this->molecule->GetAtom(A);
3156+ for(int A=0; A<this->molecule->GetAtomVect().size(); A++){
3157+ const Atom& atomA = *this->molecule->GetAtomVect()[A];
31583158 int firstAOIndexA = atomA.GetFirstAOIndex();
31593159 int lastAOIndexA = atomA.GetLastAOIndex();
31603160
@@ -3197,8 +3197,8 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
31973197 *this->fockMatrix[moK][mu];
31983198 }
31993199
3200- for(int B=A; B<this->molecule->GetNumberAtoms(); B++){
3201- const Atom& atomB = *this->molecule->GetAtom(B);
3200+ for(int B=A; B<this->molecule->GetAtomVect().size(); B++){
3201+ const Atom& atomB = *this->molecule->GetAtomVect()[B];
32023202 int firstAOIndexB = atomB.GetFirstAOIndex();
32033203 int lastAOIndexB = atomB.GetLastAOIndex();
32043204
@@ -3301,16 +3301,16 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
33013301 double* twiceMoJK = NULL;
33023302 double* tmpVector = NULL;
33033303 int numAOs = this->molecule->GetTotalNumberAOs();
3304- MallocerFreer::GetInstance()->Malloc<double>(&twoElec, this->molecule->GetNumberAtoms()*dxy*dxy, this->molecule->GetNumberAtoms()*dxy*dxy);
3305- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIJ, this->molecule->GetNumberAtoms()*dxy*dxy);
3306- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIK, this->molecule->GetNumberAtoms()*dxy*dxy);
3307- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIL, this->molecule->GetNumberAtoms()*dxy*dxy);
3308- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoKL, this->molecule->GetNumberAtoms()*dxy*dxy);
3309- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoJL, this->molecule->GetNumberAtoms()*dxy*dxy);
3310- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoJK, this->molecule->GetNumberAtoms()*dxy*dxy);
3311- MallocerFreer::GetInstance()->Malloc<double>(&tmpVector, this->molecule->GetNumberAtoms()*dxy*dxy);
3312- for(int A=0; A<this->molecule->GetNumberAtoms(); A++){
3313- const Atom& atomA = *this->molecule->GetAtom(A);
3304+ MallocerFreer::GetInstance()->Malloc<double>(&twoElec, this->molecule->GetAtomVect().size()*dxy*dxy, this->molecule->GetAtomVect().size()*dxy*dxy);
3305+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIJ, this->molecule->GetAtomVect().size()*dxy*dxy);
3306+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIK, this->molecule->GetAtomVect().size()*dxy*dxy);
3307+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIL, this->molecule->GetAtomVect().size()*dxy*dxy);
3308+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoKL, this->molecule->GetAtomVect().size()*dxy*dxy);
3309+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoJL, this->molecule->GetAtomVect().size()*dxy*dxy);
3310+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoJK, this->molecule->GetAtomVect().size()*dxy*dxy);
3311+ MallocerFreer::GetInstance()->Malloc<double>(&tmpVector, this->molecule->GetAtomVect().size()*dxy*dxy);
3312+ for(int A=0; A<this->molecule->GetAtomVect().size(); A++){
3313+ const Atom& atomA = *this->molecule->GetAtomVect()[A];
33143314 int firstAOIndexA = atomA.GetFirstAOIndex();
33153315 int lastAOIndexA = atomA.GetLastAOIndex();
33163316 for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){
@@ -3322,8 +3322,8 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
33223322 }
33233323 }
33243324
3325- for(int B=0; B<this->molecule->GetNumberAtoms(); B++){
3326- const Atom& atomB = *this->molecule->GetAtom(B);
3325+ for(int B=0; B<this->molecule->GetAtomVect().size(); B++){
3326+ const Atom& atomB = *this->molecule->GetAtomVect()[B];
33273327 int firstAOIndexB = atomB.GetFirstAOIndex();
33283328 int lastAOIndexB = atomB.GetLastAOIndex();
33293329 for(int lambda=firstAOIndexB; lambda<=lastAOIndexB; lambda++){
@@ -3335,12 +3335,12 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
33353335 }
33363336 }
33373337
3338- for(int A=0; A<this->molecule->GetNumberAtoms(); A++){
3339- const Atom& atomA = *this->molecule->GetAtom(A);
3338+ for(int A=0; A<this->molecule->GetAtomVect().size(); A++){
3339+ const Atom& atomA = *this->molecule->GetAtomVect()[A];
33403340 int firstAOIndexA = atomA.GetFirstAOIndex();
33413341 int lastAOIndexA = atomA.GetLastAOIndex();
3342- for(int B=A; B<this->molecule->GetNumberAtoms(); B++){
3343- const Atom& atomB = *this->molecule->GetAtom(B);
3342+ for(int B=A; B<this->molecule->GetAtomVect().size(); B++){
3343+ const Atom& atomB = *this->molecule->GetAtomVect()[B];
33443344 int firstAOIndexB = atomB.GetFirstAOIndex();
33453345 int lastAOIndexB = atomB.GetLastAOIndex();
33463346 double gamma = 0.0;
@@ -3389,29 +3389,29 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
33893389 }
33903390 }
33913391 }
3392- MolDS_wrappers::Blas::GetInstance()->Dsymv(this->molecule->GetNumberAtoms()*dxy*dxy,
3392+ MolDS_wrappers::Blas::GetInstance()->Dsymv(this->molecule->GetAtomVect().size()*dxy*dxy,
33933393 twoElec,
33943394 twiceMoKL,
33953395 tmpVector);
3396- value = 4.0*MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetNumberAtoms()*dxy*dxy,twiceMoIJ, tmpVector);
3397- MolDS_wrappers::Blas::GetInstance()->Dsymv(this->molecule->GetNumberAtoms()*dxy*dxy,
3396+ value = 4.0*MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetAtomVect().size()*dxy*dxy,twiceMoIJ, tmpVector);
3397+ MolDS_wrappers::Blas::GetInstance()->Dsymv(this->molecule->GetAtomVect().size()*dxy*dxy,
33983398 twoElec,
33993399 twiceMoJL,
34003400 tmpVector);
3401- value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetNumberAtoms()*dxy*dxy,twiceMoIK, tmpVector);
3402- MolDS_wrappers::Blas::GetInstance()->Dsymv(this->molecule->GetNumberAtoms()*dxy*dxy,
3401+ value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetAtomVect().size()*dxy*dxy,twiceMoIK, tmpVector);
3402+ MolDS_wrappers::Blas::GetInstance()->Dsymv(this->molecule->GetAtomVect().size()*dxy*dxy,
34033403 twoElec,
34043404 twiceMoJK,
34053405 tmpVector);
3406- value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetNumberAtoms()*dxy*dxy,twiceMoIL, tmpVector);
3407- MallocerFreer::GetInstance()->Free<double>(&twoElec, this->molecule->GetNumberAtoms()*dxy*dxy, this->molecule->GetNumberAtoms()*dxy*dxy);
3408- MallocerFreer::GetInstance()->Free<double>(&twiceMoIJ, this->molecule->GetNumberAtoms()*dxy*dxy);
3409- MallocerFreer::GetInstance()->Free<double>(&twiceMoIK, this->molecule->GetNumberAtoms()*dxy*dxy);
3410- MallocerFreer::GetInstance()->Free<double>(&twiceMoIL, this->molecule->GetNumberAtoms()*dxy*dxy);
3411- MallocerFreer::GetInstance()->Free<double>(&twiceMoKL, this->molecule->GetNumberAtoms()*dxy*dxy);
3412- MallocerFreer::GetInstance()->Free<double>(&twiceMoJL, this->molecule->GetNumberAtoms()*dxy*dxy);
3413- MallocerFreer::GetInstance()->Free<double>(&twiceMoJK, this->molecule->GetNumberAtoms()*dxy*dxy);
3414- MallocerFreer::GetInstance()->Free<double>(&tmpVector, this->molecule->GetNumberAtoms()*dxy*dxy);
3406+ value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetAtomVect().size()*dxy*dxy,twiceMoIL, tmpVector);
3407+ MallocerFreer::GetInstance()->Free<double>(&twoElec, this->molecule->GetAtomVect().size()*dxy*dxy, this->molecule->GetAtomVect().size()*dxy*dxy);
3408+ MallocerFreer::GetInstance()->Free<double>(&twiceMoIJ, this->molecule->GetAtomVect().size()*dxy*dxy);
3409+ MallocerFreer::GetInstance()->Free<double>(&twiceMoIK, this->molecule->GetAtomVect().size()*dxy*dxy);
3410+ MallocerFreer::GetInstance()->Free<double>(&twiceMoIL, this->molecule->GetAtomVect().size()*dxy*dxy);
3411+ MallocerFreer::GetInstance()->Free<double>(&twiceMoKL, this->molecule->GetAtomVect().size()*dxy*dxy);
3412+ MallocerFreer::GetInstance()->Free<double>(&twiceMoJL, this->molecule->GetAtomVect().size()*dxy*dxy);
3413+ MallocerFreer::GetInstance()->Free<double>(&twiceMoJK, this->molecule->GetAtomVect().size()*dxy*dxy);
3414+ MallocerFreer::GetInstance()->Free<double>(&tmpVector, this->molecule->GetAtomVect().size()*dxy*dxy);
34153415 // End of algorithm using blas
34163416 */
34173417
@@ -3425,14 +3425,14 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
34253425 double** twiceMoB = NULL;
34263426 double** tmpMatrix = NULL;
34273427 int numAOs = this->molecule->GetTotalNumberAOs();
3428- MallocerFreer::GetInstance()->Malloc<double>(&twoElec, this->molecule->GetNumberAtoms()*dxy*dxy, this->molecule->GetNumberAtoms()*dxy*dxy);
3429- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIJ, this->molecule->GetNumberAtoms()*dxy*dxy);
3430- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIK, this->molecule->GetNumberAtoms()*dxy*dxy);
3431- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIL, this->molecule->GetNumberAtoms()*dxy*dxy);
3432- MallocerFreer::GetInstance()->Malloc<double>(&twiceMoB, 3, this->molecule->GetNumberAtoms()*dxy*dxy);
3433- MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrix,3, this->molecule->GetNumberAtoms()*dxy*dxy);
3434- for(int A=0; A<this->molecule->GetNumberAtoms(); A++){
3435- const Atom& atomA = *this->molecule->GetAtom(A);
3428+ MallocerFreer::GetInstance()->Malloc<double>(&twoElec, this->molecule->GetAtomVect().size()*dxy*dxy, this->molecule->GetAtomVect().size()*dxy*dxy);
3429+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIJ, this->molecule->GetAtomVect().size()*dxy*dxy);
3430+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIK, this->molecule->GetAtomVect().size()*dxy*dxy);
3431+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoIL, this->molecule->GetAtomVect().size()*dxy*dxy);
3432+ MallocerFreer::GetInstance()->Malloc<double>(&twiceMoB, 3, this->molecule->GetAtomVect().size()*dxy*dxy);
3433+ MallocerFreer::GetInstance()->Malloc<double>(&tmpMatrix,3, this->molecule->GetAtomVect().size()*dxy*dxy);
3434+ for(int A=0; A<this->molecule->GetAtomVect().size(); A++){
3435+ const Atom& atomA = *this->molecule->GetAtomVect()[A];
34363436 int firstAOIndexA = atomA.GetFirstAOIndex();
34373437 int lastAOIndexA = atomA.GetLastAOIndex();
34383438 for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){
@@ -3444,8 +3444,8 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
34443444 }
34453445 }
34463446
3447- for(int B=0; B<this->molecule->GetNumberAtoms(); B++){
3448- const Atom& atomB = *this->molecule->GetAtom(B);
3447+ for(int B=0; B<this->molecule->GetAtomVect().size(); B++){
3448+ const Atom& atomB = *this->molecule->GetAtomVect()[B];
34493449 int firstAOIndexB = atomB.GetFirstAOIndex();
34503450 int lastAOIndexB = atomB.GetLastAOIndex();
34513451 for(int lambda=firstAOIndexB; lambda<=lastAOIndexB; lambda++){
@@ -3457,12 +3457,12 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
34573457 }
34583458 }
34593459
3460- for(int A=0; A<this->molecule->GetNumberAtoms(); A++){
3461- const Atom& atomA = *this->molecule->GetAtom(A);
3460+ for(int A=0; A<this->molecule->GetAtomVect().size(); A++){
3461+ const Atom& atomA = *this->molecule->GetAtomVect()[A];
34623462 int firstAOIndexA = atomA.GetFirstAOIndex();
34633463 int lastAOIndexA = atomA.GetLastAOIndex();
3464- for(int B=0; B<this->molecule->GetNumberAtoms(); B++){
3465- const Atom& atomB = *this->molecule->GetAtom(B);
3464+ for(int B=0; B<this->molecule->GetAtomVect().size(); B++){
3465+ const Atom& atomB = *this->molecule->GetAtomVect()[B];
34663466 int firstAOIndexB = atomB.GetFirstAOIndex();
34673467 int lastAOIndexB = atomB.GetLastAOIndex();
34683468 double gamma = 0.0;
@@ -3513,23 +3513,23 @@ double Mndo::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) const{
35133513 }
35143514
35153515 MolDS_wrappers::Blas::GetInstance()->Dgemm(false, true, true,
3516- this->molecule->GetNumberAtoms()*dxy*dxy,
3516+ this->molecule->GetAtomVect().size()*dxy*dxy,
35173517 3,
3518- this->molecule->GetNumberAtoms()*dxy*dxy,
3518+ this->molecule->GetAtomVect().size()*dxy*dxy,
35193519 1.0,
35203520 twoElec,
35213521 twiceMoB,
35223522 0.0,
35233523 tmpMatrix);
3524- value = 4.0*MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetNumberAtoms()*dxy*dxy,twiceMoIJ, &tmpMatrix[0][0]);
3525- value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetNumberAtoms()*dxy*dxy,twiceMoIK, &tmpMatrix[1][0]);
3526- value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetNumberAtoms()*dxy*dxy,twiceMoIL, &tmpMatrix[2][0]);
3527- MallocerFreer::GetInstance()->Free<double>(&twoElec, this->molecule->GetNumberAtoms()*dxy*dxy, this->molecule->GetNumberAtoms()*dxy*dxy);
3528- MallocerFreer::GetInstance()->Free<double>(&twiceMoIJ, this->molecule->GetNumberAtoms()*dxy*dxy);
3529- MallocerFreer::GetInstance()->Free<double>(&twiceMoIK, this->molecule->GetNumberAtoms()*dxy*dxy);
3530- MallocerFreer::GetInstance()->Free<double>(&twiceMoIL, this->molecule->GetNumberAtoms()*dxy*dxy);
3531- MallocerFreer::GetInstance()->Free<double>(&twiceMoB, 3, this->molecule->GetNumberAtoms()*dxy*dxy);
3532- MallocerFreer::GetInstance()->Free<double>(&tmpMatrix,3, this->molecule->GetNumberAtoms()*dxy*dxy);
3524+ value = 4.0*MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetAtomVect().size()*dxy*dxy,twiceMoIJ, &tmpMatrix[0][0]);
3525+ value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetAtomVect().size()*dxy*dxy,twiceMoIK, &tmpMatrix[1][0]);
3526+ value -= MolDS_wrappers::Blas::GetInstance()->Ddot(this->molecule->GetAtomVect().size()*dxy*dxy,twiceMoIL, &tmpMatrix[2][0]);
3527+ MallocerFreer::GetInstance()->Free<double>(&twoElec, this->molecule->GetAtomVect().size()*dxy*dxy, this->molecule->GetAtomVect().size()*dxy*dxy);
3528+ MallocerFreer::GetInstance()->Free<double>(&twiceMoIJ, this->molecule->GetAtomVect().size()*dxy*dxy);
3529+ MallocerFreer::GetInstance()->Free<double>(&twiceMoIK, this->molecule->GetAtomVect().size()*dxy*dxy);
3530+ MallocerFreer::GetInstance()->Free<double>(&twiceMoIL, this->molecule->GetAtomVect().size()*dxy*dxy);
3531+ MallocerFreer::GetInstance()->Free<double>(&twiceMoB, 3, this->molecule->GetAtomVect().size()*dxy*dxy);
3532+ MallocerFreer::GetInstance()->Free<double>(&tmpMatrix,3, this->molecule->GetAtomVect().size()*dxy*dxy);
35333533 // End of second algorithm using blas
35343534 */
35353535
@@ -3562,7 +3562,7 @@ void Mndo::CalcTwoElecsTwoAtomCores(double****** twoElecsTwoAtomCores,
35623562 throw MolDSException(this->errorMessageCalcTwoElecsTwoAtomCoresNullMatrix);
35633563 }
35643564 #endif
3565- int totalNumberAtoms = molecule.GetNumberAtoms();
3565+ int totalNumberAtoms = molecule.GetAtomVect().size();
35663566 MallocerFreer::GetInstance()->Initialize<double>(twoElecsTwoAtomCores,
35673567 totalNumberAtoms,
35683568 totalNumberAtoms,
@@ -3674,14 +3674,14 @@ void Mndo::CalcTwoElecsTwoAtomCores(double****** twoElecsTwoAtomCores,
36743674
36753675 void Mndo::CalcTwoElecsAtomEpcCores(double****** twoElecsAtomEpcCores,
36763676 const Molecule& molecule) const{
3677- if(molecule.GetNumberEpcs()<=0){return;}
3677+ if(molecule.GetEpcVect().empty()){return;}
36783678 #ifdef MOLDS_DBG
36793679 if(twoElecsAtomEpcCores == NULL){
36803680 throw MolDSException(this->errorMessageCalcTwoElecsAtomEpcCoresNullMatrix);
36813681 }
36823682 #endif
3683- int totalNumberAtoms = molecule.GetNumberAtoms();
3684- int totalNumberEpcs = molecule.GetNumberEpcs();
3683+ int totalNumberAtoms = molecule.GetAtomVect().size();
3684+ int totalNumberEpcs = molecule.GetEpcVect().size();
36853685 MallocerFreer::GetInstance()->Initialize<double>(twoElecsAtomEpcCores,
36863686 totalNumberAtoms,
36873687 totalNumberEpcs,
@@ -3705,7 +3705,7 @@ void Mndo::CalcTwoElecsAtomEpcCores(double****** twoElecsAtomEpcCores,
37053705 double** tmpRotMat = NULL;
37063706 double** tmpMatrixBC = NULL;
37073707 double* tmpVectorBC = NULL;
3708- const Atom& atom = *molecule.GetAtom(a);
3708+ const Atom& atom = *molecule.GetAtomVect()[a];
37093709 try{
37103710 MallocerFreer::GetInstance()->Malloc<double>(&diatomicTwoElecsTwoCores, dxy, dxy, dxy, dxy);
37113711 MallocerFreer::GetInstance()->Malloc<double>(&tmpDiatomicTwoElecsTwoCores, dxy*dxy*dxy*dxy);
@@ -3715,7 +3715,7 @@ void Mndo::CalcTwoElecsAtomEpcCores(double****** twoElecsAtomEpcCores,
37153715 // note that terms with condition a==b are not needed to calculate.
37163716 //#pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
37173717 for(int b=0; b<totalNumberEpcs; b++){
3718- const Atom& epc = *molecule.GetEpc(b);
3718+ const Atom& epc = *molecule.GetEpcVect()[b];
37193719 this->CalcDiatomicTwoElecsTwoCores(diatomicTwoElecsTwoCores,
37203720 tmpDiatomicTwoElecsTwoCores,
37213721 tmpRotMat,
@@ -3883,8 +3883,8 @@ void Mndo::CalcDiatomicTwoElecsTwoCores(double**** matrix,
38833883 double* tmpVectorBC,
38843884 int indexAtomA,
38853885 int indexAtomB) const{
3886- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
3887- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
3886+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
3887+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
38883888 this->CalcDiatomicTwoElecsTwoCores(matrix,
38893889 tmpVec,
38903890 tmpRotMat,
@@ -3908,8 +3908,8 @@ void Mndo::CalcDiatomicTwoElecsTwoCores1stDerivatives(double***** matrix,
39083908 double**** tmpDiatomicTwoElecsTwoCores,
39093909 int indexAtomA,
39103910 int indexAtomB) const{
3911- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
3912- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
3911+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
3912+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
39133913 if(indexAtomA == indexAtomB){
39143914 stringstream ss;
39153915 ss << this->errorMessageCalcDiatomicTwoElecsTwoCores1stDerivativesSameAtoms;
@@ -3992,8 +3992,8 @@ void Mndo::CalcDiatomicTwoElecsTwoCores2ndDerivatives(double****** matrix,
39923992 double***** tmpDiatomicTwoElecsTwoCores1stDerivs,
39933993 int indexAtomA,
39943994 int indexAtomB) const{
3995- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
3996- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
3995+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
3996+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
39973997 if(indexAtomA == indexAtomB){
39983998 stringstream ss;
39993999 ss << this->errorMessageCalcDiatomicTwoElecsTwoCores2ndDerivativesSameAtoms;
--- a/src/nasco/NASCO.cpp
+++ b/src/nasco/NASCO.cpp
@@ -177,8 +177,8 @@ void NASCO::DoNASCO(Molecule& molecule){
177177 void NASCO::UpdateMomenta(Molecule& molecule,
178178 double const* const* matrixForce,
179179 const double dt) const{
180- for(int a=0; a<molecule.GetNumberAtoms(); a++){
181- Atom* atom = molecule.GetAtom(a);
180+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
181+ Atom* atom = molecule.GetAtomVect()[a];
182182 for(int i=0; i<CartesianType_end; i++){
183183 atom->GetPxyz()[i] += 0.5*dt*(matrixForce[a][i]);
184184 }
@@ -188,9 +188,9 @@ void NASCO::UpdateMomenta(Molecule& molecule,
188188 void NASCO::UpdateCoordinates(Molecule& tmpMolecule,
189189 const Molecule& molecule,
190190 const double dt) const{
191- for(int a=0; a<molecule.GetNumberAtoms(); a++){
192- Atom* atom = molecule.GetAtom(a);
193- Atom* tmpAtom = tmpMolecule.GetAtom(a);
191+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
192+ Atom* atom = molecule.GetAtomVect()[a];
193+ Atom* tmpAtom = tmpMolecule.GetAtomVect()[a];
194194 double coreMass = tmpAtom->GetCoreMass();
195195 for(int i=0; i<CartesianType_end; i++){
196196 tmpAtom->GetXyz()[i] = atom->GetXyz()[i] + dt*atom->GetPxyz()[i]/coreMass;
@@ -253,8 +253,8 @@ double NASCO::OutputEnergies(const ElectronicStructure& electronicStructure,
253253 int elecState) const{
254254 double eV2AU = Parameters::GetInstance()->GetEV2AU();
255255 double coreKineticEnergy = 0.0;
256- for(int a=0; a<molecule.GetNumberAtoms(); a++){
257- Atom* atom = molecule.GetAtom(a);
256+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
257+ Atom* atom = molecule.GetAtomVect()[a];
258258 double coreMass = atom->GetCoreMass();
259259 for(int i=0; i<CartesianType_end; i++){
260260 coreKineticEnergy += 0.5*pow(atom->GetPxyz()[i],2.0)/coreMass;
--- a/src/optimization/BFGS.cpp
+++ b/src/optimization/BFGS.cpp
@@ -114,7 +114,7 @@ void BFGS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStruct
114114 double lineSearchInitialEnergy = 0.0;
115115 double const* const* matrixForce = NULL;
116116 double const* vectorForce = NULL;
117- const int dimension = molecule.GetNumberAtoms()*CartesianType_end;
117+ const int dimension = molecule.GetAtomVect().size()*CartesianType_end;
118118 double** matrixHessian = NULL;
119119 double* vectorOldForce = NULL;
120120 double* vectorStep = NULL;
@@ -156,7 +156,7 @@ void BFGS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStruct
156156 trustRadius=min(trustRadius,maxNormStep);
157157
158158 //Calculate RFO step
159- MallocerFreer::GetInstance()->Malloc(&matrixStep, molecule.GetNumberAtoms(), CartesianType_end);
159+ MallocerFreer::GetInstance()->Malloc(&matrixStep, molecule.GetAtomVect().size(), CartesianType_end);
160160 vectorStep = &matrixStep[0][0];
161161 this->CalcRFOStep(vectorStep, matrixHessian, vectorForce, trustRadius, dimension);
162162
@@ -215,16 +215,16 @@ void BFGS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStruct
215215 catch(MolDSException ex){
216216 MallocerFreer::GetInstance()->Free(&matrixHessian, dimension, dimension);
217217 MallocerFreer::GetInstance()->Free(&vectorOldForce, dimension);
218- MallocerFreer::GetInstance()->Free(&matrixStep, molecule.GetNumberAtoms(), CartesianType_end);
219- MallocerFreer::GetInstance()->Free(&matrixDisplacement, molecule.GetNumberAtoms(), CartesianType_end);
220- MallocerFreer::GetInstance()->Free(&matrixOldCoordinates, molecule.GetNumberAtoms(), CartesianType_end);
218+ MallocerFreer::GetInstance()->Free(&matrixStep, molecule.GetAtomVect().size(), CartesianType_end);
219+ MallocerFreer::GetInstance()->Free(&matrixDisplacement, molecule.GetAtomVect().size(), CartesianType_end);
220+ MallocerFreer::GetInstance()->Free(&matrixOldCoordinates, molecule.GetAtomVect().size(), CartesianType_end);
221221 throw ex;
222222 }
223223 MallocerFreer::GetInstance()->Free(&matrixHessian, dimension, dimension);
224224 MallocerFreer::GetInstance()->Free(&vectorOldForce, dimension);
225- MallocerFreer::GetInstance()->Free(&matrixStep, molecule.GetNumberAtoms(), CartesianType_end);
226- MallocerFreer::GetInstance()->Free(&matrixDisplacement, molecule.GetNumberAtoms(), CartesianType_end);
227- MallocerFreer::GetInstance()->Free(&matrixOldCoordinates, molecule.GetNumberAtoms(), CartesianType_end);
225+ MallocerFreer::GetInstance()->Free(&matrixStep, molecule.GetAtomVect().size(), CartesianType_end);
226+ MallocerFreer::GetInstance()->Free(&matrixDisplacement, molecule.GetAtomVect().size(), CartesianType_end);
227+ MallocerFreer::GetInstance()->Free(&matrixOldCoordinates, molecule.GetAtomVect().size(), CartesianType_end);
228228 }
229229
230230 void BFGS::CalcRFOStep(double* vectorStep,
@@ -356,7 +356,7 @@ void BFGS::ShiftHessianRedundantMode(double** matrixHessian,
356356 const Molecule& molecule) const{
357357 const double one = 1;
358358 const double largeEigenvalue = 1.0e3;
359- const int numAtoms = molecule.GetNumberAtoms();
359+ const int numAtoms = molecule.GetAtomVect().size();
360360 const int dimension = numAtoms *CartesianType_end;
361361 const int numTranslationalModes = 3;
362362 const int numRotationalModes = 3;
@@ -397,7 +397,7 @@ void BFGS::ShiftHessianRedundantMode(double** matrixHessian,
397397 for(int c=0; c<numRotationalModes;c++){
398398 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
399399 for(int n=0;n<numAtoms;n++){
400- const double* xyz = molecule.GetAtom(n)->GetXyz();
400+ const double* xyz = molecule.GetAtomVect()[n]->GetXyz();
401401 for(int d=0;d<CartesianType_end;d++){
402402 matrixesRedundantModes[c+numTranslationalModes][n][d] = 0.0;
403403 for(int e=0;e<CartesianType_end;e++){
@@ -548,8 +548,8 @@ void BFGS::RollbackMolecularGeometry(MolDS_base::Molecule& molecule,
548548 bool tempCanOutputLogs = molecule.CanOutputLogs();
549549 bool rollbackCanOutputLogs = true;
550550 molecule.SetCanOutputLogs(rollbackCanOutputLogs);
551- for(int i=0;i<molecule.GetNumberAtoms();i++){
552- const Atom* atom = molecule.GetAtom(i);
551+ for(int i=0;i<molecule.GetAtomVect().size();i++){
552+ const Atom* atom = molecule.GetAtomVect()[i];
553553 double* xyz = atom->GetXyz();
554554 for(int j=0;j<CartesianType_end;j++){
555555 xyz[j] = matrixOldCoordinates[i][j];
@@ -562,9 +562,9 @@ void BFGS::CalcDisplacement(double * *& matrixDisplacement,
562562 double const* const* matrixOldCoordinates,
563563 const MolDS_base::Molecule& molecule)const{
564564 //Calculate displacement (K_k at Eq. (15) in [SJTO_1983])
565- MallocerFreer::GetInstance()->Malloc(&matrixDisplacement, molecule.GetNumberAtoms(), CartesianType_end);
566- for(int i=0;i<molecule.GetNumberAtoms();i++){
567- const Atom* atom = molecule.GetAtom(i);
565+ MallocerFreer::GetInstance()->Malloc(&matrixDisplacement, molecule.GetAtomVect().size(), CartesianType_end);
566+ for(int i=0;i<molecule.GetAtomVect().size();i++){
567+ const Atom* atom = molecule.GetAtomVect()[i];
568568 const double* xyz = atom->GetXyz();
569569 for(int j=0;j<CartesianType_end;j++){
570570 matrixDisplacement[i][j] = xyz[j] - matrixOldCoordinates[i][j];
@@ -575,9 +575,9 @@ void BFGS::CalcDisplacement(double * *& matrixDisplacement,
575575 void BFGS::StoreMolecularGeometry(double **& matrixCoordinates,
576576 const MolDS_base::Molecule& molecule)const{
577577 //Store old coordinates
578- MallocerFreer::GetInstance()->Malloc(&matrixCoordinates, molecule.GetNumberAtoms(), CartesianType_end);
579- for(int i=0;i<molecule.GetNumberAtoms();i++){
580- const Atom* atom = molecule.GetAtom(i);
578+ MallocerFreer::GetInstance()->Malloc(&matrixCoordinates, molecule.GetAtomVect().size(), CartesianType_end);
579+ for(int i=0;i<molecule.GetAtomVect().size();i++){
580+ const Atom* atom = molecule.GetAtomVect()[i];
581581 const double* xyz = atom->GetXyz();
582582 for(int j=0;j<CartesianType_end;j++){
583583 matrixCoordinates[i][j] = xyz[j];
--- a/src/optimization/ConjugateGradient.cpp
+++ b/src/optimization/ConjugateGradient.cpp
@@ -88,9 +88,9 @@ void ConjugateGradient::SearchMinimum(boost::shared_ptr<ElectronicStructure> ele
8888 requireGuess = false;
8989 matrixForce = electronicStructure->GetForce(elecState);
9090 try{
91- MallocerFreer::GetInstance()->Malloc<double>(&oldMatrixForce, molecule.GetNumberAtoms(), CartesianType_end);
92- MallocerFreer::GetInstance()->Malloc<double>(&matrixSearchDirection, molecule.GetNumberAtoms(), CartesianType_end);
93- for(int a=0;a<molecule.GetNumberAtoms();a++){
91+ MallocerFreer::GetInstance()->Malloc<double>(&oldMatrixForce, molecule.GetAtomVect().size(), CartesianType_end);
92+ MallocerFreer::GetInstance()->Malloc<double>(&matrixSearchDirection, molecule.GetAtomVect().size(), CartesianType_end);
93+ for(int a=0;a<molecule.GetAtomVect().size();a++){
9494 for(int i=0; i<CartesianType_end; i++){
9595 matrixSearchDirection[a][i] = matrixForce[a][i];
9696 }
@@ -120,12 +120,12 @@ void ConjugateGradient::SearchMinimum(boost::shared_ptr<ElectronicStructure> ele
120120 }
121121 }
122122 catch(MolDSException ex){
123- MallocerFreer::GetInstance()->Free<double>(&oldMatrixForce, molecule.GetNumberAtoms(), CartesianType_end);
124- MallocerFreer::GetInstance()->Free<double>(&matrixSearchDirection, molecule.GetNumberAtoms(), CartesianType_end);
123+ MallocerFreer::GetInstance()->Free<double>(&oldMatrixForce, molecule.GetAtomVect().size(), CartesianType_end);
124+ MallocerFreer::GetInstance()->Free<double>(&matrixSearchDirection, molecule.GetAtomVect().size(), CartesianType_end);
125125 throw ex;
126126 }
127- MallocerFreer::GetInstance()->Free<double>(&oldMatrixForce, molecule.GetNumberAtoms(), CartesianType_end);
128- MallocerFreer::GetInstance()->Free<double>(&matrixSearchDirection, molecule.GetNumberAtoms(), CartesianType_end);
127+ MallocerFreer::GetInstance()->Free<double>(&oldMatrixForce, molecule.GetAtomVect().size(), CartesianType_end);
128+ MallocerFreer::GetInstance()->Free<double>(&matrixSearchDirection, molecule.GetAtomVect().size(), CartesianType_end);
129129 *lineSearchedEnergy = lineSearchCurrentEnergy;
130130 }
131131
@@ -135,7 +135,7 @@ void ConjugateGradient::UpdateSearchDirection(double const* const** matrixForce,
135135 boost::shared_ptr<ElectronicStructure> electronicStructure,
136136 const MolDS_base::Molecule& molecule,
137137 int elecState) const{
138- for(int a=0;a<molecule.GetNumberAtoms();a++){
138+ for(int a=0;a<molecule.GetAtomVect().size();a++){
139139 for(int i=0; i<CartesianType_end; i++){
140140 oldMatrixForce[a][i] = (*matrixForce)[a][i];
141141 }
@@ -143,14 +143,14 @@ void ConjugateGradient::UpdateSearchDirection(double const* const** matrixForce,
143143 *matrixForce = electronicStructure->GetForce(elecState);
144144 double beta=0.0;
145145 double temp=0.0;
146- for(int a=0;a<molecule.GetNumberAtoms();a++){
146+ for(int a=0;a<molecule.GetAtomVect().size();a++){
147147 for(int i=0; i<CartesianType_end; i++){
148148 temp += pow(oldMatrixForce[a][i],2.0);
149149 beta += ((*matrixForce)[a][i] - oldMatrixForce[a][i])*(*matrixForce)[a][i];
150150 }
151151 }
152152 beta /= temp;
153- for(int a=0;a<molecule.GetNumberAtoms();a++){
153+ for(int a=0;a<molecule.GetAtomVect().size();a++){
154154 for(int i=0; i<CartesianType_end; i++){
155155 matrixSearchDirection[a][i] *= beta;
156156 matrixSearchDirection[a][i] += (*matrixForce)[a][i];
--- a/src/optimization/GEDIIS.cpp
+++ b/src/optimization/GEDIIS.cpp
@@ -89,7 +89,7 @@ void GEDIIS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStru
8989 double lineSearchInitialEnergy = 0.0;
9090 double const* const* matrixForce = NULL;
9191 double const* vectorForce = NULL;
92- const int dimension = molecule.GetNumberAtoms()*CartesianType_end;
92+ const int dimension = molecule.GetAtomVect().size()*CartesianType_end;
9393 double** matrixHessian = NULL;
9494 double* vectorOldForce = NULL;
9595 double* vectorStep = NULL;
@@ -137,8 +137,8 @@ void GEDIIS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStru
137137 lineSearchInitialEnergy = lineSearchCurrentEnergy;
138138 double preRFOEnergy = lineSearchInitialEnergy;
139139
140- MallocerFreer::GetInstance()->Malloc(&matrixGEDIISCoordinates, molecule.GetNumberAtoms(), CartesianType_end);
141- MallocerFreer::GetInstance()->Malloc(&matrixGEDIISForce, molecule.GetNumberAtoms(), CartesianType_end);
140+ MallocerFreer::GetInstance()->Malloc(&matrixGEDIISCoordinates, molecule.GetAtomVect().size(), CartesianType_end);
141+ MallocerFreer::GetInstance()->Malloc(&matrixGEDIISForce, molecule.GetAtomVect().size(), CartesianType_end);
142142 try{
143143 history.SolveGEDIISEquation(&preRFOEnergy, matrixGEDIISCoordinates, matrixGEDIISForce);
144144
@@ -176,7 +176,7 @@ void GEDIIS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStru
176176 this->ShiftHessianRedundantMode(matrixHessian, molecule);
177177
178178 //Calculate RFO step
179- MallocerFreer::GetInstance()->Malloc(&matrixStep, molecule.GetNumberAtoms(), CartesianType_end);
179+ MallocerFreer::GetInstance()->Malloc(&matrixStep, molecule.GetAtomVect().size(), CartesianType_end);
180180 vectorStep = &matrixStep[0][0];
181181 this->CalcRFOStep(vectorStep, matrixHessian, vectorForce, trustRadius, dimension);
182182
@@ -237,20 +237,20 @@ void GEDIIS::SearchMinimum(boost::shared_ptr<ElectronicStructure> electronicStru
237237 catch(MolDSException ex){
238238 MallocerFreer::GetInstance()->Free(&matrixHessian, dimension, dimension);
239239 MallocerFreer::GetInstance()->Free(&vectorOldForce, dimension);
240- MallocerFreer::GetInstance()->Free(&matrixStep , molecule.GetNumberAtoms(), CartesianType_end);
241- MallocerFreer::GetInstance()->Free(&matrixDisplacement , molecule.GetNumberAtoms(), CartesianType_end);
242- MallocerFreer::GetInstance()->Free(&matrixOldCoordinates , molecule.GetNumberAtoms(), CartesianType_end);
243- MallocerFreer::GetInstance()->Free(&matrixGEDIISCoordinates, molecule.GetNumberAtoms(), CartesianType_end);
244- MallocerFreer::GetInstance()->Free(&matrixGEDIISForce , molecule.GetNumberAtoms(), CartesianType_end);
240+ MallocerFreer::GetInstance()->Free(&matrixStep , molecule.GetAtomVect().size(), CartesianType_end);
241+ MallocerFreer::GetInstance()->Free(&matrixDisplacement , molecule.GetAtomVect().size(), CartesianType_end);
242+ MallocerFreer::GetInstance()->Free(&matrixOldCoordinates , molecule.GetAtomVect().size(), CartesianType_end);
243+ MallocerFreer::GetInstance()->Free(&matrixGEDIISCoordinates, molecule.GetAtomVect().size(), CartesianType_end);
244+ MallocerFreer::GetInstance()->Free(&matrixGEDIISForce , molecule.GetAtomVect().size(), CartesianType_end);
245245 throw ex;
246246 }
247247 MallocerFreer::GetInstance()->Free(&matrixHessian, dimension, dimension);
248248 MallocerFreer::GetInstance()->Free(&vectorOldForce, dimension);
249- MallocerFreer::GetInstance()->Free(&matrixStep , molecule.GetNumberAtoms(), CartesianType_end);
250- MallocerFreer::GetInstance()->Free(&matrixDisplacement , molecule.GetNumberAtoms(), CartesianType_end);
251- MallocerFreer::GetInstance()->Free(&matrixOldCoordinates , molecule.GetNumberAtoms(), CartesianType_end);
252- MallocerFreer::GetInstance()->Free(&matrixGEDIISCoordinates, molecule.GetNumberAtoms(), CartesianType_end);
253- MallocerFreer::GetInstance()->Free(&matrixGEDIISForce , molecule.GetNumberAtoms(), CartesianType_end);
249+ MallocerFreer::GetInstance()->Free(&matrixStep , molecule.GetAtomVect().size(), CartesianType_end);
250+ MallocerFreer::GetInstance()->Free(&matrixDisplacement , molecule.GetAtomVect().size(), CartesianType_end);
251+ MallocerFreer::GetInstance()->Free(&matrixOldCoordinates , molecule.GetAtomVect().size(), CartesianType_end);
252+ MallocerFreer::GetInstance()->Free(&matrixGEDIISCoordinates, molecule.GetAtomVect().size(), CartesianType_end);
253+ MallocerFreer::GetInstance()->Free(&matrixGEDIISForce , molecule.GetAtomVect().size(), CartesianType_end);
254254 }
255255
256256 GEDIIS::GEDIISHistory::GEDIISHistory():maxEntryCount(5){
@@ -287,12 +287,12 @@ void GEDIIS::GEDIISHistory::DiscardEntries(){
287287 GEDIIS::GEDIISHistory::Entry::Entry(double energy,
288288 const MolDS_base::Molecule& molecule,
289289 double const* const* matrixForce):
290- energy(energy),numAtoms(molecule.GetNumberAtoms()),matrixCoordinate(NULL),matrixForce(NULL) {
290+ energy(energy),numAtoms(molecule.GetAtomVect().size()),matrixCoordinate(NULL),matrixForce(NULL) {
291291 MallocerFreer::GetInstance()->Malloc(&this->matrixCoordinate, this->numAtoms, CartesianType_end);
292292 MallocerFreer::GetInstance()->Malloc(&this->matrixForce, this->numAtoms, CartesianType_end);
293293 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
294294 for(int i = 0; i < this->numAtoms; i++){
295- const Atom* atom = molecule.GetAtom(i);
295+ const Atom* atom = molecule.GetAtomVect()[i];
296296 const double* xyz = atom->GetXyz();
297297 for(int j = 0; j < CartesianType_end; j++){
298298 this->matrixCoordinate[i][j] = xyz[j];
--- a/src/optimization/Optimizer.cpp
+++ b/src/optimization/Optimizer.cpp
@@ -131,16 +131,16 @@ void Optimizer::CheckEnableTheoryType(TheoryType theoryType) const{
131131
132132 void Optimizer::ClearMolecularMomenta(Molecule& molecule) const{
133133 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
134- for(int a=0; a<molecule.GetNumberAtoms(); a++){
135- const Atom* atom = molecule.GetAtom(a);
134+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
135+ const Atom* atom = molecule.GetAtomVect()[a];
136136 atom->SetPxyz(0.0, 0.0, 0.0);
137137 }
138138 }
139139
140140 void Optimizer::UpdateMolecularCoordinates(Molecule& molecule, double const* const* matrixForce, double dt) const{
141141 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
142- for(int a=0; a<molecule.GetNumberAtoms(); a++){
143- const Atom* atom = molecule.GetAtom(a);
142+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
143+ const Atom* atom = molecule.GetAtomVect()[a];
144144 double coreMass = atom->GetCoreMass();
145145 for(int i=0; i<CartesianType_end; i++){
146146 atom->GetXyz()[i] += dt*matrixForce[a][i]/coreMass;
@@ -151,8 +151,8 @@ void Optimizer::UpdateMolecularCoordinates(Molecule& molecule, double const* con
151151
152152 void Optimizer::UpdateMolecularCoordinates(Molecule& molecule, double const* const* matrixForce) const{
153153 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
154- for(int a=0; a<molecule.GetNumberAtoms(); a++){
155- const Atom* atom = molecule.GetAtom(a);
154+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
155+ const Atom* atom = molecule.GetAtomVect()[a];
156156 for(int i=0; i<CartesianType_end; i++){
157157 atom->GetXyz()[i] += matrixForce[a][i];
158158 }
@@ -233,7 +233,7 @@ bool Optimizer::SatisfiesConvergenceCriterion(double const* const* matrixForce,
233233 double maxGradient = 0.0;
234234 double sumSqureGradient = 0.0;
235235 double energyDifference = currentEnergy - oldEnergy;
236- for(int a=0; a<molecule.GetNumberAtoms(); a++){
236+ for(int a=0; a<molecule.GetAtomVect().size(); a++){
237237 for(int i=0; i<CartesianType_end; i++){
238238 if(maxGradient<fabs(matrixForce[a][i])){
239239 maxGradient = fabs(matrixForce[a][i]);
@@ -241,7 +241,7 @@ bool Optimizer::SatisfiesConvergenceCriterion(double const* const* matrixForce,
241241 sumSqureGradient += pow(matrixForce[a][i],2.0);
242242 }
243243 }
244- sumSqureGradient /= static_cast<double>(molecule.GetNumberAtoms()*CartesianType_end);
244+ sumSqureGradient /= static_cast<double>(molecule.GetAtomVect().size()*CartesianType_end);
245245 double rmsGradient = sqrt(sumSqureGradient);
246246
247247 // output logs
--- a/src/pm3/Pm3Pddg.cpp
+++ b/src/pm3/Pm3Pddg.cpp
@@ -143,8 +143,8 @@ double Pm3Pddg::GetDiatomCoreRepulsionEnergy(int indexAtomA, int indexAtomB) con
143143 double pm3Term = Pm3::GetDiatomCoreRepulsionEnergy(indexAtomA, indexAtomB);
144144
145145 // pddg additional term, eq. (4) in [RCJ_2002]
146- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
147- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
146+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
147+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
148148 int na = atomA.GetNumberValenceElectrons();
149149 int nb = atomB.GetNumberValenceElectrons();
150150 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
@@ -172,8 +172,8 @@ double Pm3Pddg::GetDiatomCoreRepulsion1stDerivative(int indexAtomA,
172172 double pm3Term = Pm3::GetDiatomCoreRepulsion1stDerivative(indexAtomA, indexAtomB, axisA);
173173
174174 // pddg additional term, first derivative of eq. (4) in [RCJ_2002]
175- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
176- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
175+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
176+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
177177 int na = atomA.GetNumberValenceElectrons();
178178 int nb = atomB.GetNumberValenceElectrons();
179179 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
@@ -203,8 +203,8 @@ double Pm3Pddg::GetDiatomCoreRepulsion2ndDerivative(int indexAtomA,
203203 double pm3Term = Pm3::GetDiatomCoreRepulsion2ndDerivative(indexAtomA, indexAtomB, axisA1, axisA2);
204204
205205 // pddg additional term, first derivative of eq. (4) in [RCJ_2002]
206- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
207- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
206+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
207+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
208208 double distance = this->molecule->GetDistanceAtoms(indexAtomA, indexAtomB);
209209 double dCartesian1 = (atomA.GetXyz()[axisA1] - atomB.GetXyz()[axisA1]);
210210 double dCartesian2 = (atomA.GetXyz()[axisA2] - atomB.GetXyz()[axisA2]);
--- a/src/rpmd/RPMD.cpp
+++ b/src/rpmd/RPMD.cpp
@@ -94,16 +94,16 @@ void RPMD::UpdateMomenta(const vector<boost::shared_ptr<Molecule> >& molecularBe
9494 double temperature){
9595 double kB = Parameters::GetInstance()->GetBoltzmann();
9696 int numBeads = molecularBeads.size();
97- int numAtom = molecularBeads[0]->GetNumberAtoms();
97+ int numAtom = molecularBeads[0]->GetAtomVect().size();
9898 for(int b=0; b<numBeads; b++){
9999 int preB = b==0 ? numBeads-1 : b-1;
100100 int postB = b==numBeads-1 ? 0 : b+1;
101101 double const* const* electronicForceMatrix
102102 = electronicStructureBeads[b]->GetForce(elecState);;
103103 for(int a=0; a<numAtom; a++){
104- Atom* atom = molecularBeads[b]->GetAtom(a);
105- Atom* preAtom = molecularBeads[preB]->GetAtom(a);
106- Atom* postAtom = molecularBeads[postB]->GetAtom(a);
104+ Atom* atom = molecularBeads[b]->GetAtomVect()[a];
105+ Atom* preAtom = molecularBeads[preB]->GetAtomVect()[a];
106+ Atom* postAtom = molecularBeads[postB]->GetAtomVect()[a];
107107 double coreMass = atom->GetCoreMass();
108108 for(int i=0; i<CartesianType_end; i++){
109109 double beadsForce = -1.0*coreMass*pow(kB*temperature*static_cast<double>(numBeads),2.0)
@@ -118,10 +118,10 @@ void RPMD::UpdateMomenta(const vector<boost::shared_ptr<Molecule> >& molecularBe
118118 void RPMD::UpdateCoordinates(const vector<boost::shared_ptr<Molecule> >& molecularBeads,
119119 double dt){
120120 int numBeads = molecularBeads.size();
121- int numAtom = molecularBeads[0]->GetNumberAtoms();
121+ int numAtom = molecularBeads[0]->GetAtomVect().size();
122122 for(int b=0; b<numBeads; b++){
123123 for(int a=0; a<numAtom; a++){
124- Atom* atom = molecularBeads[b]->GetAtom(a);
124+ Atom* atom = molecularBeads[b]->GetAtomVect()[a];
125125 double coreMass = atom->GetCoreMass();
126126 for(int i=0; i<CartesianType_end; i++){
127127 atom->GetXyz()[i] += dt*atom->GetPxyz()[i]/coreMass;
@@ -150,7 +150,7 @@ void RPMD::FluctuateBeads(const vector<boost::shared_ptr<Molecule> >& molecularB
150150 molecule->SetCanOutputLogs(false);
151151 mc->SetMolecule(molecule);
152152 mc->SetCanOutputLogs(false);
153- mc->DoMC(molecule->GetNumberAtoms(), elecState, temperature, stepWidth, seed+b);
153+ mc->DoMC(molecule->GetAtomVect().size(), elecState, temperature, stepWidth, seed+b);
154154 }
155155 }
156156
@@ -168,7 +168,7 @@ void RPMD::DoRPMD(const Molecule& refferenceMolecule){
168168 double dt = Parameters::GetInstance()->GetTimeWidthRPMD();
169169 double kB = Parameters::GetInstance()->GetBoltzmann();
170170 int numBeads = Parameters::GetInstance()->GetNumberBeadsRPMD();
171- int numAtom = refferenceMolecule.GetNumberAtoms();
171+ int numAtom = refferenceMolecule.GetAtomVect().size();
172172
173173 // create Beads
174174 vector<boost::shared_ptr<Molecule> > molecularBeads;
@@ -249,12 +249,12 @@ double RPMD::OutputEnergies(const vector<boost::shared_ptr<Molecule> >& molecula
249249 int elecState,
250250 double temperature){
251251 int numBeads = molecularBeads.size();
252- int numAtom = molecularBeads[0]->GetNumberAtoms();
252+ int numAtom = molecularBeads[0]->GetAtomVect().size();
253253 double beadsKineticEnergy = 0.0;;
254254 for(int b=0; b<numBeads; b++){
255255 double coreKineticEnergy = 0.0;
256256 for(int a=0; a<numAtom; a++){
257- Atom* atom = molecularBeads[b]->GetAtom(a);
257+ Atom* atom = molecularBeads[b]->GetAtomVect()[a];
258258 double coreMass = atom->GetCoreMass();
259259 for(int i=0; i<CartesianType_end; i++){
260260 coreKineticEnergy += 0.5*pow(atom->GetPxyz()[i],2.0)/coreMass;
@@ -269,8 +269,8 @@ double RPMD::OutputEnergies(const vector<boost::shared_ptr<Molecule> >& molecula
269269 double harmonicEnergy = 0.0;
270270 int preB = b==0 ? numBeads-1 : b-1;
271271 for(int a=0; a<numAtom; a++){
272- Atom* atom = molecularBeads[b]->GetAtom(a);
273- Atom* preAtom = molecularBeads[preB]->GetAtom(a);
272+ Atom* atom = molecularBeads[b]->GetAtomVect()[a];
273+ Atom* preAtom = molecularBeads[preB]->GetAtomVect()[a];
274274 double coreMass = atom->GetCoreMass();
275275 double dx = atom->GetXyz()[XAxis] - preAtom->GetXyz()[XAxis];
276276 double dy = atom->GetXyz()[YAxis] - preAtom->GetXyz()[YAxis];
--- a/src/zindo/ZindoS.cpp
+++ b/src/zindo/ZindoS.cpp
@@ -91,9 +91,9 @@ ZindoS::ZindoS() : MolDS_cndo::Cndo2(){
9191 ZindoS::~ZindoS(){
9292 if(this->theory==ZINDOS){
9393 MallocerFreer::GetInstance()->Free<double>(&this->nishimotoMatagaMatrix,
94- this->molecule->GetNumberAtoms(),
94+ this->molecule->GetAtomVect().size(),
9595 OrbitalType_end,
96- this->molecule->GetNumberAtoms(),
96+ this->molecule->GetAtomVect().size(),
9797 OrbitalType_end);
9898 }
9999 MallocerFreer::GetInstance()->Free<double>(&this->matrixCIS,
@@ -105,7 +105,7 @@ ZindoS::~ZindoS(){
105105 this->matrixCISdimension);
106106 MallocerFreer::GetInstance()->Free<double>(&this->matrixForce,
107107 this->matrixForceElecStatesNum,
108- this->molecule->GetNumberAtoms(),
108+ this->molecule->GetAtomVect().size(),
109109 CartesianType_end);
110110 MallocerFreer::GetInstance()->Free<double>(&this->zMatrixForce,
111111 this->zMatrixForceElecStatesNum,
@@ -123,11 +123,11 @@ ZindoS::~ZindoS(){
123123 this->molecule->GetTotalNumberAOs());
124124 MallocerFreer::GetInstance()->Free<double>(&this->atomicElectronPopulationCIS,
125125 elecStates->size(),
126- this->molecule->GetNumberAtoms());
126+ this->molecule->GetAtomVect().size());
127127 if(Parameters::GetInstance()->RequiresUnpairedPopCIS()){
128128 MallocerFreer::GetInstance()->Free<double>(&this->atomicUnpairedPopulationCIS,
129129 elecStates->size(),
130- this->molecule->GetNumberAtoms());
130+ this->molecule->GetAtomVect().size());
131131 }
132132 }
133133 //this->OutputLog("ZindoS deleted\n");
@@ -137,9 +137,9 @@ void ZindoS::SetMolecule(Molecule* molecule){
137137 Cndo2::SetMolecule(molecule);
138138 if(this->theory==ZINDOS){
139139 MallocerFreer::GetInstance()->Malloc<double>(&this->nishimotoMatagaMatrix,
140- this->molecule->GetNumberAtoms(),
140+ this->molecule->GetAtomVect().size(),
141141 OrbitalType_end,
142- this->molecule->GetNumberAtoms(),
142+ this->molecule->GetAtomVect().size(),
143143 OrbitalType_end);
144144 }
145145 }
@@ -255,10 +255,10 @@ double ZindoS::GetFockDiagElement(const Atom& atomA,
255255 value += temp;
256256
257257 temp = 0.0;
258- int totalNumberAtoms = molecule.GetNumberAtoms();
258+ int totalNumberAtoms = molecule.GetAtomVect().size();
259259 for(int B=0; B<totalNumberAtoms; B++){
260260 if(B != indexAtomA){
261- const Atom& atomB = *molecule.GetAtom(B);
261+ const Atom& atomB = *molecule.GetAtomVect()[B];
262262 OrbitalType orbitalSigma;
263263 int sigma;
264264 int atomBNumberValence = atomB.GetValenceSize();
@@ -732,18 +732,18 @@ double ZindoS::GetNishimotoMatagaTwoEleInt1stDerivative(const Atom& atomA,
732732 }
733733
734734 void ZindoS::CalcNishimotoMatagaMatrix(double**** nishimotoMatagaMatrix, const Molecule& molecule) const{
735- int totalNumberAtoms = molecule.GetNumberAtoms();
735+ int totalNumberAtoms = molecule.GetAtomVect().size();
736736 stringstream ompErrors;
737737 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
738738 for(int A=0; A<totalNumberAtoms; A++){
739739 try{
740- const Atom& atomA = *molecule.GetAtom(A);
740+ const Atom& atomA = *molecule.GetAtomVect()[A];
741741 int firstAOIndexA = atomA.GetFirstAOIndex();
742742 int lastAOIndexA = atomA.GetLastAOIndex();
743743 for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){
744744 OrbitalType orbitalMu = atomA.GetValence(mu-firstAOIndexA);
745745 for(int B=A; B<totalNumberAtoms; B++){
746- const Atom& atomB = *molecule.GetAtom(B);
746+ const Atom& atomB = *molecule.GetAtomVect()[B];
747747 int firstAOIndexB = atomB.GetFirstAOIndex();
748748 int lastAOIndexB = atomB.GetLastAOIndex();
749749 double rAB = molecule.GetDistanceAtoms(atomA, atomB);
@@ -956,8 +956,8 @@ double ZindoS::GetMolecularIntegralElement(int moI, int moJ, int moK, int moL,
956956 double gamma;
957957 double exchange;
958958 double coulomb;
959- for(int A=0; A<molecule.GetNumberAtoms(); A++){
960- const Atom& atomA = *molecule.GetAtom(A);
959+ for(int A=0; A<molecule.GetAtomVect().size(); A++){
960+ const Atom& atomA = *molecule.GetAtomVect()[A];
961961 int firstAOIndexA = atomA.GetFirstAOIndex();
962962 int lastAOIndexA = atomA.GetLastAOIndex();
963963
@@ -965,8 +965,8 @@ double ZindoS::GetMolecularIntegralElement(int moI, int moJ, int moK, int moL,
965965 OrbitalType orbitalMu = atomA.GetValence(mu-firstAOIndexA);
966966
967967 // CNDO term
968- for(int B=A; B<molecule.GetNumberAtoms(); B++){
969- const Atom& atomB = *molecule.GetAtom(B);
968+ for(int B=A; B<molecule.GetAtomVect().size(); B++){
969+ const Atom& atomB = *molecule.GetAtomVect()[B];
970970 int firstAOIndexB = atomB.GetFirstAOIndex();
971971 int lastAOIndexB = atomB.GetLastAOIndex();
972972
@@ -1700,7 +1700,7 @@ void ZindoS::CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationC
17001700 if(!Parameters::GetInstance()->RequiresMullikenCIS()){
17011701 return;
17021702 }
1703- int totalNumberAtoms = molecule.GetNumberAtoms();
1703+ int totalNumberAtoms = molecule.GetAtomVect().size();
17041704 vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS();
17051705 // malloc or initialize free exciton energies
17061706 if(*atomicElectronPopulationCIS == NULL){
@@ -1719,8 +1719,8 @@ void ZindoS::CalcAtomicElectronPopulationCIS(double*** atomicElectronPopulationC
17191719 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
17201720 for(int a=0; a<totalNumberAtoms; a++){
17211721 try{
1722- int firstAOIndex = molecule.GetAtom(a)->GetFirstAOIndex();
1723- int numberAOs = molecule.GetAtom(a)->GetValenceSize();
1722+ int firstAOIndex = molecule.GetAtomVect()[a]->GetFirstAOIndex();
1723+ int numberAOs = molecule.GetAtomVect()[a]->GetValenceSize();
17241724 for(int i=firstAOIndex; i<firstAOIndex+numberAOs; i++){
17251725 (*atomicElectronPopulationCIS)[k][a] += orbitalElectronPopulationCIS[k][i][i];
17261726 }
@@ -1746,7 +1746,7 @@ void ZindoS::CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationC
17461746 if(!Parameters::GetInstance()->RequiresUnpairedPopCIS()){
17471747 return;
17481748 }
1749- int totalNumberAtoms = molecule.GetNumberAtoms();
1749+ int totalNumberAtoms = molecule.GetAtomVect().size();
17501750 vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS();
17511751 // malloc or initialize free exciton energies
17521752 if(*atomicUnpairedPopulationCIS == NULL){
@@ -1765,8 +1765,8 @@ void ZindoS::CalcAtomicUnpairedPopulationCIS(double*** atomicUnpairedPopulationC
17651765 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
17661766 for(int a=0; a<totalNumberAtoms; a++){
17671767 try{
1768- int firstAOIndex = molecule.GetAtom(a)->GetFirstAOIndex();
1769- int numberAOs = molecule.GetAtom(a)->GetValenceSize();
1768+ int firstAOIndex = molecule.GetAtomVect()[a]->GetFirstAOIndex();
1769+ int numberAOs = molecule.GetAtomVect()[a]->GetValenceSize();
17701770 (*atomicUnpairedPopulationCIS)[k][a] = 0.0;
17711771 for(int i=firstAOIndex; i<firstAOIndex+numberAOs; i++){
17721772 double orbitalSquarePopulation = 0.0;
@@ -1957,12 +1957,12 @@ void ZindoS::OutputCISMulliken() const{
19571957 if(!Parameters::GetInstance()->RequiresMullikenCIS()){
19581958 return;
19591959 }
1960- int totalNumberAtoms = this->molecule->GetNumberAtoms();
1960+ int totalNumberAtoms = this->molecule->GetAtomVect().size();
19611961 this->OutputLog(this->messageMullikenAtomsTitle);
19621962 vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS();
19631963 for(int k=0; k<elecStates->size(); k++){
19641964 for(int a=0; a<totalNumberAtoms; a++){
1965- const Atom& atom = *this->molecule->GetAtom(a);
1965+ const Atom& atom = *this->molecule->GetAtomVect()[a];
19661966 this->OutputLog(boost::format("%s\t%d\t%d\t%s\t%e\t%e\n") % this->messageMullikenAtoms
19671967 % (*elecStates)[k]
19681968 % a
@@ -1981,12 +1981,12 @@ void ZindoS::OutputCISUnpairedPop() const{
19811981 if(!Parameters::GetInstance()->RequiresUnpairedPopCIS()){
19821982 return;
19831983 }
1984- int totalNumberAtoms = this->molecule->GetNumberAtoms();
1984+ int totalNumberAtoms = this->molecule->GetAtomVect().size();
19851985 this->OutputLog(this->messageUnpairedAtomsTitle);
19861986 vector<int>* elecStates = Parameters::GetInstance()->GetElectronicStateIndecesMullikenCIS();
19871987 for(int k=0; k<elecStates->size(); k++){
19881988 for(int a=0; a<totalNumberAtoms; a++){
1989- const Atom& atom = *this->molecule->GetAtom(a);
1989+ const Atom& atom = *this->molecule->GetAtomVect()[a];
19901990 this->OutputLog(boost::format("%s\t%d\t%d\t%s\t%e\n") % this->messageUnpairedAtoms
19911991 % (*elecStates)[k]
19921992 % a
@@ -2447,9 +2447,9 @@ double ZindoS::GetCISDiagElement(double const* energiesMO,
24472447 double gamma = 0.0;
24482448 double exchange = 0.0;
24492449 double coulomb = 0.0;
2450- int totalNumberAtoms = molecule.GetNumberAtoms();
2450+ int totalNumberAtoms = molecule.GetAtomVect().size();
24512451 for(int A=0; A<totalNumberAtoms; A++){
2452- const Atom& atomA = *molecule.GetAtom(A);
2452+ const Atom& atomA = *molecule.GetAtomVect()[A];
24532453 int firstAOIndexA = atomA.GetFirstAOIndex();
24542454 int lastAOIndexA = atomA.GetLastAOIndex();
24552455
@@ -2461,7 +2461,7 @@ double ZindoS::GetCISDiagElement(double const* energiesMO,
24612461
24622462 // CNDO term
24632463 for(int B=A; B<totalNumberAtoms; B++){
2464- const Atom& atomB = *molecule.GetAtom(B);
2464+ const Atom& atomB = *molecule.GetAtomVect()[B];
24652465 int firstAOIndexB = atomB.GetFirstAOIndex();
24662466 int lastAOIndexB = atomB.GetLastAOIndex();
24672467
@@ -2540,9 +2540,9 @@ double ZindoS::GetCISOffDiagElement(double const* const* const* const* nishimoto
25402540 double gamma = 0.0;
25412541 double exchange = 0.0;
25422542 double coulomb = 0.0;
2543- int totalNumberAtoms = molecule.GetNumberAtoms();
2543+ int totalNumberAtoms = molecule.GetAtomVect().size();
25442544 for(int A=0; A<totalNumberAtoms; A++){
2545- const Atom& atomA = *molecule.GetAtom(A);
2545+ const Atom& atomA = *molecule.GetAtomVect()[A];
25462546 int firstAOIndexA = atomA.GetFirstAOIndex();
25472547 int lastAOIndexA = atomA.GetLastAOIndex();
25482548
@@ -2555,7 +2555,7 @@ double ZindoS::GetCISOffDiagElement(double const* const* const* const* nishimoto
25552555
25562556 // CNDO term
25572557 for(int B=A; B<totalNumberAtoms; B++){
2558- const Atom& atomB = *molecule.GetAtom(B);
2558+ const Atom& atomB = *molecule.GetAtomVect()[B];
25592559 int firstAOIndexB = atomB.GetFirstAOIndex();
25602560 int lastAOIndexB = atomB.GetLastAOIndex();
25612561 for(int nu=firstAOIndexB; nu<=lastAOIndexB; nu++){
@@ -2636,7 +2636,7 @@ void ZindoS::CheckMatrixForce(const vector<int>& elecStates){
26362636 if(this->matrixForce == NULL){
26372637 MallocerFreer::GetInstance()->Malloc<double>(&this->matrixForce,
26382638 elecStates.size(),
2639- this->molecule->GetNumberAtoms(),
2639+ this->molecule->GetAtomVect().size(),
26402640 CartesianType_end);
26412641 this->matrixForceElecStatesNum = elecStates.size();
26422642 }
@@ -2644,7 +2644,7 @@ void ZindoS::CheckMatrixForce(const vector<int>& elecStates){
26442644 MallocerFreer::GetInstance()->
26452645 Initialize<double>(this->matrixForce,
26462646 elecStates.size(),
2647- this->molecule->GetNumberAtoms(),
2647+ this->molecule->GetAtomVect().size(),
26482648 CartesianType_end);
26492649 }
26502650 }
@@ -3121,13 +3121,13 @@ double ZindoS::GetSmallQElement(int moI,
31213121 int numberOcc = this->molecule->GetTotalNumberValenceElectrons()/2;
31223122 bool isMoPOcc = moP<numberOcc ? true : false;
31233123
3124- for(int A=0; A<molecule->GetNumberAtoms(); A++){
3125- const Atom& atomA = *molecule->GetAtom(A);
3124+ for(int A=0; A<molecule->GetAtomVect().size(); A++){
3125+ const Atom& atomA = *molecule->GetAtomVect()[A];
31263126 int firstAOIndexA = atomA.GetFirstAOIndex();
31273127 int lastAOIndexA = atomA.GetLastAOIndex();
31283128
3129- for(int B=A; B<molecule->GetNumberAtoms(); B++){
3130- const Atom& atomB = *molecule->GetAtom(B);
3129+ for(int B=A; B<molecule->GetAtomVect().size(); B++){
3130+ const Atom& atomB = *molecule->GetAtomVect()[B];
31313131 int firstAOIndexB = atomB.GetFirstAOIndex();
31323132 int lastAOIndexB = atomB.GetLastAOIndex();
31333133
@@ -3518,8 +3518,8 @@ double ZindoS::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) cons
35183518
35193519 // Fast algorith, but this is not easy to read.
35203520 // Slow algorithm is alos written below.
3521- for(int A=0; A<this->molecule->GetNumberAtoms(); A++){
3522- const Atom& atomA = *this->molecule->GetAtom(A);
3521+ for(int A=0; A<this->molecule->GetAtomVect().size(); A++){
3522+ const Atom& atomA = *this->molecule->GetAtomVect()[A];
35233523 int firstAOIndexA = atomA.GetFirstAOIndex();
35243524 int lastAOIndexA = atomA.GetLastAOIndex();
35253525
@@ -3566,8 +3566,8 @@ double ZindoS::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) cons
35663566 }
35673567
35683568 // (A==B || A!=B) && (mu==nu && lambda==sigma for (mu nu|lamba sigma))
3569- for(int B=A; B<this->molecule->GetNumberAtoms(); B++){
3570- const Atom& atomB = *this->molecule->GetAtom(B);
3569+ for(int B=A; B<this->molecule->GetAtomVect().size(); B++){
3570+ const Atom& atomB = *this->molecule->GetAtomVect()[B];
35713571 int firstAOIndexB = atomB.GetFirstAOIndex();
35723572 int lastAOIndexB = atomB.GetLastAOIndex();
35733573
@@ -3624,10 +3624,10 @@ double ZindoS::GetAuxiliaryKNRKRElement(int moI, int moJ, int moK, int moL) cons
36243624 void ZindoS::CalcDiatomicTwoElecsTwoCores1stDerivatives(double*** matrix,
36253625 int indexAtomA,
36263626 int indexAtomB) const{
3627- const Atom& atomA = *molecule->GetAtom(indexAtomA);
3627+ const Atom& atomA = *molecule->GetAtomVect()[indexAtomA];
36283628 const int firstAOIndexA = atomA.GetFirstAOIndex();
36293629 const int lastAOIndexA = atomA.GetLastAOIndex();
3630- const Atom& atomB = *molecule->GetAtom(indexAtomB);
3630+ const Atom& atomB = *molecule->GetAtomVect()[indexAtomB];
36313631 const int firstAOIndexB = atomB.GetFirstAOIndex();
36323632 const int lastAOIndexB = atomB.GetLastAOIndex();
36333633 const double rAB = this->molecule->GetDistanceAtoms(atomA, atomB);
@@ -3657,9 +3657,9 @@ void ZindoS::CalcForce(const vector<int>& elecStates){
36573657 }
36583658
36593659 // this loop is MPI-parallelized
3660- for(int a=0; a<this->molecule->GetNumberAtoms(); a++){
3660+ for(int a=0; a<this->molecule->GetAtomVect().size(); a++){
36613661 if(a%mpiSize != mpiRank){continue;}
3662- const Atom& atomA = *molecule->GetAtom(a);
3662+ const Atom& atomA = *molecule->GetAtomVect()[a];
36633663 int firstAOIndexA = atomA.GetFirstAOIndex();
36643664 int lastAOIndexA = atomA.GetLastAOIndex();
36653665 stringstream ompErrors;
@@ -3689,9 +3689,9 @@ void ZindoS::CalcForce(const vector<int>& elecStates){
36893689 &tmpMatrixBC,
36903690 &tmpVectorBC);
36913691 #pragma omp for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
3692- for(int b=0; b<this->molecule->GetNumberAtoms(); b++){
3692+ for(int b=0; b<this->molecule->GetAtomVect().size(); b++){
36933693 if(a == b){continue;}
3694- const Atom& atomB = *molecule->GetAtom(b);
3694+ const Atom& atomB = *molecule->GetAtomVect()[b];
36953695 int firstAOIndexB = atomB.GetFirstAOIndex();
36963696 int lastAOIndexB = atomB.GetLastAOIndex();
36973697 double rAB = this->molecule->GetDistanceAtoms(atomA, atomB);
@@ -3839,7 +3839,7 @@ void ZindoS::CalcForce(const vector<int>& elecStates){
38393839 } // end of for(int a) with MPI parallelization
38403840
38413841 // communication to reduce thsi->matrixForce on all node (namely, all_reduce)
3842- int numTransported = elecStates.size()*this->molecule->GetNumberAtoms()*CartesianType_end;
3842+ int numTransported = elecStates.size()*this->molecule->GetAtomVect().size()*CartesianType_end;
38433843 MolDS_mpi::MpiProcess::GetInstance()->AllReduce(&this->matrixForce[0][0][0], numTransported, std::plus<double>());
38443844
38453845 /*
@@ -3848,9 +3848,9 @@ void ZindoS::CalcForce(const vector<int>& elecStates){
38483848 // calculated with GTO expansion technique.
38493849 stringstream ompErrors;
38503850 #pragma omp parallel for schedule(dynamic, MOLDS_OMP_DYNAMIC_CHUNK_SIZE)
3851- for(int a=0; a<this->molecule->GetNumberAtoms(); a++){
3851+ for(int a=0; a<this->molecule->GetAtomVect().size(); a++){
38523852 try{
3853- const Atom& atomA = *molecule->GetAtom(a);
3853+ const Atom& atomA = *molecule->GetAtomVect()[a];
38543854 int firstAOIndexA = atomA.GetFirstAOIndex();
38553855 int lastAOIndexA = atomA.GetLastAOIndex();
38563856 for(int i=0; i<CartesianType_end; i++){
@@ -3859,9 +3859,9 @@ void ZindoS::CalcForce(const vector<int>& elecStates){
38593859 double forceElecCoreAttPart = 0.0;
38603860 double forceOverlapAOsPart = 0.0;
38613861 double forceTwoElecPart = 0.0;
3862- for(int b=0; b<this->molecule->GetNumberAtoms(); b++){
3862+ for(int b=0; b<this->molecule->GetAtomVect().size(); b++){
38633863 if(a != b){
3864- const Atom& atomB = *molecule->GetAtom(b);
3864+ const Atom& atomB = *molecule->GetAtomVect()[b];
38653865 int firstAOIndexB = atomB.GetFirstAOIndex();
38663866 int lastAOIndexB = atomB.GetLastAOIndex();
38673867
@@ -3978,8 +3978,8 @@ void ZindoS::CalcForceExcitedStaticPart(double* force,
39783978 int indexAtomA,
39793979 int indexAtomB,
39803980 double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
3981- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
3982- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
3981+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
3982+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
39833983 int firstAOIndexA = atomA.GetFirstAOIndex();
39843984 int firstAOIndexB = atomB.GetFirstAOIndex();
39853985 int lastAOIndexA = atomA.GetLastAOIndex();
@@ -4005,8 +4005,8 @@ void ZindoS::CalcForceExcitedElecCoreAttractionPart(double* force,
40054005 int indexAtomA,
40064006 int indexAtomB,
40074007 double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
4008- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
4009- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
4008+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
4009+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
40104010 int firstAOIndexA = atomA.GetFirstAOIndex();
40114011 int lastAOIndexA = atomA.GetLastAOIndex();
40124012 for(int mu=firstAOIndexA; mu<=lastAOIndexA; mu++){
@@ -4023,8 +4023,8 @@ void ZindoS::CalcForceExcitedOverlapAOsPart(double* force,
40234023 int indexAtomA,
40244024 int indexAtomB,
40254025 double const* const* const* diatomicOverlapAOs1stDerivs) const{
4026- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
4027- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
4026+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
4027+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
40284028 int firstAOIndexA = atomA.GetFirstAOIndex();
40294029 int firstAOIndexB = atomB.GetFirstAOIndex();
40304030 int lastAOIndexA = atomA.GetLastAOIndex();
@@ -4053,8 +4053,8 @@ void ZindoS::CalcForceExcitedTwoElecPart(double* force,
40534053 int indexAtomA,
40544054 int indexAtomB,
40554055 double const* const* const* diatomicTwoElecsTwoCores1stDerivs) const{
4056- const Atom& atomA = *this->molecule->GetAtom(indexAtomA);
4057- const Atom& atomB = *this->molecule->GetAtom(indexAtomB);
4056+ const Atom& atomA = *this->molecule->GetAtomVect()[indexAtomA];
4057+ const Atom& atomB = *this->molecule->GetAtomVect()[indexAtomB];
40584058 int firstAOIndexA = atomA.GetFirstAOIndex();
40594059 int firstAOIndexB = atomB.GetFirstAOIndex();
40604060 int lastAOIndexA = atomA.GetLastAOIndex();