- Timestamp:
- Jun 24, 2010, 10:33:22 AM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 04488a
- Parents:
- 9f3b85 (diff), da3024 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Actions/Process.cpp
r9f3b85 rce4487 13 13 14 14 Process::Process(int _maxSteps, std::string _name, bool _doRegister) : 15 Action(_name,_doRegister), 15 16 Observable("Process"), 16 Action(_name,_doRegister),17 17 maxSteps(_maxSteps), 18 18 active(false), -
src/Actions/WorldAction/RepeatBoxAction.cpp
r9f3b85 rce4487 80 80 for (n[2] = 0; n[2] < Repeater[2]; n[2]++) { 81 81 y[2] = n[2]; 82 if ( n[0] == n[1] == n[2] == 0)82 if ((n[0] == 0) && (n[1] == 0) && (n[2] == 0)) 83 83 continue; 84 84 for (vector<molecule *>::iterator MolRunner = AllMolecules.begin(); MolRunner != AllMolecules.end(); ++MolRunner) { -
src/Hbondangle.db
r9f3b85 rce4487 1 # atomicnumber angles for single, double and triple bond (-1 no angle) 1 2 1 180 -1 -1 2 3 5 180 131.0 109.2 -
src/Hbonddistance.db
r9f3b85 rce4487 1 #atomic number bond distances for single, double and triple bond (-1 no bond) 1 2 1 0.74 -1 -1 2 3 2 0.77429209 -1 -1 -
src/Patterns/ObservedIterator.hpp
r9f3b85 rce4487 84 84 { 85 85 --iter; 86 return *this; 86 87 } 87 88 -
src/atom.cpp
r9f3b85 rce4487 315 315 } 316 316 317 atomId_t atom::getId() {317 atomId_t atom::getId() const { 318 318 return id; 319 319 } -
src/atom.hpp
r9f3b85 rce4487 79 79 void setWorld(World*); 80 80 81 virtual atomId_t getId() ;81 virtual atomId_t getId() const; 82 82 virtual bool changeId(atomId_t newId); 83 83 -
src/builder.cpp
r9f3b85 rce4487 1361 1361 }; 1362 1362 1363 #endif1364 1363 1365 1364 /** Tries given filename or standard on saving the config file. … … 1487 1486 }; 1488 1487 1488 #endif 1489 1489 1490 /** Parses the command line options. 1490 1491 * Note that this function is from now on transitional. All commands that are not passed … … 1504 1505 { 1505 1506 Vector x,y,z,n; // coordinates for absolute point in cell volume 1506 double *factor; // unit factor if desired1507 1507 ifstream test; 1508 1508 ofstream output; 1509 1509 string line; 1510 atom *first;1511 1510 bool SaveFlag = false; 1512 1511 int ExitFlag = 0; … … 1514 1513 double volume = 0.; 1515 1514 enum ConfigStatus configPresent = absent; 1516 clock_t start,end;1517 double MaxDistance = -1;1518 1515 int argptr; 1519 1516 molecule *mol = NULL; 1520 1517 string BondGraphFileName("\n"); 1521 bool DatabasePathGiven = false;1522 1518 1523 1519 if (argc > 1) { // config file specified as option … … 2204 2200 int main(int argc, char **argv) 2205 2201 { 2206 config *configuration = World::getInstance().getConfig();2207 2202 // while we are non interactive, we want to abort from asserts 2208 2203 //ASSERT_DO(Assert::Abort); 2209 molecule *mol = NULL;2210 2204 Vector x, y, z, n; 2211 2205 ifstream test; -
src/config.cpp
r9f3b85 rce4487 1784 1784 char filename[MAXSTRINGSIZE]; 1785 1785 ofstream output; 1786 molecule *mol = World::getInstance().createMolecule(); 1787 mol->SetNameFromFilename(ConfigFileName); 1786 molecule *mol = NULL; 1788 1787 1789 1788 if (!strcmp(configpath, GetDefaultPath())) { … … 1816 1815 // translate each to its center and merge all molecules in MoleculeListClass into this molecule 1817 1816 int N = molecules->ListOfMolecules.size(); 1818 int *src = new int[N]; 1819 N=0; 1820 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1821 src[N++] = (*ListRunner)->IndexNr; 1822 (*ListRunner)->Translate(&(*ListRunner)->Center); 1823 } 1824 molecules->SimpleMultiAdd(mol, src, N); 1825 delete[](src); 1826 1827 // ... and translate back 1828 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1829 (*ListRunner)->Center.Scale(-1.); 1830 (*ListRunner)->Translate(&(*ListRunner)->Center); 1831 (*ListRunner)->Center.Scale(-1.); 1817 if (N != 1) { // don't do anything in case of only one molecule (shifts mol ids otherwise) 1818 int *src = new int[N]; 1819 N=0; 1820 for (MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) { 1821 src[N++] = (*ListRunner)->IndexNr; 1822 (*ListRunner)->Translate(&(*ListRunner)->Center); 1823 } 1824 mol = World::getInstance().createMolecule(); 1825 mol->SetNameFromFilename(ConfigFileName); 1826 molecules->SimpleMultiMerge(mol, src, N); 1827 mol->doCountAtoms(); 1828 mol->CountElements(); 1829 mol->CalculateOrbitals(*this); 1830 delete[](src); 1831 } else { 1832 if (!molecules->ListOfMolecules.empty()) { 1833 mol = *(molecules->ListOfMolecules.begin()); 1834 mol->doCountAtoms(); 1835 mol->CalculateOrbitals(*this); 1836 } else { 1837 DoeLog(1) && (eLog() << Verbose(1) << "There are no molecules to save!" << endl); 1838 } 1832 1839 } 1833 1840 1834 1841 Log() << Verbose(0) << "Storing configuration ... " << endl; 1835 1842 // get correct valence orbitals 1836 mol->CalculateOrbitals(*this);1837 InitMaxMinStopStep = MaxMinStopStep = MaxPsiDouble;1838 1843 if (ConfigFileName != NULL) { // test the file name 1839 1844 strcpy(filename, ConfigFileName); … … 1895 1900 } 1896 1901 1897 World::getInstance().destroyMolecule(mol); 1902 // don't destroy molecule as it contains all our atoms 1903 //World::getInstance().destroyMolecule(mol); 1898 1904 }; 1899 1905 -
src/molecule.cpp
r9f3b85 rce4487 42 42 NoCyclicBonds(0), BondDistance(0.), ActiveFlag(false), IndexNr(-1), 43 43 formula(this,boost::bind(&molecule::calcFormula,this),"formula"), 44 AtomCount(this,boost::bind(&molecule::doCountAtoms,this),"AtomCount"), last_atom(0), InternalPointer( begin())44 AtomCount(this,boost::bind(&molecule::doCountAtoms,this),"AtomCount"), last_atom(0), InternalPointer(atoms.begin()) 45 45 { 46 46 … … 146 146 iter--; 147 147 atom* atom = *loc; 148 atoms.erase( loc ); 148 atomIds.erase( atom->getId() ); 149 atoms.remove( atom ); 149 150 atom->removeFromMolecule(); 150 151 return iter; … … 156 157 molecule::const_iterator iter = find(key); 157 158 if (iter != end()){ 158 atoms.erase( iter++ ); 159 atomIds.erase( key->getId() ); 160 atoms.remove( key ); 159 161 key->removeFromMolecule(); 160 162 } … … 164 166 molecule::const_iterator molecule::find ( atom * key ) const 165 167 { 166 return atoms.find( key ); 168 molecule::const_iterator iter; 169 for (molecule::const_iterator Runner = begin(); Runner != end(); ++Runner) { 170 if (*Runner == key) 171 return molecule::const_iterator(Runner); 172 } 173 return molecule::const_iterator(atoms.end()); 167 174 } 168 175 169 176 pair<molecule::iterator,bool> molecule::insert ( atom * const key ) 170 177 { 171 pair<atomSet::iterator,bool> res = atoms.insert(key); 172 return pair<iterator,bool>(iterator(res.first,this),res.second); 178 pair<atomIdSet::iterator,bool> res = atomIds.insert(key->getId()); 179 if (res.second) { // push atom if went well 180 atoms.push_back(key); 181 return pair<iterator,bool>(molecule::iterator(--end()),res.second); 182 } else { 183 return pair<iterator,bool>(molecule::iterator(end()),res.second); 184 } 173 185 } 174 186 175 187 bool molecule::containsAtom(atom* key){ 176 return atoms.count(key);188 return (find(key) != end()); 177 189 } 178 190 … … 790 802 for (molecule::iterator iter = begin(); !empty(); iter = begin()) 791 803 erase(iter); 804 return empty(); 792 805 }; 793 806 … … 1010 1023 configuration.MaxPsiDouble /= 2; 1011 1024 configuration.PsiType = (configuration.PsiMaxNoDown == configuration.PsiMaxNoUp) ? 0 : 1; 1012 if ((configuration.PsiType == 1) && (configuration.ProcPEPsi < 2) ) {1025 if ((configuration.PsiType == 1) && (configuration.ProcPEPsi < 2) && ((configuration.PsiMaxNoDown != 1) || (configuration.PsiMaxNoUp != 0))) { 1013 1026 configuration.ProcPEGamma /= 2; 1014 1027 configuration.ProcPEPsi *= 2; … … 1017 1030 configuration.ProcPEPsi = 1; 1018 1031 } 1019 configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.MaxPsiDouble; 1032 cout << configuration.PsiMaxNoDown << ">" << configuration.PsiMaxNoUp << endl; 1033 if (configuration.PsiMaxNoDown > configuration.PsiMaxNoUp) { 1034 configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoDown; 1035 cout << configuration.PsiMaxNoDown << " " << configuration.InitMaxMinStopStep << endl; 1036 } else { 1037 configuration.InitMaxMinStopStep = configuration.MaxMinStopStep = configuration.PsiMaxNoUp; 1038 cout << configuration.PsiMaxNoUp << " " << configuration.InitMaxMinStopStep << endl; 1039 } 1020 1040 }; 1021 1041 -
src/molecule.hpp
r9f3b85 rce4487 93 93 94 94 public: 95 typedef std::set<atom*> atomSet; 95 typedef std::list<atom*> atomSet; 96 typedef std::set<atomId_t> atomIdSet; 96 97 typedef ObservedIterator<atomSet> iterator; 97 98 typedef atomSet::const_iterator const_iterator; … … 121 122 Cacheable<int> AtomCount; 122 123 moleculeId_t id; 123 atomSet atoms; //<!set of atoms 124 atomSet atoms; //<!list of atoms 125 atomIdSet atomIds; //<!set of atomic ids to check uniqueness of atoms 124 126 protected: 125 127 //void CountAtoms(); -
src/molecule_pointcloud.cpp
r9f3b85 rce4487 57 57 void molecule::GoToFirst() const 58 58 { 59 InternalPointer = atoms.begin(); 59 // evil hack necessary because 60 // -# although InternalPointer is mutable 61 // -# only const_iterator begin() is called due to const in the function declaration above 62 // -# and there is no cast from const_iterator to const iterator 63 atomSet::const_iterator test = begin(); 64 InternalPointer = *(reinterpret_cast<atomSet::iterator *>(&test)); 60 65 }; 61 66 -
src/moleculelist.cpp
r9f3b85 rce4487 212 212 213 213 // put all molecules of src into mol 214 molecule::iterator runner; 215 for (molecule::iterator iter = srcmol->begin(); iter != srcmol->end(); ++iter) { 216 runner = iter++; 217 srcmol->UnlinkAtom((*runner)); 218 mol->AddAtom((*runner)); 214 for (molecule::iterator iter = srcmol->begin(); !srcmol->empty(); iter=srcmol->begin()) { 215 atom * const Walker = *iter; 216 srcmol->UnlinkAtom(Walker); 217 mol->AddAtom(Walker); 219 218 } 220 219 … … 259 258 status = status && SimpleMerge(mol, srcmol); 260 259 } 260 insert(mol); 261 261 return status; 262 262 }; -
src/orbitals.db
r9f3b85 rce4487 1 # atomicnumber numberoforbitals 1 2 1 1 2 3 2 0 -
src/periodentafel.cpp
r9f3b85 rce4487 373 373 (*input) >> elements[Z]->Valence; 374 374 (*input) >> ws; 375 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->Valence << " valence electrons." << endl;375 //Log() << Verbose(3) << "Element " << Z << " has " << FindElement(Z)->Valence << " valence electrons." << endl; 376 376 } 377 377 return true; … … 396 396 (*input) >> elements[Z]->NoValenceOrbitals; 397 397 (*input) >> ws; 398 //Log() << Verbose(3) << "Element " << (int)tmp << " has " << FindElement((int)tmp)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl;398 //Log() << Verbose(3) << "Element " << Z << " has " << FindElement(Z)->NoValenceOrbitals << " number of singly occupied valence orbitals." << endl; 399 399 } 400 400 return true; -
src/valence.db
r9f3b85 rce4487 1 #atomicnumber numberofvalenceorbitals 1 2 1 0.10000000000000E+01 2 3 2 0.20000000000000E+01
Note:
See TracChangeset
for help on using the changeset viewer.