Changeset 47d041 for src/linkedcell.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, 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:
- 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
-
src/linkedcell.cpp (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/linkedcell.cpp
r50e4e5 r47d041 59 59 max.Zero(); 60 60 min.Zero(); 61 DoLog(1) && (Log() << Verbose(1) << "Begin of LinkedCell" << endl);61 LOG(1, "Begin of LinkedCell"); 62 62 if (set.IsEmpty()) { 63 DoeLog(1) && (eLog()<< Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl);63 ELOG(1, "set is NULL or contains no linked cell nodes!"); 64 64 return; 65 65 } … … 82 82 set.GoToNext(); 83 83 } 84 DoLog(2) && (Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl);84 LOG(2, "Bounding box is " << min << " and " << max << "."); 85 85 86 86 // 2. find then number of cells per axis … … 88 88 N[i] = static_cast<int>(floor((max[i] - min[i])/RADIUS)+1); 89 89 } 90 DoLog(2) && (Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl);90 LOG(2, "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "."); 91 91 92 92 // 3. allocate the lists 93 DoLog(2) && (Log() << Verbose(2) << "Allocating cells ... ");93 LOG(2, "INFO: Allocating cells ... "); 94 94 if (LC != NULL) { 95 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl);95 ELOG(1, "Linked Cell list is already allocated, I do nothing."); 96 96 return; 97 97 } … … 101 101 LC [index].clear(); 102 102 } 103 DoLog(0) && (Log() << Verbose(0) << "done." << endl);103 LOG(0, "done."); 104 104 105 105 // 4. put each atom into its respective cell 106 DoLog(2) && (Log() << Verbose(2) << "Filling cells ... ");106 LOG(2, "INFO: Filling cells ... "); 107 107 set.GoToFirst(); 108 108 while (!set.IsEnd()) { … … 113 113 index = n[0] * N[1] * N[2] + n[1] * N[2] + n[2]; 114 114 LC[index].push_back(Walker); 115 //L og() << Verbose(2) << *Walker << " goes into cell " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;115 //LOG(2, *Walker << " goes into cell " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "."); 116 116 set.GoToNext(); 117 117 } 118 DoLog(0) && (Log() << Verbose(0) << "done." << endl);119 DoLog(1) && (Log() << Verbose(1) << "End of LinkedCell" << endl);118 LOG(0, "done."); 119 LOG(1, "End of LinkedCell"); 120 120 }; 121 121 … … 143 143 status = status && ((n[i] >=0) && (n[i] < N[i])); 144 144 // if (!status) 145 // DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl);145 // ELOG(1, "indices are out of bounds!"); 146 146 return status; 147 147 }; … … 216 216 return status; 217 217 } else { 218 DoeLog(1) && (eLog()<< Verbose(1) << "Node at " << *Walker << " is out of bounds." << endl);218 ELOG(1, "Node at " << *Walker << " is out of bounds."); 219 219 return false; 220 220 } … … 239 239 if (upper[i] < 0) 240 240 upper[i] = 0; 241 //L og() << Verbose(0) << "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]" << endl;241 //LOG(0, "axis " << i << " has bounds [" << lower[i] << "," << upper[i] << "]"); 242 242 } 243 243 }; … … 257 257 GetNeighbourBounds(Nlower, Nupper, step); 258 258 259 //Log() << Verbose(0) << endl;260 259 for (n[0] = Nlower[0]; n[0] <= Nupper[0]; n[0]++) 261 260 for (n[1] = Nlower[1]; n[1] <= Nupper[1]; n[1]++) 262 261 for (n[2] = Nlower[2]; n[2] <= Nupper[2]; n[2]++) { 263 262 const TesselPointSTLList *List = GetCurrentCell(); 264 //L og() << Verbose(1) << "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;263 //LOG(1, "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "."); 265 264 if (List != NULL) { 266 265 for (TesselPointSTLList::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { … … 336 335 const double dist = SetClosestIndexToOutsideVector(center); 337 336 if (dist > 2.*radius) { 338 DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << *center << " is too far away from any atom in LinkedCell's bounding box." << endl);337 ELOG(1, "Vector " << *center << " is too far away from any atom in LinkedCell's bounding box."); 339 338 return TesselList; 340 339 } else 341 DoLog(1) && (Log() << Verbose(1) << "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "." << endl);340 LOG(1, "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "."); 342 341 343 342 // gather all neighbours first, then look who fulfills distance criteria 344 343 NeighbourList = GetallNeighbours(2.*radius-dist); 345 //L og() << Verbose(1) << "I found " << NeighbourList->size() << " neighbours to check." << endl;344 //LOG(1, "I found " << NeighbourList->size() << " neighbours to check."); 346 345 if (NeighbourList != NULL) { 347 346 for (TesselPointSTLList::const_iterator Runner = NeighbourList->begin(); Runner != NeighbourList->end(); Runner++) { 348 347 Walker = *Runner; 349 //L og() << Verbose(1) << "Current neighbour is at " << *Walker->node << "." << endl;348 //LOG(1, "Current neighbour is at " << *Walker->node << "."); 350 349 if ((Walker->DistanceSquared(*center) - radiusSquared) < MYEPSILON) { 351 350 TesselList->push_back(Walker); … … 354 353 delete(NeighbourList); 355 354 } else 356 DoeLog(2) && (eLog()<< Verbose(2) << "Around vector " << *center << " there are no atoms." << endl);355 ELOG(2, "Around vector " << *center << " there are no atoms."); 357 356 return TesselList; 358 357 };
Note:
See TracChangeset
for help on using the changeset viewer.
