Changes in src/molecule.cpp [906822:35b698]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule.cpp
r906822 r35b698 79 79 void molecule::setName(const std::string _name){ 80 80 OBSERVE; 81 cout << "Set name of molecule " << getId() << " to " << _name << endl; 81 82 strncpy(name,_name.c_str(),MAXSTRINGSIZE); 82 83 } … … 154 155 molecule::const_iterator molecule::erase( atom * key ) 155 156 { 157 cout << "trying to erase atom" << endl; 156 158 molecule::const_iterator iter = find(key); 157 159 if (iter != end()){ … … 739 741 else 740 742 length = strlen(molname) - strlen(endname); 743 cout << "Set name of molecule " << getId() << " to " << molname << endl; 741 744 strncpy(name, molname, length); 742 745 name[length]='\0'; … … 880 883 ElementNo[i] = current++; 881 884 } 882 ActOnAllAtoms( &atom::OutputArrayIndexed, output, (const int *)ElementNo, (int *)AtomNo, (const char *) NULL );885 ActOnAllAtoms( &atom::OutputArrayIndexed, (ostream * const) output, (const int *)ElementNo, (int *)AtomNo, (const char *) NULL ); 883 886 return true; 884 887 } … … 1003 1006 for(int i=MAX_ELEMENTS;i--;) 1004 1007 ElementCount += (ElementsInMolecule[i] != 0 ? 1 : 0); 1005 };1006 1007 1008 /** Counts necessary number of valence electrons and returns number and SpinType.1009 * \param configuration containing everything1010 */1011 void molecule::CalculateOrbitals(class config &configuration)1012 {1013 configuration.MaxPsiDouble = configuration.PsiMaxNoDown = configuration.PsiMaxNoUp = configuration.PsiType = 0;1014 for(int i=MAX_ELEMENTS;i--;) {1015 if (ElementsInMolecule[i] != 0) {1016 //Log() << Verbose(0) << "CalculateOrbitals: " << elemente->FindElement(i)->name << " has a valence of " << (int)elemente->FindElement(i)->Valence << " and there are " << ElementsInMolecule[i] << " of it." << endl;1017 configuration.MaxPsiDouble += ElementsInMolecule[i]*((int)elemente->FindElement(i)->Valence);1018 }1019 }1020 configuration.PsiMaxNoDown = configuration.MaxPsiDouble/2 + (configuration.MaxPsiDouble % 2);1021 configuration.PsiMaxNoUp = configuration.MaxPsiDouble/2;1022 configuration.MaxPsiDouble /= 2;1023 configuration.PsiType = (configuration.PsiMaxNoDown == configuration.PsiMaxNoUp) ? 0 : 1;1024 if ((configuration.PsiType == 1) && (configuration.ProcPEPsi < 2) && ((configuration.PsiMaxNoDown != 1) || (configuration.PsiMaxNoUp != 0))) {1025 configuration.ProcPEGamma /= 2;1026 configuration.ProcPEPsi *= 2;1027 } else {1028 configuration.ProcPEGamma *= configuration.ProcPEPsi;1029 configuration.ProcPEPsi = 1;1030 }1031 cout << configuration.PsiMaxNoDown << ">" << configuration.PsiMaxNoUp << endl;1032 if (configuration.PsiMaxNoDown > configuration.PsiMaxNoUp) {1033 configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoDown;1034 cout << configuration.PsiMaxNoDown << " " << configuration.InitMaxMinStopStep << endl;1035 } else {1036 configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoUp;1037 cout << configuration.PsiMaxNoUp << " " << configuration.InitMaxMinStopStep << endl;1038 }1039 1008 }; 1040 1009
Note:
See TracChangeset
for help on using the changeset viewer.