Changeset f01769 for src/moleculelist.cpp
- Timestamp:
- Jul 24, 2015, 4:44:34 PM (10 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, Candidate_v1.7.0, 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:
- a58c16
- Parents:
- 1259df
- git-author:
- Frederik Heber <heber@…> (06/01/15 16:57:36)
- git-committer:
- Frederik Heber <heber@…> (07/24/15 16:44:34)
- File:
-
- 1 edited
-
src/moleculelist.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/moleculelist.cpp
r1259df rf01769 129 129 //LOG(0, "Comparing fragment no. " << *(molecule **)a << " to " << *(molecule **)b << "."); 130 130 // Yes those types are awkward... but check it for yourself it checks out this way 131 molecule *const *mol1_ptr= static_cast<molecule *const *>(a);132 molecule *mol1 = *mol1_ptr;133 molecule *const *mol2_ptr= static_cast<molecule *const *>(b);134 molecule *mol2 = *mol2_ptr;131 const molecule *const *mol1_ptr= static_cast<molecule *const *>(a); 132 const molecule *mol1 = *mol1_ptr; 133 const molecule *const *mol2_ptr= static_cast<molecule *const *>(b); 134 const molecule *mol2 = *mol2_ptr; 135 135 if (mol1->getAtomCount() < mol2->getAtomCount()) { 136 136 return -1; … … 212 212 else { 213 213 Origin.Zero(); 214 for (MoleculeList:: iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {214 for (MoleculeList::const_iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 215 215 // count atoms per element and determine size of bounding sphere 216 216 size=0.; 217 for (molecule::const_iterator iter = (*ListRunner)->begin(); iter != (*ListRunner)->end(); ++iter) { 217 const molecule *MolRunner = *ListRunner; 218 for (molecule::const_iterator iter = MolRunner->begin(); iter != MolRunner->end(); ++iter) { 218 219 counts[(*iter)->getType()->getAtomicNumber()]++; 219 220 if ((*iter)->DistanceSquared(Origin) > size) … … 221 222 } 222 223 // output Index, Name, number of atoms, chemical formula 223 (*out) << ( (*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->getAtomCount() << "\t";224 (*out) << (MolRunner->ActiveFlag ? "*" : " ") << MolRunner->IndexNr << "\t" << MolRunner->name << "\t\t" << MolRunner->getAtomCount() << "\t"; 224 225 225 226 std::map<atomicNumber_t,unsigned int>::reverse_iterator iter; … … 229 230 } 230 231 // Center and size 231 Vector Center = (*ListRunner)->DetermineCenterOfAll();232 Vector Center = MolRunner->DetermineCenterOfAll(); 232 233 (*out) << "\t" << Center << "\t" << sqrt(size) << endl; 233 234 } … … 407 408 correction[k][j] = 0.; 408 409 // 2. take every hydrogen that is a saturated one 409 for (molecule::const_iterator iter = (*ListRunner)->begin(); iter != (*ListRunner)->end(); ++iter) { 410 const molecule *MolRunner = *ListRunner; 411 for (molecule::const_iterator iter = MolRunner->begin(); iter != MolRunner->end(); ++iter) { 410 412 //LOG(1, "(*iter): " << *(*iter) << " with first bond " << *((*iter)->getListOfBonds().begin()) << "."); 411 413 if (((*iter)->getType()->getAtomicNumber() == 1) && (((*iter)->getFather() == NULL) 412 414 || ((*iter)->getFather()->getType()->getAtomicNumber() != 1))) { // if it's a hydrogen 413 for (molecule::const_iterator runner = (*ListRunner)->begin(); runner != (*ListRunner)->end(); ++runner) {415 for (molecule::const_iterator runner = MolRunner->begin(); runner != MolRunner->end(); ++runner) { 414 416 //LOG(2, "Runner: " << *(*runner) << " with first bond " << *((*iter)->getListOfBonds().begin()) << "."); 415 417 // 3. take every other hydrogen that is the not the first and not bound to same bonding partner … … 420 422 distance = (*runner)->distance(*(*iter)); 421 423 //std::stringstream output; 422 //output << "Fragment " << (*ListRunner)->name << ": " << *(*runner) << "<= " << distance << "=>" << *(*iter) << ":";424 //output << "Fragment " << MolRunner->name << ": " << *(*runner) << "<= " << distance << "=>" << *(*iter) << ":"; 423 425 for (int k = 0; k < a; k++) { 424 426 for (int j = 0; j < b; j++) { … … 447 449 line.append("/"); 448 450 line += FRAGMENTPREFIX; 449 FragmentNumber = FixedDigitNumber(ListOfMolecules.size(), (*ListRunner)->IndexNr);451 FragmentNumber = FixedDigitNumber(ListOfMolecules.size(), MolRunner->IndexNr); 450 452 line += FragmentNumber; 451 453 delete[] (FragmentNumber); … … 506 508 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 507 509 periodentafel::const_iterator elemIter; 510 const molecule *MolRunner = *ListRunner; 508 511 for(elemIter=periode->begin();elemIter!=periode->end();++elemIter){ 509 if ( (*ListRunner)->hasElement((*elemIter).first)) { // if this element got atoms510 for(molecule:: iterator atomIter = (*ListRunner)->begin(); atomIter !=(*ListRunner)->end();++atomIter){512 if (MolRunner->hasElement((*elemIter).first)) { // if this element got atoms 513 for(molecule::const_iterator atomIter = MolRunner->begin(); atomIter !=MolRunner->end();++atomIter){ 511 514 if ((*atomIter)->getType()->getAtomicNumber() == (*elemIter).first) { 512 515 if (((*atomIter)->GetTrueFather() != NULL) && ((*atomIter)->GetTrueFather() != (*atomIter))) {// if there is a rea … … 557 560 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 558 561 // correct periodic 562 const molecule *MolRunner = *ListRunner; 559 563 if ((*ListRunner)->ScanForPeriodicCorrection()) { 560 564 count++; … … 565 569 std::stringstream output; 566 570 output << "Contained atoms: "; 567 for (molecule::const_iterator iter = (*ListRunner)->begin(); iter != (*ListRunner)->end(); ++iter) {571 for (molecule::const_iterator iter = MolRunner->begin(); iter != MolRunner->end(); ++iter) { 568 572 output << (*iter)->getName() << " "; 569 573 } … … 573 577 { 574 578 // // center on edge 575 // (*ListRunner)->CenterEdge(&BoxDimension);579 // MolRunner->CenterEdge(&BoxDimension); 576 580 // for (int k = 0; k < NDIM; k++) // if one edge is to small, set at least to 1 angstroem 577 581 // if (BoxDimension[k] < 1.) … … 588 592 // } 589 593 // World::getInstance().setDomain(cell_size); 590 // (*ListRunner)->Translate(&BoxDimension);594 // MolRunner->Translate(&BoxDimension); 591 595 592 596 // output file
Note:
See TracChangeset
for help on using the changeset viewer.
