Changeset 47d041 for src/molecule_graph.cpp
- Timestamp:
- Nov 3, 2011, 7:44:01 PM (14 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:
- 41a467
- Parents:
- 50e4e5
- git-author:
- Frederik Heber <heber@…> (10/27/11 11:53:58)
- git-committer:
- Frederik Heber <heber@…> (11/03/11 19:44:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/molecule_graph.cpp
r50e4e5 r47d041 57 57 int AtomNo; 58 58 59 DoLog(1) && (Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl);59 LOG(1, "Begin of FillBondStructureFromReference."); 60 60 // fill ListOfLocalAtoms if NULL was given 61 61 if (!FillListOfLocalAtoms(ListOfLocalAtoms, reference->getAtomCount())) { 62 DoLog(1) && (Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl);62 LOG(1, "Filling of ListOfLocalAtoms failed."); 63 63 return false; 64 64 } 65 65 66 66 if (status) { 67 DoLog(1) && (Log() << Verbose(1) << "Creating adjacency list for molecule " << getName() << "." << endl);67 LOG(1, "Creating adjacency list for molecule " << getName() << "."); 68 68 // remove every bond from the list 69 69 for_each(begin(), end(), … … 83 83 AddBond((*iter), OtherWalker, (*Runner)->BondDegree); 84 84 } else { 85 DoLog(1) && (Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!" << endl);85 LOG(1, "OtherWalker = ListOfLocalAtoms[" << (*Runner)->GetOtherAtom((*iter)->GetTrueFather())->getNr() << "] is NULL!"); 86 86 status = false; 87 87 } … … 94 94 delete[](ListOfLocalAtoms); 95 95 } 96 DoLog(1) && (Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl);96 LOG(1, "End of FillBondStructureFromReference."); 97 97 return status; 98 98 }; … … 117 117 void molecule::OutputBondsList() const 118 118 { 119 DoLog(1) && (Log() << Verbose(1) << endl << "From contents of bond chain list:"); 120 for(molecule::const_iterator AtomRunner = molecule::begin(); AtomRunner != molecule::end(); ++AtomRunner) { 121 const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds(); 122 for(BondList::const_iterator BondRunner = ListOfBonds.begin(); 123 BondRunner != ListOfBonds.end(); 124 ++BondRunner) 125 if ((*BondRunner)->leftatom == *AtomRunner) { 126 DoLog(0) && (Log() << Verbose(0) << *(*BondRunner) << "\t" << endl); 127 } 128 } 129 DoLog(0) && (Log() << Verbose(0) << endl); 130 } 131 ; 119 if (DoLog(1)) { 120 std::stringstream output; 121 output << std::endl << "From contents of bond chain list:"; 122 for(molecule::const_iterator AtomRunner = molecule::begin(); AtomRunner != molecule::end(); ++AtomRunner) { 123 const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds(); 124 for(BondList::const_iterator BondRunner = ListOfBonds.begin(); 125 BondRunner != ListOfBonds.end(); 126 ++BondRunner) 127 if ((*BondRunner)->leftatom == *AtomRunner) { 128 output << *(*BondRunner) << "\t"; 129 } 130 } 131 LOG(1, output.str()); 132 } 133 } 132 134 133 135 … … 149 151 line = filename; 150 152 AdjacencyFile.open(line.c_str(), ios::out); 151 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... " << endl);153 LOG(1, "Saving adjacency list ... "); 152 154 if (AdjacencyFile.good()) { 153 155 AdjacencyFile << "m\tn" << endl; 154 156 for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputAdjacency),&AdjacencyFile)); 155 157 AdjacencyFile.close(); 156 DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl);158 LOG(1, "\t... done."); 157 159 } else { 158 DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line << "." << endl);160 LOG(1, "\t... failed to open file " << line << "."); 159 161 status = false; 160 162 } … … 181 183 line = filename; 182 184 BondFile.open(line.c_str(), ios::out); 183 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... " << endl);185 LOG(1, "Saving adjacency list ... "); 184 186 if (BondFile.good()) { 185 187 BondFile << "m\tn" << endl; 186 188 for_each(atoms.begin(),atoms.end(),bind2nd(mem_fun(&atom::OutputBonds),&BondFile)); 187 189 BondFile.close(); 188 DoLog(1) && (Log() << Verbose(1) << "\t... done." << endl);190 LOG(1, "\t... done."); 189 191 } else { 190 DoLog(1) && (Log() << Verbose(1) << "\t... failed to open file " << line << "." << endl);192 LOG(1, "\t... failed to open file " << line << "."); 191 193 status = false; 192 194 } … … 242 244 243 245 if (LookupTable != NULL) { 244 Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl;246 ELOG(1, "Pointer for Lookup table is not NULL! Aborting ..."); 245 247 return false; 246 248 } … … 253 255 } 254 256 if (count <= 0) { 255 Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl;257 ELOG(1, "Count of lookup list is 0 or less."); 256 258 return false; 257 259 } … … 260 262 LookupTable = new atom *[count]; 261 263 if (LookupTable == NULL) { 262 eLog() << Verbose(0) << "LookupTable memory allocation failed!" << endl;264 ELOG(0, "LookupTable memory allocation failed!"); 263 265 performCriticalExit(); 264 266 status = false; … … 272 274 LookupTable[AtomNo] = (*iter); 273 275 } else { 274 Log() << Verbose(0) << "Walker " << *(*iter) << " exceeded range of nuclear ids [0, " << count << ")." << endl;276 ELOG(1, "Walker " << *(*iter) << " exceeded range of nuclear ids [0, " << count << ")."); 275 277 status = false; 276 278 break; … … 306 308 BondGraph *BG = World::getInstance().getBondGraph(); 307 309 308 DoLog(2) && (Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl);310 LOG(2, "Begin of ScanForPeriodicCorrection."); 309 311 310 312 ColorList = new enum GraphEdge::Shading[getAtomCount()]; … … 324 326 for (int i=NDIM;i--;) { 325 327 tmp = fabs(Binder->leftatom->at(i) - Binder->rightatom->at(i)); 326 //L og() << Verbose(3) << "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << "." << endl;328 //LOG(3, "Checking " << i << "th distance of " << *Binder->leftatom << " to " << *Binder->rightatom << ": " << tmp << "."); 327 329 const range<double> MinMaxDistance( 328 330 BG->getMinMaxDistance(Binder->leftatom, Binder->rightatom)); 329 331 if (!MinMaxDistance.isInRange(tmp)) { 330 DoLog(2) && (Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl);332 LOG(2, "Correcting at bond " << *Binder << "."); 331 333 flag = true; 332 334 break; … … 346 348 } 347 349 Translationvector *= matrix; 348 //Log() << Verbose(3) << "Translation vector is "; 349 Log() << Verbose(0) << Translationvector << endl; 350 LOG(3, "INFO: Translation vector is " << Translationvector << "."); 350 351 // apply to all atoms of first component via BFS 351 352 for (int i=getAtomCount();i--;) … … 355 356 Walker = AtomStack->front(); 356 357 AtomStack->pop_front(); 357 //L og() << Verbose (3) << "Current Walker is: " << *Walker << "." << endl;358 //LOG(3, "INFO: Current Walker is: " << *Walker << "."); 358 359 ColorList[Walker->getNr()] = GraphEdge::black; // mark as explored 359 360 *Walker += Translationvector; // translate … … 381 382 // } 382 383 } else { 383 DoLog(3) && (Log() << Verbose(3) << "No corrections for this fragment." << endl);384 LOG(3, "No corrections for this fragment."); 384 385 } 385 386 //delete(CompStack); … … 388 389 delete(AtomStack); 389 390 delete[](ColorList); 390 DoLog(2) && (Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl);391 LOG(2, "End of ScanForPeriodicCorrection."); 391 392 392 393 return flag;
Note:
See TracChangeset
for help on using the changeset viewer.