- Timestamp:
- Apr 22, 2010, 2:00:03 PM (16 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, Candidate_v1.7.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:
- 299554
- Parents:
- 6613ec
- Location:
- src
- Files:
-
- 33 edited
-
analysis_correlation.cpp (modified) (12 diffs)
-
analyzer.cpp (modified) (4 diffs)
-
atom_bondedparticle.cpp (modified) (1 diff)
-
atom_graphnode.cpp (modified) (2 diffs)
-
atom_trajectoryparticle.cpp (modified) (1 diff)
-
bondgraph.cpp (modified) (2 diffs)
-
boundary.cpp (modified) (30 diffs)
-
builder.cpp (modified) (110 diffs)
-
config.cpp (modified) (20 diffs)
-
datacreator.cpp (modified) (13 diffs)
-
ellipsoid.cpp (modified) (17 diffs)
-
graph.cpp (modified) (2 diffs)
-
helpers.cpp (modified) (1 diff)
-
helpers.hpp (modified) (3 diffs)
-
info.cpp (modified) (2 diffs)
-
joiner.cpp (modified) (6 diffs)
-
linkedcell.cpp (modified) (11 diffs)
-
memoryusageobserver.cpp (modified) (1 diff)
-
molecule.cpp (modified) (18 diffs)
-
molecule_dynamics.cpp (modified) (13 diffs)
-
molecule_fragmentation.cpp (modified) (55 diffs)
-
molecule_geometry.cpp (modified) (9 diffs)
-
molecule_graph.cpp (modified) (55 diffs)
-
moleculelist.cpp (modified) (34 diffs)
-
parser.cpp (modified) (23 diffs)
-
periodentafel.cpp (modified) (5 diffs)
-
stackclass.hpp (modified) (2 diffs)
-
tesselation.cpp (modified) (182 diffs)
-
tesselationhelpers.cpp (modified) (20 diffs)
-
unittests/logunittest.cpp (modified) (1 diff)
-
unittests/memoryallocatorunittest.cpp (modified) (1 diff)
-
unittests/tesselation_insideoutsideunittest.cpp (modified) (3 diffs)
-
vector.cpp (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/analysis_correlation.cpp
r6613ec ra67d19 46 46 while (Walker->next != (*MolWalker)->end) { 47 47 Walker = Walker->next; 48 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;48 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 49 49 if ((type1 == NULL) || (Walker->type == type1)) { 50 50 for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++) 51 51 if ((*MolOtherWalker)->ActiveFlag) { 52 Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;52 DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl); 53 53 atom *OtherWalker = (*MolOtherWalker)->start; 54 54 while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker 55 55 OtherWalker = OtherWalker->next; 56 Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;56 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl); 57 57 if (Walker->nr < OtherWalker->nr) 58 58 if ((type2 == NULL) || (OtherWalker->type == type2)) { … … 104 104 while (Walker->next != (*MolWalker)->end) { 105 105 Walker = Walker->next; 106 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;106 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 107 107 if ((type1 == NULL) || (Walker->type == type1)) { 108 108 periodicX.CopyVector(Walker->node); … … 117 117 for (MoleculeList::const_iterator MolOtherWalker = MolWalker; MolOtherWalker != molecules->ListOfMolecules.end(); MolOtherWalker++) 118 118 if ((*MolOtherWalker)->ActiveFlag) { 119 Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl;119 DoLog(2) && (Log() << Verbose(2) << "Current other molecule is " << *MolOtherWalker << "." << endl); 120 120 atom *OtherWalker = (*MolOtherWalker)->start; 121 121 while (OtherWalker->next != (*MolOtherWalker)->end) { // only go up to Walker 122 122 OtherWalker = OtherWalker->next; 123 Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl;123 DoLog(3) && (Log() << Verbose(3) << "Current otheratom is " << *OtherWalker << "." << endl); 124 124 if (Walker->nr < OtherWalker->nr) 125 125 if ((type2 == NULL) || (OtherWalker->type == type2)) { … … 164 164 165 165 if (molecules->ListOfMolecules.empty()) { 166 Log() << Verbose(1) <<"No molecule given." << endl;166 DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl); 167 167 return outmap; 168 168 } … … 170 170 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 171 171 if ((*MolWalker)->ActiveFlag) { 172 Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;173 atom *Walker = (*MolWalker)->start; 174 while (Walker->next != (*MolWalker)->end) { 175 Walker = Walker->next; 176 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;172 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 173 atom *Walker = (*MolWalker)->start; 174 while (Walker->next != (*MolWalker)->end) { 175 Walker = Walker->next; 176 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 177 177 if ((type == NULL) || (Walker->type == type)) { 178 178 distance = Walker->node->PeriodicDistance(point, World::get()->cell_size); 179 Log() << Verbose(4) << "Current distance is " << distance << "." << endl;179 DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl); 180 180 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) ); 181 181 } … … 204 204 205 205 if (molecules->ListOfMolecules.empty()) { 206 Log() << Verbose(1) <<"No molecule given." << endl;206 DoLog(1) && (Log() << Verbose(1) <<"No molecule given." << endl); 207 207 return outmap; 208 208 } … … 212 212 double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size); 213 213 double * FullInverseMatrix = InverseMatrix(FullMatrix); 214 Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;215 atom *Walker = (*MolWalker)->start; 216 while (Walker->next != (*MolWalker)->end) { 217 Walker = Walker->next; 218 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;214 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 215 atom *Walker = (*MolWalker)->start; 216 while (Walker->next != (*MolWalker)->end) { 217 Walker = Walker->next; 218 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 219 219 if ((type == NULL) || (Walker->type == type)) { 220 220 periodicX.CopyVector(Walker->node); … … 228 228 checkX.MatrixMultiplication(FullMatrix); 229 229 distance = checkX.Distance(point); 230 Log() << Verbose(4) << "Current distance is " << distance << "." << endl;230 DoLog(4) && (Log() << Verbose(4) << "Current distance is " << distance << "." << endl); 231 231 outmap->insert ( pair<double, pair<atom *, const Vector*> >(distance, pair<atom *, const Vector*> (Walker, point) ) ); 232 232 } … … 263 263 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 264 264 if ((*MolWalker)->ActiveFlag) { 265 Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl;265 DoLog(1) && (Log() << Verbose(1) << "Current molecule is " << (*MolWalker)->name << "." << endl); 266 266 atom *Walker = (*MolWalker)->start; 267 267 while (Walker->next != (*MolWalker)->end) { … … 276 276 } 277 277 } else 278 Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl;278 DoLog(1) && (Log() << Verbose(1) << "molecule " << (*MolWalker)->name << " is not active." << endl); 279 279 280 280 … … 307 307 308 308 if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) { 309 Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;309 DoLog(1) && (Log() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl); 310 310 return outmap; 311 311 } … … 317 317 double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size); 318 318 double * FullInverseMatrix = InverseMatrix(FullMatrix); 319 Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;320 atom *Walker = (*MolWalker)->start; 321 while (Walker->next != (*MolWalker)->end) { 322 Walker = Walker->next; 323 Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl;319 DoLog(2) && (Log() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 320 atom *Walker = (*MolWalker)->start; 321 while (Walker->next != (*MolWalker)->end) { 322 Walker = Walker->next; 323 DoLog(3) && (Log() << Verbose(3) << "Current atom is " << *Walker << "." << endl); 324 324 if ((type == NULL) || (Walker->type == type)) { 325 325 periodicX.CopyVector(Walker->node); -
src/analyzer.cpp
r6613ec ra67d19 63 63 int counter = 0; 64 64 65 Log() << Verbose(0) << "ANOVA Analyzer" << endl;66 Log() << Verbose(0) << "==============" << endl;65 DoLog(0) && (Log() << Verbose(0) << "ANOVA Analyzer" << endl); 66 DoLog(0) && (Log() << Verbose(0) << "==============" << endl); 67 67 68 68 // Get the command line options 69 69 if (argc < 4) { 70 Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl;71 Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl;72 Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl;73 Log() << Verbose(0) << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl;74 Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;70 DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> <outputdir> [elementsdb]" << endl); 71 DoLog(0) && (Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl); 72 DoLog(0) && (Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl); 73 DoLog(0) && (Log() << Verbose(0) << "<outputdir>\tcreated plotfiles and datafiles are placed into this directory " << endl); 74 DoLog(0) && (Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl); 75 75 return 1; 76 76 } else { … … 81 81 82 82 if (argc > 4) { 83 Log() << Verbose(0) << "Loading periodentafel." << endl;83 DoLog(0) && (Log() << Verbose(0) << "Loading periodentafel." << endl); 84 84 periode = Malloc<periodentafel>(1, "main - periode"); 85 85 periode->LoadPeriodentafel(argv[4]); … … 248 248 // +++++++++++++++ ANALYZING ++++++++++++++++++++++++++++++ 249 249 250 Log() << Verbose(0) << "Analyzing ..." << endl;250 DoLog(0) && (Log() << Verbose(0) << "Analyzing ..." << endl); 251 251 252 252 // ======================================= Creating the data files ============================================================== … … 559 559 delete(periode); 560 560 Free(&dir); 561 Log() << Verbose(0) << "done." << endl;561 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 562 562 return 0; 563 563 }; -
src/atom_bondedparticle.cpp
r6613ec ra67d19 44 44 void BondedParticle::OutputBondOfAtom() const 45 45 { 46 Log() << Verbose(4) << "Atom " << Name << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl;46 DoLog(4) && (Log() << Verbose(4) << "Atom " << Name << "/" << nr << " with " << ListOfBonds.size() << " bonds: " << endl); 47 47 int TotalDegree = 0; 48 48 for (BondList::const_iterator Runner = ListOfBonds.begin(); Runner != ListOfBonds.end(); ++Runner) { 49 Log() << Verbose(4) << **Runner << endl;49 DoLog(4) && (Log() << Verbose(4) << **Runner << endl); 50 50 TotalDegree += (*Runner)->BondDegree; 51 51 } 52 Log() << Verbose(4) << " -- TotalDegree: " << TotalDegree << endl;52 DoLog(4) && (Log() << Verbose(4) << " -- TotalDegree: " << TotalDegree << endl); 53 53 }; 54 54 -
src/atom_graphnode.cpp
r6613ec ra67d19 27 27 void GraphNode::OutputGraphInfo() const 28 28 { 29 Log() << Verbose(2) << "Atom " << Name << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are ";29 DoLog(2) && (Log() << Verbose(2) << "Atom " << Name << " is " << ((SeparationVertex) ? "a" : "not a") << " separation vertex, components are "); 30 30 OutputComponentNumber(); 31 Log() << Verbose(3) << " with Lowpoint " << LowpointNr << " and Graph Nr. " << GraphNr << "." << endl;31 DoLog(3) && (Log() << Verbose(3) << " with Lowpoint " << LowpointNr << " and Graph Nr. " << GraphNr << "." << endl); 32 32 }; 33 33 … … 40 40 if (ComponentNr != NULL) { 41 41 for (int i=0; ComponentNr[i] != -1; i++) 42 Log() << Verbose(2) << ComponentNr[i] << " ";42 DoLog(2) && (Log() << Verbose(2) << ComponentNr[i] << " "); 43 43 } 44 44 }; -
src/atom_trajectoryparticle.cpp
r6613ec ra67d19 198 198 // throw a dice to determine whether it gets hit by a heat bath particle 199 199 if (((((rand()/(double)RAND_MAX))*configuration->TempFrequency) < 1.)) { 200 Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> ";200 DoLog(3) && (Log() << Verbose(3) << "Particle " << *this << " was hit (sigma " << sigma << "): " << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << " -> "); 201 201 // pick three random numbers from a Boltzmann distribution around the desired temperature T for each momenta axis 202 202 for (int d=0; d<NDIM; d++) { 203 203 U[d] = gsl_ran_gaussian (r, sigma); 204 204 } 205 Log() << Verbose(2) << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << endl;205 DoLog(2) && (Log() << Verbose(2) << sqrt(U[0]*U[0]+U[1]*U[1]+U[2]*U[2]) << endl); 206 206 } 207 207 for (int d=0; d<NDIM; d++) -
src/bondgraph.cpp
r6613ec ra67d19 50 50 // allocate MatrixContainer 51 51 if (BondLengthMatrix != NULL) { 52 Log() << Verbose(1) << "MatrixContainer for Bond length already present, removing." << endl;52 DoLog(1) && (Log() << Verbose(1) << "MatrixContainer for Bond length already present, removing." << endl); 53 53 delete(BondLengthMatrix); 54 54 } … … 57 57 // parse in matrix 58 58 if ((status = TempContainer->ParseMatrix(filename.c_str(), 0, 1, 0))) { 59 Log() << Verbose(1) << "Parsing bond length matrix successful." << endl;59 DoLog(1) && (Log() << Verbose(1) << "Parsing bond length matrix successful." << endl); 60 60 } else { 61 61 DoeLog(1) && (eLog()<< Verbose(1) << "Parsing bond length matrix failed." << endl); -
src/boundary.cpp
r6613ec ra67d19 57 57 } else { 58 58 BoundaryPoints = BoundaryPtr; 59 Log() << Verbose(0) << "Using given boundary points set." << endl;59 DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl); 60 60 } 61 61 // determine biggest "diameter" of cluster for each axis … … 163 163 AngleReferenceNormalVector.x[(axis + 2) % NDIM] = 1.; 164 164 165 Log() << Verbose(1) << "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << "." << endl;165 DoLog(1) && (Log() << Verbose(1) << "Axisvector is " << AxisVector << " and AngleReferenceVector is " << AngleReferenceVector << ", and AngleReferenceNormalVector is " << AngleReferenceNormalVector << "." << endl); 166 166 167 167 // 3b. construct set of all points, transformed into cylindrical system and with left and right neighbours … … 184 184 angle = 2. * M_PI - angle; 185 185 } 186 Log() << Verbose(1) << "Inserting " << *Walker << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl;186 DoLog(1) && (Log() << Verbose(1) << "Inserting " << *Walker << ": (r, alpha) = (" << radius << "," << angle << "): " << ProjectedVector << endl); 187 187 BoundaryTestPair = BoundaryPoints[axis].insert(BoundariesPair(angle, DistancePair (radius, Walker))); 188 188 if (!BoundaryTestPair.second) { // same point exists, check first r, then distance of original vectors to center of gravity 189 Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl;190 Log() << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl;191 Log() << Verbose(2) << "New vector: " << *Walker << endl;189 DoLog(2) && (Log() << Verbose(2) << "Encountered two vectors whose projection onto axis " << axis << " is equal: " << endl); 190 DoLog(2) && (Log() << Verbose(2) << "Present vector: " << *BoundaryTestPair.first->second.second << endl); 191 DoLog(2) && (Log() << Verbose(2) << "New vector: " << *Walker << endl); 192 192 const double ProjectedVectorNorm = ProjectedVector.NormSquared(); 193 193 if ((ProjectedVectorNorm - BoundaryTestPair.first->second.first) > MYEPSILON) { 194 194 BoundaryTestPair.first->second.first = ProjectedVectorNorm; 195 195 BoundaryTestPair.first->second.second = Walker; 196 Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;196 DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger projected distance " << ProjectedVectorNorm << "." << endl); 197 197 } else if (fabs(ProjectedVectorNorm - BoundaryTestPair.first->second.first) < MYEPSILON) { 198 198 helper.CopyVector(&Walker->x); … … 203 203 if (helper.NormSquared() < oldhelperNorm) { 204 204 BoundaryTestPair.first->second.second = Walker; 205 Log() << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl;205 DoLog(2) && (Log() << Verbose(2) << "Keeping new vector due to larger distance to molecule center " << helper.NormSquared() << "." << endl); 206 206 } else { 207 Log() << Verbose(2) << "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << "." << endl;207 DoLog(2) && (Log() << Verbose(2) << "Keeping present vector due to larger distance to molecule center " << oldhelperNorm << "." << endl); 208 208 } 209 209 } else { 210 Log() << Verbose(2) << "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << "." << endl;210 DoLog(2) && (Log() << Verbose(2) << "Keeping present vector due to larger projected distance " << ProjectedVectorNorm << "." << endl); 211 211 } 212 212 } … … 227 227 // 3c. throw out points whose distance is less than the mean of left and right neighbours 228 228 bool flag = false; 229 Log() << Verbose(1) << "Looking for candidates to kick out by convex condition ... " << endl;229 DoLog(1) && (Log() << Verbose(1) << "Looking for candidates to kick out by convex condition ... " << endl); 230 230 do { // do as long as we still throw one out per round 231 231 flag = false; … … 282 282 const double MinDistance = a * sin(beta) / (sin(delta)) * (((alpha < M_PI / 2.) || (gamma < M_PI / 2.)) ? 1. : -1.); 283 283 //Log() << Verbose(1) << " I calculated: a = " << a << ", h = " << h << ", beta(" << left->second.second->Name << "," << left->second.second->Name << "-" << right->second.second->Name << ") = " << beta << ", delta(" << left->second.second->Name << "," << runner->second.second->Name << ") = " << delta << ", Min = " << MinDistance << "." << endl; 284 Log() << Verbose(1) << "Checking CoG distance of runner " << *runner->second.second << " " << h << " against triangle's side length spanned by (" << *left->second.second << "," << *right->second.second << ") of " << MinDistance << "." << endl;284 DoLog(1) && (Log() << Verbose(1) << "Checking CoG distance of runner " << *runner->second.second << " " << h << " against triangle's side length spanned by (" << *left->second.second << "," << *right->second.second << ") of " << MinDistance << "." << endl); 285 285 if ((fabs(h / fabs(h) - MinDistance / fabs(MinDistance)) < MYEPSILON) && ((h - MinDistance)) < -MYEPSILON) { 286 286 // throw out point 287 Log() << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl;287 DoLog(1) && (Log() << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl); 288 288 BoundaryPoints[axis].erase(runner); 289 289 flag = true; … … 320 320 BoundaryPoints = GetBoundaryPoints(mol, TesselStruct); 321 321 } else { 322 Log() << Verbose(0) << "Using given boundary points set." << endl;322 DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl); 323 323 } 324 324 … … 326 326 for (int axis=0; axis < NDIM; axis++) 327 327 { 328 Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl;328 DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl); 329 329 int i=0; 330 330 for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) { 331 331 if (runner != BoundaryPoints[axis].begin()) 332 Log() << Verbose(0) << ", " << i << ": " << *runner->second.second;332 DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second); 333 333 else 334 Log() << Verbose(0) << i << ": " << *runner->second.second;334 DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second); 335 335 i++; 336 336 } 337 Log() << Verbose(0) << endl;337 DoLog(0) && (Log() << Verbose(0) << endl); 338 338 } 339 339 … … 344 344 DoeLog(2) && (eLog()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl); 345 345 346 Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl;346 DoLog(0) && (Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl); 347 347 // now we have the whole set of edge points in the BoundaryList 348 348 … … 364 364 DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl); 365 365 366 Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;366 DoLog(0) && (Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl); 367 367 368 368 // 4. Store triangles in tecplot file … … 395 395 for (LineMap::iterator LineRunner = TesselStruct->LinesOnBoundary.begin(); LineRunner != TesselStruct->LinesOnBoundary.end(); LineRunner++) { 396 396 line = LineRunner->second; 397 Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl;397 DoLog(1) && (Log() << Verbose(1) << "INFO: Current line is " << *line << "." << endl); 398 398 if (!line->CheckConvexityCriterion()) { 399 Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl;399 DoLog(1) && (Log() << Verbose(1) << "... line " << *line << " is concave, flipping it." << endl); 400 400 401 401 // flip the line … … 404 404 else { 405 405 TesselStruct->FlipBaseline(line); 406 Log() << Verbose(1) << "INFO: Correction of concave baselines worked." << endl;406 DoLog(1) && (Log() << Verbose(1) << "INFO: Correction of concave baselines worked." << endl); 407 407 } 408 408 } … … 414 414 // Log() << Verbose(1) << "Correction of concave tesselpoints failed!" << endl; 415 415 416 Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl;416 DoLog(0) && (Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl); 417 417 418 418 // 4. Store triangles in tecplot file … … 462 462 PointMap::iterator PointRunner; 463 463 while (!TesselStruct->PointsOnBoundary.empty()) { 464 Log() << Verbose(1) << "Remaining points are: ";464 DoLog(1) && (Log() << Verbose(1) << "Remaining points are: "); 465 465 for (PointMap::iterator PointSprinter = TesselStruct->PointsOnBoundary.begin(); PointSprinter != TesselStruct->PointsOnBoundary.end(); PointSprinter++) 466 Log() << Verbose(0) << *(PointSprinter->second) << "\t";467 Log() << Verbose(0) << endl;466 DoLog(0) && (Log() << Verbose(0) << *(PointSprinter->second) << "\t"); 467 DoLog(0) && (Log() << Verbose(0) << endl); 468 468 469 469 PointRunner = TesselStruct->PointsOnBoundary.begin(); … … 537 537 PointAdvance++; 538 538 point = PointRunner->second; 539 Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl;539 DoLog(1) && (Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl); 540 540 for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) { 541 541 line = LineRunner->second; 542 Log() << Verbose(1) << "INFO: Current line of point " << *point << " is " << *line << "." << endl;542 DoLog(1) && (Log() << Verbose(1) << "INFO: Current line of point " << *point << " is " << *line << "." << endl); 543 543 if (!line->CheckConvexityCriterion()) { 544 544 // remove the point if needed 545 Log() << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl;545 DoLog(1) && (Log() << Verbose(1) << "... point " << *point << " cannot be on convex envelope." << endl); 546 546 volume += TesselStruct->RemovePointFromTesselatedSurface(point); 547 547 sprintf(dummy, "-first-%d", ++run); … … 564 564 LineAdvance++; 565 565 line = LineRunner->second; 566 Log() << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl;566 DoLog(1) && (Log() << Verbose(1) << "INFO: Picking farthest baseline for line is " << *line << "." << endl); 567 567 // take highest of both lines 568 568 if (TesselStruct->IsConvexRectangle(line) == NULL) { … … 605 605 606 606 // end 607 Log() << Verbose(0) << "Volume is " << volume << "." << endl;607 DoLog(0) && (Log() << Verbose(0) << "Volume is " << volume << "." << endl); 608 608 return volume; 609 609 }; … … 734 734 totalmass += Walker->type->mass; 735 735 } 736 Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl;737 Log() << Verbose(0) << "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;736 DoLog(0) && (Log() << Verbose(0) << "RESULT: The summed mass is " << setprecision(10) << totalmass << " atomicmassunit." << endl); 737 DoLog(0) && (Log() << Verbose(0) << "RESULT: The average density is " << setprecision(10) << totalmass / clustervolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl); 738 738 739 739 // solve cubic polynomial 740 Log() << Verbose(1) << "Solving equidistant suspension in water problem ..." << endl;740 DoLog(1) && (Log() << Verbose(1) << "Solving equidistant suspension in water problem ..." << endl); 741 741 if (IsAngstroem) 742 742 cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_A - (totalmass / clustervolume)) / (celldensity - 1); 743 743 else 744 744 cellvolume = (TotalNoClusters * totalmass / SOLVENTDENSITY_a0 - (totalmass / clustervolume)) / (celldensity - 1); 745 Log() << Verbose(1) << "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;745 DoLog(1) && (Log() << Verbose(1) << "Cellvolume needed for a density of " << celldensity << " g/cm^3 is " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl); 746 746 747 747 double minimumvolume = TotalNoClusters * (GreatestDiameter[0] * GreatestDiameter[1] * GreatestDiameter[2]); 748 Log() << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;748 DoLog(1) && (Log() << Verbose(1) << "Minimum volume of the convex envelope contained in a rectangular box is " << minimumvolume << " atomicmassunit/" << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl); 749 749 if (minimumvolume > cellvolume) { 750 750 DoeLog(1) && (eLog()<< Verbose(1) << "the containing box already has a greater volume than the envisaged cell volume!" << endl); 751 Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl;751 DoLog(0) && (Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl); 752 752 for (int i = 0; i < NDIM; i++) 753 753 BoxLengths.x[i] = GreatestDiameter[i]; … … 761 761 double x2 = 0.; 762 762 if (gsl_poly_solve_cubic(BoxLengths.x[0], BoxLengths.x[1], BoxLengths.x[2], &x0, &x1, &x2) == 1) // either 1 or 3 on return 763 Log() << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl;763 DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting spacing is: " << x0 << " ." << endl); 764 764 else { 765 Log() << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl;765 DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting spacings are: " << x0 << " and " << x1 << " and " << x2 << " ." << endl); 766 766 x0 = x2; // sorted in ascending order 767 767 } … … 774 774 775 775 // set new box dimensions 776 Log() << Verbose(0) << "Translating to box with these boundaries." << endl;776 DoLog(0) && (Log() << Verbose(0) << "Translating to box with these boundaries." << endl); 777 777 mol->SetBoxDimension(&BoxLengths); 778 778 mol->CenterInBox(); … … 780 780 // update Box of atoms by boundary 781 781 mol->SetBoxDimension(&BoxLengths); 782 Log() << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl;782 DoLog(0) && (Log() << Verbose(0) << "RESULT: The resulting cell dimensions are: " << BoxLengths.x[0] << " and " << BoxLengths.x[1] << " and " << BoxLengths.x[2] << " with total volume of " << cellvolume << " " << (IsAngstroem ? "angstrom" : "atomiclength") << "^3." << endl); 783 783 }; 784 784 … … 822 822 for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) 823 823 if ((*ListRunner)->AtomCount > 0) { 824 Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl;824 DoLog(1) && (Log() << Verbose(1) << "Pre-creating linked cell lists for molecule " << *ListRunner << "." << endl); 825 825 LCList[(*ListRunner)] = new LinkedCell((*ListRunner), 10.); // get linked cell list 826 Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl;826 DoLog(1) && (Log() << Verbose(1) << "Pre-creating tesselation for molecule " << *ListRunner << "." << endl); 827 827 TesselStruct[(*ListRunner)] = NULL; 828 828 FindNonConvexBorder((*ListRunner), TesselStruct[(*ListRunner)], (const LinkedCell *&)LCList[(*ListRunner)], 5., NULL); … … 832 832 filler->CenterEdge(&Inserter); 833 833 filler->Center.Zero(); 834 Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl;834 DoLog(2) && (Log() << Verbose(2) << "INFO: Filler molecule has the following bonds:" << endl); 835 835 Binder = filler->first; 836 836 while(Binder->next != filler->last) { 837 837 Binder = Binder->next; 838 Log() << Verbose(2) << " " << *Binder << endl;838 DoLog(2) && (Log() << Verbose(2) << " " << *Binder << endl); 839 839 } 840 840 … … 847 847 for(int i=0;i<NDIM;i++) 848 848 N[i] = (int) ceil(1./FillerDistance.x[i]); 849 Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl;849 DoLog(1) && (Log() << Verbose(1) << "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << "." << endl); 850 850 851 851 // initialize seed of random number generator to current time … … 862 862 for (int i=0;i<NDIM;i++) 863 863 FillerTranslations.x[i] = RandomMolDisplacement*(rand()/(RAND_MAX/2.) - 1.); 864 Log() << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << "." << endl;864 DoLog(2) && (Log() << Verbose(2) << "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << "." << endl); 865 865 866 866 // go through all atoms … … 917 917 // insert into Filling 918 918 if (FillIt) { 919 Log() << Verbose(1) << "INFO: Position at " << Inserter << " is outer point." << endl;919 DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is outer point." << endl); 920 920 // copy atom ... 921 921 CopyAtoms[Walker->nr] = new atom(Walker); 922 922 CopyAtoms[Walker->nr]->x.CopyVector(&Inserter); 923 923 Filling->AddAtom(CopyAtoms[Walker->nr]); 924 Log() << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl;924 DoLog(4) && (Log() << Verbose(4) << "Filling atom " << *Walker << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[Walker->nr]->x) << "." << endl); 925 925 } else { 926 Log() << Verbose(1) << "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance." << endl;926 DoLog(1) && (Log() << Verbose(1) << "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance." << endl); 927 927 CopyAtoms[Walker->nr] = NULL; 928 928 continue; … … 965 965 966 966 if (TesselStruct == NULL) { 967 Log() << Verbose(1) << "Allocating Tesselation struct ..." << endl;967 DoLog(1) && (Log() << Verbose(1) << "Allocating Tesselation struct ..." << endl); 968 968 TesselStruct= new Tesselation; 969 969 } else { 970 970 delete(TesselStruct); 971 Log() << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl;971 DoLog(1) && (Log() << Verbose(1) << "Re-Allocating Tesselation struct ..." << endl); 972 972 TesselStruct = new Tesselation; 973 973 } … … 990 990 while ((!TesselStruct->OpenLines.empty()) && (OneLoopWithoutSuccessFlag)) { 991 991 // 2a. print OpenLines 992 Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl;992 DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl); 993 993 for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) 994 Log() << Verbose(1) << " " << *(Runner->second) << endl;994 DoLog(1) && (Log() << Verbose(1) << " " << *(Runner->second) << endl); 995 995 996 996 // 2b. find best candidate for each OpenLine … … 998 998 999 999 // 2c. print OpenLines with candidates again 1000 Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl;1000 DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl); 1001 1001 for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) 1002 Log() << Verbose(1) << " " << *(Runner->second) << endl;1002 DoLog(1) && (Log() << Verbose(1) << " " << *(Runner->second) << endl); 1003 1003 1004 1004 // 2d. search for smallest ShortestAngle among all candidates … … 1008 1008 baseline = Runner->second; 1009 1009 ShortestAngle = baseline->ShortestAngle; 1010 Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle << endl;1010 DoLog(1) && (Log() << Verbose(1) << "New best candidate is " << *baseline->BaseLine << " with point " << *(*baseline->pointlist.begin()) << " and angle " << baseline->ShortestAngle << endl); 1011 1011 } 1012 1012 } -
src/builder.cpp
r6613ec ra67d19 132 132 if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl); 133 133 second = mol->AskAtom("Enter atom number: "); 134 Log() << Verbose(0) << "Enter relative coordinates." << endl;134 DoLog(0) && (Log() << Verbose(0) << "Enter relative coordinates." << endl); 135 135 first->x.AskPosition(World::get()->cell_size, false); 136 136 for (int i=NDIM;i--;) { … … 175 175 continue; 176 176 } 177 Log() << Verbose(0) << "resulting relative coordinates: ";177 DoLog(0) && (Log() << Verbose(0) << "resulting relative coordinates: "); 178 178 z.Output(); 179 Log() << Verbose(0) << endl;179 DoLog(0) && (Log() << Verbose(0) << endl); 180 180 */ 181 181 // calc axis vector … … 185 185 Log() << Verbose(0) << "x: ", 186 186 x.Output(); 187 Log() << Verbose(0) << endl;187 DoLog(0) && (Log() << Verbose(0) << endl); 188 188 z.MakeNormalVector(&second->x,&third->x,&fourth->x); 189 189 Log() << Verbose(0) << "z: ", 190 190 z.Output(); 191 Log() << Verbose(0) << endl;191 DoLog(0) && (Log() << Verbose(0) << endl); 192 192 y.MakeNormalVector(&x,&z); 193 193 Log() << Verbose(0) << "y: ", 194 194 y.Output(); 195 Log() << Verbose(0) << endl;195 DoLog(0) && (Log() << Verbose(0) << endl); 196 196 197 197 // rotate vector around first angle … … 200 200 Log() << Verbose(0) << "Rotated vector: ", 201 201 first->x.Output(); 202 Log() << Verbose(0) << endl;202 DoLog(0) && (Log() << Verbose(0) << endl); 203 203 // remove the projection onto the rotation plane of the second angle 204 204 n.CopyVector(&y); … … 206 206 Log() << Verbose(0) << "N1: ", 207 207 n.Output(); 208 Log() << Verbose(0) << endl;208 DoLog(0) && (Log() << Verbose(0) << endl); 209 209 first->x.SubtractVector(&n); 210 210 Log() << Verbose(0) << "Subtracted vector: ", 211 211 first->x.Output(); 212 Log() << Verbose(0) << endl;212 DoLog(0) && (Log() << Verbose(0) << endl); 213 213 n.CopyVector(&z); 214 214 n.Scale(first->x.ScalarProduct(&z)); 215 215 Log() << Verbose(0) << "N2: ", 216 216 n.Output(); 217 Log() << Verbose(0) << endl;217 DoLog(0) && (Log() << Verbose(0) << endl); 218 218 first->x.SubtractVector(&n); 219 219 Log() << Verbose(0) << "2nd subtracted vector: ", 220 220 first->x.Output(); 221 Log() << Verbose(0) << endl;221 DoLog(0) && (Log() << Verbose(0) << endl); 222 222 223 223 // rotate another vector around second angle … … 226 226 Log() << Verbose(0) << "2nd Rotated vector: ", 227 227 n.Output(); 228 Log() << Verbose(0) << endl;228 DoLog(0) && (Log() << Verbose(0) << endl); 229 229 230 230 // add the two linear independent vectors … … 234 234 first->x.AddVector(&second->x); 235 235 236 Log() << Verbose(0) << "resulting coordinates: ";236 DoLog(0) && (Log() << Verbose(0) << "resulting coordinates: "); 237 237 first->x.Output(); 238 Log() << Verbose(0) << endl;238 DoLog(0) && (Log() << Verbose(0) << endl); 239 239 } while (!(valid = mol->CheckBounds((const Vector *)&first->x))); 240 240 first->type = periode->AskElement(); // give type … … 388 388 cout << Verbose(0) << "Offset vector: "; 389 389 x.Output(); 390 Log() << Verbose(0) << endl;390 DoLog(0) && (Log() << Verbose(0) << endl); 391 391 n.Normalize(); 392 392 break; 393 393 }; 394 Log() << Verbose(0) << "Alignment vector: ";394 DoLog(0) && (Log() << Verbose(0) << "Alignment vector: "); 395 395 n.Output(); 396 Log() << Verbose(0) << endl;396 DoLog(0) && (Log() << Verbose(0) << endl); 397 397 mol->Align(&n); 398 398 }; … … 407 407 char choice; // menu choice char 408 408 409 Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl;410 Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl;411 Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl;412 Log() << Verbose(0) << " c - state two atoms in normal direction" << endl;413 Log() << Verbose(0) << "all else - go back" << endl;414 Log() << Verbose(0) << "===============================================" << endl;415 Log() << Verbose(0) << "INPUT: ";409 DoLog(0) && (Log() << Verbose(0) << "===========MIRROR ATOMS=========================" << endl); 410 DoLog(0) && (Log() << Verbose(0) << " a - state three atoms defining mirror plane" << endl); 411 DoLog(0) && (Log() << Verbose(0) << " b - state normal vector of mirror plane" << endl); 412 DoLog(0) && (Log() << Verbose(0) << " c - state two atoms in normal direction" << endl); 413 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 414 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 415 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 416 416 cin >> choice; 417 417 … … 426 426 break; 427 427 case 'b': // normal vector of mirror plane 428 Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl;428 DoLog(0) && (Log() << Verbose(0) << "Enter normal vector of mirror plane." << endl); 429 429 n.AskPosition(World::get()->cell_size,0); 430 430 n.Normalize(); … … 439 439 break; 440 440 }; 441 Log() << Verbose(0) << "Normal vector: ";441 DoLog(0) && (Log() << Verbose(0) << "Normal vector: "); 442 442 n.Output(); 443 Log() << Verbose(0) << endl;443 DoLog(0) && (Log() << Verbose(0) << endl); 444 444 mol->Mirror((const Vector *)&n); 445 445 }; … … 455 455 char choice; // menu choice char 456 456 457 Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl;458 Log() << Verbose(0) << " a - state atom for removal by number" << endl;459 Log() << Verbose(0) << " b - keep only in radius around atom" << endl;460 Log() << Verbose(0) << " c - remove this with one axis greater value" << endl;461 Log() << Verbose(0) << "all else - go back" << endl;462 Log() << Verbose(0) << "===============================================" << endl;463 Log() << Verbose(0) << "INPUT: ";457 DoLog(0) && (Log() << Verbose(0) << "===========REMOVE ATOMS=========================" << endl); 458 DoLog(0) && (Log() << Verbose(0) << " a - state atom for removal by number" << endl); 459 DoLog(0) && (Log() << Verbose(0) << " b - keep only in radius around atom" << endl); 460 DoLog(0) && (Log() << Verbose(0) << " c - remove this with one axis greater value" << endl); 461 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 462 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 463 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 464 464 cin >> choice; 465 465 … … 468 468 case 'a': 469 469 if (mol->RemoveAtom(mol->AskAtom("Enter number of atom within molecule: "))) 470 Log() << Verbose(1) << "Atom removed." << endl;470 DoLog(1) && (Log() << Verbose(1) << "Atom removed." << endl); 471 471 else 472 Log() << Verbose(1) << "Atom not found." << endl;472 DoLog(1) && (Log() << Verbose(1) << "Atom not found." << endl); 473 473 break; 474 474 case 'b': 475 475 second = mol->AskAtom("Enter number of atom as reference point: "); 476 Log() << Verbose(0) << "Enter radius: ";476 DoLog(0) && (Log() << Verbose(0) << "Enter radius: "); 477 477 cin >> tmp1; 478 478 first = mol->start; … … 486 486 break; 487 487 case 'c': 488 Log() << Verbose(0) << "Which axis is it: ";488 DoLog(0) && (Log() << Verbose(0) << "Which axis is it: "); 489 489 cin >> axis; 490 Log() << Verbose(0) << "Lower boundary: ";490 DoLog(0) && (Log() << Verbose(0) << "Lower boundary: "); 491 491 cin >> tmp1; 492 Log() << Verbose(0) << "Upper boundary: ";492 DoLog(0) && (Log() << Verbose(0) << "Upper boundary: "); 493 493 cin >> tmp2; 494 494 first = mol->start; … … 520 520 char choice; // menu choice char 521 521 522 Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl;523 Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl;524 Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl;525 Log() << Verbose(0) << " c - calculate bond angle" << endl;526 Log() << Verbose(0) << " d - calculate principal axis of the system" << endl;527 Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl;528 Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl;529 Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl;530 Log() << Verbose(0) << "all else - go back" << endl;531 Log() << Verbose(0) << "===============================================" << endl;532 Log() << Verbose(0) << "INPUT: ";522 DoLog(0) && (Log() << Verbose(0) << "===========MEASURE ATOMS=========================" << endl); 523 DoLog(0) && (Log() << Verbose(0) << " a - calculate bond length between one atom and all others" << endl); 524 DoLog(0) && (Log() << Verbose(0) << " b - calculate bond length between two atoms" << endl); 525 DoLog(0) && (Log() << Verbose(0) << " c - calculate bond angle" << endl); 526 DoLog(0) && (Log() << Verbose(0) << " d - calculate principal axis of the system" << endl); 527 DoLog(0) && (Log() << Verbose(0) << " e - calculate volume of the convex envelope" << endl); 528 DoLog(0) && (Log() << Verbose(0) << " f - calculate temperature from current velocity" << endl); 529 DoLog(0) && (Log() << Verbose(0) << " g - output all temperatures per step from velocities" << endl); 530 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 531 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 532 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 533 533 cin >> choice; 534 534 535 535 switch(choice) { 536 536 default: 537 Log() << Verbose(1) << "Not a valid choice." << endl;537 DoLog(1) && (Log() << Verbose(1) << "Not a valid choice." << endl); 538 538 break; 539 539 case 'a': … … 567 567 x.SubtractVector((const Vector *)&second->x); 568 568 tmp1 = x.Norm(); 569 Log() << Verbose(1) << "Distance vector is ";569 DoLog(1) && (Log() << Verbose(1) << "Distance vector is "); 570 570 x.Output(); 571 Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl;571 DoLog(0) && (Log() << Verbose(0) << "." << endl << "Norm of distance is " << tmp1 << "." << endl); 572 572 break; 573 573 574 574 case 'c': 575 Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl;575 DoLog(0) && (Log() << Verbose(0) << "Evaluating bond angle between three - first, central, last - atoms." << endl); 576 576 first = mol->AskAtom("Enter first atom: "); 577 577 second = mol->AskAtom("Enter central atom: "); … … 582 582 y.CopyVector((const Vector *)&third->x); 583 583 y.SubtractVector((const Vector *)&second->x); 584 Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": ";585 Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl;584 DoLog(0) && (Log() << Verbose(0) << "Bond angle between first atom Nr." << first->nr << ", central atom Nr." << second->nr << " and last atom Nr." << third->nr << ": "); 585 DoLog(0) && (Log() << Verbose(0) << (acos(x.ScalarProduct((const Vector *)&y)/(y.Norm()*x.Norm()))/M_PI*180.) << " degrees" << endl); 586 586 break; 587 587 case 'd': 588 Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;589 Log() << Verbose(0) << "Shall we rotate? [0/1]: ";588 DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl); 589 DoLog(0) && (Log() << Verbose(0) << "Shall we rotate? [0/1]: "); 590 590 cin >> Z; 591 591 if ((Z >=0) && (Z <=1)) … … 596 596 case 'e': 597 597 { 598 Log() << Verbose(0) << "Evaluating volume of the convex envelope.";598 DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope."); 599 599 class Tesselation *TesselStruct = NULL; 600 600 const LinkedCell *LCList = NULL; … … 602 602 FindConvexBorder(mol, TesselStruct, LCList, NULL); 603 603 double clustervolume = VolumeOfConvexEnvelope(TesselStruct, configuration); 604 Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl;\604 DoLog(0) && (Log() << Verbose(0) << "The tesselated surface area is " << clustervolume << "." << endl);\ 605 605 delete(LCList); 606 606 delete(TesselStruct); … … 613 613 { 614 614 char filename[255]; 615 Log() << Verbose(0) << "Please enter filename: " << endl;615 DoLog(0) && (Log() << Verbose(0) << "Please enter filename: " << endl); 616 616 cin >> filename; 617 Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl;617 DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << filename << "." << endl); 618 618 ofstream *output = new ofstream(filename, ios::trunc); 619 619 if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps)) 620 Log() << Verbose(2) << "File could not be written." << endl;620 DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl); 621 621 else 622 Log() << Verbose(2) << "File stored." << endl;622 DoLog(2) && (Log() << Verbose(2) << "File stored." << endl); 623 623 output->close(); 624 624 delete(output); … … 637 637 clock_t start, end; 638 638 639 Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;640 Log() << Verbose(0) << "What's the desired bond order: ";639 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 640 DoLog(0) && (Log() << Verbose(0) << "What's the desired bond order: "); 641 641 cin >> Order1; 642 642 if (mol->first->next != mol->last) { // there are bonds … … 644 644 mol->FragmentMolecule(Order1, configuration); 645 645 end = clock(); 646 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;646 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 647 647 } else 648 Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl;648 DoLog(0) && (Log() << Verbose(0) << "Connection matrix has not yet been generated!" << endl); 649 649 }; 650 650 … … 665 665 bool valid; 666 666 667 Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl;668 Log() << Verbose(0) << "a - add an atom" << endl;669 Log() << Verbose(0) << "r - remove an atom" << endl;670 Log() << Verbose(0) << "b - scale a bond between atoms" << endl;671 Log() << Verbose(0) << "t - turn an atom round another bond" << endl;672 Log() << Verbose(0) << "u - change an atoms element" << endl;673 Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl;674 Log() << Verbose(0) << "all else - go back" << endl;675 Log() << Verbose(0) << "===============================================" << endl;667 DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE ATOMS======================" << endl); 668 DoLog(0) && (Log() << Verbose(0) << "a - add an atom" << endl); 669 DoLog(0) && (Log() << Verbose(0) << "r - remove an atom" << endl); 670 DoLog(0) && (Log() << Verbose(0) << "b - scale a bond between atoms" << endl); 671 DoLog(0) && (Log() << Verbose(0) << "t - turn an atom round another bond" << endl); 672 DoLog(0) && (Log() << Verbose(0) << "u - change an atoms element" << endl); 673 DoLog(0) && (Log() << Verbose(0) << "l - measure lengths, angles, ... for an atom" << endl); 674 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 675 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 676 676 if (molecules->NumberOfActiveMolecules() > 1) 677 677 DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl); 678 Log() << Verbose(0) << "INPUT: ";678 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 679 679 cin >> choice; 680 680 681 681 switch (choice) { 682 682 default: 683 Log() << Verbose(0) << "Not a valid choice." << endl;683 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 684 684 break; 685 685 … … 688 688 if ((*ListRunner)->ActiveFlag) { 689 689 mol = *ListRunner; 690 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;690 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 691 691 AddAtoms(periode, mol); 692 692 } … … 697 697 if ((*ListRunner)->ActiveFlag) { 698 698 mol = *ListRunner; 699 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;700 Log() << Verbose(0) << "Scaling bond length between two atoms." << endl;699 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 700 DoLog(0) && (Log() << Verbose(0) << "Scaling bond length between two atoms." << endl); 701 701 first = mol->AskAtom("Enter first (fixed) atom: "); 702 702 second = mol->AskAtom("Enter second (shifting) atom: "); … … 705 705 minBond += (first->x.x[i]-second->x.x[i])*(first->x.x[i] - second->x.x[i]); 706 706 minBond = sqrt(minBond); 707 Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl;708 Log() << Verbose(0) << "Enter new bond length [a.u.]: ";707 DoLog(0) && (Log() << Verbose(0) << "Current Bond length between " << first->type->name << " Atom " << first->nr << " and " << second->type->name << " Atom " << second->nr << ": " << minBond << " a.u." << endl); 708 DoLog(0) && (Log() << Verbose(0) << "Enter new bond length [a.u.]: "); 709 709 cin >> bond; 710 710 for (int i=NDIM;i--;) { … … 720 720 if ((*ListRunner)->ActiveFlag) { 721 721 mol = *ListRunner; 722 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;723 Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl;724 Log() << Verbose(0) << "Enter three factors: ";722 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 723 DoLog(0) && (Log() << Verbose(0) << "Angstroem -> Bohrradius: 1.8897261\t\tBohrradius -> Angstroem: 0.52917721" << endl); 724 DoLog(0) && (Log() << Verbose(0) << "Enter three factors: "); 725 725 factor = new double[NDIM]; 726 726 cin >> factor[0]; … … 737 737 if ((*ListRunner)->ActiveFlag) { 738 738 mol = *ListRunner; 739 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;739 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 740 740 MeasureAtoms(periode, mol, configuration); 741 741 } … … 746 746 if ((*ListRunner)->ActiveFlag) { 747 747 mol = *ListRunner; 748 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;748 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 749 749 RemoveAtoms(mol); 750 750 } … … 755 755 if ((*ListRunner)->ActiveFlag) { 756 756 mol = *ListRunner; 757 Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl;757 DoLog(0) && (Log() << Verbose(0) << "Turning atom around another bond - first is atom to turn, second (central) and third specify bond" << endl); 758 758 first = mol->AskAtom("Enter turning atom: "); 759 759 second = mol->AskAtom("Enter central atom: "); … … 789 789 int Z; 790 790 mol = *ListRunner; 791 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;791 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 792 792 first = NULL; 793 793 do { 794 Log() << Verbose(0) << "Change the element of which atom: ";794 DoLog(0) && (Log() << Verbose(0) << "Change the element of which atom: "); 795 795 cin >> Z; 796 796 } while ((first = mol->FindAtom(Z)) == NULL); 797 Log() << Verbose(0) << "New element by atomic number Z: ";797 DoLog(0) && (Log() << Verbose(0) << "New element by atomic number Z: "); 798 798 cin >> Z; 799 799 first->type = periode->FindElement(Z); 800 Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl;800 DoLog(0) && (Log() << Verbose(0) << "Atom " << first->nr << "'s element is " << first->type->name << "." << endl); 801 801 } 802 802 break; … … 819 819 MoleculeLeafClass *Subgraphs = NULL; 820 820 821 Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl;822 Log() << Verbose(0) << "c - scale by unit transformation" << endl;823 Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl;824 Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl;825 Log() << Verbose(0) << "g - center atoms in box" << endl;826 Log() << Verbose(0) << "i - realign molecule" << endl;827 Log() << Verbose(0) << "m - mirror all molecules" << endl;828 Log() << Verbose(0) << "o - create connection matrix" << endl;829 Log() << Verbose(0) << "t - translate molecule by vector" << endl;830 Log() << Verbose(0) << "all else - go back" << endl;831 Log() << Verbose(0) << "===============================================" << endl;821 DoLog(0) && (Log() << Verbose(0) << "=========MANIPULATE GLOBALLY===================" << endl); 822 DoLog(0) && (Log() << Verbose(0) << "c - scale by unit transformation" << endl); 823 DoLog(0) && (Log() << Verbose(0) << "d - duplicate molecule/periodic cell" << endl); 824 DoLog(0) && (Log() << Verbose(0) << "f - fragment molecule many-body bond order style" << endl); 825 DoLog(0) && (Log() << Verbose(0) << "g - center atoms in box" << endl); 826 DoLog(0) && (Log() << Verbose(0) << "i - realign molecule" << endl); 827 DoLog(0) && (Log() << Verbose(0) << "m - mirror all molecules" << endl); 828 DoLog(0) && (Log() << Verbose(0) << "o - create connection matrix" << endl); 829 DoLog(0) && (Log() << Verbose(0) << "t - translate molecule by vector" << endl); 830 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 831 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 832 832 if (molecules->NumberOfActiveMolecules() > 1) 833 833 DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl); 834 Log() << Verbose(0) << "INPUT: ";834 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 835 835 cin >> choice; 836 836 837 837 switch (choice) { 838 838 default: 839 Log() << Verbose(0) << "Not a valid choice." << endl;839 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 840 840 break; 841 841 … … 844 844 if ((*ListRunner)->ActiveFlag) { 845 845 mol = *ListRunner; 846 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;847 Log() << Verbose(0) << "State the axis [(+-)123]: ";846 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 847 DoLog(0) && (Log() << Verbose(0) << "State the axis [(+-)123]: "); 848 848 cin >> axis; 849 Log() << Verbose(0) << "State the factor: ";849 DoLog(0) && (Log() << Verbose(0) << "State the factor: "); 850 850 cin >> faktor; 851 851 … … 903 903 if ((*ListRunner)->ActiveFlag) { 904 904 mol = *ListRunner; 905 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;905 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 906 906 CenterAtoms(mol); 907 907 } … … 912 912 if ((*ListRunner)->ActiveFlag) { 913 913 mol = *ListRunner; 914 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;914 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 915 915 AlignAtoms(periode, mol); 916 916 } … … 921 921 if ((*ListRunner)->ActiveFlag) { 922 922 mol = *ListRunner; 923 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;923 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 924 924 MirrorAtoms(mol); 925 925 } … … 932 932 double bonddistance; 933 933 clock_t start,end; 934 Log() << Verbose(0) << "What's the maximum bond distance: ";934 DoLog(0) && (Log() << Verbose(0) << "What's the maximum bond distance: "); 935 935 cin >> bonddistance; 936 936 start = clock(); 937 937 mol->CreateAdjacencyList(bonddistance, configuration->GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 938 938 end = clock(); 939 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;939 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 940 940 } 941 941 break; … … 945 945 if ((*ListRunner)->ActiveFlag) { 946 946 mol = *ListRunner; 947 Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl;948 Log() << Verbose(0) << "Enter translation vector." << endl;947 DoLog(0) && (Log() << Verbose(0) << "Current molecule is: " << mol->IndexNr << "\t" << mol->name << endl); 948 DoLog(0) && (Log() << Verbose(0) << "Enter translation vector." << endl); 949 949 x.AskPosition(World::get()->cell_size,0); 950 950 mol->Center.AddVector((const Vector *)&x); … … 974 974 molecule *mol = NULL; 975 975 976 Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl;977 Log() << Verbose(0) << "c - create new molecule" << endl;978 Log() << Verbose(0) << "l - load molecule from xyz file" << endl;979 Log() << Verbose(0) << "n - change molecule's name" << endl;980 Log() << Verbose(0) << "N - give molecules filename" << endl;981 Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl;982 Log() << Verbose(0) << "r - remove a molecule" << endl;983 Log() << Verbose(0) << "all else - go back" << endl;984 Log() << Verbose(0) << "===============================================" << endl;985 Log() << Verbose(0) << "INPUT: ";976 DoLog(0) && (Log() << Verbose(0) << "==========EDIT MOLECULES=====================" << endl); 977 DoLog(0) && (Log() << Verbose(0) << "c - create new molecule" << endl); 978 DoLog(0) && (Log() << Verbose(0) << "l - load molecule from xyz file" << endl); 979 DoLog(0) && (Log() << Verbose(0) << "n - change molecule's name" << endl); 980 DoLog(0) && (Log() << Verbose(0) << "N - give molecules filename" << endl); 981 DoLog(0) && (Log() << Verbose(0) << "p - parse atoms in xyz file into molecule" << endl); 982 DoLog(0) && (Log() << Verbose(0) << "r - remove a molecule" << endl); 983 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 984 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 985 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 986 986 cin >> choice; 987 987 988 988 switch (choice) { 989 989 default: 990 Log() << Verbose(0) << "Not a valid choice." << endl;990 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 991 991 break; 992 992 case 'c': … … 998 998 { 999 999 char filename[MAXSTRINGSIZE]; 1000 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;1000 DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl); 1001 1001 mol = new molecule(periode); 1002 1002 do { 1003 Log() << Verbose(0) << "Enter file name: ";1003 DoLog(0) && (Log() << Verbose(0) << "Enter file name: "); 1004 1004 cin >> filename; 1005 1005 } while (!mol->AddXYZFile(filename)); … … 1022 1022 char filename[MAXSTRINGSIZE]; 1023 1023 do { 1024 Log() << Verbose(0) << "Enter index of molecule: ";1024 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1025 1025 cin >> nr; 1026 1026 mol = molecules->ReturnIndex(nr); 1027 1027 } while (mol == NULL); 1028 Log() << Verbose(0) << "Enter name: ";1028 DoLog(0) && (Log() << Verbose(0) << "Enter name: "); 1029 1029 cin >> filename; 1030 1030 strcpy(mol->name, filename); … … 1036 1036 char filename[MAXSTRINGSIZE]; 1037 1037 do { 1038 Log() << Verbose(0) << "Enter index of molecule: ";1038 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1039 1039 cin >> nr; 1040 1040 mol = molecules->ReturnIndex(nr); 1041 1041 } while (mol == NULL); 1042 Log() << Verbose(0) << "Enter name: ";1042 DoLog(0) && (Log() << Verbose(0) << "Enter name: "); 1043 1043 cin >> filename; 1044 1044 mol->SetNameFromFilename(filename); … … 1051 1051 mol = NULL; 1052 1052 do { 1053 Log() << Verbose(0) << "Enter index of molecule: ";1053 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1054 1054 cin >> nr; 1055 1055 mol = molecules->ReturnIndex(nr); 1056 1056 } while (mol == NULL); 1057 Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl;1057 DoLog(0) && (Log() << Verbose(0) << "Format should be XYZ with: ShorthandOfElement\tX\tY\tZ" << endl); 1058 1058 do { 1059 Log() << Verbose(0) << "Enter file name: ";1059 DoLog(0) && (Log() << Verbose(0) << "Enter file name: "); 1060 1060 cin >> filename; 1061 1061 } while (!mol->AddXYZFile(filename)); … … 1065 1065 1066 1066 case 'r': 1067 Log() << Verbose(0) << "Enter index of molecule: ";1067 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 1068 1068 cin >> nr; 1069 1069 count = 1; … … 1088 1088 char choice; // menu choice char 1089 1089 1090 Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl;1091 Log() << Verbose(0) << "a - simple add of one molecule to another" << endl;1092 Log() << Verbose(0) << "b - count the number of bonds of two elements" << endl;1093 Log() << Verbose(0) << "B - count the number of bonds of three elements " << endl;1094 Log() << Verbose(0) << "e - embedding merge of two molecules" << endl;1095 Log() << Verbose(0) << "h - count the number of hydrogen bonds" << endl;1096 Log() << Verbose(0) << "b - count the number of hydrogen bonds" << endl;1097 Log() << Verbose(0) << "m - multi-merge of all molecules" << endl;1098 Log() << Verbose(0) << "s - scatter merge of two molecules" << endl;1099 Log() << Verbose(0) << "t - simple merge of two molecules" << endl;1100 Log() << Verbose(0) << "all else - go back" << endl;1101 Log() << Verbose(0) << "===============================================" << endl;1102 Log() << Verbose(0) << "INPUT: ";1090 DoLog(0) && (Log() << Verbose(0) << "===========MERGE MOLECULES=====================" << endl); 1091 DoLog(0) && (Log() << Verbose(0) << "a - simple add of one molecule to another" << endl); 1092 DoLog(0) && (Log() << Verbose(0) << "b - count the number of bonds of two elements" << endl); 1093 DoLog(0) && (Log() << Verbose(0) << "B - count the number of bonds of three elements " << endl); 1094 DoLog(0) && (Log() << Verbose(0) << "e - embedding merge of two molecules" << endl); 1095 DoLog(0) && (Log() << Verbose(0) << "h - count the number of hydrogen bonds" << endl); 1096 DoLog(0) && (Log() << Verbose(0) << "b - count the number of hydrogen bonds" << endl); 1097 DoLog(0) && (Log() << Verbose(0) << "m - multi-merge of all molecules" << endl); 1098 DoLog(0) && (Log() << Verbose(0) << "s - scatter merge of two molecules" << endl); 1099 DoLog(0) && (Log() << Verbose(0) << "t - simple merge of two molecules" << endl); 1100 DoLog(0) && (Log() << Verbose(0) << "all else - go back" << endl); 1101 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 1102 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 1103 1103 cin >> choice; 1104 1104 1105 1105 switch (choice) { 1106 1106 default: 1107 Log() << Verbose(0) << "Not a valid choice." << endl;1107 DoLog(0) && (Log() << Verbose(0) << "Not a valid choice." << endl); 1108 1108 break; 1109 1109 … … 1114 1114 { 1115 1115 do { 1116 Log() << Verbose(0) << "Enter index of destination molecule: ";1116 DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: "); 1117 1117 cin >> dest; 1118 1118 destmol = molecules->ReturnIndex(dest); 1119 1119 } while ((destmol == NULL) && (dest != -1)); 1120 1120 do { 1121 Log() << Verbose(0) << "Enter index of source molecule to add from: ";1121 DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to add from: "); 1122 1122 cin >> src; 1123 1123 srcmol = molecules->ReturnIndex(src); … … 1186 1186 molecule *srcmol = NULL, *destmol = NULL; 1187 1187 do { 1188 Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): ";1188 DoLog(0) && (Log() << Verbose(0) << "Enter index of matrix molecule (the variable one): "); 1189 1189 cin >> src; 1190 1190 srcmol = molecules->ReturnIndex(src); 1191 1191 } while ((srcmol == NULL) && (src != -1)); 1192 1192 do { 1193 Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): ";1193 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into (the fixed one): "); 1194 1194 cin >> dest; 1195 1195 destmol = molecules->ReturnIndex(dest); … … 1215 1215 molecule *mol = NULL; 1216 1216 do { 1217 Log() << Verbose(0) << "Enter index of molecule to merge into: ";1217 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule to merge into: "); 1218 1218 cin >> nr; 1219 1219 mol = molecules->ReturnIndex(nr); … … 1232 1232 1233 1233 case 's': 1234 Log() << Verbose(0) << "Not implemented yet." << endl;1234 DoLog(0) && (Log() << Verbose(0) << "Not implemented yet." << endl); 1235 1235 break; 1236 1236 … … 1241 1241 { 1242 1242 do { 1243 Log() << Verbose(0) << "Enter index of destination molecule: ";1243 DoLog(0) && (Log() << Verbose(0) << "Enter index of destination molecule: "); 1244 1244 cin >> dest; 1245 1245 destmol = molecules->ReturnIndex(dest); 1246 1246 } while ((destmol == NULL) && (dest != -1)); 1247 1247 do { 1248 Log() << Verbose(0) << "Enter index of source molecule to merge into: ";1248 DoLog(0) && (Log() << Verbose(0) << "Enter index of source molecule to merge into: "); 1249 1249 cin >> src; 1250 1250 srcmol = molecules->ReturnIndex(src); … … 1282 1282 1283 1283 // generate some KeySets 1284 Log() << Verbose(0) << "Generating KeySets." << endl;1284 DoLog(0) && (Log() << Verbose(0) << "Generating KeySets." << endl); 1285 1285 KeySet TestSets[mol->AtomCount+1]; 1286 1286 i=1; … … 1292 1292 i++; 1293 1293 } 1294 Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl;1294 DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in KeySets." << endl); 1295 1295 KeySetTestPair test; 1296 1296 test = TestSets[mol->AtomCount-1].insert(Walker->nr); 1297 1297 if (test.second) { 1298 Log() << Verbose(1) << "Insertion worked?!" << endl;1298 DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl); 1299 1299 } else { 1300 Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl;1300 DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*test.first) << "." << endl); 1301 1301 } 1302 1302 TestSets[mol->AtomCount].insert(mol->end->previous->nr); … … 1304 1304 1305 1305 // constructing Graph structure 1306 Log() << Verbose(0) << "Generating Subgraph class." << endl;1306 DoLog(0) && (Log() << Verbose(0) << "Generating Subgraph class." << endl); 1307 1307 Graph Subgraphs; 1308 1308 1309 1309 // insert KeySets into Subgraphs 1310 Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl;1310 DoLog(0) && (Log() << Verbose(0) << "Inserting KeySets into Subgraph class." << endl); 1311 1311 for (int j=0;j<mol->AtomCount;j++) { 1312 1312 Subgraphs.insert(GraphPair (TestSets[j],pair<int, double>(counter++, 1.))); 1313 1313 } 1314 Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl;1314 DoLog(0) && (Log() << Verbose(0) << "Testing insertion of already present item in Subgraph." << endl); 1315 1315 GraphTestPair test2; 1316 1316 test2 = Subgraphs.insert(GraphPair (TestSets[mol->AtomCount],pair<int, double>(counter++, 1.))); 1317 1317 if (test2.second) { 1318 Log() << Verbose(1) << "Insertion worked?!" << endl;1318 DoLog(1) && (Log() << Verbose(1) << "Insertion worked?!" << endl); 1319 1319 } else { 1320 Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl;1320 DoLog(1) && (Log() << Verbose(1) << "Insertion rejected: Present object is " << (*(test2.first)).second.first << "." << endl); 1321 1321 } 1322 1322 1323 1323 // show graphs 1324 Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl;1324 DoLog(0) && (Log() << Verbose(0) << "Showing Subgraph's contents, checking that it's sorted." << endl); 1325 1325 Graph::iterator A = Subgraphs.begin(); 1326 1326 while (A != Subgraphs.end()) { 1327 Log() << Verbose(0) << (*A).second.first << ": ";1327 DoLog(0) && (Log() << Verbose(0) << (*A).second.first << ": "); 1328 1328 KeySet::iterator key = (*A).first.begin(); 1329 1329 comp = -1; 1330 1330 while (key != (*A).first.end()) { 1331 1331 if ((*key) > comp) 1332 Log() << Verbose(0) << (*key) << " ";1332 DoLog(0) && (Log() << Verbose(0) << (*key) << " "); 1333 1333 else 1334 Log() << Verbose(0) << (*key) << "! ";1334 DoLog(0) && (Log() << Verbose(0) << (*key) << "! "); 1335 1335 comp = (*key); 1336 1336 key++; 1337 1337 } 1338 Log() << Verbose(0) << endl;1338 DoLog(0) && (Log() << Verbose(0) << endl); 1339 1339 A++; 1340 1340 } … … 1365 1365 if (output == NULL) 1366 1366 strcpy(filename,"main_pcp_linux"); 1367 Log() << Verbose(0) << "Saving as pdb input ";1367 DoLog(0) && (Log() << Verbose(0) << "Saving as pdb input "); 1368 1368 if (configuration->SavePDB(filename, molecules)) 1369 Log() << Verbose(0) << "done." << endl;1369 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 1370 1370 else 1371 Log() << Verbose(0) << "failed." << endl;1371 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1372 1372 1373 1373 // then save as tremolo data file … … 1376 1376 if (output == NULL) 1377 1377 strcpy(filename,"main_pcp_linux"); 1378 Log() << Verbose(0) << "Saving as tremolo data input ";1378 DoLog(0) && (Log() << Verbose(0) << "Saving as tremolo data input "); 1379 1379 if (configuration->SaveTREMOLO(filename, molecules)) 1380 Log() << Verbose(0) << "done." << endl;1380 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 1381 1381 else 1382 Log() << Verbose(0) << "failed." << endl;1382 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1383 1383 1384 1384 // translate each to its center and merge all molecules in MoleculeListClass into this molecule … … 1400 1400 } 1401 1401 1402 Log() << Verbose(0) << "Storing configuration ... " << endl;1402 DoLog(0) && (Log() << Verbose(0) << "Storing configuration ... " << endl); 1403 1403 // get correct valence orbitals 1404 1404 mol->CalculateOrbitals(*configuration); … … 1416 1416 output.close(); 1417 1417 output.clear(); 1418 Log() << Verbose(0) << "Saving of config file ";1418 DoLog(0) && (Log() << Verbose(0) << "Saving of config file "); 1419 1419 if (configuration->Save(filename, periode, mol)) 1420 Log() << Verbose(0) << "successful." << endl;1420 DoLog(0) && (Log() << Verbose(0) << "successful." << endl); 1421 1421 else 1422 Log() << Verbose(0) << "failed." << endl;1422 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1423 1423 1424 1424 // and save to xyz file … … 1433 1433 output.open(filename, ios::trunc); 1434 1434 } 1435 Log() << Verbose(0) << "Saving of XYZ file ";1435 DoLog(0) && (Log() << Verbose(0) << "Saving of XYZ file "); 1436 1436 if (mol->MDSteps <= 1) { 1437 1437 if (mol->OutputXYZ(&output)) 1438 Log() << Verbose(0) << "successful." << endl;1438 DoLog(0) && (Log() << Verbose(0) << "successful." << endl); 1439 1439 else 1440 Log() << Verbose(0) << "failed." << endl;1440 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1441 1441 } else { 1442 1442 if (mol->OutputTrajectoriesXYZ(&output)) 1443 Log() << Verbose(0) << "successful." << endl;1443 DoLog(0) && (Log() << Verbose(0) << "successful." << endl); 1444 1444 else 1445 Log() << Verbose(0) << "failed." << endl;1445 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1446 1446 } 1447 1447 output.close(); … … 1453 1453 if (output == NULL) 1454 1454 strcpy(filename,"main_pcp_linux"); 1455 Log() << Verbose(0) << "Saving as mpqc input ";1455 DoLog(0) && (Log() << Verbose(0) << "Saving as mpqc input "); 1456 1456 if (configuration->SaveMPQC(filename, mol)) 1457 Log() << Verbose(0) << "done." << endl;1457 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 1458 1458 else 1459 Log() << Verbose(0) << "failed." << endl;1459 DoLog(0) && (Log() << Verbose(0) << "failed." << endl); 1460 1460 1461 1461 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { … … 1502 1502 do { 1503 1503 if (argv[argptr][0] == '-') { 1504 Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n";1504 DoLog(0) && (Log() << Verbose(0) << "Recognized command line argument: " << argv[argptr][1] << ".\n"); 1505 1505 argptr++; 1506 1506 switch(argv[argptr-1][1]) { … … 1508 1508 case 'H': 1509 1509 case '?': 1510 Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl;1511 Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl;1512 Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl;1513 Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl;1514 Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl;1515 Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;1516 Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl;1517 Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl;1518 Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl;1519 Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl;1520 Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl;1521 Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl;1522 Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl;1523 Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl;1524 Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;1525 Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl;1526 Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl;1527 Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl;1528 Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl;1529 Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl;1530 Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl;1531 Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl;1532 Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl;1533 Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl;1534 Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl;1535 Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl;1536 Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl;1537 Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl;1538 Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl;1539 Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl;1540 Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl;1541 Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl;1542 Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl;1543 Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl;1544 Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl;1545 Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl;1546 Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl;1547 Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl;1548 Log() << Verbose(0) << "\t-V\t\tGives version information." << endl;1549 Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl;1550 Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl;1510 DoLog(0) && (Log() << Verbose(0) << "MoleCuilder suite" << endl << "==================" << endl << endl); 1511 DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << "[config file] [-{acefpsthH?vfrp}] [further arguments]" << endl); 1512 DoLog(0) && (Log() << Verbose(0) << "or simply " << argv[0] << " without arguments for interactive session." << endl); 1513 DoLog(0) && (Log() << Verbose(0) << "\t-a Z x1 x2 x3\tAdd new atom of element Z at coordinates (x1,x2,x3)." << endl); 1514 DoLog(0) && (Log() << Verbose(0) << "\t-A <source>\tCreate adjacency list from bonds parsed from 'dbond'-style file." <<endl); 1515 DoLog(0) && (Log() << Verbose(0) << "\t-b xx xy xz yy yz zz\tCenter atoms in domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl); 1516 DoLog(0) && (Log() << Verbose(0) << "\t-B xx xy xz yy yz zz\tBound atoms by domain with given symmetric matrix of (xx,xy,xz,yy,yz,zz)." << endl); 1517 DoLog(0) && (Log() << Verbose(0) << "\t-c x1 x2 x3\tCenter atoms in domain with a minimum distance to boundary of (x1,x2,x3)." << endl); 1518 DoLog(0) && (Log() << Verbose(0) << "\t-C <type> [params] <output> <bin output> <BinWidth> <BinStart> <BinEnd>\tPair Correlation analysis." << endl); 1519 DoLog(0) && (Log() << Verbose(0) << "\t-d x1 x2 x3\tDuplicate cell along each axis by given factor." << endl); 1520 DoLog(0) && (Log() << Verbose(0) << "\t-D <bond distance>\tDepth-First-Search Analysis of the molecule, giving cycles and tree/back edges." << endl); 1521 DoLog(0) && (Log() << Verbose(0) << "\t-e <file>\tSets the databases path to be parsed (default: ./)." << endl); 1522 DoLog(0) && (Log() << Verbose(0) << "\t-E <id> <Z>\tChange atom <id>'s element to <Z>, <id> begins at 0." << endl); 1523 DoLog(0) && (Log() << Verbose(0) << "\t-f <dist> <order>\tFragments the molecule in BOSSANOVA manner (with/out rings compressed) and stores config files in same dir as config (return code 0 - fragmented, 2 - no fragmentation necessary)." << endl); 1524 DoLog(0) && (Log() << Verbose(0) << "\t-F <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl); 1525 DoLog(0) && (Log() << Verbose(0) << "\t-FF <MaxDistance> <xyz of filler> <dist_x> <dist_y> <dist_z> <epsilon> <randatom> <randmol> <DoRotate>\tFilling Box with water molecules." << endl); 1526 DoLog(0) && (Log() << Verbose(0) << "\t-g <file>\tParses a bond length table from the given file." << endl); 1527 DoLog(0) && (Log() << Verbose(0) << "\t-h/-H/-?\tGive this help screen." << endl); 1528 DoLog(0) && (Log() << Verbose(0) << "\t-I\t Dissect current system of molecules into a set of disconnected (subgraphs of) molecules." << endl); 1529 DoLog(0) && (Log() << Verbose(0) << "\t-j\t<path> Store all bonds to file." << endl); 1530 DoLog(0) && (Log() << Verbose(0) << "\t-J\t<path> Store adjacency per atom to file." << endl); 1531 DoLog(0) && (Log() << Verbose(0) << "\t-L <step0> <step1> <prefix>\tStore a linear interpolation between two configurations <step0> and <step1> into single config files with prefix <prefix> and as Trajectories into the current config file." << endl); 1532 DoLog(0) && (Log() << Verbose(0) << "\t-m <0/1>\tCalculate (0)/ Align in(1) PAS with greatest EV along z axis." << endl); 1533 DoLog(0) && (Log() << Verbose(0) << "\t-M <basis>\tSetting basis to store to MPQC config files." << endl); 1534 DoLog(0) && (Log() << Verbose(0) << "\t-n\tFast parsing (i.e. no trajectories are looked for)." << endl); 1535 DoLog(0) && (Log() << Verbose(0) << "\t-N <radius> <file>\tGet non-convex-envelope." << endl); 1536 DoLog(0) && (Log() << Verbose(0) << "\t-o <out>\tGet volume of the convex envelope (and store to tecplot file)." << endl); 1537 DoLog(0) && (Log() << Verbose(0) << "\t-O\tCenter atoms in origin." << endl); 1538 DoLog(0) && (Log() << Verbose(0) << "\t-p <file>\tParse given xyz file and create raw config file from it." << endl); 1539 DoLog(0) && (Log() << Verbose(0) << "\t-P <file>\tParse given forces file and append as an MD step to config file via Verlet." << endl); 1540 DoLog(0) && (Log() << Verbose(0) << "\t-r <id>\t\tRemove an atom with given id." << endl); 1541 DoLog(0) && (Log() << Verbose(0) << "\t-R <id> <radius>\t\tRemove all atoms out of sphere around a given one." << endl); 1542 DoLog(0) && (Log() << Verbose(0) << "\t-s x1 x2 x3\tScale all atom coordinates by this vector (x1,x2,x3)." << endl); 1543 DoLog(0) && (Log() << Verbose(0) << "\t-S <file> Store temperatures from the config file in <file>." << endl); 1544 DoLog(0) && (Log() << Verbose(0) << "\t-t x1 x2 x3\tTranslate all atoms by this vector (x1,x2,x3)." << endl); 1545 DoLog(0) && (Log() << Verbose(0) << "\t-T x1 x2 x3\tTranslate periodically all atoms by this vector (x1,x2,x3)." << endl); 1546 DoLog(0) && (Log() << Verbose(0) << "\t-u rho\tsuspend in water solution and output necessary cell lengths, average density rho and repetition." << endl); 1547 DoLog(0) && (Log() << Verbose(0) << "\t-v\t\tsets verbosity (more is more)." << endl); 1548 DoLog(0) && (Log() << Verbose(0) << "\t-V\t\tGives version information." << endl); 1549 DoLog(0) && (Log() << Verbose(0) << "\t-X\t\tset default name of a molecule." << endl); 1550 DoLog(0) && (Log() << Verbose(0) << "Note: config files must not begin with '-' !" << endl); 1551 1551 return (1); 1552 1552 break; … … 1556 1556 } 1557 1557 setVerbosity(verbosity); 1558 Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl;1558 DoLog(0) && (Log() << Verbose(0) << "Setting verbosity to " << verbosity << "." << endl); 1559 1559 break; 1560 1560 case 'V': 1561 Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl;1562 Log() << Verbose(0) << "Build your own molecule position set." << endl;1561 DoLog(0) && (Log() << Verbose(0) << argv[0] << " " << VERSIONSTRING << endl); 1562 DoLog(0) && (Log() << Verbose(0) << "Build your own molecule position set." << endl); 1563 1563 return (1); 1564 1564 break; … … 1572 1572 SaveFlag = true; 1573 1573 j = -1; 1574 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;1574 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl); 1575 1575 double * const cell_size = World::get()->cell_size; 1576 1576 for (int i=0;i<6;i++) { … … 1585 1585 performCriticalExit(); 1586 1586 } else { 1587 Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl;1587 DoLog(0) && (Log() << Verbose(0) << "Using " << argv[argptr] << " as elements database." << endl); 1588 1588 strncpy (configuration.databasepath, argv[argptr], MAXSTRINGSIZE-1); 1589 1589 argptr+=1; … … 1596 1596 } else { 1597 1597 BondGraphFileName = argv[argptr]; 1598 Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl;1598 DoLog(0) && (Log() << Verbose(0) << "Using " << BondGraphFileName << " as bond length table." << endl); 1599 1599 argptr+=1; 1600 1600 } 1601 1601 break; 1602 1602 case 'n': 1603 Log() << Verbose(0) << "I won't parse trajectories." << endl;1603 DoLog(0) && (Log() << Verbose(0) << "I won't parse trajectories." << endl); 1604 1604 configuration.FastParsing = true; 1605 1605 break; … … 1611 1611 *name = new char[length+2]; 1612 1612 strncpy(*name, argv[argptr], length); 1613 Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl;1613 DoLog(0) && (Log() << Verbose(0) << "Default name of new molecules set to " << *name << "." << endl); 1614 1614 } 1615 1615 break; … … 1624 1624 // 3a. Parse the element database 1625 1625 if (periode->LoadPeriodentafel(configuration.databasepath)) { 1626 Log() << Verbose(0) << "Element list loaded successfully." << endl;1626 DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl); 1627 1627 //periode->Output(); 1628 1628 } else { 1629 Log() << Verbose(0) << "Element list loading failed." << endl;1629 DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl); 1630 1630 return 1; 1631 1631 } … … 1633 1633 if (argv[1][0] != '-') { 1634 1634 // simply create a new molecule, wherein the config file is loaded and the manipulation takes place 1635 Log() << Verbose(0) << "Config file given." << endl;1635 DoLog(0) && (Log() << Verbose(0) << "Config file given." << endl); 1636 1636 test.open(argv[1], ios::in); 1637 1637 if (test == NULL) { … … 1639 1639 output.open(argv[1], ios::out); 1640 1640 if (output == NULL) { 1641 Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl;1641 DoLog(1) && (Log() << Verbose(1) << "Specified config file " << argv[1] << " not found." << endl); 1642 1642 configPresent = absent; 1643 1643 } else { 1644 Log() << Verbose(0) << "Empty configuration file." << endl;1644 DoLog(0) && (Log() << Verbose(0) << "Empty configuration file." << endl); 1645 1645 ConfigFileName = argv[1]; 1646 1646 configPresent = empty; … … 1650 1650 test.close(); 1651 1651 ConfigFileName = argv[1]; 1652 Log() << Verbose(1) << "Specified config file found, parsing ... ";1652 DoLog(1) && (Log() << Verbose(1) << "Specified config file found, parsing ... "); 1653 1653 switch (configuration.TestSyntax(ConfigFileName, periode)) { 1654 1654 case 1: 1655 Log() << Verbose(0) << "new syntax." << endl;1655 DoLog(0) && (Log() << Verbose(0) << "new syntax." << endl); 1656 1656 configuration.Load(ConfigFileName, BondGraphFileName, periode, molecules); 1657 1657 configPresent = present; 1658 1658 break; 1659 1659 case 0: 1660 Log() << Verbose(0) << "old syntax." << endl;1660 DoLog(0) && (Log() << Verbose(0) << "old syntax." << endl); 1661 1661 configuration.LoadOld(ConfigFileName, BondGraphFileName, periode, molecules); 1662 1662 configPresent = present; 1663 1663 break; 1664 1664 default: 1665 Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl;1665 DoLog(0) && (Log() << Verbose(0) << "Unknown syntax or empty, yet present file." << endl); 1666 1666 configPresent = empty; 1667 1667 } … … 1687 1687 configuration.BG = new BondGraph(configuration.GetIsAngstroem()); 1688 1688 if ((!BondGraphFileName.empty()) && (configuration.BG->LoadBondLengthTable(BondGraphFileName))) { 1689 Log() << Verbose(0) << "Bond length table loaded successfully." << endl;1689 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 1690 1690 } else { 1691 1691 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); … … 1696 1696 argptr = 1; 1697 1697 do { 1698 Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl;1698 DoLog(0) && (Log() << Verbose(0) << "Current Command line argument: " << argv[argptr] << "." << endl); 1699 1699 if (argv[argptr][0] == '-') { 1700 1700 argptr++; … … 1709 1709 } else { 1710 1710 SaveFlag = true; 1711 Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl;1711 DoLog(1) && (Log() << Verbose(1) << "Parsing xyz file for new atoms." << endl); 1712 1712 if (!mol->AddXYZFile(argv[argptr])) 1713 Log() << Verbose(2) << "File not found." << endl;1713 DoLog(2) && (Log() << Verbose(2) << "File not found." << endl); 1714 1714 else { 1715 Log() << Verbose(2) << "File found and parsed." << endl;1715 DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl); 1716 1716 configPresent = present; 1717 1717 } … … 1726 1726 } else { 1727 1727 SaveFlag = true; 1728 Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), ";1728 DoLog(1) && (Log() << Verbose(1) << "Adding new atom with element " << argv[argptr] << " at (" << argv[argptr+1] << "," << argv[argptr+2] << "," << argv[argptr+3] << "), "); 1729 1729 first = new atom; 1730 1730 first->type = periode->FindElement(atoi(argv[argptr])); 1731 1731 if (first->type != NULL) 1732 Log() << Verbose(2) << "found element " << first->type->name << endl;1732 DoLog(2) && (Log() << Verbose(2) << "found element " << first->type->name << endl); 1733 1733 for (int i=NDIM;i--;) 1734 1734 first->x.x[i] = atof(argv[argptr+1+i]); … … 1755 1755 } else { 1756 1756 configuration.basis = argv[argptr]; 1757 Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl;1757 DoLog(1) && (Log() << Verbose(1) << "Setting MPQC basis to " << configuration.basis << "." << endl); 1758 1758 argptr+=1; 1759 1759 } … … 1762 1762 if (ExitFlag == 0) ExitFlag = 1; 1763 1763 { 1764 Log() << Verbose(1) << "Depth-First-Search Analysis." << endl;1764 DoLog(1) && (Log() << Verbose(1) << "Depth-First-Search Analysis." << endl); 1765 1765 MoleculeLeafClass *Subgraphs = NULL; // list of subgraphs from DFS analysis 1766 1766 int *MinimumRingSize = new int[mol->AtomCount]; … … 1793 1793 break; 1794 1794 case 'I': 1795 Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl;1795 DoLog(1) && (Log() << Verbose(1) << "Dissecting molecular system into a set of disconnected subgraphs ... " << endl); 1796 1796 // @TODO rather do the dissection afterwards 1797 1797 molecules->DissectMoleculeIntoConnectedSubgraphs(periode, &configuration); … … 1972 1972 } else { 1973 1973 SaveFlag = true; 1974 Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl;1974 DoLog(1) && (Log() << Verbose(1) << "Changing atom " << argv[argptr] << " to element " << argv[argptr+1] << "." << endl); 1975 1975 first = mol->FindAtom(atoi(argv[argptr])); 1976 1976 first->type = periode->FindElement(atoi(argv[argptr+1])); … … 1984 1984 // fetch first argument as max distance to surface 1985 1985 MaxDistance = atof(argv[argptr++]); 1986 Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl;1986 DoLog(0) && (Log() << Verbose(0) << "Filling with maximum layer distance of " << MaxDistance << "." << endl); 1987 1987 } 1988 1988 if ((argptr+7 >=argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+7]))) { … … 1992 1992 } else { 1993 1993 SaveFlag = true; 1994 Log() << Verbose(1) << "Filling Box with water molecules." << endl;1994 DoLog(1) && (Log() << Verbose(1) << "Filling Box with water molecules." << endl); 1995 1995 // construct water molecule 1996 1996 molecule *filler = new molecule(periode); … … 2021 2021 performCriticalExit(); 2022 2022 } else { 2023 Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl;2023 DoLog(0) && (Log() << Verbose(0) << "Parsing bonds from " << argv[argptr] << "." << endl); 2024 2024 ifstream *input = new ifstream(argv[argptr]); 2025 2025 mol->CreateAdjacencyListFromDbondFile(input); … … 2036 2036 performCriticalExit(); 2037 2037 } else { 2038 Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl;2038 DoLog(0) && (Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl); 2039 2039 configuration.BG->ConstructBondGraph(mol); 2040 2040 mol->StoreAdjacencyToFile(NULL, argv[argptr]); … … 2050 2050 performCriticalExit(); 2051 2051 } else { 2052 Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl;2052 DoLog(0) && (Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl); 2053 2053 configuration.BG->ConstructBondGraph(mol); 2054 2054 mol->StoreBondsToFile(NULL, argv[argptr]); … … 2069 2069 //string filename(argv[argptr+1]); 2070 2070 //filename.append(".csv"); 2071 Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule.";2072 Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl;2071 DoLog(0) && (Log() << Verbose(0) << "Evaluating non-convex envelope of biggest molecule."); 2072 DoLog(1) && (Log() << Verbose(1) << "Using rolling ball of radius " << atof(argv[argptr]) << " and storing tecplot data in " << argv[argptr+1] << "." << endl); 2073 2073 // find biggest molecule 2074 2074 int counter = 0; … … 2080 2080 counter++; 2081 2081 } 2082 Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl;2082 DoLog(1) && (Log() << Verbose(1) << "Biggest molecule has " << Boundary->AtomCount << " atoms." << endl); 2083 2083 start = clock(); 2084 2084 LCList = new LinkedCell(Boundary, atof(argv[argptr])*2.); … … 2087 2087 //FindDistributionOfEllipsoids(T, &LCList, N, number, filename.c_str()); 2088 2088 end = clock(); 2089 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;2089 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 2090 2090 delete(LCList); 2091 2091 delete(T); … … 2100 2100 performCriticalExit(); 2101 2101 } else { 2102 Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl;2102 DoLog(1) && (Log() << Verbose(1) << "Storing temperatures in " << argv[argptr] << "." << endl); 2103 2103 ofstream *output = new ofstream(argv[argptr], ios::trunc); 2104 2104 if (!mol->OutputTemperatureFromTrajectories(output, 0, mol->MDSteps)) 2105 Log() << Verbose(2) << "File could not be written." << endl;2105 DoLog(2) && (Log() << Verbose(2) << "File could not be written." << endl); 2106 2106 else 2107 Log() << Verbose(2) << "File stored." << endl;2107 DoLog(2) && (Log() << Verbose(2) << "File stored." << endl); 2108 2108 output->close(); 2109 2109 delete(output); … … 2119 2119 } else { 2120 2120 SaveFlag = true; 2121 Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl;2121 DoLog(1) && (Log() << Verbose(1) << "Linear interpolation between configuration " << argv[argptr] << " and " << argv[argptr+1] << "." << endl); 2122 2122 if (atoi(argv[argptr+3]) == 1) 2123 Log() << Verbose(1) << "Using Identity for the permutation map." << endl;2123 DoLog(1) && (Log() << Verbose(1) << "Using Identity for the permutation map." << endl); 2124 2124 if (!mol->LinearInterpolationBetweenConfiguration(atoi(argv[argptr]), atoi(argv[argptr+1]), argv[argptr+2], configuration, atoi(argv[argptr+3])) == 1 ? true : false) 2125 Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl;2125 DoLog(2) && (Log() << Verbose(2) << "Could not store " << argv[argptr+2] << " files." << endl); 2126 2126 else 2127 Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl;2127 DoLog(2) && (Log() << Verbose(2) << "Steps created and " << argv[argptr+2] << " files stored." << endl); 2128 2128 argptr+=4; 2129 2129 } … … 2137 2137 } else { 2138 2138 SaveFlag = true; 2139 Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl;2139 DoLog(1) && (Log() << Verbose(1) << "Parsing forces file and Verlet integrating." << endl); 2140 2140 if (!mol->VerletForceIntegration(argv[argptr], configuration)) 2141 Log() << Verbose(2) << "File not found." << endl;2141 DoLog(2) && (Log() << Verbose(2) << "File not found." << endl); 2142 2142 else 2143 Log() << Verbose(2) << "File found and parsed." << endl;2143 DoLog(2) && (Log() << Verbose(2) << "File found and parsed." << endl); 2144 2144 argptr+=1; 2145 2145 } … … 2153 2153 } else { 2154 2154 SaveFlag = true; 2155 Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl;2155 DoLog(1) && (Log() << Verbose(1) << "Removing atoms around " << argv[argptr] << " with radius " << argv[argptr+1] << "." << endl); 2156 2156 double tmp1 = atof(argv[argptr+1]); 2157 2157 atom *third = mol->FindAtom(atoi(argv[argptr])); … … 2180 2180 if (ExitFlag == 0) ExitFlag = 1; 2181 2181 SaveFlag = true; 2182 Log() << Verbose(1) << "Translating all ions by given vector." << endl;2182 DoLog(1) && (Log() << Verbose(1) << "Translating all ions by given vector." << endl); 2183 2183 for (int i=NDIM;i--;) 2184 2184 x.x[i] = atof(argv[argptr+i]); … … 2196 2196 if (ExitFlag == 0) ExitFlag = 1; 2197 2197 SaveFlag = true; 2198 Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl;2198 DoLog(1) && (Log() << Verbose(1) << "Translating all ions periodically by given vector." << endl); 2199 2199 for (int i=NDIM;i--;) 2200 2200 x.x[i] = atof(argv[argptr+i]); … … 2212 2212 SaveFlag = true; 2213 2213 j = -1; 2214 Log() << Verbose(1) << "Scaling all ion positions by factor." << endl;2214 DoLog(1) && (Log() << Verbose(1) << "Scaling all ion positions by factor." << endl); 2215 2215 factor = new double[NDIM]; 2216 2216 factor[0] = atof(argv[argptr]); … … 2237 2237 SaveFlag = true; 2238 2238 j = -1; 2239 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;2239 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl); 2240 2240 double * const cell_size = World::get()->cell_size; 2241 2241 for (int i=0;i<6;i++) { … … 2256 2256 SaveFlag = true; 2257 2257 j = -1; 2258 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl;2258 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl); 2259 2259 double * const cell_size = World::get()->cell_size; 2260 2260 for (int i=0;i<6;i++) { … … 2275 2275 SaveFlag = true; 2276 2276 j = -1; 2277 Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl;2277 DoLog(1) && (Log() << Verbose(1) << "Centering atoms in config file within given additional boundary." << endl); 2278 2278 // make every coordinate positive 2279 2279 mol->CenterEdge(&x); … … 2295 2295 if (ExitFlag == 0) ExitFlag = 1; 2296 2296 SaveFlag = true; 2297 Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl;2297 DoLog(1) && (Log() << Verbose(1) << "Centering atoms on edge and setting box dimensions." << endl); 2298 2298 x.Zero(); 2299 2299 mol->CenterEdge(&x); … … 2309 2309 } else { 2310 2310 SaveFlag = true; 2311 Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl;2311 DoLog(1) && (Log() << Verbose(1) << "Removing atom " << argv[argptr] << "." << endl); 2312 2312 atom *first = mol->FindAtom(atoi(argv[argptr])); 2313 2313 mol->RemoveAtom(first); … … 2322 2322 performCriticalExit(); 2323 2323 } else { 2324 Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl;2325 Log() << Verbose(0) << "Creating connection matrix..." << endl;2324 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with bond distance " << argv[argptr] << " angstroem, order of " << argv[argptr+1] << "." << endl); 2325 DoLog(0) && (Log() << Verbose(0) << "Creating connection matrix..." << endl); 2326 2326 start = clock(); 2327 2327 mol->CreateAdjacencyList(atof(argv[argptr++]), configuration.GetIsAngstroem(), &BondGraph::CovalentMinMaxDistance, NULL); 2328 Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl;2328 DoLog(0) && (Log() << Verbose(0) << "Fragmenting molecule with current connection matrix ..." << endl); 2329 2329 if (mol->first->next != mol->last) { 2330 2330 ExitFlag = mol->FragmentMolecule(atoi(argv[argptr]), &configuration); 2331 2331 } 2332 2332 end = clock(); 2333 Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl;2333 DoLog(0) && (Log() << Verbose(0) << "Clocks for this operation: " << (end-start) << ", time: " << ((double)(end-start)/CLOCKS_PER_SEC) << "s." << endl); 2334 2334 argptr+=2; 2335 2335 } … … 2344 2344 if (j) { 2345 2345 SaveFlag = true; 2346 Log() << Verbose(0) << "Converting to prinicipal axis system." << endl;2346 DoLog(0) && (Log() << Verbose(0) << "Converting to prinicipal axis system." << endl); 2347 2347 } else 2348 Log() << Verbose(0) << "Evaluating prinicipal axis." << endl;2348 DoLog(0) && (Log() << Verbose(0) << "Evaluating prinicipal axis." << endl); 2349 2349 mol->PrincipalAxisSystem((bool)j); 2350 2350 break; … … 2358 2358 class Tesselation *TesselStruct = NULL; 2359 2359 const LinkedCell *LCList = NULL; 2360 Log() << Verbose(0) << "Evaluating volume of the convex envelope.";2361 Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl;2362 Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl;2360 DoLog(0) && (Log() << Verbose(0) << "Evaluating volume of the convex envelope."); 2361 DoLog(1) && (Log() << Verbose(1) << "Storing tecplot convex data in " << argv[argptr] << "." << endl); 2362 DoLog(1) && (Log() << Verbose(1) << "Storing tecplot non-convex data in " << argv[argptr+1] << "." << endl); 2363 2363 LCList = new LinkedCell(mol, 10.); 2364 2364 //FindConvexBorder(mol, LCList, argv[argptr]); … … 2367 2367 double volumedifference = ConvexizeNonconvexEnvelope(TesselStruct, mol, argv[argptr]); 2368 2368 double clustervolume = VolumeOfConvexEnvelope(TesselStruct, &configuration); 2369 Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;2370 Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl;2369 DoLog(0) && (Log() << Verbose(0) << "The tesselated volume area is " << clustervolume << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl); 2370 DoLog(0) && (Log() << Verbose(0) << "The non-convex tesselated volume area is " << clustervolume-volumedifference << " " << (configuration.GetIsAngstroem() ? "angstrom" : "atomiclength") << "^3." << endl); 2371 2371 delete(TesselStruct); 2372 2372 delete(LCList); … … 2382 2382 } else { 2383 2383 volume = atof(argv[argptr++]); 2384 Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl;2384 DoLog(0) && (Log() << Verbose(0) << "Using " << volume << " angstrom^3 as the volume instead of convex envelope one's." << endl); 2385 2385 } 2386 2386 case 'u': … … 2394 2394 double density; 2395 2395 SaveFlag = true; 2396 Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water.";2396 DoLog(0) && (Log() << Verbose(0) << "Evaluating necessary cell volume for a cluster suspended in water."); 2397 2397 density = atof(argv[argptr++]); 2398 2398 if (density < 1.0) { … … 2482 2482 } else { // no arguments, hence scan the elements db 2483 2483 if (periode->LoadPeriodentafel(configuration.databasepath)) 2484 Log() << Verbose(0) << "Element list loaded successfully." << endl;2484 DoLog(0) && (Log() << Verbose(0) << "Element list loaded successfully." << endl); 2485 2485 else 2486 Log() << Verbose(0) << "Element list loading failed." << endl;2486 DoLog(0) && (Log() << Verbose(0) << "Element list loading failed." << endl); 2487 2487 configuration.RetrieveConfigPathAndName("main_pcp_linux"); 2488 2488 } … … 2508 2508 cout << ESPACKVersion << endl; 2509 2509 2510 Log() << Verbose(1) << "test" << endl;2510 DoLog(1) && (Log() << Verbose(1) << "test" << endl); 2511 2511 DoLog(3) && (Log() << Verbose(1) << "test"); 2512 2512 … … 2539 2539 double * const cell_size = World::get()->cell_size; 2540 2540 if (cell_size[0] == 0.) { 2541 Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl;2541 DoLog(0) && (Log() << Verbose(0) << "enter lower tridiagonal form of basis matrix" << endl << endl); 2542 2542 for (int i=0;i<6;i++) { 2543 Log() << Verbose(1) << "Cell size" << i << ": ";2543 DoLog(1) && (Log() << Verbose(1) << "Cell size" << i << ": "); 2544 2544 cin >> cell_size[i]; 2545 2545 } … … 2552 2552 2553 2553 // now the main construction loop 2554 Log() << Verbose(0) << endl << "Now comes the real construction..." << endl;2554 DoLog(0) && (Log() << Verbose(0) << endl << "Now comes the real construction..." << endl); 2555 2555 do { 2556 Log() << Verbose(0) << endl << endl;2557 Log() << Verbose(0) << "============Molecule list=======================" << endl;2556 DoLog(0) && (Log() << Verbose(0) << endl << endl); 2557 DoLog(0) && (Log() << Verbose(0) << "============Molecule list=======================" << endl); 2558 2558 molecules->Enumerate((ofstream *)&cout); 2559 Log() << Verbose(0) << "============Menu===============================" << endl;2560 Log() << Verbose(0) << "a - set molecule (in)active" << endl;2561 Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl;2562 Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl;2563 Log() << Verbose(0) << "M - Merge molecules" << endl;2564 Log() << Verbose(0) << "m - manipulate atoms" << endl;2565 Log() << Verbose(0) << "-----------------------------------------------" << endl;2566 Log() << Verbose(0) << "c - edit the current configuration" << endl;2567 Log() << Verbose(0) << "-----------------------------------------------" << endl;2568 Log() << Verbose(0) << "s - save current setup to config file" << endl;2569 Log() << Verbose(0) << "T - call the current test routine" << endl;2570 Log() << Verbose(0) << "q - quit" << endl;2571 Log() << Verbose(0) << "===============================================" << endl;2572 Log() << Verbose(0) << "Input: ";2559 DoLog(0) && (Log() << Verbose(0) << "============Menu===============================" << endl); 2560 DoLog(0) && (Log() << Verbose(0) << "a - set molecule (in)active" << endl); 2561 DoLog(0) && (Log() << Verbose(0) << "e - edit molecules (load, parse, save)" << endl); 2562 DoLog(0) && (Log() << Verbose(0) << "g - globally manipulate atoms in molecule" << endl); 2563 DoLog(0) && (Log() << Verbose(0) << "M - Merge molecules" << endl); 2564 DoLog(0) && (Log() << Verbose(0) << "m - manipulate atoms" << endl); 2565 DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl); 2566 DoLog(0) && (Log() << Verbose(0) << "c - edit the current configuration" << endl); 2567 DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl); 2568 DoLog(0) && (Log() << Verbose(0) << "s - save current setup to config file" << endl); 2569 DoLog(0) && (Log() << Verbose(0) << "T - call the current test routine" << endl); 2570 DoLog(0) && (Log() << Verbose(0) << "q - quit" << endl); 2571 DoLog(0) && (Log() << Verbose(0) << "===============================================" << endl); 2572 DoLog(0) && (Log() << Verbose(0) << "Input: "); 2573 2573 cin >> choice; 2574 2574 … … 2576 2576 case 'a': // (in)activate molecule 2577 2577 { 2578 Log() << Verbose(0) << "Enter index of molecule: ";2578 DoLog(0) && (Log() << Verbose(0) << "Enter index of molecule: "); 2579 2579 cin >> j; 2580 2580 for(MoleculeList::iterator ListRunner = molecules->ListOfMolecules.begin(); ListRunner != molecules->ListOfMolecules.end(); ListRunner++) … … 2622 2622 // save element data base 2623 2623 if (periode->StorePeriodentafel(configuration->databasepath)) //ElementsFileName 2624 Log() << Verbose(0) << "Saving of elements.db successful." << endl;2624 DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db successful." << endl); 2625 2625 else 2626 Log() << Verbose(0) << "Saving of elements.db failed." << endl;2626 DoLog(0) && (Log() << Verbose(0) << "Saving of elements.db failed." << endl); 2627 2627 2628 2628 delete(molecules); // also free's all molecules contained -
src/config.cpp
r6613ec ra67d19 85 85 file->clear(); 86 86 file->seekg(file_position, ios::beg); 87 Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl;87 DoLog(1) && (Log() << Verbose(1) << NoLines-1 << " lines were recognized." << endl); 88 88 89 89 // allocate buffer's 1st dimension … … 105 105 lines++; 106 106 } while((!file->eof()) && (lines < NoLines)); 107 Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl;107 DoLog(1) && (Log() << Verbose(1) << lines-1 << " lines were read into the buffer." << endl); 108 108 109 109 // close and exit … … 250 250 Thermostat = None; 251 251 } else { 252 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;252 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 253 253 Thermostat = None; 254 254 } … … 258 258 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read scaling frequency 259 259 } else { 260 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;260 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 261 261 Thermostat = None; 262 262 } … … 266 266 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, int_type, &ScaleTempStep, 1, critical); // read collision rate 267 267 } else { 268 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;268 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 269 269 Thermostat = None; 270 270 } … … 274 274 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read gamma 275 275 if (ParseForParameter(verbose,fb,"Thermostat", 0, 3, 1, double_type, &alpha, 1, optional)) { 276 Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl;276 DoLog(2) && (Log() << Verbose(2) << "Extended Stochastic Thermostat detected with interpolation coefficient " << alpha << "." << endl); 277 277 } else { 278 278 alpha = 1.; 279 279 } 280 280 } else { 281 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;281 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 282 282 Thermostat = None; 283 283 } … … 287 287 ParseForParameter(verbose,fb,"Thermostat", 0, 2, 1, double_type, &TempFrequency, 1, critical); // read \tau_T 288 288 } else { 289 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;289 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 290 290 Thermostat = None; 291 291 } … … 296 296 alpha = 0.; 297 297 } else { 298 Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl;298 DoLog(1) && (Log() << Verbose(1) << "Warning: " << ThermostatNames[0] << " thermostat not implemented, falling back to None." << endl); 299 299 Thermostat = None; 300 300 } 301 301 } else { 302 Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl;302 DoLog(1) && (Log() << Verbose(1) << " Warning: thermostat name was not understood!" << endl); 303 303 Thermostat = None; 304 304 } 305 305 } else { 306 306 if ((MaxOuterStep > 0) && (TargetTemp != 0)) 307 Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl;307 DoLog(2) && (Log() << Verbose(2) << "No thermostat chosen despite finite temperature MD, falling back to None." << endl); 308 308 Thermostat = None; 309 309 } … … 321 321 322 322 do { 323 Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl;324 Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl;325 Log() << Verbose(0) << " B - Default path (for runtime files)" << endl;326 Log() << Verbose(0) << " C - Path of pseudopotential files" << endl;327 Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl;328 Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl;329 Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl;330 Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl;331 Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl;332 Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl;333 Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl;334 Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl;335 Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl;336 Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl;337 Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl;338 Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl;339 Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl;340 Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl;341 Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl;342 Log() << Verbose(0) << " T - Output visual after ...th step" << endl;343 Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl;344 Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl;345 Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl;346 Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl;347 Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl;348 Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl;349 Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl;350 Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl;351 Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl;352 Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl;353 Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl;323 DoLog(0) && (Log() << Verbose(0) << "===========EDIT CONFIGURATION============================" << endl); 324 DoLog(0) && (Log() << Verbose(0) << " A - mainname (prefix for all runtime files)" << endl); 325 DoLog(0) && (Log() << Verbose(0) << " B - Default path (for runtime files)" << endl); 326 DoLog(0) && (Log() << Verbose(0) << " C - Path of pseudopotential files" << endl); 327 DoLog(0) && (Log() << Verbose(0) << " D - Number of coefficient sharing processes" << endl); 328 DoLog(0) && (Log() << Verbose(0) << " E - Number of wave function sharing processes" << endl); 329 DoLog(0) && (Log() << Verbose(0) << " F - 0: Don't output density for OpenDX, 1: do" << endl); 330 DoLog(0) && (Log() << Verbose(0) << " G - 0: Don't output physical data, 1: do" << endl); 331 DoLog(0) && (Log() << Verbose(0) << " H - 0: Don't output densities of each unperturbed orbital for OpenDX, 1: do" << endl); 332 DoLog(0) && (Log() << Verbose(0) << " I - 0: Don't output current density for OpenDX, 1: do" << endl); 333 DoLog(0) && (Log() << Verbose(0) << " J - 0: Don't do the full current calculation, 1: do" << endl); 334 DoLog(0) && (Log() << Verbose(0) << " K - 0: Don't do perturbation calculation to obtain susceptibility and shielding, 1: do" << endl); 335 DoLog(0) && (Log() << Verbose(0) << " L - 0: Wannier centres as calculated, 1: common centre for all, 2: unite centres according to spread, 3: cell centre, 4: shifted to nearest grid point" << endl); 336 DoLog(0) && (Log() << Verbose(0) << " M - Absolute begin of unphysical sawtooth transfer for position operator within cell" << endl); 337 DoLog(0) && (Log() << Verbose(0) << " N - (0,1,2) x,y,z-plane to do two-dimensional current vector cut" << endl); 338 DoLog(0) && (Log() << Verbose(0) << " O - Absolute position along vector cut axis for cut plane" << endl); 339 DoLog(0) && (Log() << Verbose(0) << " P - Additional Gram-Schmidt-Orthonormalization to stabilize numerics" << endl); 340 DoLog(0) && (Log() << Verbose(0) << " Q - Initial integer value of random number generator" << endl); 341 DoLog(0) && (Log() << Verbose(0) << " R - for perturbation 0, for structure optimization defines upper limit of iterations" << endl); 342 DoLog(0) && (Log() << Verbose(0) << " T - Output visual after ...th step" << endl); 343 DoLog(0) && (Log() << Verbose(0) << " U - Output source densities of wave functions after ...th step" << endl); 344 DoLog(0) && (Log() << Verbose(0) << " X - minimization iterations per wave function, if unsure leave at default value 0" << endl); 345 DoLog(0) && (Log() << Verbose(0) << " Y - tolerance value for total spread in iterative Jacobi diagonalization" << endl); 346 DoLog(0) && (Log() << Verbose(0) << " Z - Maximum number of minimization iterations" << endl); 347 DoLog(0) && (Log() << Verbose(0) << " a - Relative change in total energy to stop min. iteration" << endl); 348 DoLog(0) && (Log() << Verbose(0) << " b - Relative change in kinetic energy to stop min. iteration" << endl); 349 DoLog(0) && (Log() << Verbose(0) << " c - Check stop conditions every ..th step during min. iteration" << endl); 350 DoLog(0) && (Log() << Verbose(0) << " e - Maximum number of minimization iterations during initial level" << endl); 351 DoLog(0) && (Log() << Verbose(0) << " f - Relative change in total energy to stop min. iteration during initial level" << endl); 352 DoLog(0) && (Log() << Verbose(0) << " g - Relative change in kinetic energy to stop min. iteration during initial level" << endl); 353 DoLog(0) && (Log() << Verbose(0) << " h - Check stop conditions every ..th step during min. iteration during initial level" << endl); 354 354 // Log() << Verbose(0) << " j - six lower diagonal entries of matrix, defining the unit cell" << endl; 355 Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl;356 Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl;357 Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl;358 Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl;359 Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl;360 Log() << Verbose(0) << " p - Number of Riemann levels" << endl;361 Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl;362 Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl;363 Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl;364 Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl;365 Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl;366 Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl;367 Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl;368 Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl;369 Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl;370 Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl;371 Log() << Verbose(0) << "=========================================================" << endl;372 Log() << Verbose(0) << "INPUT: ";355 DoLog(0) && (Log() << Verbose(0) << " k - Energy cutoff of plane wave basis in Hartree" << endl); 356 DoLog(0) && (Log() << Verbose(0) << " l - Maximum number of levels in multi-level-ansatz" << endl); 357 DoLog(0) && (Log() << Verbose(0) << " m - Factor by which grid nodes increase between standard and upper level" << endl); 358 DoLog(0) && (Log() << Verbose(0) << " n - 0: Don't use RiemannTensor, 1: Do" << endl); 359 DoLog(0) && (Log() << Verbose(0) << " o - Factor by which grid nodes increase between Riemann and standard(?) level" << endl); 360 DoLog(0) && (Log() << Verbose(0) << " p - Number of Riemann levels" << endl); 361 DoLog(0) && (Log() << Verbose(0) << " r - 0: Don't Use RiemannTensor, 1: Do" << endl); 362 DoLog(0) && (Log() << Verbose(0) << " s - 0: Doubly occupied orbitals, 1: Up-/Down-Orbitals" << endl); 363 DoLog(0) && (Log() << Verbose(0) << " t - Number of orbitals (depends pn SpinType)" << endl); 364 DoLog(0) && (Log() << Verbose(0) << " u - Number of SpinUp orbitals (depends on SpinType)" << endl); 365 DoLog(0) && (Log() << Verbose(0) << " v - Number of SpinDown orbitals (depends on SpinType)" << endl); 366 DoLog(0) && (Log() << Verbose(0) << " w - Number of additional, unoccupied orbitals" << endl); 367 DoLog(0) && (Log() << Verbose(0) << " x - radial cutoff for ewald summation in Bohrradii" << endl); 368 DoLog(0) && (Log() << Verbose(0) << " y - 0: Don't do structure optimization beforehand, 1: Do" << endl); 369 DoLog(0) && (Log() << Verbose(0) << " z - 0: Units are in Bohr radii, 1: units are in Aengstrom" << endl); 370 DoLog(0) && (Log() << Verbose(0) << " i - 0: Coordinates given in file are absolute, 1: ... are relative to unit cell" << endl); 371 DoLog(0) && (Log() << Verbose(0) << "=========================================================" << endl); 372 DoLog(0) && (Log() << Verbose(0) << "INPUT: "); 373 373 cin >> choice; 374 374 375 375 switch (choice) { 376 376 case 'A': // mainname 377 Log() << Verbose(0) << "Old: " << config::mainname << "\t new: ";377 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::mainname << "\t new: "); 378 378 cin >> config::mainname; 379 379 break; 380 380 case 'B': // defaultpath 381 Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: ";381 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::defaultpath << "\t new: "); 382 382 cin >> config::defaultpath; 383 383 break; 384 384 case 'C': // pseudopotpath 385 Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: ";385 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::pseudopotpath << "\t new: "); 386 386 cin >> config::pseudopotpath; 387 387 break; 388 388 389 389 case 'D': // ProcPEGamma 390 Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: ";390 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEGamma << "\t new: "); 391 391 cin >> config::ProcPEGamma; 392 392 break; 393 393 case 'E': // ProcPEPsi 394 Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: ";394 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ProcPEPsi << "\t new: "); 395 395 cin >> config::ProcPEPsi; 396 396 break; 397 397 case 'F': // DoOutVis 398 Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: ";398 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutVis << "\t new: "); 399 399 cin >> config::DoOutVis; 400 400 break; 401 401 case 'G': // DoOutMes 402 Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: ";402 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutMes << "\t new: "); 403 403 cin >> config::DoOutMes; 404 404 break; 405 405 case 'H': // DoOutOrbitals 406 Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: ";406 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutOrbitals << "\t new: "); 407 407 cin >> config::DoOutOrbitals; 408 408 break; 409 409 case 'I': // DoOutCurrent 410 Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: ";410 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoOutCurrent << "\t new: "); 411 411 cin >> config::DoOutCurrent; 412 412 break; 413 413 case 'J': // DoFullCurrent 414 Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: ";414 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoFullCurrent << "\t new: "); 415 415 cin >> config::DoFullCurrent; 416 416 break; 417 417 case 'K': // DoPerturbation 418 Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: ";418 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::DoPerturbation << "\t new: "); 419 419 cin >> config::DoPerturbation; 420 420 break; 421 421 case 'L': // CommonWannier 422 Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: ";422 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::CommonWannier << "\t new: "); 423 423 cin >> config::CommonWannier; 424 424 break; 425 425 case 'M': // SawtoothStart 426 Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: ";426 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::SawtoothStart << "\t new: "); 427 427 cin >> config::SawtoothStart; 428 428 break; 429 429 case 'N': // VectorPlane 430 Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: ";430 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorPlane << "\t new: "); 431 431 cin >> config::VectorPlane; 432 432 break; 433 433 case 'O': // VectorCut 434 Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: ";434 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::VectorCut << "\t new: "); 435 435 cin >> config::VectorCut; 436 436 break; 437 437 case 'P': // UseAddGramSch 438 Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: ";438 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::UseAddGramSch << "\t new: "); 439 439 cin >> config::UseAddGramSch; 440 440 break; 441 441 case 'Q': // Seed 442 Log() << Verbose(0) << "Old: " << config::Seed << "\t new: ";442 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Seed << "\t new: "); 443 443 cin >> config::Seed; 444 444 break; 445 445 446 446 case 'R': // MaxOuterStep 447 Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: ";447 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxOuterStep << "\t new: "); 448 448 cin >> config::MaxOuterStep; 449 449 break; 450 450 case 'T': // OutVisStep 451 Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: ";451 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutVisStep << "\t new: "); 452 452 cin >> config::OutVisStep; 453 453 break; 454 454 case 'U': // OutSrcStep 455 Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: ";455 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::OutSrcStep << "\t new: "); 456 456 cin >> config::OutSrcStep; 457 457 break; 458 458 case 'X': // MaxPsiStep 459 Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: ";459 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiStep << "\t new: "); 460 460 cin >> config::MaxPsiStep; 461 461 break; 462 462 case 'Y': // EpsWannier 463 Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: ";463 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::EpsWannier << "\t new: "); 464 464 cin >> config::EpsWannier; 465 465 break; 466 466 467 467 case 'Z': // MaxMinStep 468 Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: ";468 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStep << "\t new: "); 469 469 cin >> config::MaxMinStep; 470 470 break; 471 471 case 'a': // RelEpsTotalEnergy 472 Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: ";472 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsTotalEnergy << "\t new: "); 473 473 cin >> config::RelEpsTotalEnergy; 474 474 break; 475 475 case 'b': // RelEpsKineticEnergy 476 Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: ";476 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelEpsKineticEnergy << "\t new: "); 477 477 cin >> config::RelEpsKineticEnergy; 478 478 break; 479 479 case 'c': // MaxMinStopStep 480 Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: ";480 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxMinStopStep << "\t new: "); 481 481 cin >> config::MaxMinStopStep; 482 482 break; 483 483 case 'e': // MaxInitMinStep 484 Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: ";484 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxInitMinStep << "\t new: "); 485 485 cin >> config::MaxInitMinStep; 486 486 break; 487 487 case 'f': // InitRelEpsTotalEnergy 488 Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: ";488 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsTotalEnergy << "\t new: "); 489 489 cin >> config::InitRelEpsTotalEnergy; 490 490 break; 491 491 case 'g': // InitRelEpsKineticEnergy 492 Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: ";492 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitRelEpsKineticEnergy << "\t new: "); 493 493 cin >> config::InitRelEpsKineticEnergy; 494 494 break; 495 495 case 'h': // InitMaxMinStopStep 496 Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: ";496 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::InitMaxMinStopStep << "\t new: "); 497 497 cin >> config::InitMaxMinStopStep; 498 498 break; … … 508 508 509 509 case 'k': // ECut 510 Log() << Verbose(0) << "Old: " << config::ECut << "\t new: ";510 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::ECut << "\t new: "); 511 511 cin >> config::ECut; 512 512 break; 513 513 case 'l': // MaxLevel 514 Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: ";514 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxLevel << "\t new: "); 515 515 cin >> config::MaxLevel; 516 516 break; 517 517 case 'm': // RiemannTensor 518 Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: ";518 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannTensor << "\t new: "); 519 519 cin >> config::RiemannTensor; 520 520 break; 521 521 case 'n': // LevRFactor 522 Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: ";522 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::LevRFactor << "\t new: "); 523 523 cin >> config::LevRFactor; 524 524 break; 525 525 case 'o': // RiemannLevel 526 Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: ";526 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RiemannLevel << "\t new: "); 527 527 cin >> config::RiemannLevel; 528 528 break; 529 529 case 'p': // Lev0Factor 530 Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: ";530 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::Lev0Factor << "\t new: "); 531 531 cin >> config::Lev0Factor; 532 532 break; 533 533 case 'r': // RTActualUse 534 Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: ";534 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RTActualUse << "\t new: "); 535 535 cin >> config::RTActualUse; 536 536 break; 537 537 case 's': // PsiType 538 Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: ";538 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiType << "\t new: "); 539 539 cin >> config::PsiType; 540 540 break; 541 541 case 't': // MaxPsiDouble 542 Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: ";542 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::MaxPsiDouble << "\t new: "); 543 543 cin >> config::MaxPsiDouble; 544 544 break; 545 545 case 'u': // PsiMaxNoUp 546 Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: ";546 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoUp << "\t new: "); 547 547 cin >> config::PsiMaxNoUp; 548 548 break; 549 549 case 'v': // PsiMaxNoDown 550 Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: ";550 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::PsiMaxNoDown << "\t new: "); 551 551 cin >> config::PsiMaxNoDown; 552 552 break; 553 553 case 'w': // AddPsis 554 Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: ";554 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::AddPsis << "\t new: "); 555 555 cin >> config::AddPsis; 556 556 break; 557 557 558 558 case 'x': // RCut 559 Log() << Verbose(0) << "Old: " << config::RCut << "\t new: ";559 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RCut << "\t new: "); 560 560 cin >> config::RCut; 561 561 break; 562 562 case 'y': // StructOpt 563 Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: ";563 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::StructOpt << "\t new: "); 564 564 cin >> config::StructOpt; 565 565 break; 566 566 case 'z': // IsAngstroem 567 Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: ";567 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::IsAngstroem << "\t new: "); 568 568 cin >> config::IsAngstroem; 569 569 break; 570 570 case 'i': // RelativeCoord 571 Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: ";571 DoLog(0) && (Log() << Verbose(0) << "Old: " << config::RelativeCoord << "\t new: "); 572 572 cin >> config::RelativeCoord; 573 573 break; … … 648 648 } 649 649 strcpy(configname, ptr); 650 Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl;650 DoLog(0) && (Log() << Verbose(0) << "Found configpath: " << configpath << ", dir slash was found at " << last << ", config name is " << configname << "." << endl); 651 651 delete[](buffer); 652 652 }; … … 695 695 } else { 696 696 // prescan number of ions per type 697 Log() << Verbose(0) << "Prescanning ions per type: " << endl;697 DoLog(0) && (Log() << Verbose(0) << "Prescanning ions per type: " << endl); 698 698 int NoAtoms = 0; 699 699 for (int i=0; i < MaxTypes; i++) { … … 702 702 ParseForParameter(verbose,FileBuffer, name, 0, 2, 1, int_type, &Z, 1, critical); 703 703 elementhash[i] = periode->FindElement(Z); 704 Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl;704 DoLog(1) && (Log() << Verbose(1) << i << ". Z = " << elementhash[i]->Z << " with " << No[i] << " ions." << endl); 705 705 NoAtoms += No[i]; 706 706 } … … 728 728 bool status = true; 729 729 while (status) { 730 Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl;730 DoLog(0) && (Log() << Verbose(0) << "Currently parsing MD step " << repetition << "." << endl); 731 731 for (int i=0; i < MaxTypes; i++) { 732 732 sprintf(name,"Ion_Type%i",i+1); … … 794 794 } 795 795 repetition--; 796 Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl;796 DoLog(0) && (Log() << Verbose(0) << "Found " << repetition << " trajectory steps." << endl); 797 797 if (repetition <= 1) // if onyl one step, desactivate use of trajectories 798 798 mol->MDSteps = 0; … … 806 806 ParseForParameter(verbose,FileBuffer, "Ion_Type1_1", 0, 3, 1, double_type, &value[2], repetition, (repetition == 0) ? critical : optional)) 807 807 repetition++; 808 Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl;808 DoLog(0) && (Log() << Verbose(0) << "I found " << repetition << " times the keyword Ion_Type1_1." << endl); 809 809 // parse in molecule coordinates 810 810 for (int i=0; i < MaxTypes; i++) { … … 1063 1063 BG = new BondGraph(IsAngstroem); 1064 1064 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1065 Log() << Verbose(0) << "Bond length table loaded successfully." << endl;1065 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 1066 1066 } else { 1067 1067 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); … … 1254 1254 BG = new BondGraph(IsAngstroem); 1255 1255 if (BG->LoadBondLengthTable(BondGraphFileName)) { 1256 Log() << Verbose(0) << "Bond length table loaded successfully." << endl;1256 DoLog(0) && (Log() << Verbose(0) << "Bond length table loaded successfully." << endl); 1257 1257 } else { 1258 Log() << Verbose(0) << "Bond length table loading failed." << endl;1258 DoLog(0) && (Log() << Verbose(0) << "Bond length table loading failed." << endl); 1259 1259 } 1260 1260 … … 1263 1263 for (i=MAX_ELEMENTS;i--;) 1264 1264 elementhash[i] = NULL; 1265 Log() << Verbose(0) << "Parsing Ions ..." << endl;1265 DoLog(0) && (Log() << Verbose(0) << "Parsing Ions ..." << endl); 1266 1266 No=0; 1267 1267 found = 0; 1268 1268 while (getline(*file,zeile,'\n')) { 1269 1269 if (zeile.find("Ions_Data") == 0) { 1270 Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl;1270 DoLog(1) && (Log() << Verbose(1) << "found Ions_Data...begin parsing" << endl); 1271 1271 found ++; 1272 1272 } … … 1282 1282 input >> b; // element mass 1283 1283 elementhash[No] = periode->FindElement(Z); 1284 Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:" << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl;1284 DoLog(1) && (Log() << Verbose(1) << "AtomNo: " << AtomNo << "\tZ: " << Z << "\ta:" << a << "\tl:" << l << "\b:" << b << "\tElement:" << elementhash[No] << "\t:" << endl); 1285 1285 for(i=0;i<AtomNo;i++) { 1286 1286 if (!getline(*file,zeile,'\n')) {// parse on and on 1287 Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl;1287 DoLog(2) && (Log() << Verbose(2) << "Error: Too few items in ionic list of element" << elementhash[No] << "." << endl << "Exiting." << endl); 1288 1288 // return 1; 1289 1289 } else { -
src/datacreator.cpp
r6613ec ra67d19 25 25 output.open(name.str().c_str(), ios::out); 26 26 if (output == NULL) { 27 Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl;27 DoLog(0) && (Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl); 28 28 return false; 29 29 } … … 43 43 output.open(name.str().c_str(), ios::app); 44 44 if (output == NULL) { 45 Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl;45 DoLog(0) && (Log() << Verbose(0) << "Unable to open " << name.str() << " for writing, is directory correct?" << endl); 46 46 return false; 47 47 } … … 63 63 filename << prefix << ".dat"; 64 64 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 65 Log() << Verbose(0) << msg << endl;65 DoLog(0) && (Log() << Verbose(0) << msg << endl); 66 66 output << "# " << msg << ", created on " << datum; 67 67 output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; … … 96 96 filename << prefix << ".dat"; 97 97 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 98 Log() << Verbose(0) << msg << endl;98 DoLog(0) && (Log() << Verbose(0) << msg << endl); 99 99 output << "# " << msg << ", created on " << datum; 100 100 output << "#Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; … … 133 133 filename << prefix << ".dat"; 134 134 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 135 Log() << Verbose(0) << msg << endl;135 DoLog(0) && (Log() << Verbose(0) << msg << endl); 136 136 output << "# " << msg << ", created on " << datum; 137 137 output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; … … 165 165 filename << prefix << ".dat"; 166 166 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 167 Log() << Verbose(0) << msg << endl;167 DoLog(0) && (Log() << Verbose(0) << msg << endl); 168 168 output << "# " << msg << ", created on " << datum; 169 169 output << "# Order\tFrag.No.\t" << Fragments.Header[Fragments.MatrixCounter] << endl; … … 198 198 filename << prefix << ".dat"; 199 199 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 200 Log() << Verbose(0) << msg << endl;200 DoLog(0) && (Log() << Verbose(0) << msg << endl); 201 201 output << "# " << msg << ", created on " << datum; 202 202 output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl; … … 244 244 filename << prefix << ".dat"; 245 245 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 246 Log() << Verbose(0) << msg << endl;246 DoLog(0) && (Log() << Verbose(0) << msg << endl); 247 247 output << "# " << msg << ", created on " << datum; 248 248 output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl; … … 281 281 filename << prefix << ".dat"; 282 282 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 283 Log() << Verbose(0) << msg << endl;283 DoLog(0) && (Log() << Verbose(0) << msg << endl); 284 284 output << "# " << msg << ", created on " << datum; 285 285 output << "# AtomNo\t" << Fragments.Header[Fragments.MatrixCounter] << endl; … … 321 321 filename << prefix << ".dat"; 322 322 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 323 Log() << Verbose(0) << msg << endl;323 DoLog(0) && (Log() << Verbose(0) << msg << endl); 324 324 output << "# " << msg << ", created on " << datum; 325 325 output << "# AtomNo\t"; … … 363 363 filename << prefix << ".dat"; 364 364 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 365 Log() << Verbose(0) << msg << endl;365 DoLog(0) && (Log() << Verbose(0) << msg << endl); 366 366 output << "# " << msg << ", created on " << datum; 367 367 output << "# AtomNo\t" << Fragments.Header[ Fragments.MatrixCounter ] << endl; … … 393 393 filename << prefix << ".dat"; 394 394 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 395 Log() << Verbose(0) << msg << endl;395 DoLog(0) && (Log() << Verbose(0) << msg << endl); 396 396 output << "# " << msg << ", created on " << datum << endl; 397 397 output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl; … … 458 458 filename << prefix << ".dat"; 459 459 if (!OpenOutputFile(output, dir, filename.str().c_str())) return false; 460 Log() << Verbose(0) << msg << endl;460 DoLog(0) && (Log() << Verbose(0) << msg << endl); 461 461 output << "# " << msg << ", created on " << datum; 462 462 output << "#Order\tFrag.No.\t" << Fragment.Header[ Fragment.MatrixCounter ] << endl; -
src/ellipsoid.cpp
r6613ec ra67d19 146 146 { 147 147 int status = GSL_SUCCESS; 148 Log() << Verbose(2) << "Begin of FitPointSetToEllipsoid " << endl;148 DoLog(2) && (Log() << Verbose(2) << "Begin of FitPointSetToEllipsoid " << endl); 149 149 if (N >= 3) { // check that enough points are given (9 d.o.f.) 150 150 struct EllipsoidMinimisation par; … … 199 199 EllipsoidAngle[i] = gsl_vector_get (s->x, i+6); 200 200 } 201 Log() << Verbose(4) << setprecision(3) << "Converged fit at: " << *EllipsoidCenter << ", lengths " << EllipsoidLength[0] << ", " << EllipsoidLength[1] << ", " << EllipsoidLength[2] << ", angles " << EllipsoidAngle[0] << ", " << EllipsoidAngle[1] << ", " << EllipsoidAngle[2] << " with summed distance " << s->fval << "." << endl;201 DoLog(4) && (Log() << Verbose(4) << setprecision(3) << "Converged fit at: " << *EllipsoidCenter << ", lengths " << EllipsoidLength[0] << ", " << EllipsoidLength[1] << ", " << EllipsoidLength[2] << ", angles " << EllipsoidAngle[0] << ", " << EllipsoidAngle[1] << ", " << EllipsoidAngle[2] << " with summed distance " << s->fval << "." << endl); 202 202 } 203 203 … … 209 209 210 210 } else { 211 Log() << Verbose(3) << "Not enough points provided for fit to ellipsoid." << endl;211 DoLog(3) && (Log() << Verbose(3) << "Not enough points provided for fit to ellipsoid." << endl); 212 212 return false; 213 213 } 214 Log() << Verbose(2) << "End of FitPointSetToEllipsoid" << endl;214 DoLog(2) && (Log() << Verbose(2) << "End of FitPointSetToEllipsoid" << endl); 215 215 if (status == GSL_SUCCESS) 216 216 return true; … … 235 235 int index; 236 236 TesselPoint *Candidate = NULL; 237 Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl;237 DoLog(2) && (Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl); 238 238 239 239 // allocate array … … 247 247 for(int i=0;i<NDIM;i++) // pick three random indices 248 248 LC->n[i] = (rand() % LC->N[i]); 249 Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... ";249 DoLog(2) && (Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... "); 250 250 // get random cell 251 251 const LinkedCell::LinkedNodes *List = LC->GetCurrentCell(); … … 253 253 continue; 254 254 } 255 Log() << Verbose(2) << "with No. " << LC->index << "." << endl;256 257 Log() << Verbose(2) << "LC Intervals:";255 DoLog(2) && (Log() << Verbose(2) << "with No. " << LC->index << "." << endl); 256 257 DoLog(2) && (Log() << Verbose(2) << "LC Intervals:"); 258 258 for (int i=0;i<NDIM;i++) { 259 259 Nlower[i] = ((LC->n[i]-1) >= 0) ? LC->n[i]-1 : 0; 260 260 Nupper[i] = ((LC->n[i]+1) < LC->N[i]) ? LC->n[i]+1 : LC->N[i]-1; 261 Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] ";262 } 263 Log() << Verbose(0) << endl;261 DoLog(0) && (Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] "); 262 } 263 DoLog(0) && (Log() << Verbose(0) << endl); 264 264 265 265 // count whether there are sufficient atoms in this cell+neighbors … … 271 271 PointsLeft += List->size(); 272 272 } 273 Log() << Verbose(2) << "There are " << PointsLeft << " atoms in this neighbourhood." << endl;273 DoLog(2) && (Log() << Verbose(2) << "There are " << PointsLeft << " atoms in this neighbourhood." << endl); 274 274 if (PointsLeft < PointsToPick) { // ensure that we can pick enough points in its neighbourhood at all. 275 275 continue; … … 303 303 if ((current != PickedAtomNrs.end()) && (*current == index)) { 304 304 Candidate = (*Runner); 305 Log() << Verbose(2) << "Current picked node is " << **Runner << " with index " << index << "." << endl;305 DoLog(2) && (Log() << Verbose(2) << "Current picked node is " << **Runner << " with index " << index << "." << endl); 306 306 x[PointsPicked++].CopyVector(Candidate->node); // we have one more atom picked 307 307 current++; // next pre-picked atom … … 313 313 } 314 314 } 315 Log() << Verbose(2) << "The following points were picked: " << endl;315 DoLog(2) && (Log() << Verbose(2) << "The following points were picked: " << endl); 316 316 for (size_t i=0;i<PointsPicked;i++) 317 Log() << Verbose(2) << x[i] << endl;317 DoLog(2) && (Log() << Verbose(2) << x[i] << endl); 318 318 if (PointsPicked == PointsToPick) // break out of loop if we have all 319 319 break; 320 320 } while(1); 321 321 322 Log() << Verbose(2) << "End of PickRandomPointSet" << endl;322 DoLog(2) && (Log() << Verbose(2) << "End of PickRandomPointSet" << endl); 323 323 }; 324 324 … … 335 335 double value, threshold; 336 336 PointMap *List = &T->PointsOnBoundary; 337 Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl;337 DoLog(2) && (Log() << Verbose(2) << "Begin of PickRandomPointSet" << endl); 338 338 339 339 // allocate array … … 358 358 PointsLeft--; 359 359 } 360 Log() << Verbose(2) << "The following points were picked: " << endl;360 DoLog(2) && (Log() << Verbose(2) << "The following points were picked: " << endl); 361 361 for (size_t i=0;i<PointsPicked;i++) 362 Log() << Verbose(3) << x[i] << endl;363 364 Log() << Verbose(2) << "End of PickRandomPointSet" << endl;362 DoLog(3) && (Log() << Verbose(3) << x[i] << endl); 363 364 DoLog(2) && (Log() << Verbose(2) << "End of PickRandomPointSet" << endl); 365 365 }; 366 366 … … 382 382 double EllipsoidAngle[3]; 383 383 double distance, MaxDistance, MinDistance; 384 Log() << Verbose(0) << "Begin of FindDistributionOfEllipsoids" << endl;384 DoLog(0) && (Log() << Verbose(0) << "Begin of FindDistributionOfEllipsoids" << endl); 385 385 386 386 // construct center of gravity of boundary point set for initial ellipsoid center … … 389 389 Center.AddVector(Runner->second->node->node); 390 390 Center.Scale(1./T->PointsOnBoundaryCount); 391 Log() << Verbose(1) << "Center is at " << Center << "." << endl;391 DoLog(1) && (Log() << Verbose(1) << "Center is at " << Center << "." << endl); 392 392 393 393 // Output header … … 397 397 // loop over desired number of parameter sets 398 398 for (;number >0;number--) { 399 Log() << Verbose(1) << "Determining data set " << number << " ... " << endl;399 DoLog(1) && (Log() << Verbose(1) << "Determining data set " << number << " ... " << endl); 400 400 // pick the point set 401 401 x = NULL; … … 423 423 // fit the parameters 424 424 if (FitPointSetToEllipsoid(x, N, &EllipsoidCenter, &EllipsoidLength[0], &EllipsoidAngle[0])) { 425 Log() << Verbose(1) << "Picking succeeded!" << endl;425 DoLog(1) && (Log() << Verbose(1) << "Picking succeeded!" << endl); 426 426 // output obtained parameter set 427 427 output << number << "\t"; … … 434 434 output << endl; 435 435 } else { // increase N to pick one more 436 Log() << Verbose(1) << "Picking failed!" << endl;436 DoLog(1) && (Log() << Verbose(1) << "Picking failed!" << endl); 437 437 number++; 438 438 } … … 442 442 output.close(); 443 443 444 Log() << Verbose(0) << "End of FindDistributionOfEllipsoids" << endl;445 }; 444 DoLog(0) && (Log() << Verbose(0) << "End of FindDistributionOfEllipsoids" << endl); 445 }; -
src/graph.cpp
r6613ec ra67d19 85 85 testGraphInsert = Fragment->Leaflet->insert(GraphPair (*Fragment->FragmentSet,pair<int,double>(Fragment->FragmentCounter,Fragment->TEFactor))); // store fragment number and current factor 86 86 if (testGraphInsert.second) { 87 Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " successfully inserted." << endl;87 DoLog(2) && (Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " successfully inserted." << endl); 88 88 Fragment->FragmentCounter++; 89 89 } else { 90 Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;90 DoLog(2) && (Log() << Verbose(2) << "KeySet " << Fragment->FragmentCounter << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl); 91 91 ((*(testGraphInsert.first)).second).second += Fragment->TEFactor; // increase the "created" counter 92 Log() << Verbose(2) << "New factor is " << ((*(testGraphInsert.first)).second).second << "." << endl;92 DoLog(2) && (Log() << Verbose(2) << "New factor is " << ((*(testGraphInsert.first)).second).second << "." << endl); 93 93 } 94 94 }; … … 115 115 testGraphInsert = graph1.insert(GraphPair ((*runner).first,pair<int,double>((*counter)++,((*runner).second).second))); // store fragment number and current factor 116 116 if (testGraphInsert.second) { 117 Log() << Verbose(2) << "KeySet " << (*counter)-1 << " successfully inserted." << endl;117 DoLog(2) && (Log() << Verbose(2) << "KeySet " << (*counter)-1 << " successfully inserted." << endl); 118 118 } else { 119 Log() << Verbose(2) << "KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl;119 DoLog(2) && (Log() << Verbose(2) << "KeySet " << (*counter)-1 << " failed to insert, present fragment is " << ((*(testGraphInsert.first)).second).first << endl); 120 120 ((*(testGraphInsert.first)).second).second += (*runner).second.second; 121 Log() << Verbose(2) << "New factor is " << (*(testGraphInsert.first)).second.second << "." << endl;121 DoLog(2) && (Log() << Verbose(2) << "New factor is " << (*(testGraphInsert.first)).second.second << "." << endl); 122 122 } 123 123 } -
src/helpers.cpp
r6613ec ra67d19 19 19 double test = 0.1439851348959832147598734598273456723948652983045928346598365; 20 20 do { 21 Log() << Verbose(0) << text;21 DoLog(0) && (Log() << Verbose(0) << text); 22 22 cin >> test; 23 23 } while (test == 0.1439851348959832147598734598273456723948652983045928346598365); -
src/helpers.hpp
r6613ec ra67d19 114 114 115 115 if (LookupTable != NULL) { 116 Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl;116 DoLog(0) && (Log() << Verbose(0) << "Pointer for Lookup table is not NULL! Aborting ..." <<endl); 117 117 return false; 118 118 } … … 127 127 } 128 128 if (count <= 0) { 129 Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl;129 DoLog(0) && (Log() << Verbose(0) << "Count of lookup list is 0 or less." << endl); 130 130 return false; 131 131 } … … 146 146 LookupTable[AtomNo] = Walker; 147 147 } else { 148 Log() << Verbose(0) << "Walker " << *Walker << " exceeded range of nuclear ids [0, " << count << ")." << endl;148 DoLog(0) && (Log() << Verbose(0) << "Walker " << *Walker << " exceeded range of nuclear ids [0, " << count << ")." << endl); 149 149 status = false; 150 150 break; -
src/info.cpp
r6613ec ra67d19 21 21 verbosity++; 22 22 FunctionName = msg; 23 Log() << Verbose(0) << "Begin of " << FunctionName << endl;23 DoLog(0) && (Log() << Verbose(0) << "Begin of " << FunctionName << endl); 24 24 }; 25 25 … … 28 28 */ 29 29 Info::~Info() { 30 Log() << Verbose(0) << "End of " << FunctionName << endl;30 DoLog(0) && (Log() << Verbose(0) << "End of " << FunctionName << endl); 31 31 verbosity--; 32 32 } -
src/joiner.cpp
r6613ec ra67d19 47 47 bool NoHessian = false; 48 48 49 Log() << Verbose(0) << "Joiner" << endl;50 Log() << Verbose(0) << "======" << endl;49 DoLog(0) && (Log() << Verbose(0) << "Joiner" << endl); 50 DoLog(0) && (Log() << Verbose(0) << "======" << endl); 51 51 52 52 // Get the command line options 53 53 if (argc < 3) { 54 Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> [elementsdb]" << endl;55 Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl;56 Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl;57 Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl;54 DoLog(0) && (Log() << Verbose(0) << "Usage: " << argv[0] << " <inputdir> <prefix> [elementsdb]" << endl); 55 DoLog(0) && (Log() << Verbose(0) << "<inputdir>\ttherein the output of a molecuilder fragmentation is expected, each fragment with a subdir containing an energy.all and a forces.all file." << endl); 56 DoLog(0) && (Log() << Verbose(0) << "<prefix>\tprefix of energy and forces file." << endl); 57 DoLog(0) && (Log() << Verbose(0) << "[elementsdb]\tpath to elements database, needed for shieldings." << endl); 58 58 return 1; 59 59 } else { … … 77 77 if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX, 0,0)) { 78 78 NoHCorrection = true; 79 Log() << Verbose(0) << "No HCorrection matrices found, skipping these." << endl;79 DoLog(0) && (Log() << Verbose(0) << "No HCorrection matrices found, skipping these." << endl); 80 80 } 81 81 if (!Force.ParseFragmentMatrix(argv[1], dir, ForcesSuffix, 0,0)) return 1; 82 82 if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix, 0,0)) { 83 83 NoHessian = true; 84 Log() << Verbose(0) << "No hessian matrices found, skipping these." << endl;84 DoLog(0) && (Log() << Verbose(0) << "No hessian matrices found, skipping these." << endl); 85 85 } 86 86 if (periode != NULL) { // also look for PAS values … … 146 146 for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) { 147 147 // --------- sum up energy -------------------- 148 Log() << Verbose(0) << "Summing energy of order " << BondOrder+1 << " ..." << endl;148 DoLog(0) && (Log() << Verbose(0) << "Summing energy of order " << BondOrder+1 << " ..." << endl); 149 149 if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return 1; 150 150 if (!NoHCorrection) { … … 155 155 if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return 1; 156 156 // --------- sum up Forces -------------------- 157 Log() << Verbose(0) << "Summing forces of order " << BondOrder+1 << " ..." << endl;157 DoLog(0) && (Log() << Verbose(0) << "Summing forces of order " << BondOrder+1 << " ..." << endl); 158 158 if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return 1; 159 159 if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return 1; 160 160 // --------- sum up Hessian -------------------- 161 161 if (!NoHessian) { 162 Log() << Verbose(0) << "Summing Hessian of order " << BondOrder+1 << " ..." << endl;162 DoLog(0) && (Log() << Verbose(0) << "Summing Hessian of order " << BondOrder+1 << " ..." << endl); 163 163 if (!HessianFragments.SumSubManyBodyTerms(Hessian, KeySet, BondOrder)) return 1; 164 164 if (!Hessian.SumSubHessians(HessianFragments, KeySet, BondOrder, 1.)) return 1; 165 165 } 166 166 if (periode != NULL) { // also look for PAS values 167 Log() << Verbose(0) << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl;167 DoLog(0) && (Log() << Verbose(0) << "Summing shieldings and susceptibilities of order " << BondOrder+1 << " ..." << endl); 168 168 if (!ShieldingFragments.SumSubManyBodyTerms(Shielding, KeySet, BondOrder)) return 1; 169 169 if (!Shielding.SumSubForces(ShieldingFragments, KeySet, BondOrder, 1.)) return 1; … … 179 179 prefix.str(" "); 180 180 prefix << dir << OrderSuffix << (BondOrder+1); 181 Log() << Verbose(0) << "Writing files " << argv[1] << prefix.str() << ". ..." << endl;181 DoLog(0) && (Log() << Verbose(0) << "Writing files " << argv[1] << prefix.str() << ". ..." << endl); 182 182 // energy 183 183 if (!Energy.WriteLastMatrix(argv[1], (prefix.str()).c_str(), EnergySuffix)) return 1; … … 244 244 delete(periode); 245 245 Free(&dir); 246 Log() << Verbose(0) << "done." << endl;246 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 247 247 return 0; 248 248 }; -
src/linkedcell.cpp
r6613ec ra67d19 45 45 max.Zero(); 46 46 min.Zero(); 47 Log() << Verbose(1) << "Begin of LinkedCell" << endl;47 DoLog(1) && (Log() << Verbose(1) << "Begin of LinkedCell" << endl); 48 48 if ((set == NULL) || (set->IsEmpty())) { 49 49 DoeLog(1) && (eLog()<< Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl); … … 68 68 set->GoToNext(); 69 69 } 70 Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl;70 DoLog(2) && (Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl); 71 71 72 72 // 2. find then number of cells per axis … … 74 74 N[i] = (int)floor((max.x[i] - min.x[i])/RADIUS)+1; 75 75 } 76 Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl;76 DoLog(2) && (Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl); 77 77 78 78 // 3. allocate the lists 79 Log() << Verbose(2) << "Allocating cells ... ";79 DoLog(2) && (Log() << Verbose(2) << "Allocating cells ... "); 80 80 if (LC != NULL) { 81 81 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl); … … 86 86 LC [index].clear(); 87 87 } 88 Log() << Verbose(0) << "done." << endl;88 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 89 89 90 90 // 4. put each atom into its respective cell 91 Log() << Verbose(2) << "Filling cells ... ";91 DoLog(2) && (Log() << Verbose(2) << "Filling cells ... "); 92 92 set->GoToFirst(); 93 93 while (!set->IsEnd()) { … … 101 101 set->GoToNext(); 102 102 } 103 Log() << Verbose(0) << "done." << endl;104 Log() << Verbose(1) << "End of LinkedCell" << endl;103 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 104 DoLog(1) && (Log() << Verbose(1) << "End of LinkedCell" << endl); 105 105 }; 106 106 … … 120 120 max.Zero(); 121 121 min.Zero(); 122 Log() << Verbose(1) << "Begin of LinkedCell" << endl;122 DoLog(1) && (Log() << Verbose(1) << "Begin of LinkedCell" << endl); 123 123 if (set->empty()) { 124 124 DoeLog(1) && (eLog()<< Verbose(1) << "set contains no linked cell nodes!" << endl); … … 140 140 } 141 141 } 142 Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl;142 DoLog(2) && (Log() << Verbose(2) << "Bounding box is " << min << " and " << max << "." << endl); 143 143 144 144 // 2. find then number of cells per axis … … 146 146 N[i] = (int)floor((max.x[i] - min.x[i])/RADIUS)+1; 147 147 } 148 Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl;148 DoLog(2) && (Log() << Verbose(2) << "Number of cells per axis are " << N[0] << ", " << N[1] << " and " << N[2] << "." << endl); 149 149 150 150 // 3. allocate the lists 151 Log() << Verbose(2) << "Allocating cells ... ";151 DoLog(2) && (Log() << Verbose(2) << "Allocating cells ... "); 152 152 if (LC != NULL) { 153 153 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl); … … 158 158 LC [index].clear(); 159 159 } 160 Log() << Verbose(0) << "done." << endl;160 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 161 161 162 162 // 4. put each atom into its respective cell 163 Log() << Verbose(2) << "Filling cells ... ";163 DoLog(2) && (Log() << Verbose(2) << "Filling cells ... "); 164 164 for (LinkedNodes::iterator Runner = set->begin(); Runner != set->end(); Runner++) { 165 165 Walker = *Runner; … … 171 171 //Log() << Verbose(2) << *Walker << " goes into cell " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl; 172 172 } 173 Log() << Verbose(0) << "done." << endl;174 Log() << Verbose(1) << "End of LinkedCell" << endl;173 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 174 DoLog(1) && (Log() << Verbose(1) << "End of LinkedCell" << endl); 175 175 }; 176 176 … … 399 399 return TesselList; 400 400 } else 401 Log() << Verbose(1) << "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "." << endl;401 DoLog(1) && (Log() << Verbose(1) << "Distance of closest cell to center of sphere with radius " << radius << " is " << dist << "." << endl); 402 402 403 403 // gather all neighbours first, then look who fulfills distance criteria -
src/memoryusageobserver.cpp
r6613ec ra67d19 93 93 << pointer << " is not registered by MemoryUsageObserver: "; 94 94 if (msg != NULL) 95 Log() << Verbose(0) << *msg;96 Log() << Verbose(0) << endl;95 DoLog(0) && (Log() << Verbose(0) << *msg); 96 DoLog(0) && (Log() << Verbose(0) << endl); 97 97 return; 98 98 } -
src/molecule.cpp
r6613ec ra67d19 429 429 input = new istringstream(line); 430 430 *input >> NumberOfAtoms; 431 Log() << Verbose(0) << "Parsing " << NumberOfAtoms << " atoms in file." << endl;431 DoLog(0) && (Log() << Verbose(0) << "Parsing " << NumberOfAtoms << " atoms in file." << endl); 432 432 getline(xyzfile,line,'\n'); // Read comment 433 Log() << Verbose(1) << "Comment: " << line << endl;433 DoLog(1) && (Log() << Verbose(1) << "Comment: " << line << endl); 434 434 435 435 if (MDSteps == 0) // no atoms yet present … … 665 665 return walker; 666 666 } else { 667 Log() << Verbose(0) << "Atom not found in list." << endl;667 DoLog(0) && (Log() << Verbose(0) << "Atom not found in list." << endl); 668 668 return NULL; 669 669 } … … 681 681 //mol->Output((ofstream *)&cout); 682 682 //Log() << Verbose(0) << "===============================================" << endl; 683 Log() << Verbose(0) << text;683 DoLog(0) && (Log() << Verbose(0) << text); 684 684 cin >> No; 685 685 ion = this->FindAtom(No); … … 770 770 void molecule::OutputListOfBonds() const 771 771 { 772 Log() << Verbose(2) << endl << "From Contents of ListOfBonds, all non-hydrogen atoms:" << endl;772 DoLog(2) && (Log() << Verbose(2) << endl << "From Contents of ListOfBonds, all non-hydrogen atoms:" << endl); 773 773 ActOnAllAtoms (&atom::OutputBondOfAtom ); 774 Log() << Verbose(0) << endl;774 DoLog(0) && (Log() << Verbose(0) << endl); 775 775 }; 776 776 … … 829 829 } 830 830 if ((AtomCount == 0) || (i != AtomCount)) { 831 Log() << Verbose(3) << "Mismatch in AtomCount " << AtomCount << " and recounted number " << i << ", renaming all." << endl;831 DoLog(3) && (Log() << Verbose(3) << "Mismatch in AtomCount " << AtomCount << " and recounted number " << i << ", renaming all." << endl); 832 832 AtomCount = i; 833 833 … … 845 845 Walker->Name = Malloc<char>(6, "molecule::CountAtoms: *walker->Name"); 846 846 sprintf(Walker->Name, "%2s%02d", Walker->type->symbol, Walker->nr+1); 847 Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->Name << "." << endl;847 DoLog(3) && (Log() << Verbose(3) << "Naming atom nr. " << Walker->nr << " " << Walker->Name << "." << endl); 848 848 i++; 849 849 } 850 850 } else 851 Log() << Verbose(3) << "AtomCount is still " << AtomCount << ", thus counting nothing." << endl;851 DoLog(3) && (Log() << Verbose(3) << "AtomCount is still " << AtomCount << ", thus counting nothing." << endl); 852 852 } 853 853 }; … … 909 909 bool result = true; // status of comparison 910 910 911 Log() << Verbose(3) << "Begin of IsEqualToWithinThreshold." << endl;911 DoLog(3) && (Log() << Verbose(3) << "Begin of IsEqualToWithinThreshold." << endl); 912 912 /// first count both their atoms and elements and update lists thereby ... 913 913 //Log() << Verbose(0) << "Counting atoms, updating list" << endl; … … 921 921 if (result) { 922 922 if (AtomCount != OtherMolecule->AtomCount) { 923 Log() << Verbose(4) << "AtomCounts don't match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl;923 DoLog(4) && (Log() << Verbose(4) << "AtomCounts don't match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl); 924 924 result = false; 925 925 } else Log() << Verbose(4) << "AtomCounts match: " << AtomCount << " == " << OtherMolecule->AtomCount << endl; … … 928 928 if (result) { 929 929 if (ElementCount != OtherMolecule->ElementCount) { 930 Log() << Verbose(4) << "ElementCount don't match: " << ElementCount << " == " << OtherMolecule->ElementCount << endl;930 DoLog(4) && (Log() << Verbose(4) << "ElementCount don't match: " << ElementCount << " == " << OtherMolecule->ElementCount << endl); 931 931 result = false; 932 932 } else Log() << Verbose(4) << "ElementCount match: " << ElementCount << " == " << OtherMolecule->ElementCount << endl; … … 940 940 } 941 941 if (flag < MAX_ELEMENTS) { 942 Log() << Verbose(4) << "ElementsInMolecule don't match." << endl;942 DoLog(4) && (Log() << Verbose(4) << "ElementsInMolecule don't match." << endl); 943 943 result = false; 944 944 } else Log() << Verbose(4) << "ElementsInMolecule match." << endl; … … 946 946 /// then determine and compare center of gravity for each molecule ... 947 947 if (result) { 948 Log() << Verbose(5) << "Calculating Centers of Gravity" << endl;948 DoLog(5) && (Log() << Verbose(5) << "Calculating Centers of Gravity" << endl); 949 949 DeterminePeriodicCenter(CenterOfGravity); 950 950 OtherMolecule->DeterminePeriodicCenter(OtherCenterOfGravity); 951 Log() << Verbose(5) << "Center of Gravity: ";951 DoLog(5) && (Log() << Verbose(5) << "Center of Gravity: "); 952 952 CenterOfGravity.Output(); 953 Log() << Verbose(0) << endl << Verbose(5) << "Other Center of Gravity: ";953 DoLog(0) && (Log() << Verbose(0) << endl << Verbose(5) << "Other Center of Gravity: "); 954 954 OtherCenterOfGravity.Output(); 955 Log() << Verbose(0) << endl;955 DoLog(0) && (Log() << Verbose(0) << endl); 956 956 if (CenterOfGravity.DistanceSquared(&OtherCenterOfGravity) > threshold*threshold) { 957 Log() << Verbose(4) << "Centers of gravity don't match." << endl;957 DoLog(4) && (Log() << Verbose(4) << "Centers of gravity don't match." << endl); 958 958 result = false; 959 959 } … … 962 962 /// ... then make a list with the euclidian distance to this center for each atom of both molecules 963 963 if (result) { 964 Log() << Verbose(5) << "Calculating distances" << endl;964 DoLog(5) && (Log() << Verbose(5) << "Calculating distances" << endl); 965 965 Distances = Calloc<double>(AtomCount, "molecule::IsEqualToWithinThreshold: Distances"); 966 966 OtherDistances = Calloc<double>(AtomCount, "molecule::IsEqualToWithinThreshold: OtherDistances"); … … 969 969 970 970 /// ... sort each list (using heapsort (o(N log N)) from GSL) 971 Log() << Verbose(5) << "Sorting distances" << endl;971 DoLog(5) && (Log() << Verbose(5) << "Sorting distances" << endl); 972 972 PermMap = Calloc<size_t>(AtomCount, "molecule::IsEqualToWithinThreshold: *PermMap"); 973 973 OtherPermMap = Calloc<size_t>(AtomCount, "molecule::IsEqualToWithinThreshold: *OtherPermMap"); … … 975 975 gsl_heapsort_index (OtherPermMap, OtherDistances, AtomCount, sizeof(double), CompareDoubles); 976 976 PermutationMap = Calloc<int>(AtomCount, "molecule::IsEqualToWithinThreshold: *PermutationMap"); 977 Log() << Verbose(5) << "Combining Permutation Maps" << endl;977 DoLog(5) && (Log() << Verbose(5) << "Combining Permutation Maps" << endl); 978 978 for(int i=AtomCount;i--;) 979 979 PermutationMap[PermMap[i]] = (int) OtherPermMap[i]; 980 980 981 981 /// ... and compare them step by step, whether the difference is individually(!) below \a threshold for all 982 Log() << Verbose(4) << "Comparing distances" << endl;982 DoLog(4) && (Log() << Verbose(4) << "Comparing distances" << endl); 983 983 flag = 0; 984 984 for (int i=0;i<AtomCount;i++) { 985 Log() << Verbose(5) << "Distances squared: |" << Distances[PermMap[i]] << " - " << OtherDistances[OtherPermMap[i]] << "| = " << fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) << " ?<? " << threshold << endl;985 DoLog(5) && (Log() << Verbose(5) << "Distances squared: |" << Distances[PermMap[i]] << " - " << OtherDistances[OtherPermMap[i]] << "| = " << fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) << " ?<? " << threshold << endl); 986 986 if (fabs(Distances[PermMap[i]] - OtherDistances[OtherPermMap[i]]) > threshold*threshold) 987 987 flag = 1; … … 999 999 } 1000 1000 /// return pointer to map if all distances were below \a threshold 1001 Log() << Verbose(3) << "End of IsEqualToWithinThreshold." << endl;1001 DoLog(3) && (Log() << Verbose(3) << "End of IsEqualToWithinThreshold." << endl); 1002 1002 if (result) { 1003 Log() << Verbose(3) << "Result: Equal." << endl;1003 DoLog(3) && (Log() << Verbose(3) << "Result: Equal." << endl); 1004 1004 return PermutationMap; 1005 1005 } else { 1006 Log() << Verbose(3) << "Result: Not equal." << endl;1006 DoLog(3) && (Log() << Verbose(3) << "Result: Not equal." << endl); 1007 1007 return NULL; 1008 1008 } … … 1019 1019 { 1020 1020 atom *Walker = NULL, *OtherWalker = NULL; 1021 Log() << Verbose(3) << "Begin of GetFatherAtomicMap." << endl;1021 DoLog(3) && (Log() << Verbose(3) << "Begin of GetFatherAtomicMap." << endl); 1022 1022 int *AtomicMap = Malloc<int>(AtomCount, "molecule::GetAtomicMap: *AtomicMap"); 1023 1023 for (int i=AtomCount;i--;) … … 1026 1026 for (int i=AtomCount;i--;) // no need as -1 means already that there is trivial correspondence 1027 1027 AtomicMap[i] = i; 1028 Log() << Verbose(4) << "Map is trivial." << endl;1028 DoLog(4) && (Log() << Verbose(4) << "Map is trivial." << endl); 1029 1029 } else { 1030 Log() << Verbose(4) << "Map is ";1030 DoLog(4) && (Log() << Verbose(4) << "Map is "); 1031 1031 Walker = start; 1032 1032 while (Walker->next != end) { … … 1045 1045 } 1046 1046 } 1047 Log() << Verbose(0) << AtomicMap[Walker->nr] << "\t";1048 } 1049 Log() << Verbose(0) << endl;1050 } 1051 Log() << Verbose(3) << "End of GetFatherAtomicMap." << endl;1047 DoLog(0) && (Log() << Verbose(0) << AtomicMap[Walker->nr] << "\t"); 1048 } 1049 DoLog(0) && (Log() << Verbose(0) << endl); 1050 } 1051 DoLog(3) && (Log() << Verbose(3) << "End of GetFatherAtomicMap." << endl); 1052 1052 return AtomicMap; 1053 1053 }; -
src/molecule_dynamics.cpp
r6613ec ra67d19 207 207 doubles++; 208 208 if (doubles >0) 209 Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl;209 DoLog(2) && (Log() << Verbose(2) << "Found " << doubles << " Doubles." << endl); 210 210 Free(&DoubleList); 211 211 // Log() << Verbose(2) << zeile1.str() << endl << zeile2.str() << endl; … … 249 249 Params.DoubleList[Params.DistanceList[Walker->nr]->begin()->second->nr]++; // increase this target's source count (>1? not injective) 250 250 Params.DistanceIterators[Walker->nr] = Params.DistanceList[Walker->nr]->begin(); // and remember which one we picked 251 Log() << Verbose(2) << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl;251 DoLog(2) && (Log() << Verbose(2) << *Walker << " starts with distance " << Params.DistanceList[Walker->nr]->begin()->first << "." << endl); 252 252 } 253 253 }; … … 277 277 Params.DistanceIterators[Walker->nr] = NewBase; 278 278 OldPotential = Potential; 279 Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl;279 DoLog(3) && (Log() << Verbose(3) << "Found a new permutation, new potential is " << OldPotential << "." << endl); 280 280 } 281 281 } … … 309 309 performCriticalExit(); 310 310 } 311 Log() << Verbose(1) << "done." << endl;311 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 312 312 }; 313 313 … … 358 358 Params.PenaltyConstants[2] = 1e+7; // just a huge penalty 359 359 // generate the distance list 360 Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl;360 DoLog(1) && (Log() << Verbose(1) << "Allocating, initializting and filling the distance list ... " << endl); 361 361 FillDistanceList(this, Params); 362 362 … … 365 365 366 366 // make the PermutationMap injective by checking whether we have a non-zero constants[2] term in it 367 Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl;367 DoLog(1) && (Log() << Verbose(1) << "Making the PermutationMap injective ... " << endl); 368 368 MakeInjectivePermutation(this, Params); 369 369 Free(&Params.DoubleList); 370 370 371 371 // argument minimise the constrained potential in this injective PermutationMap 372 Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl;372 DoLog(1) && (Log() << Verbose(1) << "Argument minimising the PermutationMap." << endl); 373 373 OldPotential = 1e+10; 374 374 round = 0; 375 375 do { 376 Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl;376 DoLog(2) && (Log() << Verbose(2) << "Starting round " << ++round << ", at current potential " << OldPotential << " ... " << endl); 377 377 OlderPotential = OldPotential; 378 378 do { … … 424 424 } else { 425 425 Params.DistanceIterators[Runner->nr] = Rider; // if successful also move the pointer in the iterator list 426 Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl;426 DoLog(3) && (Log() << Verbose(3) << "Found a better permutation, new potential is " << Potential << " vs." << OldPotential << "." << endl); 427 427 OldPotential = Potential; 428 428 } … … 443 443 } while (Walker->next != end); 444 444 } while ((OlderPotential - OldPotential) > 1e-3); 445 Log() << Verbose(1) << "done." << endl;445 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 446 446 447 447 … … 466 466 { 467 467 /// evaluate forces (only the distance to target dependent part) with the final PermutationMap 468 Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl;468 DoLog(1) && (Log() << Verbose(1) << "Calculating forces and adding onto ForceMatrix ... " << endl); 469 469 ActOnAllAtoms( &atom::EvaluateConstrainedForce, startstep, endstep, PermutationMap, Force ); 470 Log() << Verbose(1) << "done." << endl;470 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 471 471 }; 472 472 … … 503 503 504 504 // go through all steps and add the molecular configuration to the list and to the Trajectories of \a this molecule 505 Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl;505 DoLog(1) && (Log() << Verbose(1) << "Filling intermediate " << MaxSteps << " steps with MDSteps of " << MDSteps << "." << endl); 506 506 for (int step = 0; step <= MaxSteps; step++) { 507 507 mol = new molecule(elemente); … … 652 652 switch(Thermostat) { 653 653 case None: 654 Log() << Verbose(2) << "Applying no thermostat..." << endl;654 DoLog(2) && (Log() << Verbose(2) << "Applying no thermostat..." << endl); 655 655 break; 656 656 case Woodcock: 657 657 if ((configuration.ScaleTempStep > 0) && ((MDSteps-1) % configuration.ScaleTempStep == 0)) { 658 Log() << Verbose(2) << "Applying Woodcock thermostat..." << endl;658 DoLog(2) && (Log() << Verbose(2) << "Applying Woodcock thermostat..." << endl); 659 659 ActOnAllAtoms( &atom::Thermostat_Woodcock, sqrt(ScaleTempFactor), MDSteps, &ekin ); 660 660 } 661 661 break; 662 662 case Gaussian: 663 Log() << Verbose(2) << "Applying Gaussian thermostat..." << endl;663 DoLog(2) && (Log() << Verbose(2) << "Applying Gaussian thermostat..." << endl); 664 664 ActOnAllAtoms( &atom::Thermostat_Gaussian_init, MDSteps, &G, &E ); 665 665 666 Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl;666 DoLog(1) && (Log() << Verbose(1) << "Gaussian Least Constraint constant is " << G/E << "." << endl); 667 667 ActOnAllAtoms( &atom::Thermostat_Gaussian_least_constraint, MDSteps, G/E, &ekin, &configuration); 668 668 669 669 break; 670 670 case Langevin: 671 Log() << Verbose(2) << "Applying Langevin thermostat..." << endl;671 DoLog(2) && (Log() << Verbose(2) << "Applying Langevin thermostat..." << endl); 672 672 // init random number generator 673 673 gsl_rng_env_setup(); … … 679 679 680 680 case Berendsen: 681 Log() << Verbose(2) << "Applying Berendsen-VanGunsteren thermostat..." << endl;681 DoLog(2) && (Log() << Verbose(2) << "Applying Berendsen-VanGunsteren thermostat..." << endl); 682 682 ActOnAllAtoms( &atom::Thermostat_Berendsen, MDSteps, ScaleTempFactor, &ekin, &configuration ); 683 683 break; 684 684 685 685 case NoseHoover: 686 Log() << Verbose(2) << "Applying Nose-Hoover thermostat..." << endl;686 DoLog(2) && (Log() << Verbose(2) << "Applying Nose-Hoover thermostat..." << endl); 687 687 // dynamically evolve alpha (the additional degree of freedom) 688 688 delta_alpha = 0.; … … 690 690 delta_alpha = (delta_alpha - (3.*AtomCount+1.) * configuration.TargetTemp)/(configuration.HooverMass*Units2Electronmass); 691 691 configuration.alpha += delta_alpha*configuration.Deltat; 692 Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl;692 DoLog(3) && (Log() << Verbose(3) << "alpha = " << delta_alpha << " * " << configuration.Deltat << " = " << configuration.alpha << "." << endl); 693 693 // apply updated alpha as additional force 694 694 ActOnAllAtoms( &atom::Thermostat_NoseHoover_scale, MDSteps, &ekin, &configuration ); 695 695 break; 696 696 } 697 Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl;698 }; 697 DoLog(1) && (Log() << Verbose(1) << "Kinetic energy is " << ekin << "." << endl); 698 }; -
src/molecule_fragmentation.cpp
r6613ec ra67d19 44 44 } 45 45 FragmentCount = NoNonHydrogen*(1 << (c*order)); 46 Log() << Verbose(1) << "Upper limit for this subgraph is " << FragmentCount << " for " << NoNonHydrogen << " non-H atoms with maximum bond degree of " << c << "." << endl;46 DoLog(1) && (Log() << Verbose(1) << "Upper limit for this subgraph is " << FragmentCount << " for " << NoNonHydrogen << " non-H atoms with maximum bond degree of " << c << "." << endl); 47 47 return FragmentCount; 48 48 }; … … 68 68 } // else it's "-1" or else and thus must not be added 69 69 } 70 Log() << Verbose(1) << "The scanned KeySet is ";70 DoLog(1) && (Log() << Verbose(1) << "The scanned KeySet is "); 71 71 for(KeySet::iterator runner = CurrentSet.begin(); runner != CurrentSet.end(); runner++) { 72 Log() << Verbose(0) << (*runner) << "\t";73 } 74 Log() << Verbose(0) << endl;72 DoLog(0) && (Log() << Verbose(0) << (*runner) << "\t"); 73 } 74 DoLog(0) && (Log() << Verbose(0) << endl); 75 75 return (status != 0); 76 76 }; … … 100 100 101 101 // 1st pass: open file and read 102 Log() << Verbose(1) << "Parsing the KeySet file ... " << endl;102 DoLog(1) && (Log() << Verbose(1) << "Parsing the KeySet file ... " << endl); 103 103 sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, KEYSETFILE); 104 104 InputFile.open(filename); … … 122 122 InputFile.clear(); 123 123 Free(&buffer); 124 Log() << Verbose(1) << "done." << endl;124 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 125 125 } else { 126 Log() << Verbose(1) << "File " << filename << " not found." << endl;126 DoLog(1) && (Log() << Verbose(1) << "File " << filename << " not found." << endl); 127 127 status = false; 128 128 } … … 154 154 155 155 // 2nd pass: open TEFactors file and read 156 Log() << Verbose(1) << "Parsing the TEFactors file ... " << endl;156 DoLog(1) && (Log() << Verbose(1) << "Parsing the TEFactors file ... " << endl); 157 157 sprintf(filename, "%s/%s%s", path, FRAGMENTPREFIX, TEFACTORSFILE); 158 158 InputFile.open(filename); … … 164 164 InputFile >> TEFactor; 165 165 (*runner).second.second = TEFactor; 166 Log() << Verbose(2) << "Setting " << ++NumberOfFragments << " fragment's TEFactor to " << (*runner).second.second << "." << endl;166 DoLog(2) && (Log() << Verbose(2) << "Setting " << ++NumberOfFragments << " fragment's TEFactor to " << (*runner).second.second << "." << endl); 167 167 } else { 168 168 status = false; … … 172 172 // 4. Free and done 173 173 InputFile.close(); 174 Log() << Verbose(1) << "done." << endl;174 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 175 175 } else { 176 Log() << Verbose(1) << "File " << filename << " not found." << endl;176 DoLog(1) && (Log() << Verbose(1) << "File " << filename << " not found." << endl); 177 177 status = false; 178 178 } … … 202 202 line += KEYSETFILE; 203 203 output.open(line.c_str(), ios::out); 204 Log() << Verbose(1) << "Saving key sets of the total graph ... ";204 DoLog(1) && (Log() << Verbose(1) << "Saving key sets of the total graph ... "); 205 205 if(output != NULL) { 206 206 for(Graph::iterator runner = KeySetList.begin(); runner != KeySetList.end(); runner++) { … … 212 212 output << endl; 213 213 } 214 Log() << Verbose(0) << "done." << endl;214 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 215 215 } else { 216 216 DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open " << line << " for writing keysets!" << endl); … … 243 243 line += TEFACTORSFILE; 244 244 output.open(line.c_str(), ios::out); 245 Log() << Verbose(1) << "Saving TEFactors of the total graph ... ";245 DoLog(1) && (Log() << Verbose(1) << "Saving TEFactors of the total graph ... "); 246 246 if(output != NULL) { 247 247 for(Graph::iterator runner = KeySetList.begin(); runner != KeySetList.end(); runner++) 248 248 output << (*runner).second.second << endl; 249 Log() << Verbose(1) << "done." << endl;249 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 250 250 } else { 251 Log() << Verbose(1) << "failed to open " << line << "." << endl;251 DoLog(1) && (Log() << Verbose(1) << "failed to open " << line << "." << endl); 252 252 status = false; 253 253 } … … 293 293 (*PresentItem).second.first = fabs(Value); 294 294 (*PresentItem).second.second = FragOrder; 295 Log() << Verbose(2) << "Updated element (" << (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl;295 DoLog(2) && (Log() << Verbose(2) << "Updated element (" << (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl); 296 296 } else { 297 Log() << Verbose(2) << "Did not update element " << (*PresentItem).first << " as " << FragOrder << " is less than or equal to " << (*PresentItem).second.second << "." << endl;297 DoLog(2) && (Log() << Verbose(2) << "Did not update element " << (*PresentItem).first << " as " << FragOrder << " is less than or equal to " << (*PresentItem).second.second << "." << endl); 298 298 } 299 299 } else { 300 Log() << Verbose(2) << "Inserted element (" << (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl;300 DoLog(2) && (Log() << Verbose(2) << "Inserted element (" << (*PresentItem).first << ",[" << (*PresentItem).second.first << "," << (*PresentItem).second.second << "])." << endl); 301 301 } 302 302 } else { 303 Log() << Verbose(1) << "No Fragment under No. " << No << "found." << endl;303 DoLog(1) && (Log() << Verbose(1) << "No Fragment under No. " << No << "found." << endl); 304 304 } 305 305 }; … … 360 360 atom *Walker = mol->start; 361 361 map<double, pair<int,int> > *FinalRootCandidates = new map<double, pair<int,int> > ; 362 Log() << Verbose(1) << "Root candidate list is: " << endl;362 DoLog(1) && (Log() << Verbose(1) << "Root candidate list is: " << endl); 363 363 for(map<int, pair<double,int> >::iterator runner = AdaptiveCriteriaList->begin(); runner != AdaptiveCriteriaList->end(); runner++) { 364 364 Walker = mol->FindAtom((*runner).first); … … 366 366 //if ((*runner).second.second >= Walker->AdaptiveOrder) { // only insert if this is an "active" root site for the current order 367 367 if (!Walker->MaxOrder) { 368 Log() << Verbose(2) << "(" << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "])" << endl;368 DoLog(2) && (Log() << Verbose(2) << "(" << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "])" << endl); 369 369 FinalRootCandidates->insert( make_pair( (*runner).second.first, pair<int,int>((*runner).first, (*runner).second.second) ) ); 370 370 } else { 371 Log() << Verbose(2) << "Excluding (" << *Walker << ", " << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "]), as it has reached its maximum order." << endl;371 DoLog(2) && (Log() << Verbose(2) << "Excluding (" << *Walker << ", " << (*runner).first << ",[" << (*runner).second.first << "," << (*runner).second.second << "]), as it has reached its maximum order." << endl); 372 372 } 373 373 } else { … … 397 397 Walker = mol->FindAtom(No); 398 398 //if (Walker->AdaptiveOrder < MinimumRingSize[Walker->nr]) { 399 Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl;399 DoLog(2) && (Log() << Verbose(2) << "Root " << No << " is still above threshold (10^{" << Order <<"}: " << runner->first << ", setting entry " << No << " of Atom mask to true." << endl); 400 400 AtomMask[No] = true; 401 401 status = true; … … 413 413 void PrintAtomMask(bool *AtomMask, int AtomCount) 414 414 { 415 Log() << Verbose(2) << " ";415 DoLog(2) && (Log() << Verbose(2) << " "); 416 416 for(int i=0;i<AtomCount;i++) 417 Log() << Verbose(0) << (i % 10);418 Log() << Verbose(0) << endl;419 Log() << Verbose(2) << "Atom mask is: ";417 DoLog(0) && (Log() << Verbose(0) << (i % 10)); 418 DoLog(0) && (Log() << Verbose(0) << endl); 419 DoLog(2) && (Log() << Verbose(2) << "Atom mask is: "); 420 420 for(int i=0;i<AtomCount;i++) 421 Log() << Verbose(0) << (AtomMask[i] ? "t" : "f");422 Log() << Verbose(0) << endl;421 DoLog(0) && (Log() << Verbose(0) << (AtomMask[i] ? "t" : "f")); 422 DoLog(0) && (Log() << Verbose(0) << endl); 423 423 }; 424 424 … … 493 493 if (!status) { 494 494 if (Order == 0) 495 Log() << Verbose(1) << "Single stepping done." << endl;495 DoLog(1) && (Log() << Verbose(1) << "Single stepping done." << endl); 496 496 else 497 Log() << Verbose(1) << "Order at every site is already equal or above desired order " << Order << "." << endl;497 DoLog(1) && (Log() << Verbose(1) << "Order at every site is already equal or above desired order " << Order << "." << endl); 498 498 } 499 499 } … … 512 512 { 513 513 if (SortIndex != NULL) { 514 Log() << Verbose(1) << "SortIndex is " << SortIndex << " and not NULL as expected." << endl;514 DoLog(1) && (Log() << Verbose(1) << "SortIndex is " << SortIndex << " and not NULL as expected." << endl); 515 515 return false; 516 516 } … … 563 563 bool *AtomMask = NULL; 564 564 565 Log() << Verbose(0) << endl;565 DoLog(0) && (Log() << Verbose(0) << endl); 566 566 #ifdef ADDHYDROGEN 567 Log() << Verbose(0) << "I will treat hydrogen special and saturate dangling bonds with it." << endl;567 DoLog(0) && (Log() << Verbose(0) << "I will treat hydrogen special and saturate dangling bonds with it." << endl); 568 568 #else 569 Log() << Verbose(0) << "Hydrogen is treated just like the rest of the lot." << endl;569 DoLog(0) && (Log() << Verbose(0) << "Hydrogen is treated just like the rest of the lot." << endl); 570 570 #endif 571 571 … … 593 593 // fill the bond structure of the individually stored subgraphs 594 594 MolecularWalker->FillBondStructureFromReference(this, FragmentCounter, ListOfLocalAtoms, false); // we want to keep the created ListOfLocalAtoms 595 Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;595 DoLog(0) && (Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl); 596 596 LocalBackEdgeStack = new StackClass<bond *> (MolecularWalker->Leaf->BondCount); 597 597 // // check the list of local atoms for debugging … … 602 602 // else 603 603 // Log() << Verbose(0) << "\t" << ListOfLocalAtoms[FragmentCounter][i]->Name; 604 Log() << Verbose(0) << "Gathering local back edges for subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;604 DoLog(0) && (Log() << Verbose(0) << "Gathering local back edges for subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl); 605 605 MolecularWalker->Leaf->PickLocalBackEdges(ListOfLocalAtoms[FragmentCounter++], BackEdgeStack, LocalBackEdgeStack); 606 Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;606 DoLog(0) && (Log() << Verbose(0) << "Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl); 607 607 MolecularWalker->Leaf->CyclicStructureAnalysis(LocalBackEdgeStack, MinimumRingSize); 608 Log() << Verbose(0) << "Done with Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl;608 DoLog(0) && (Log() << Verbose(0) << "Done with Analysing the cycles of subgraph " << MolecularWalker->Leaf << " with nr. " << FragmentCounter << "." << endl); 609 609 delete(LocalBackEdgeStack); 610 610 } … … 637 637 while (MolecularWalker->next != NULL) { 638 638 MolecularWalker = MolecularWalker->next; 639 Log() << Verbose(1) << "Fragmenting subgraph " << MolecularWalker << "." << endl;639 DoLog(1) && (Log() << Verbose(1) << "Fragmenting subgraph " << MolecularWalker << "." << endl); 640 640 //MolecularWalker->Leaf->OutputListOfBonds(out); // output atom::ListOfBonds for debugging 641 641 if (MolecularWalker->Leaf->first->next != MolecularWalker->Leaf->last) { 642 642 // call BOSSANOVA method 643 Log() << Verbose(0) << endl << " ========== BOND ENERGY of subgraph " << FragmentCounter << " ========================= " << endl;643 DoLog(0) && (Log() << Verbose(0) << endl << " ========== BOND ENERGY of subgraph " << FragmentCounter << " ========================= " << endl); 644 644 MolecularWalker->Leaf->FragmentBOSSANOVA(FragmentList[FragmentCounter], RootStack[FragmentCounter], MinimumRingSize); 645 645 } else { … … 649 649 } 650 650 } 651 Log() << Verbose(2) << "CheckOrder is " << CheckOrder << "." << endl;651 DoLog(2) && (Log() << Verbose(2) << "CheckOrder is " << CheckOrder << "." << endl); 652 652 delete[](RootStack); 653 653 delete[](AtomMask); … … 680 680 for(Graph::iterator runner = TotalGraph.begin(); runner != TotalGraph.end(); runner++) { 681 681 KeySet test = (*runner).first; 682 Log() << Verbose(0) << "Fragment No." << (*runner).second.first << " with TEFactor " << (*runner).second.second << "." << endl;682 DoLog(0) && (Log() << Verbose(0) << "Fragment No." << (*runner).second.first << " with TEFactor " << (*runner).second.second << "." << endl); 683 683 BondFragments->insert(StoreFragmentFromKeySet(test, configuration)); 684 684 k++; 685 685 } 686 Log() << Verbose(0) << k << "/" << BondFragments->ListOfMolecules.size() << " fragments generated from the keysets." << endl;686 DoLog(0) && (Log() << Verbose(0) << k << "/" << BondFragments->ListOfMolecules.size() << " fragments generated from the keysets." << endl); 687 687 688 688 // ===== 9. Save fragments' configuration and keyset files et al to disk === … … 691 691 CreateMappingLabelsToConfigSequence(SortIndex); 692 692 693 Log() << Verbose(1) << "Writing " << BondFragments->ListOfMolecules.size() << " possible bond fragmentation configs" << endl;693 DoLog(1) && (Log() << Verbose(1) << "Writing " << BondFragments->ListOfMolecules.size() << " possible bond fragmentation configs" << endl); 694 694 if (BondFragments->OutputConfigForListOfFragments(configuration, SortIndex)) 695 Log() << Verbose(1) << "All configs written." << endl;695 DoLog(1) && (Log() << Verbose(1) << "All configs written." << endl); 696 696 else 697 Log() << Verbose(1) << "Some config writing failed." << endl;697 DoLog(1) && (Log() << Verbose(1) << "Some config writing failed." << endl); 698 698 699 699 // store force index reference file … … 720 720 721 721 // free memory for bond part 722 Log() << Verbose(1) << "Freeing bond memory" << endl;722 DoLog(1) && (Log() << Verbose(1) << "Freeing bond memory" << endl); 723 723 delete(FragmentList); // remove bond molecule from memory 724 724 Free(&SortIndex); 725 725 } else { 726 Log() << Verbose(1) << "FragmentList is zero on return, splitting failed." << endl;726 DoLog(1) && (Log() << Verbose(1) << "FragmentList is zero on return, splitting failed." << endl); 727 727 } 728 728 delete(BondFragments); 729 Log() << Verbose(0) << "End of bond fragmentation." << endl;729 DoLog(0) && (Log() << Verbose(0) << "End of bond fragmentation." << endl); 730 730 731 731 return ((int)(!FragmentationToDo)+1); // 1 - continue, 2 - stop (no fragmentation occured) … … 746 746 line << path << "/" << FRAGMENTPREFIX << ORDERATSITEFILE; 747 747 file.open(line.str().c_str()); 748 Log() << Verbose(1) << "Writing OrderAtSite " << ORDERATSITEFILE << " ... " << endl;748 DoLog(1) && (Log() << Verbose(1) << "Writing OrderAtSite " << ORDERATSITEFILE << " ... " << endl); 749 749 if (file != NULL) { 750 750 ActOnAllAtoms( &atom::OutputOrder, &file ); 751 751 file.close(); 752 Log() << Verbose(1) << "done." << endl;752 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 753 753 return true; 754 754 } else { 755 Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;755 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl); 756 756 return false; 757 757 } … … 774 774 ifstream file; 775 775 776 Log() << Verbose(1) << "Begin of ParseOrderAtSiteFromFile" << endl;776 DoLog(1) && (Log() << Verbose(1) << "Begin of ParseOrderAtSiteFromFile" << endl); 777 777 line << path << "/" << FRAGMENTPREFIX << ORDERATSITEFILE; 778 778 file.open(line.str().c_str()); … … 795 795 SetAtomValueToIndexedArray( MaxArray, &atom::nr, &atom::MaxOrder ); 796 796 797 Log() << Verbose(1) << "done." << endl;797 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 798 798 status = true; 799 799 } else { 800 Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;800 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl); 801 801 status = false; 802 802 } … … 804 804 Free(&MaxArray); 805 805 806 Log() << Verbose(1) << "End of ParseOrderAtSiteFromFile" << endl;806 DoLog(1) && (Log() << Verbose(1) << "End of ParseOrderAtSiteFromFile" << endl); 807 807 return status; 808 808 }; … … 821 821 int SP, Removal; 822 822 823 Log() << Verbose(2) << "Looking for removal candidate." << endl;823 DoLog(2) && (Log() << Verbose(2) << "Looking for removal candidate." << endl); 824 824 SP = -1; //0; // not -1, so that Root is never removed 825 825 Removal = -1; … … 909 909 } 910 910 if ((LonelyFlag) && (Leaf->AtomCount > 1)) { 911 Log() << Verbose(0) << *Runner << "has got bonds only to hydrogens!" << endl;911 DoLog(0) && (Log() << Verbose(0) << *Runner << "has got bonds only to hydrogens!" << endl); 912 912 } 913 913 #ifdef ADDHYDROGEN … … 1056 1056 TouchedList[j] = -1; 1057 1057 } 1058 Log() << Verbose(2) << "Remaining local nr.s on snake stack are: ";1058 DoLog(2) && (Log() << Verbose(2) << "Remaining local nr.s on snake stack are: "); 1059 1059 for(KeySet::iterator runner = FragmentSet->begin(); runner != FragmentSet->end(); runner++) 1060 Log() << Verbose(0) << (*runner) << " ";1061 Log() << Verbose(0) << endl;1060 DoLog(0) && (Log() << Verbose(0) << (*runner) << " "); 1061 DoLog(0) && (Log() << Verbose(0) << endl); 1062 1062 TouchedIndex = 0; // set Index to 0 for list of atoms added on this level 1063 1063 }; … … 1136 1136 Log() << Verbose(1+verbosity) << "Enough items on stack for a fragment!" << endl; 1137 1137 // store fragment as a KeySet 1138 Log() << Verbose(2) << "Found a new fragment[" << FragmentSearch->FragmentCounter << "], local nr.s are: ";1138 DoLog(2) && (Log() << Verbose(2) << "Found a new fragment[" << FragmentSearch->FragmentCounter << "], local nr.s are: "); 1139 1139 for(KeySet::iterator runner = FragmentSearch->FragmentSet->begin(); runner != FragmentSearch->FragmentSet->end(); runner++) 1140 Log() << Verbose(0) << (*runner) << " ";1141 Log() << Verbose(0) << endl;1140 DoLog(0) && (Log() << Verbose(0) << (*runner) << " "); 1141 DoLog(0) && (Log() << Verbose(0) << endl); 1142 1142 //if (!CheckForConnectedSubgraph(FragmentSearch->FragmentSet)) 1143 1143 //DoeLog(1) && (eLog()<< Verbose(1) << "The found fragment is not a connected subgraph!" << endl); … … 1221 1221 { 1222 1222 bond *Binder = NULL; 1223 Log() << Verbose(0) << "Free'ing all found lists. and resetting index lists" << endl;1223 DoLog(0) && (Log() << Verbose(0) << "Free'ing all found lists. and resetting index lists" << endl); 1224 1224 for(int i=Order;i--;) { 1225 Log() << Verbose(1) << "Current SP level is " << i << ": ";1225 DoLog(1) && (Log() << Verbose(1) << "Current SP level is " << i << ": "); 1226 1226 Binder = FragmentSearch.BondsPerSPList[2*i]; 1227 1227 while (Binder->next != FragmentSearch.BondsPerSPList[2*i+1]) { … … 1234 1234 cleanup(FragmentSearch.BondsPerSPList[2*i], FragmentSearch.BondsPerSPList[2*i+1]); 1235 1235 // also start and end node 1236 Log() << Verbose(0) << "cleaned." << endl;1236 DoLog(0) && (Log() << Verbose(0) << "cleaned." << endl); 1237 1237 } 1238 1238 }; … … 1264 1264 int SP = -1; 1265 1265 1266 Log() << Verbose(0) << "Starting BFS analysis ..." << endl;1266 DoLog(0) && (Log() << Verbose(0) << "Starting BFS analysis ..." << endl); 1267 1267 for (SP = 0; SP < (Order-1); SP++) { 1268 Log() << Verbose(1) << "New SP level reached: " << SP << ", creating new SP list with " << FragmentSearch.BondsPerSPCount[SP] << " item(s)";1268 DoLog(1) && (Log() << Verbose(1) << "New SP level reached: " << SP << ", creating new SP list with " << FragmentSearch.BondsPerSPCount[SP] << " item(s)"); 1269 1269 if (SP > 0) { 1270 Log() << Verbose(0) << ", old level closed with " << FragmentSearch.BondsPerSPCount[SP-1] << " item(s)." << endl;1270 DoLog(0) && (Log() << Verbose(0) << ", old level closed with " << FragmentSearch.BondsPerSPCount[SP-1] << " item(s)." << endl); 1271 1271 FragmentSearch.BondsPerSPCount[SP] = 0; 1272 1272 } else 1273 Log() << Verbose(0) << "." << endl;1273 DoLog(0) && (Log() << Verbose(0) << "." << endl); 1274 1274 1275 1275 RemainingWalkers = FragmentSearch.BondsPerSPCount[SP]; … … 1281 1281 Predecessor = CurrentEdge->leftatom; // ... and leftatom is predecessor 1282 1282 AtomKeyNr = Walker->nr; 1283 Log() << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->nr << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level." << endl;1283 DoLog(0) && (Log() << Verbose(0) << "Current Walker is: " << *Walker << " with nr " << Walker->nr << " and SP of " << SP << ", with " << RemainingWalkers << " remaining walkers on this level." << endl); 1284 1284 // check for new sp level 1285 1285 // go through all its bonds 1286 Log() << Verbose(1) << "Going through all bonds of Walker." << endl;1286 DoLog(1) && (Log() << Verbose(1) << "Going through all bonds of Walker." << endl); 1287 1287 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 1288 1288 OtherWalker = (*Runner)->GetOtherAtom(Walker); … … 1292 1292 #endif 1293 1293 ) { // skip hydrogens and restrict to fragment 1294 Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << *(*Runner) << "." << endl;1294 DoLog(2) && (Log() << Verbose(2) << "Current partner is " << *OtherWalker << " with nr " << OtherWalker->nr << " in bond " << *(*Runner) << "." << endl); 1295 1295 // set the label if not set (and push on root stack as well) 1296 1296 if ((OtherWalker != Predecessor) && (OtherWalker->GetTrueFather()->nr > RootKeyNr)) { // only pass through those with label bigger than Root's 1297 1297 FragmentSearch.ShortestPathList[OtherWalker->nr] = SP+1; 1298 Log() << Verbose(3) << "Set Shortest Path to " << FragmentSearch.ShortestPathList[OtherWalker->nr] << "." << endl;1298 DoLog(3) && (Log() << Verbose(3) << "Set Shortest Path to " << FragmentSearch.ShortestPathList[OtherWalker->nr] << "." << endl); 1299 1299 // add the bond in between to the SP list 1300 1300 Binder = new bond(Walker, OtherWalker); // create a new bond in such a manner, that bond::rightatom is always the one more distant 1301 1301 add(Binder, FragmentSearch.BondsPerSPList[2*(SP+1)+1]); 1302 1302 FragmentSearch.BondsPerSPCount[SP+1]++; 1303 Log() << Verbose(3) << "Added its bond to SP list, having now " << FragmentSearch.BondsPerSPCount[SP+1] << " item(s)." << endl;1303 DoLog(3) && (Log() << Verbose(3) << "Added its bond to SP list, having now " << FragmentSearch.BondsPerSPCount[SP+1] << " item(s)." << endl); 1304 1304 } else { 1305 1305 if (OtherWalker != Predecessor) 1306 Log() << Verbose(3) << "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->nr << " is smaller than that of Root " << RootKeyNr << "." << endl;1306 DoLog(3) && (Log() << Verbose(3) << "Not passing on, as index of " << *OtherWalker << " " << OtherWalker->GetTrueFather()->nr << " is smaller than that of Root " << RootKeyNr << "." << endl); 1307 1307 else 1308 Log() << Verbose(3) << "This is my predecessor " << *Predecessor << "." << endl;1308 DoLog(3) && (Log() << Verbose(3) << "This is my predecessor " << *Predecessor << "." << endl); 1309 1309 } 1310 1310 } else Log() << Verbose(2) << "Is not in the restricted keyset or skipping hydrogen " << *OtherWalker << "." << endl; … … 1322 1322 { 1323 1323 bond *Binder = NULL; 1324 Log() << Verbose(0) << "Printing all found lists." << endl;1324 DoLog(0) && (Log() << Verbose(0) << "Printing all found lists." << endl); 1325 1325 for(int i=1;i<Order;i++) { // skip the root edge in the printing 1326 1326 Binder = FragmentSearch.BondsPerSPList[2*i]; 1327 Log() << Verbose(1) << "Current SP level is " << i << "." << endl;1327 DoLog(1) && (Log() << Verbose(1) << "Current SP level is " << i << "." << endl); 1328 1328 while (Binder->next != FragmentSearch.BondsPerSPList[2*i+1]) { 1329 1329 Binder = Binder->next; 1330 Log() << Verbose(2) << *Binder << endl;1330 DoLog(2) && (Log() << Verbose(2) << *Binder << endl); 1331 1331 } 1332 1332 } … … 1372 1372 int Counter = FragmentSearch.FragmentCounter; // mark current value of counter 1373 1373 1374 Log() << Verbose(0) << endl;1375 Log() << Verbose(0) << "Begin of PowerSetGenerator with order " << Order << " at Root " << *FragmentSearch.Root << "." << endl;1374 DoLog(0) && (Log() << Verbose(0) << endl); 1375 DoLog(0) && (Log() << Verbose(0) << "Begin of PowerSetGenerator with order " << Order << " at Root " << *FragmentSearch.Root << "." << endl); 1376 1376 1377 1377 SetSPList(Order, FragmentSearch); … … 1385 1385 // creating fragments with the found edge sets (may be done in reverse order, faster) 1386 1386 int SP = CountNumbersInBondsList(Order, FragmentSearch); 1387 Log() << Verbose(0) << "Total number of edges is " << SP << "." << endl;1387 DoLog(0) && (Log() << Verbose(0) << "Total number of edges is " << SP << "." << endl); 1388 1388 if (SP >= (Order-1)) { 1389 1389 // start with root (push on fragment stack) 1390 Log() << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << ", local nr is " << FragmentSearch.Root->nr << "." << endl;1390 DoLog(0) && (Log() << Verbose(0) << "Starting fragment generation with " << *FragmentSearch.Root << ", local nr is " << FragmentSearch.Root->nr << "." << endl); 1391 1391 FragmentSearch.FragmentSet->clear(); 1392 Log() << Verbose(0) << "Preparing subset for this root and calling generator." << endl;1392 DoLog(0) && (Log() << Verbose(0) << "Preparing subset for this root and calling generator." << endl); 1393 1393 1394 1394 // prepare the subset and call the generator … … 1400 1400 Free(&BondsList); 1401 1401 } else { 1402 Log() << Verbose(0) << "Not enough total number of edges to build " << Order << "-body fragments." << endl;1402 DoLog(0) && (Log() << Verbose(0) << "Not enough total number of edges to build " << Order << "-body fragments." << endl); 1403 1403 } 1404 1404 1405 1405 // as FragmentSearch structure is used only once, we don't have to clean it anymore 1406 1406 // remove root from stack 1407 Log() << Verbose(0) << "Removing root again from stack." << endl;1407 DoLog(0) && (Log() << Verbose(0) << "Removing root again from stack." << endl); 1408 1408 FragmentSearch.FragmentSet->erase(FragmentSearch.Root->nr); 1409 1409 … … 1412 1412 1413 1413 // return list 1414 Log() << Verbose(0) << "End of PowerSetGenerator." << endl;1414 DoLog(0) && (Log() << Verbose(0) << "End of PowerSetGenerator." << endl); 1415 1415 return (FragmentSearch.FragmentCounter - Counter); 1416 1416 }; … … 1458 1458 atom *Walker = NULL; 1459 1459 1460 Log() << Verbose(0) << "Combining the lists of all orders per order and finally into a single one." << endl;1460 DoLog(0) && (Log() << Verbose(0) << "Combining the lists of all orders per order and finally into a single one." << endl); 1461 1461 if (FragmentList == NULL) { 1462 1462 FragmentList = new Graph; … … 1491 1491 void FreeAllOrdersList(Graph ***FragmentLowerOrdersList, KeyStack &RootStack, molecule *mol) 1492 1492 { 1493 Log() << Verbose(1) << "Free'ing the lists of all orders per order." << endl;1493 DoLog(1) && (Log() << Verbose(1) << "Free'ing the lists of all orders per order." << endl); 1494 1494 int RootNr = 0; 1495 1495 int RootKeyNr = 0; … … 1544 1544 struct UniqueFragments FragmentSearch; 1545 1545 1546 Log() << Verbose(0) << "Begin of FragmentBOSSANOVA." << endl;1546 DoLog(0) && (Log() << Verbose(0) << "Begin of FragmentBOSSANOVA." << endl); 1547 1547 1548 1548 // FragmentLowerOrdersList is a 2D-array of pointer to MoleculeListClass objects, one dimension represents the ANOVA expansion of a single order (i.e. 5) … … 1594 1594 1595 1595 // create top order where nothing is reduced 1596 Log() << Verbose(0) << "==============================================================================================================" << endl;1597 Log() << Verbose(0) << "Creating KeySets of Bond Order " << Order << " for " << *Walker << ", " << (RootStack.size()-RootNr) << " Roots remaining." << endl; // , NumLevels is " << NumLevels << "1596 DoLog(0) && (Log() << Verbose(0) << "==============================================================================================================" << endl); 1597 DoLog(0) && (Log() << Verbose(0) << "Creating KeySets of Bond Order " << Order << " for " << *Walker << ", " << (RootStack.size()-RootNr) << " Roots remaining." << endl); // , NumLevels is " << NumLevels << " 1598 1598 1599 1599 // Create list of Graphs of current Bond Order (i.e. F_{ij}) … … 1605 1605 1606 1606 // output resulting number 1607 Log() << Verbose(1) << "Number of resulting KeySets is: " << NumMoleculesOfOrder[RootNr] << "." << endl;1607 DoLog(1) && (Log() << Verbose(1) << "Number of resulting KeySets is: " << NumMoleculesOfOrder[RootNr] << "." << endl); 1608 1608 if (NumMoleculesOfOrder[RootNr] != 0) { 1609 1609 NumMolecules = 0; … … 1622 1622 } 1623 1623 } 1624 Log() << Verbose(0) << "==============================================================================================================" << endl;1625 Log() << Verbose(1) << "Total number of resulting molecules is: " << TotalNumMolecules << "." << endl;1626 Log() << Verbose(0) << "==============================================================================================================" << endl;1624 DoLog(0) && (Log() << Verbose(0) << "==============================================================================================================" << endl); 1625 DoLog(1) && (Log() << Verbose(1) << "Total number of resulting molecules is: " << TotalNumMolecules << "." << endl); 1626 DoLog(0) && (Log() << Verbose(0) << "==============================================================================================================" << endl); 1627 1627 1628 1628 // cleanup FragmentSearch structure … … 1642 1642 Free(&NumMoleculesOfOrder); 1643 1643 1644 Log() << Verbose(0) << "End of FragmentBOSSANOVA." << endl;1644 DoLog(0) && (Log() << Verbose(0) << "End of FragmentBOSSANOVA." << endl); 1645 1645 }; 1646 1646 … … 1666 1666 bool flag = true; 1667 1667 1668 Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl;1668 DoLog(2) && (Log() << Verbose(2) << "Begin of ScanForPeriodicCorrection." << endl); 1669 1669 1670 1670 ColorList = Calloc<enum Shading>(AtomCount, "molecule::ScanForPeriodicCorrection: *ColorList"); … … 1684 1684 OtherBinder = Binder->next; // note down binding partner for later re-insertion 1685 1685 unlink(Binder); // unlink bond 1686 Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl;1686 DoLog(2) && (Log() << Verbose(2) << "Correcting at bond " << *Binder << "." << endl); 1687 1687 flag = true; 1688 1688 break; … … 1700 1700 //Log() << Verbose(3) << "Translation vector is "; 1701 1701 Translationvector.Output(); 1702 Log() << Verbose(0) << endl;1702 DoLog(0) && (Log() << Verbose(0) << endl); 1703 1703 // apply to all atoms of first component via BFS 1704 1704 for (int i=AtomCount;i--;) … … 1722 1722 link(Binder, OtherBinder); 1723 1723 } else { 1724 Log() << Verbose(3) << "No corrections for this fragment." << endl;1724 DoLog(3) && (Log() << Verbose(3) << "No corrections for this fragment." << endl); 1725 1725 } 1726 1726 //delete(CompStack); … … 1731 1731 Free(&ColorList); 1732 1732 Free(&matrix); 1733 Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl;1734 }; 1733 DoLog(2) && (Log() << Verbose(2) << "End of ScanForPeriodicCorrection." << endl); 1734 }; -
src/molecule_geometry.cpp
r6613ec ra67d19 280 280 if ((fabs(tmp)) > BondDistance) { 281 281 flag = false; 282 Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl;282 DoLog(0) && (Log() << Verbose(0) << "Hit: atom " << Walker->Name << " in bond " << *(*Runner) << " has to be shifted due to " << tmp << "." << endl); 283 283 if (tmp > 0) 284 284 Translationvector.x[j] -= 1.; … … 291 291 Testvector.MatrixMultiplication(matrix); 292 292 Center.AddVector(&Testvector); 293 Log() << Verbose(1) << "vector is: ";293 DoLog(1) && (Log() << Verbose(1) << "vector is: "); 294 294 Testvector.Output(); 295 Log() << Verbose(0) << endl;295 DoLog(0) && (Log() << Verbose(0) << endl); 296 296 #ifdef ADDHYDROGEN 297 297 // now also change all hydrogens … … 303 303 Testvector.MatrixMultiplication(matrix); 304 304 Center.AddVector(&Testvector); 305 Log() << Verbose(1) << "Hydrogen vector is: ";305 DoLog(1) && (Log() << Verbose(1) << "Hydrogen vector is: "); 306 306 Testvector.Output(); 307 Log() << Verbose(0) << endl;307 DoLog(0) && (Log() << Verbose(0) << endl); 308 308 } 309 309 } … … 352 352 } 353 353 // print InertiaTensor for debugging 354 Log() << Verbose(0) << "The inertia tensor is:" << endl;354 DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl); 355 355 for(int i=0;i<NDIM;i++) { 356 356 for(int j=0;j<NDIM;j++) 357 Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";358 Log() << Verbose(0) << endl;359 } 360 Log() << Verbose(0) << endl;357 DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " "); 358 DoLog(0) && (Log() << Verbose(0) << endl); 359 } 360 DoLog(0) && (Log() << Verbose(0) << endl); 361 361 362 362 // diagonalize to determine principal axis system … … 370 370 371 371 for(int i=0;i<NDIM;i++) { 372 Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i);373 Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl;372 DoLog(1) && (Log() << Verbose(1) << "eigenvalue = " << gsl_vector_get(eval, i)); 373 DoLog(0) && (Log() << Verbose(0) << ", eigenvector = (" << evec->data[i * evec->tda + 0] << "," << evec->data[i * evec->tda + 1] << "," << evec->data[i * evec->tda + 2] << ")" << endl); 374 374 } 375 375 376 376 // check whether we rotate or not 377 377 if (DoRotate) { 378 Log() << Verbose(1) << "Transforming molecule into PAS ... ";378 DoLog(1) && (Log() << Verbose(1) << "Transforming molecule into PAS ... "); 379 379 // the eigenvectors specify the transformation matrix 380 380 ActOnAllVectors( &Vector::MatrixMultiplication, (const double *) evec->data ); 381 Log() << Verbose(0) << "done." << endl;381 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 382 382 383 383 // summing anew for debugging (resulting matrix has to be diagonal!) … … 404 404 } 405 405 // print InertiaTensor for debugging 406 Log() << Verbose(0) << "The inertia tensor is:" << endl;406 DoLog(0) && (Log() << Verbose(0) << "The inertia tensor is:" << endl); 407 407 for(int i=0;i<NDIM;i++) { 408 408 for(int j=0;j<NDIM;j++) 409 Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " ";410 Log() << Verbose(0) << endl;411 } 412 Log() << Verbose(0) << endl;409 DoLog(0) && (Log() << Verbose(0) << InertiaTensor[i*NDIM+j] << " "); 410 DoLog(0) && (Log() << Verbose(0) << endl); 411 } 412 DoLog(0) && (Log() << Verbose(0) << endl); 413 413 } 414 414 … … 433 433 434 434 // rotate on z-x plane 435 Log() << Verbose(0) << "Begin of Aligning all atoms." << endl;435 DoLog(0) && (Log() << Verbose(0) << "Begin of Aligning all atoms." << endl); 436 436 alpha = atan(-n->x[0]/n->x[2]); 437 Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... ";437 DoLog(1) && (Log() << Verbose(1) << "Z-X-angle: " << alpha << " ... "); 438 438 while (ptr->next != end) { 439 439 ptr = ptr->next; … … 451 451 n->x[0] = cos(alpha) * tmp + sin(alpha) * n->x[2]; 452 452 n->x[2] = -sin(alpha) * tmp + cos(alpha) * n->x[2]; 453 Log() << Verbose(1) << "alignment vector after first rotation: ";453 DoLog(1) && (Log() << Verbose(1) << "alignment vector after first rotation: "); 454 454 n->Output(); 455 Log() << Verbose(0) << endl;455 DoLog(0) && (Log() << Verbose(0) << endl); 456 456 457 457 // rotate on z-y plane 458 458 ptr = start; 459 459 alpha = atan(-n->x[1]/n->x[2]); 460 Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... ";460 DoLog(1) && (Log() << Verbose(1) << "Z-Y-angle: " << alpha << " ... "); 461 461 while (ptr->next != end) { 462 462 ptr = ptr->next; … … 475 475 n->x[2] = -sin(alpha) * tmp + cos(alpha) * n->x[2]; 476 476 477 Log() << Verbose(1) << "alignment vector after second rotation: ";477 DoLog(1) && (Log() << Verbose(1) << "alignment vector after second rotation: "); 478 478 n->Output(); 479 Log() << Verbose(1) << endl;480 Log() << Verbose(0) << "End of Aligning all atoms." << endl;479 DoLog(1) && (Log() << Verbose(1) << endl); 480 DoLog(0) && (Log() << Verbose(0) << "End of Aligning all atoms." << endl); 481 481 }; 482 482 -
src/molecule_graph.cpp
r6613ec ra67d19 59 59 60 60 if (!input) { 61 Log() << Verbose(1) << "Opening silica failed \n";61 DoLog(1) && (Log() << Verbose(1) << "Opening silica failed \n"); 62 62 }; 63 63 64 64 *input >> ws >> atom1; 65 65 *input >> ws >> atom2; 66 Log() << Verbose(1) << "Scanning file\n";66 DoLog(1) && (Log() << Verbose(1) << "Scanning file\n"); 67 67 while (!input->eof()) // Check whether we read everything already 68 68 { … … 115 115 116 116 BondDistance = bonddistance; // * ((IsAngstroem) ? 1. : 1./AtomicLengthToAngstroem); 117 Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl;117 DoLog(0) && (Log() << Verbose(0) << "Begin of CreateAdjacencyList." << endl); 118 118 // remove every bond from the list 119 119 bond *Binder = NULL; … … 128 128 // count atoms in molecule = dimension of matrix (also give each unique name and continuous numbering) 129 129 CountAtoms(); 130 Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl;130 DoLog(1) && (Log() << Verbose(1) << "AtomCount " << AtomCount << " and bonddistance is " << bonddistance << "." << endl); 131 131 132 132 if ((AtomCount > 1) && (bonddistance > 1.)) { 133 Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl;133 DoLog(2) && (Log() << Verbose(2) << "Creating Linked Cell structure ... " << endl); 134 134 LC = new LinkedCell(this, bonddistance); 135 135 136 136 // create a list to map Tesselpoint::nr to atom * 137 Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl;137 DoLog(2) && (Log() << Verbose(2) << "Creating TesselPoint to atom map ... " << endl); 138 138 AtomMap = Calloc<atom *> (AtomCount, "molecule::CreateAdjacencyList - **AtomCount"); 139 139 Walker = start; … … 144 144 145 145 // 3a. go through every cell 146 Log() << Verbose(2) << "Celling ... " << endl;146 DoLog(2) && (Log() << Verbose(2) << "Celling ... " << endl); 147 147 for (LC->n[0] = 0; LC->n[0] < LC->N[0]; LC->n[0]++) 148 148 for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++) … … 183 183 Free(&AtomMap); 184 184 delete (LC); 185 Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl;185 DoLog(1) && (Log() << Verbose(1) << "I detected " << BondCount << " bonds in the molecule with distance " << BondDistance << "." << endl); 186 186 187 187 // correct bond degree by comparing valence and bond degree 188 Log() << Verbose(2) << "Correcting bond degree ... " << endl;188 DoLog(2) && (Log() << Verbose(2) << "Correcting bond degree ... " << endl); 189 189 CorrectBondDegree(); 190 190 … … 192 192 ActOnAllAtoms( &atom::OutputBondOfAtom ); 193 193 } else 194 Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl;195 Log() << Verbose(0) << "End of CreateAdjacencyList." << endl;194 DoLog(1) && (Log() << Verbose(1) << "AtomCount is " << AtomCount << ", thus no bonds, no connections!." << endl); 195 DoLog(0) && (Log() << Verbose(0) << "End of CreateAdjacencyList." << endl); 196 196 if (free_BG) 197 197 delete(BG); … … 204 204 void molecule::OutputBondsList() const 205 205 { 206 Log() << Verbose(1) << endl << "From contents of bond chain list:";206 DoLog(1) && (Log() << Verbose(1) << endl << "From contents of bond chain list:"); 207 207 bond *Binder = first; 208 208 while (Binder->next != last) { 209 209 Binder = Binder->next; 210 Log() << Verbose(0) << *Binder << "\t" << endl;211 } 212 Log() << Verbose(0) << endl;210 DoLog(0) && (Log() << Verbose(0) << *Binder << "\t" << endl); 211 } 212 DoLog(0) && (Log() << Verbose(0) << endl); 213 213 } 214 214 ; … … 227 227 228 228 if (BondCount != 0) { 229 Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl;229 DoLog(1) && (Log() << Verbose(1) << "Correcting Bond degree of each bond ... " << endl); 230 230 do { 231 231 OldNo = No; 232 232 No = SumPerAtom( &atom::CorrectBondDegree ); 233 233 } while (OldNo != No); 234 Log() << Verbose(0) << " done." << endl;234 DoLog(0) && (Log() << Verbose(0) << " done." << endl); 235 235 } else { 236 Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl;237 } 238 Log() << Verbose(0) << No << " bonds could not be corrected." << endl;236 DoLog(1) && (Log() << Verbose(1) << "BondCount is " << BondCount << ", no bonds between any of the " << AtomCount << " atoms." << endl); 237 } 238 DoLog(0) && (Log() << Verbose(0) << No << " bonds could not be corrected." << endl); 239 239 240 240 return (No); … … 255 255 bond *Binder = first; 256 256 if ((Binder->next != last) && (Binder->next->Type == Undetermined)) { 257 Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl;257 DoLog(0) && (Log() << Verbose(0) << "No Depth-First-Search analysis performed so far, calling ..." << endl); 258 258 Subgraphs = DepthFirstSearchAnalysis(BackEdgeStack); 259 259 while (Subgraphs->next != NULL) { … … 310 310 Walker->GraphNr = DFS.CurrentGraphNr; 311 311 Walker->LowpointNr = DFS.CurrentGraphNr; 312 Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl;312 DoLog(1) && (Log() << Verbose(1) << "Setting Walker[" << Walker->Name << "]'s number to " << Walker->GraphNr << " with Lowpoint " << Walker->LowpointNr << "." << endl); 313 313 DFS.AtomStack->Push(Walker); 314 314 DFS.CurrentGraphNr++; … … 337 337 if (Binder == NULL) 338 338 break; 339 Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl;339 DoLog(2) && (Log() << Verbose(2) << "Current Unused Bond is " << *Binder << "." << endl); 340 340 // (4) Mark Binder used, ... 341 341 Binder->MarkUsed(black); 342 342 OtherAtom = Binder->GetOtherAtom(Walker); 343 Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl;343 DoLog(2) && (Log() << Verbose(2) << "(4) OtherAtom is " << OtherAtom->Name << "." << endl); 344 344 if (OtherAtom->GraphNr != -1) { 345 345 // (4a) ... if "other" atom has been visited (GraphNr != 0), set lowpoint to minimum of both, go to (3) … … 347 347 DFS.BackEdgeStack->Push(Binder); 348 348 Walker->LowpointNr = (Walker->LowpointNr < OtherAtom->GraphNr) ? Walker->LowpointNr : OtherAtom->GraphNr; 349 Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl;349 DoLog(3) && (Log() << Verbose(3) << "(4a) Visited: Setting Lowpoint of Walker[" << Walker->Name << "] to " << Walker->LowpointNr << "." << endl); 350 350 } else { 351 351 // (4b) ... otherwise set OtherAtom as Ancestor of Walker and Walker as OtherAtom, go to (2) … … 353 353 OtherAtom->Ancestor = Walker; 354 354 Walker = OtherAtom; 355 Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl;355 DoLog(3) && (Log() << Verbose(3) << "(4b) Not Visited: OtherAtom[" << OtherAtom->Name << "]'s Ancestor is now " << OtherAtom->Ancestor->Name << ", Walker is OtherAtom " << OtherAtom->Name << "." << endl); 356 356 break; 357 357 } … … 375 375 376 376 // (5) if Ancestor of Walker is ... 377 Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl;377 DoLog(1) && (Log() << Verbose(1) << "(5) Number of Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "] is " << Walker->Ancestor->GraphNr << "." << endl); 378 378 379 379 if (Walker->Ancestor->GraphNr != DFS.Root->GraphNr) { … … 382 382 // (6a) set Ancestor's Lowpoint number to minimum of of its Ancestor and itself, go to Step(8) 383 383 Walker->Ancestor->LowpointNr = (Walker->Ancestor->LowpointNr < Walker->LowpointNr) ? Walker->Ancestor->LowpointNr : Walker->LowpointNr; 384 Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl;384 DoLog(2) && (Log() << Verbose(2) << "(6) Setting Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s Lowpoint to " << Walker->Ancestor->LowpointNr << "." << endl); 385 385 } else { 386 386 // (7) (Ancestor of Walker is a separating vertex, remove all from stack till Walker (including), these and Ancestor form a component 387 387 Walker->Ancestor->SeparationVertex = true; 388 Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl;388 DoLog(2) && (Log() << Verbose(2) << "(7) Walker[" << Walker->Name << "]'s Ancestor[" << Walker->Ancestor->Name << "]'s is a separating vertex, creating component." << endl); 389 389 mol->SetNextComponentNumber(Walker->Ancestor, DFS.ComponentNumber); 390 Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl;390 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Ancestor's Compont is " << DFS.ComponentNumber << "." << endl); 391 391 mol->SetNextComponentNumber(Walker, DFS.ComponentNumber); 392 Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;392 DoLog(3) && (Log() << Verbose(3) << "(7) Walker[" << Walker->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl); 393 393 do { 394 394 OtherAtom = DFS.AtomStack->PopLast(); 395 395 LeafWalker->Leaf->AddCopyAtom(OtherAtom); 396 396 mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber); 397 Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;397 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl); 398 398 } while (OtherAtom != Walker); 399 399 DFS.ComponentNumber++; 400 400 } 401 401 // (8) Walker becomes its Ancestor, go to (3) 402 Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl;402 DoLog(2) && (Log() << Verbose(2) << "(8) Walker[" << Walker->Name << "] is now its Ancestor " << Walker->Ancestor->Name << ", backstepping. " << endl); 403 403 Walker = Walker->Ancestor; 404 404 DFS.BackStepping = true; … … 424 424 //DFS.AtomStack->Output(out); 425 425 mol->SetNextComponentNumber(DFS.Root, DFS.ComponentNumber); 426 Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl;426 DoLog(3) && (Log() << Verbose(3) << "(9) Root[" << DFS.Root->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl); 427 427 mol->SetNextComponentNumber(Walker, DFS.ComponentNumber); 428 Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl;428 DoLog(3) && (Log() << Verbose(3) << "(9) Walker[" << Walker->Name << "]'s Component is " << DFS.ComponentNumber << "." << endl); 429 429 do { 430 430 OtherAtom = DFS.AtomStack->PopLast(); 431 431 LeafWalker->Leaf->AddCopyAtom(OtherAtom); 432 432 mol->SetNextComponentNumber(OtherAtom, DFS.ComponentNumber); 433 Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl;433 DoLog(3) && (Log() << Verbose(3) << "(7) Other[" << OtherAtom->Name << "]'s Compont is " << DFS.ComponentNumber << "." << endl); 434 434 } while (OtherAtom != Walker); 435 435 DFS.ComponentNumber++; … … 438 438 Walker = DFS.Root; 439 439 Binder = mol->FindNextUnused(Walker); 440 Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl;440 DoLog(1) && (Log() << Verbose(1) << "(10) Walker is Root[" << DFS.Root->Name << "], next Unused Bond is " << Binder << "." << endl); 441 441 if (Binder != NULL) { // Root is separation vertex 442 Log() << Verbose(1) << "(11) Root is a separation vertex." << endl;442 DoLog(1) && (Log() << Verbose(1) << "(11) Root is a separation vertex." << endl); 443 443 Walker->SeparationVertex = true; 444 444 } … … 497 497 if (AtomCount == 0) 498 498 return SubGraphs; 499 Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl;499 DoLog(0) && (Log() << Verbose(0) << "Begin of DepthFirstSearchAnalysis" << endl); 500 500 DepthFirstSearchAnalysis_Init(DFS, this); 501 501 … … 519 519 520 520 if (Binder == NULL) { 521 Log() << Verbose(2) << "No more Unused Bonds." << endl;521 DoLog(2) && (Log() << Verbose(2) << "No more Unused Bonds." << endl); 522 522 break; 523 523 } else … … 536 536 537 537 // From OldGraphNr to CurrentGraphNr ranges an disconnected subgraph 538 Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl;538 DoLog(0) && (Log() << Verbose(0) << "Disconnected subgraph ranges from " << OldGraphNr << " to " << DFS.CurrentGraphNr << "." << endl); 539 539 LeafWalker->Leaf->Output((ofstream *)&cout); 540 Log() << Verbose(0) << endl;540 DoLog(0) && (Log() << Verbose(0) << endl); 541 541 542 542 // step on to next root … … 556 556 // free all and exit 557 557 DepthFirstSearchAnalysis_Finalize(DFS); 558 Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl;558 DoLog(0) && (Log() << Verbose(0) << "End of DepthFirstSearchAnalysis" << endl); 559 559 return SubGraphs; 560 560 } … … 582 582 void molecule::OutputGraphInfoPerAtom() const 583 583 { 584 Log() << Verbose(1) << "Final graph info for each atom is:" << endl;584 DoLog(1) && (Log() << Verbose(1) << "Final graph info for each atom is:" << endl); 585 585 ActOnAllAtoms( &atom::OutputGraphInfo ); 586 586 } … … 592 592 void molecule::OutputGraphInfoPerBond() const 593 593 { 594 Log() << Verbose(1) << "Final graph info for each bond is:" << endl;594 DoLog(1) && (Log() << Verbose(1) << "Final graph info for each bond is:" << endl); 595 595 bond *Binder = first; 596 596 while (Binder->next != last) { 597 597 Binder = Binder->next; 598 Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <";599 Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp.";598 DoLog(2) && (Log() << Verbose(2) << ((Binder->Type == TreeEdge) ? "TreeEdge " : "BackEdge ") << *Binder << ": <"); 599 DoLog(0) && (Log() << Verbose(0) << ((Binder->leftatom->SeparationVertex) ? "SP," : "") << "L" << Binder->leftatom->LowpointNr << " G" << Binder->leftatom->GraphNr << " Comp."); 600 600 Binder->leftatom->OutputComponentNumber(); 601 Log() << Verbose(0) << " === ";602 Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp.";601 DoLog(0) && (Log() << Verbose(0) << " === "); 602 DoLog(0) && (Log() << Verbose(0) << ((Binder->rightatom->SeparationVertex) ? "SP," : "") << "L" << Binder->rightatom->LowpointNr << " G" << Binder->rightatom->GraphNr << " Comp."); 603 603 Binder->rightatom->OutputComponentNumber(); 604 Log() << Verbose(0) << ">." << endl;604 DoLog(0) && (Log() << Verbose(0) << ">." << endl); 605 605 if (Binder->Cyclic) // cyclic ?? 606 Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl;606 DoLog(3) && (Log() << Verbose(3) << "Lowpoint at each side are equal: CYCLIC!" << endl); 607 607 } 608 608 } … … 678 678 do { // look for Root 679 679 Walker = BFS.BFSStack->PopFirst(); 680 Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl;680 DoLog(2) && (Log() << Verbose(2) << "Current Walker is " << *Walker << ", we look for SP to Root " << *BFS.Root << "." << endl); 681 681 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 682 682 if ((*Runner) != BackEdge) { // only walk along DFS spanning tree (otherwise we always find SP of one being backedge Binder) … … 685 685 if (OtherAtom->type->Z != 1) { 686 686 #endif 687 Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl;687 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl); 688 688 if (BFS.ColorList[OtherAtom->nr] == white) { 689 689 BFS.TouchedStack->Push(OtherAtom); … … 691 691 BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor 692 692 BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1; 693 Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl;693 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " lightgray, its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl); 694 694 //if (BFS.ShortestPathList[OtherAtom->nr] < MinimumRingSize[Walker->GetTrueFather()->nr]) { // Check for maximum distance 695 Log() << Verbose(3) << "Putting OtherAtom into queue." << endl;695 DoLog(3) && (Log() << Verbose(3) << "Putting OtherAtom into queue." << endl); 696 696 BFS.BFSStack->Push(OtherAtom); 697 697 //} 698 698 } else { 699 Log() << Verbose(3) << "Not Adding, has already been visited." << endl;699 DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl); 700 700 } 701 701 if (OtherAtom == BFS.Root) … … 703 703 #ifdef ADDHYDROGEN 704 704 } else { 705 Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl;705 DoLog(2) && (Log() << Verbose(2) << "Skipping hydrogen atom " << *OtherAtom << "." << endl); 706 706 BFS.ColorList[OtherAtom->nr] = black; 707 707 } 708 708 #endif 709 709 } else { 710 Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl;710 DoLog(2) && (Log() << Verbose(2) << "Bond " << *(*Runner) << " not Visiting, is the back edge." << endl); 711 711 } 712 712 } 713 713 BFS.ColorList[Walker->nr] = black; 714 Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;714 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl); 715 715 if (OtherAtom == BFS.Root) { // if we have found the root, check whether this cycle wasn't already found beforehand 716 716 // step through predecessor list … … 722 722 } 723 723 if (OtherAtom == BackEdge->rightatom) { // if each atom in found cycle is cyclic, loop's been found before already 724 Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl;724 DoLog(3) && (Log() << Verbose(3) << "This cycle was already found before, skipping and removing seeker from search." << endl); 725 725 do { 726 726 OtherAtom = BFS.TouchedStack->PopLast(); 727 727 if (BFS.PredecessorList[OtherAtom->nr] == Walker) { 728 Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl;728 DoLog(4) && (Log() << Verbose(4) << "Removing " << *OtherAtom << " from lists and stacks." << endl); 729 729 BFS.PredecessorList[OtherAtom->nr] = NULL; 730 730 BFS.ShortestPathList[OtherAtom->nr] = -1; … … 760 760 RingSize = 1; 761 761 BFS.Root->GetTrueFather()->IsCyclic = true; 762 Log() << Verbose(1) << "Found ring contains: ";762 DoLog(1) && (Log() << Verbose(1) << "Found ring contains: "); 763 763 Walker = BFS.Root; 764 764 while (Walker != BackEdge->rightatom) { 765 Log() << Verbose(0) << Walker->Name << " <-> ";765 DoLog(0) && (Log() << Verbose(0) << Walker->Name << " <-> "); 766 766 Walker = BFS.PredecessorList[Walker->nr]; 767 767 Walker->GetTrueFather()->IsCyclic = true; 768 768 RingSize++; 769 769 } 770 Log() << Verbose(0) << Walker->Name << " with a length of " << RingSize << "." << endl << endl;770 DoLog(0) && (Log() << Verbose(0) << Walker->Name << " with a length of " << RingSize << "." << endl << endl); 771 771 // walk through all and set MinimumRingSize 772 772 Walker = BFS.Root; … … 780 780 MinRingSize = RingSize; 781 781 } else { 782 Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl;782 DoLog(1) && (Log() << Verbose(1) << "No ring containing " << *BFS.Root << " with length equal to or smaller than " << MinimumRingSize[Walker->GetTrueFather()->nr] << " found." << endl); 783 783 } 784 784 }; … … 858 858 859 859 } 860 Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl;861 } 862 Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl;860 DoLog(1) && (Log() << Verbose(1) << "Minimum ring size of " << *Root << " is " << MinimumRingSize[Root->GetTrueFather()->nr] << "." << endl); 861 } 862 DoLog(1) && (Log() << Verbose(1) << "Minimum ring size is " << MinRingSize << ", over " << NumCycles << " cycles total." << endl); 863 863 } else 864 Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl;864 DoLog(1) && (Log() << Verbose(1) << "No rings were detected in the molecular structure." << endl); 865 865 } 866 866 ; … … 890 890 //BackEdgeStack->Output(out); 891 891 892 Log() << Verbose(1) << "Analysing cycles ... " << endl;892 DoLog(1) && (Log() << Verbose(1) << "Analysing cycles ... " << endl); 893 893 NumCycles = 0; 894 894 while (!BackEdgeStack->IsEmpty()) { … … 901 901 ResetBFSAccounting(Walker, BFS); 902 902 903 Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl;903 DoLog(1) && (Log() << Verbose(1) << "---------------------------------------------------------------------------------------------------------" << endl); 904 904 OtherAtom = NULL; 905 905 CyclicStructureAnalysis_CyclicBFSFromRootToRoot(BackEdge, BFS); … … 973 973 void OutputAlreadyVisited(int *list) 974 974 { 975 Log() << Verbose(4) << "Already Visited Bonds:\t";975 DoLog(4) && (Log() << Verbose(4) << "Already Visited Bonds:\t"); 976 976 for (int i = 1; i <= list[0]; i++) 977 Log() << Verbose(0) << list[i] << " ";978 Log() << Verbose(0) << endl;977 DoLog(0) && (Log() << Verbose(0) << list[i] << " "); 978 DoLog(0) && (Log() << Verbose(0) << endl); 979 979 } 980 980 ; … … 997 997 line << filename; 998 998 AdjacencyFile.open(line.str().c_str(), ios::out); 999 Log() << Verbose(1) << "Saving adjacency list ... ";999 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... "); 1000 1000 if (AdjacencyFile != NULL) { 1001 1001 AdjacencyFile << "m\tn" << endl; 1002 1002 ActOnAllAtoms(&atom::OutputAdjacency, &AdjacencyFile); 1003 1003 AdjacencyFile.close(); 1004 Log() << Verbose(1) << "done." << endl;1004 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 1005 1005 } else { 1006 Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;1006 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl); 1007 1007 status = false; 1008 1008 } … … 1029 1029 line << filename; 1030 1030 BondFile.open(line.str().c_str(), ios::out); 1031 Log() << Verbose(1) << "Saving adjacency list ... ";1031 DoLog(1) && (Log() << Verbose(1) << "Saving adjacency list ... "); 1032 1032 if (BondFile != NULL) { 1033 1033 BondFile << "m\tn" << endl; 1034 1034 ActOnAllAtoms(&atom::OutputBonds, &BondFile); 1035 1035 BondFile.close(); 1036 Log() << Verbose(1) << "done." << endl;1036 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 1037 1037 } else { 1038 Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;1038 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl); 1039 1039 status = false; 1040 1040 } … … 1049 1049 filename << path << "/" << FRAGMENTPREFIX << ADJACENCYFILE; 1050 1050 File.open(filename.str().c_str(), ios::out); 1051 Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... ";1051 DoLog(1) && (Log() << Verbose(1) << "Looking at bond structure stored in adjacency file and comparing to present one ... "); 1052 1052 if (File == NULL) 1053 1053 return false; … … 1090 1090 //Log() << Verbose(0) << endl; 1091 1091 } else { 1092 Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl;1092 DoLog(0) && (Log() << Verbose(0) << "Number of bonds for Atom " << *Walker << " does not match, parsed " << CurrentBondsOfAtom << " against " << Walker->ListOfBonds.size() << "." << endl); 1093 1093 status = false; 1094 1094 } … … 1113 1113 1114 1114 if (!CheckAdjacencyFileAgainstMolecule_Init(path, File, CurrentBonds)) { 1115 Log() << Verbose(1) << "Adjacency file not found." << endl;1115 DoLog(1) && (Log() << Verbose(1) << "Adjacency file not found." << endl); 1116 1116 return true; 1117 1117 } … … 1139 1139 1140 1140 if (status) { // if equal we parse the KeySetFile 1141 Log() << Verbose(1) << "done: Equal." << endl;1141 DoLog(1) && (Log() << Verbose(1) << "done: Equal." << endl); 1142 1142 } else 1143 Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl;1143 DoLog(1) && (Log() << Verbose(1) << "done: Not equal by " << NonMatchNumber << " atoms." << endl); 1144 1144 return status; 1145 1145 } … … 1157 1157 bool status = true; 1158 1158 if (ReferenceStack->IsEmpty()) { 1159 Log() << Verbose(1) << "ReferenceStack is empty!" << endl;1159 DoLog(1) && (Log() << Verbose(1) << "ReferenceStack is empty!" << endl); 1160 1160 return false; 1161 1161 } … … 1172 1172 if (OtherAtom == ListOfLocalAtoms[(*Runner)->rightatom->nr]) { // found the bond 1173 1173 LocalStack->Push((*Runner)); 1174 Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl;1174 DoLog(3) && (Log() << Verbose(3) << "Found local edge " << *(*Runner) << "." << endl); 1175 1175 break; 1176 1176 } 1177 1177 } 1178 1178 Binder = ReferenceStack->PopFirst(); // loop the stack for next item 1179 Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl;1179 DoLog(3) && (Log() << Verbose(3) << "Current candidate edge " << Binder << "." << endl); 1180 1180 ReferenceStack->Push(Binder); 1181 1181 } while (FirstBond != Binder); … … 1226 1226 BFS.PredecessorList[OtherAtom->nr] = Walker; // Walker is the predecessor 1227 1227 BFS.ShortestPathList[OtherAtom->nr] = BFS.ShortestPathList[Walker->nr] + 1; 1228 Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl;1228 DoLog(2) && (Log() << Verbose(2) << "Coloring OtherAtom " << OtherAtom->Name << " " << ((BFS.ColorList[OtherAtom->nr] == white) ? "white" : "lightgray") << ", its predecessor is " << Walker->Name << " and its Shortest Path is " << BFS.ShortestPathList[OtherAtom->nr] << " egde(s) long." << endl); 1229 1229 if ((((BFS.ShortestPathList[OtherAtom->nr] < BFS.BondOrder) && (Binder != Bond)))) { // Check for maximum distance 1230 Log() << Verbose(3);1230 DoLog(3) && (Log() << Verbose(3)); 1231 1231 if (AddedAtomList[OtherAtom->nr] == NULL) { // add if it's not been so far 1232 1232 AddedAtomList[OtherAtom->nr] = Mol->AddCopyAtom(OtherAtom); 1233 Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name;1233 DoLog(0) && (Log() << Verbose(0) << "Added OtherAtom " << OtherAtom->Name); 1234 1234 AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder); 1235 Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", ";1235 DoLog(0) && (Log() << Verbose(0) << " and bond " << *(AddedBondList[Binder->nr]) << ", "); 1236 1236 } else { // this code should actually never come into play (all white atoms are not yet present in BondMolecule, that's why they are white in the first place) 1237 Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name;1237 DoLog(0) && (Log() << Verbose(0) << "Not adding OtherAtom " << OtherAtom->Name); 1238 1238 if (AddedBondList[Binder->nr] == NULL) { 1239 1239 AddedBondList[Binder->nr] = Mol->CopyBond(AddedAtomList[Walker->nr], AddedAtomList[OtherAtom->nr], Binder); 1240 Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr]);1240 DoLog(0) && (Log() << Verbose(0) << ", added Bond " << *(AddedBondList[Binder->nr])); 1241 1241 } else 1242 Log() << Verbose(0) << ", not added Bond ";1243 } 1244 Log() << Verbose(0) << ", putting OtherAtom into queue." << endl;1242 DoLog(0) && (Log() << Verbose(0) << ", not added Bond "); 1243 } 1244 DoLog(0) && (Log() << Verbose(0) << ", putting OtherAtom into queue." << endl); 1245 1245 BFS.BFSStack->Push(OtherAtom); 1246 1246 } else { // out of bond order, then replace … … 1248 1248 BFS.ColorList[OtherAtom->nr] = white; // unmark if it has not been queued/added, to make it available via its other bonds (cyclic) 1249 1249 if (Binder == Bond) 1250 Log() << Verbose(3) << "Not Queueing, is the Root bond";1250 DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is the Root bond"); 1251 1251 else if (BFS.ShortestPathList[OtherAtom->nr] >= BFS.BondOrder) 1252 Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder;1252 DoLog(3) && (Log() << Verbose(3) << "Not Queueing, is out of Bond Count of " << BFS.BondOrder); 1253 1253 if (!Binder->Cyclic) 1254 Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl;1254 DoLog(0) && (Log() << Verbose(0) << ", is not part of a cyclic bond, saturating bond with Hydrogen." << endl); 1255 1255 if (AddedBondList[Binder->nr] == NULL) { 1256 1256 if ((AddedAtomList[OtherAtom->nr] != NULL)) { // .. whether we add or saturate … … 1269 1269 void BreadthFirstSearchAdd_VisitedNode(molecule *Mol, struct BFSAccounting &BFS, atom *&Walker, atom *&OtherAtom, bond *&Binder, bond *&Bond, atom **&AddedAtomList, bond **&AddedBondList, bool IsAngstroem) 1270 1270 { 1271 Log() << Verbose(3) << "Not Adding, has already been visited." << endl;1271 DoLog(3) && (Log() << Verbose(3) << "Not Adding, has already been visited." << endl); 1272 1272 // This has to be a cyclic bond, check whether it's present ... 1273 1273 if (AddedBondList[Binder->nr] == NULL) { … … 1315 1315 // followed by n+1 till top of stack. 1316 1316 Walker = BFS.BFSStack->PopFirst(); // pop oldest added 1317 Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl;1317 DoLog(1) && (Log() << Verbose(1) << "Current Walker is: " << Walker->Name << ", and has " << Walker->ListOfBonds.size() << " bonds." << endl); 1318 1318 for (BondList::const_iterator Runner = Walker->ListOfBonds.begin(); Runner != Walker->ListOfBonds.end(); (++Runner)) { 1319 1319 if ((*Runner) != NULL) { // don't look at bond equal NULL 1320 1320 Binder = (*Runner); 1321 1321 OtherAtom = (*Runner)->GetOtherAtom(Walker); 1322 Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl;1322 DoLog(2) && (Log() << Verbose(2) << "Current OtherAtom is: " << OtherAtom->Name << " for bond " << *(*Runner) << "." << endl); 1323 1323 if (BFS.ColorList[OtherAtom->nr] == white) { 1324 1324 BreadthFirstSearchAdd_UnvisitedNode(Mol, BFS, Walker, OtherAtom, Binder, Bond, AddedAtomList, AddedBondList, IsAngstroem); … … 1329 1329 } 1330 1330 BFS.ColorList[Walker->nr] = black; 1331 Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl;1331 DoLog(1) && (Log() << Verbose(1) << "Coloring Walker " << Walker->Name << " black." << endl); 1332 1332 } 1333 1333 BreadthFirstSearchAdd_Free(BFS); … … 1354 1354 // reset parent list 1355 1355 ParentList = Calloc<atom*> (AtomCount, "molecule::BuildInducedSubgraph_Init: **ParentList"); 1356 Log() << Verbose(3) << "Resetting ParentList." << endl;1356 DoLog(3) && (Log() << Verbose(3) << "Resetting ParentList." << endl); 1357 1357 } 1358 1358 ; … … 1361 1361 { 1362 1362 // fill parent list with sons 1363 Log() << Verbose(3) << "Filling Parent List." << endl;1363 DoLog(3) && (Log() << Verbose(3) << "Filling Parent List." << endl); 1364 1364 atom *Walker = mol->start; 1365 1365 while (Walker->next != mol->end) { … … 1367 1367 ParentList[Walker->father->nr] = Walker; 1368 1368 // Outputting List for debugging 1369 Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl;1369 DoLog(4) && (Log() << Verbose(4) << "Son[" << Walker->father->nr << "] of " << Walker->father << " is " << ParentList[Walker->father->nr] << "." << endl); 1370 1370 } 1371 1371 … … 1385 1385 atom *OtherAtom = NULL; 1386 1386 // check each entry of parent list and if ok (one-to-and-onto matching) create bonds 1387 Log() << Verbose(3) << "Creating bonds." << endl;1387 DoLog(3) && (Log() << Verbose(3) << "Creating bonds." << endl); 1388 1388 Walker = Father->start; 1389 1389 while (Walker->next != Father->end) { … … 1396 1396 OtherAtom = (*Runner)->GetOtherAtom(Walker); 1397 1397 if (ParentList[OtherAtom->nr] != NULL) { // if otheratom is also a father of an atom on this molecule, create the bond 1398 Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl;1398 DoLog(4) && (Log() << Verbose(4) << "Endpoints of Bond " << (*Runner) << " are both present: " << ParentList[Walker->nr]->Name << " and " << ParentList[OtherAtom->nr]->Name << "." << endl); 1399 1399 mol->AddBond(ParentList[Walker->nr], ParentList[OtherAtom->nr], (*Runner)->BondDegree); 1400 1400 } … … 1421 1421 atom **ParentList = NULL; 1422 1422 1423 Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl;1423 DoLog(2) && (Log() << Verbose(2) << "Begin of BuildInducedSubgraph." << endl); 1424 1424 BuildInducedSubgraph_Init(ParentList, Father->AtomCount); 1425 1425 BuildInducedSubgraph_FillParentList(this, Father, ParentList); 1426 1426 status = BuildInducedSubgraph_CreateBondsFromParent(this, Father, ParentList); 1427 1427 BuildInducedSubgraph_Finalize(ParentList); 1428 Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl;1428 DoLog(2) && (Log() << Verbose(2) << "End of BuildInducedSubgraph." << endl); 1429 1429 return status; 1430 1430 } … … 1443 1443 int size; 1444 1444 1445 Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl;1446 Log() << Verbose(2) << "Disconnected atom: ";1445 DoLog(1) && (Log() << Verbose(1) << "Begin of CheckForConnectedSubgraph" << endl); 1446 DoLog(2) && (Log() << Verbose(2) << "Disconnected atom: "); 1447 1447 1448 1448 // count number of atoms in graph … … 1466 1466 } 1467 1467 if (!BondStatus) { 1468 Log() << Verbose(0) << (*Walker) << endl;1468 DoLog(0) && (Log() << Verbose(0) << (*Walker) << endl); 1469 1469 return false; 1470 1470 } 1471 1471 } 1472 1472 else { 1473 Log() << Verbose(0) << "none." << endl;1473 DoLog(0) && (Log() << Verbose(0) << "none." << endl); 1474 1474 return true; 1475 1475 } 1476 Log() << Verbose(0) << "none." << endl;1477 1478 Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl;1476 DoLog(0) && (Log() << Verbose(0) << "none." << endl); 1477 1478 DoLog(1) && (Log() << Verbose(1) << "End of CheckForConnectedSubgraph" << endl); 1479 1479 1480 1480 return true; -
src/moleculelist.cpp
r6613ec ra67d19 36 36 MoleculeListClass::~MoleculeListClass() 37 37 { 38 Log() << Verbose(3) << this << ": Freeing ListOfMolcules." << endl;38 DoLog(3) && (Log() << Verbose(3) << this << ": Freeing ListOfMolcules." << endl); 39 39 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) { 40 Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl;40 DoLog(4) && (Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl); 41 41 delete (*ListRunner); 42 42 } 43 Log() << Verbose(4) << "Freeing ListOfMolecules." << endl;43 DoLog(4) && (Log() << Verbose(4) << "Freeing ListOfMolecules." << endl); 44 44 ListOfMolecules.clear(); // empty list 45 45 }; … … 145 145 146 146 // header 147 Log() << Verbose(0) << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl;148 Log() << Verbose(0) << "-----------------------------------------------" << endl;147 DoLog(0) && (Log() << Verbose(0) << "Index\tName\t\tAtoms\tFormula\tCenter\tSize" << endl); 148 DoLog(0) && (Log() << Verbose(0) << "-----------------------------------------------" << endl); 149 149 if (ListOfMolecules.size() == 0) 150 Log() << Verbose(0) << "\tNone" << endl;150 DoLog(0) && (Log() << Verbose(0) << "\tNone" << endl); 151 151 else { 152 152 Origin.Zero(); … … 165 165 } 166 166 // output Index, Name, number of atoms, chemical formula 167 Log() << Verbose(0) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t";167 DoLog(0) && (Log() << Verbose(0) << ((*ListRunner)->ActiveFlag ? "*" : " ") << (*ListRunner)->IndexNr << "\t" << (*ListRunner)->name << "\t\t" << (*ListRunner)->AtomCount << "\t"); 168 168 Elemental = (*ListRunner)->elemente->end; 169 169 while(Elemental->previous != (*ListRunner)->elemente->start) { 170 170 Elemental = Elemental->previous; 171 171 if (Counts[Elemental->Z] != 0) 172 Log() << Verbose(0) << Elemental->symbol << Counts[Elemental->Z];172 DoLog(0) && (Log() << Verbose(0) << Elemental->symbol << Counts[Elemental->Z]); 173 173 } 174 174 // Center and size 175 Log() << Verbose(0) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl;175 DoLog(0) && (Log() << Verbose(0) << "\t" << (*ListRunner)->Center << "\t" << sqrt(size) << endl); 176 176 } 177 177 } … … 339 339 while (Walker->next != srcmol->end) { 340 340 Walker = Walker->next; 341 Log() << Verbose(2) << "INFO: Current Walker is " << *Walker << "." << endl;341 DoLog(2) && (Log() << Verbose(2) << "INFO: Current Walker is " << *Walker << "." << endl); 342 342 if (!TesselStruct->IsInnerPoint(Walker->x, LCList)) { 343 343 CopyAtoms[Walker->nr] = new atom(Walker); … … 348 348 } 349 349 } 350 Log() << Verbose(1) << nr << " of " << srcmol->AtomCount << " atoms have been merged.";350 DoLog(1) && (Log() << Verbose(1) << nr << " of " << srcmol->AtomCount << " atoms have been merged."); 351 351 352 352 // go through all bonds and add as well … … 354 354 while(Binder->next != srcmol->last) { 355 355 Binder = Binder->next; 356 Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl;356 DoLog(3) && (Log() << Verbose(3) << "Adding Bond between " << *CopyAtoms[Binder->leftatom->nr] << " and " << *CopyAtoms[Binder->rightatom->nr]<< "." << endl); 357 357 mol->AddBond(CopyAtoms[Binder->leftatom->nr], CopyAtoms[Binder->rightatom->nr], Binder->BondDegree); 358 358 } … … 366 366 void MoleculeListClass::Output(ofstream *out) 367 367 { 368 Log() << Verbose(1) << "MoleculeList: ";368 DoLog(1) && (Log() << Verbose(1) << "MoleculeList: "); 369 369 for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) 370 Log() << Verbose(0) << *ListRunner << "\t";371 Log() << Verbose(0) << endl;370 DoLog(0) && (Log() << Verbose(0) << *ListRunner << "\t"); 371 DoLog(0) && (Log() << Verbose(0) << endl); 372 372 }; 373 373 … … 395 395 char *FragmentNumber = NULL; 396 396 397 Log() << Verbose(1) << "Saving hydrogen saturation correction ... ";397 DoLog(1) && (Log() << Verbose(1) << "Saving hydrogen saturation correction ... "); 398 398 // 0. parse in fit constant files that should have the same dimension as the final energy files 399 399 // 0a. find dimension of matrices with constants … … 405 405 input.open(line.c_str()); 406 406 if (input == NULL) { 407 Log() << Verbose(1) << endl << "Unable to open " << line << ", is the directory correct?" << endl;407 DoLog(1) && (Log() << Verbose(1) << endl << "Unable to open " << line << ", is the directory correct?" << endl); 408 408 return false; 409 409 } … … 422 422 b++; 423 423 } 424 Log() << Verbose(0) << "I recognized " << a << " columns and " << b << " rows, ";424 DoLog(0) && (Log() << Verbose(0) << "I recognized " << a << " columns and " << b << " rows, "); 425 425 input.close(); 426 426 … … 465 465 } 466 466 for (int k = 0; k < 3; k++) { 467 Log() << Verbose(0) << "Constants " << k << ":" << endl;467 DoLog(0) && (Log() << Verbose(0) << "Constants " << k << ":" << endl); 468 468 for (int j = 0; j < b; j++) { 469 469 for (int i = 0; i < a; i++) { 470 Log() << Verbose(0) << FitConstant[k][i][j] << "\t";470 DoLog(0) && (Log() << Verbose(0) << FitConstant[k][i][j] << "\t"); 471 471 } 472 Log() << Verbose(0) << endl;473 } 474 Log() << Verbose(0) << endl;472 DoLog(0) && (Log() << Verbose(0) << endl); 473 } 474 DoLog(0) && (Log() << Verbose(0) << endl); 475 475 } 476 476 … … 560 560 } 561 561 Free(&FitConstant); 562 Log() << Verbose(0) << "done." << endl;562 DoLog(0) && (Log() << Verbose(0) << "done." << endl); 563 563 return true; 564 564 }; … … 580 580 581 581 // open file for the force factors 582 Log() << Verbose(1) << "Saving force factors ... ";582 DoLog(1) && (Log() << Verbose(1) << "Saving force factors ... "); 583 583 line << path << "/" << FRAGMENTPREFIX << FORCESFILE; 584 584 ForcesFile.open(line.str().c_str(), ios::out); … … 608 608 } 609 609 ForcesFile.close(); 610 Log() << Verbose(1) << "done." << endl;610 DoLog(1) && (Log() << Verbose(1) << "done." << endl); 611 611 } else { 612 612 status = false; 613 Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl;613 DoLog(1) && (Log() << Verbose(1) << "failed to open file " << line.str() << "." << endl); 614 614 } 615 615 ForcesFile.close(); … … 663 663 sprintf(FragmentName, "%s/%s%s.conf.xyz", configuration->configpath, FRAGMENTPREFIX, FragmentNumber); 664 664 outputFragment.open(FragmentName, ios::out); 665 Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as XYZ ...";665 DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as XYZ ..."); 666 666 if ((intermediateResult = (*ListRunner)->OutputXYZ(&outputFragment))) 667 Log() << Verbose(0) << " done." << endl;667 DoLog(0) && (Log() << Verbose(0) << " done." << endl); 668 668 else 669 Log() << Verbose(0) << " failed." << endl;669 DoLog(0) && (Log() << Verbose(0) << " failed." << endl); 670 670 result = result && intermediateResult; 671 671 outputFragment.close(); … … 673 673 674 674 // list atoms in fragment for debugging 675 Log() << Verbose(2) << "Contained atoms: ";675 DoLog(2) && (Log() << Verbose(2) << "Contained atoms: "); 676 676 Walker = (*ListRunner)->start; 677 677 while (Walker->next != (*ListRunner)->end) { 678 678 Walker = Walker->next; 679 Log() << Verbose(0) << Walker->Name << " ";680 } 681 Log() << Verbose(0) << endl;679 DoLog(0) && (Log() << Verbose(0) << Walker->Name << " "); 680 } 681 DoLog(0) && (Log() << Verbose(0) << endl); 682 682 683 683 // center on edge … … 703 703 // and save as config 704 704 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber); 705 Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as config ...";705 DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as config ..."); 706 706 if ((intermediateResult = configuration->Save(FragmentName, (*ListRunner)->elemente, (*ListRunner)))) 707 Log() << Verbose(0) << " done." << endl;707 DoLog(0) && (Log() << Verbose(0) << " done." << endl); 708 708 else 709 Log() << Verbose(0) << " failed." << endl;709 DoLog(0) && (Log() << Verbose(0) << " failed." << endl); 710 710 result = result && intermediateResult; 711 711 … … 715 715 // and save as mpqc input file 716 716 sprintf(FragmentName, "%s/%s%s.conf", configuration->configpath, FRAGMENTPREFIX, FragmentNumber); 717 Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as mpqc input ...";717 DoLog(2) && (Log() << Verbose(2) << "Saving bond fragment No. " << FragmentNumber << "/" << FragmentCounter - 1 << " as mpqc input ..."); 718 718 if ((intermediateResult = configuration->SaveMPQC(FragmentName, (*ListRunner)))) 719 Log() << Verbose(2) << " done." << endl;719 DoLog(2) && (Log() << Verbose(2) << " done." << endl); 720 720 else 721 Log() << Verbose(0) << " failed." << endl;721 DoLog(0) && (Log() << Verbose(0) << " failed." << endl); 722 722 723 723 result = result && intermediateResult; … … 726 726 Free(&FragmentNumber); 727 727 } 728 Log() << Verbose(0) << " done." << endl;728 DoLog(0) && (Log() << Verbose(0) << " done." << endl); 729 729 730 730 // printing final number 731 Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl;731 DoLog(2) && (Log() << Verbose(2) << "Final number of fragments: " << FragmentCounter << "." << endl); 732 732 733 733 // restore cell_size … … 768 768 Walker = Advancer; 769 769 Advancer = Advancer->next; 770 Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl;770 DoLog(3) && (Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl); 771 771 unlink(Walker); 772 772 Walker->father = Walker; … … 819 819 strncat(molecules[i]->name, number, MAXSTRINGSIZE - strlen(mol->name) - 1); 820 820 } 821 Log() << Verbose(1) << "MolName is " << molecules[i]->name << endl;821 DoLog(1) && (Log() << Verbose(1) << "MolName is " << molecules[i]->name << endl); 822 822 insert(molecules[i]); 823 823 } … … 848 848 FragmentCounter = MolMap[Walker->nr]; 849 849 if (FragmentCounter != 0) { 850 Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl;850 DoLog(3) && (Log() << Verbose(3) << "Re-linking " << *Walker << "..." << endl); 851 851 unlink(Walker); 852 852 molecules[FragmentCounter-1]->AddAtom(Walker); // counting starts at 1 … … 873 873 Free(&MolMap); 874 874 Free(&molecules); 875 Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl;875 DoLog(1) && (Log() << Verbose(1) << "I scanned " << FragmentCounter << " molecules." << endl); 876 876 }; 877 877 … … 982 982 int AtomNo; 983 983 984 Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl;984 DoLog(1) && (Log() << Verbose(1) << "Begin of FillBondStructureFromReference." << endl); 985 985 // fill ListOfLocalAtoms if NULL was given 986 986 if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) { 987 Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;987 DoLog(1) && (Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl); 988 988 return false; 989 989 } 990 990 991 991 if (status) { 992 Log() << Verbose(1) << "Creating adjacency list for subgraph " << Leaf << "." << endl;992 DoLog(1) && (Log() << Verbose(1) << "Creating adjacency list for subgraph " << Leaf << "." << endl); 993 993 // remove every bond from the list 994 994 bond *Binder = NULL; … … 1011 1011 Leaf->AddBond(Walker, OtherWalker, (*Runner)->BondDegree); 1012 1012 } else { 1013 Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << (*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl;1013 DoLog(1) && (Log() << Verbose(1) << "OtherWalker = ListOfLocalAtoms[" << FragmentCounter << "][" << (*Runner)->GetOtherAtom(Walker->GetTrueFather())->nr << "] is NULL!" << endl); 1014 1014 status = false; 1015 1015 } … … 1024 1024 Free(&ListOfLocalAtoms); 1025 1025 } 1026 Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl;1026 DoLog(1) && (Log() << Verbose(1) << "End of FillBondStructureFromReference." << endl); 1027 1027 return status; 1028 1028 }; … … 1057 1057 next->FillRootStackForSubgraphs(RootStack, AtomMask, ++FragmentCounter); 1058 1058 } else { 1059 Log() << Verbose(1) << "Rootstack[" << FragmentCounter << "] is NULL." << endl;1059 DoLog(1) && (Log() << Verbose(1) << "Rootstack[" << FragmentCounter << "] is NULL." << endl); 1060 1060 return false; 1061 1061 } … … 1063 1063 return true; 1064 1064 } else { 1065 Log() << Verbose(1) << "Rootstack is NULL." << endl;1065 DoLog(1) && (Log() << Verbose(1) << "Rootstack is NULL." << endl); 1066 1066 return false; 1067 1067 } … … 1113 1113 int KeySetCounter = 0; 1114 1114 1115 Log() << Verbose(1) << "Begin of AssignKeySetsToFragment." << endl;1115 DoLog(1) && (Log() << Verbose(1) << "Begin of AssignKeySetsToFragment." << endl); 1116 1116 // fill ListOfLocalAtoms if NULL was given 1117 1117 if (!FillListOfLocalAtoms(ListOfLocalAtoms, FragmentCounter, reference->AtomCount, FreeList)) { 1118 Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl;1118 DoLog(1) && (Log() << Verbose(1) << "Filling of ListOfLocalAtoms failed." << endl); 1119 1119 return false; 1120 1120 } … … 1144 1144 delete (TempSet); 1145 1145 if (KeySetCounter == 0) {// if there are no keysets, delete the list 1146 Log() << Verbose(1) << "KeySetCounter is zero, deleting FragmentList." << endl;1146 DoLog(1) && (Log() << Verbose(1) << "KeySetCounter is zero, deleting FragmentList." << endl); 1147 1147 delete (FragmentList[FragmentCounter]); 1148 1148 } else 1149 Log() << Verbose(1) << KeySetCounter << " keysets were assigned to subgraph " << FragmentCounter << "." << endl;1149 DoLog(1) && (Log() << Verbose(1) << KeySetCounter << " keysets were assigned to subgraph " << FragmentCounter << "." << endl); 1150 1150 FragmentCounter++; 1151 1151 if (next != NULL) … … 1153 1153 FragmentCounter--; 1154 1154 } else 1155 Log() << Verbose(1) << "KeySetList is NULL or empty." << endl;1155 DoLog(1) && (Log() << Verbose(1) << "KeySetList is NULL or empty." << endl); 1156 1156 1157 1157 if ((FreeList) && (ListOfLocalAtoms != NULL)) { … … 1161 1161 Free(&ListOfLocalAtoms); 1162 1162 } 1163 Log() << Verbose(1) << "End of AssignKeySetsToFragment." << endl;1163 DoLog(1) && (Log() << Verbose(1) << "End of AssignKeySetsToFragment." << endl); 1164 1164 return status; 1165 1165 }; … … 1174 1174 void MoleculeLeafClass::TranslateIndicesToGlobalIDs(Graph **FragmentList, int &FragmentCounter, int &TotalNumberOfKeySets, Graph &TotalGraph) 1175 1175 { 1176 Log() << Verbose(1) << "Begin of TranslateIndicesToGlobalIDs." << endl;1176 DoLog(1) && (Log() << Verbose(1) << "Begin of TranslateIndicesToGlobalIDs." << endl); 1177 1177 KeySet *TempSet = new KeySet; 1178 1178 if (FragmentList[FragmentCounter] != NULL) { … … 1185 1185 delete (TempSet); 1186 1186 } else { 1187 Log() << Verbose(1) << "FragmentList is NULL." << endl;1187 DoLog(1) && (Log() << Verbose(1) << "FragmentList is NULL." << endl); 1188 1188 } 1189 1189 if (next != NULL) 1190 1190 next->TranslateIndicesToGlobalIDs(FragmentList, ++FragmentCounter, TotalNumberOfKeySets, TotalGraph); 1191 1191 FragmentCounter--; 1192 Log() << Verbose(1) << "End of TranslateIndicesToGlobalIDs." << endl;1192 DoLog(1) && (Log() << Verbose(1) << "End of TranslateIndicesToGlobalIDs." << endl); 1193 1193 }; 1194 1194 -
src/parser.cpp
r6613ec ra67d19 32 32 if (input == NULL) { 33 33 if (!test) 34 Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl;34 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << filename << ", is the directory correct?" << endl); 35 35 return false; 36 36 } … … 109 109 bool MatrixContainer::InitialiseIndices(class MatrixContainer *Matrix) 110 110 { 111 Log() << Verbose(0) << "Initialising indices";111 DoLog(0) && (Log() << Verbose(0) << "Initialising indices"); 112 112 if (Matrix == NULL) { 113 Log() << Verbose(0) << " with trivial mapping." << endl;113 DoLog(0) && (Log() << Verbose(0) << " with trivial mapping." << endl); 114 114 Indices = Malloc<int*>(MatrixCounter + 1, "MatrixContainer::InitialiseIndices: **Indices"); 115 115 for(int i=MatrixCounter+1;i--;) { … … 119 119 } 120 120 } else { 121 Log() << Verbose(0) << " from other MatrixContainer." << endl;121 DoLog(0) && (Log() << Verbose(0) << " from other MatrixContainer." << endl); 122 122 if (MatrixCounter != Matrix->MatrixCounter) 123 123 return false; … … 269 269 input.open(file.str().c_str(), ios::in); 270 270 if (input == NULL) { 271 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;271 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 272 272 return false; 273 273 } … … 278 278 } 279 279 input.close(); 280 Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl;281 282 Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl;280 DoLog(0) && (Log() << Verbose(0) << "Determined " << MatrixCounter << " fragments." << endl); 281 282 DoLog(0) && (Log() << Verbose(0) << "Parsing through each fragment and retrieving " << prefix << suffix << "." << endl); 283 283 Header = ReAlloc<char*>(Header, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: **Header"); // one more each for the total molecule 284 284 Matrix = ReAlloc<double**>(Matrix, MatrixCounter + 1, "MatrixContainer::ParseFragmentMatrix: ***Matrix"); // one more each for the total molecule … … 469 469 char *FragmentNumber = NULL; 470 470 471 Log() << Verbose(0) << "Writing fragment files." << endl;471 DoLog(0) && (Log() << Verbose(0) << "Writing fragment files." << endl); 472 472 for(int i=0;i<MatrixCounter;i++) { 473 473 stringstream line; … … 503 503 stringstream line; 504 504 505 Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl;505 DoLog(0) && (Log() << Verbose(0) << "Writing matrix values of " << suffix << "." << endl); 506 506 line << name << prefix << suffix; 507 507 output.open(line.str().c_str(), ios::out); … … 529 529 bool EnergyMatrix::ParseIndices() 530 530 { 531 Log() << Verbose(0) << "Parsing energy indices." << endl;531 DoLog(0) && (Log() << Verbose(0) << "Parsing energy indices." << endl); 532 532 Indices = Malloc<int*>(MatrixCounter + 1, "EnergyMatrix::ParseIndices: **Indices"); 533 533 for(int i=MatrixCounter+1;i--;) { … … 588 588 } 589 589 // allocate last plus one matrix 590 Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;590 DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl); 591 591 Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 592 592 for(int j=0;j<=RowCounter[MatrixCounter];j++) … … 615 615 stringstream line; 616 616 617 Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl;617 DoLog(0) && (Log() << Verbose(0) << "Parsing force indices for " << MatrixCounter << " matrices." << endl); 618 618 Indices = Malloc<int*>(MatrixCounter + 1, "ForceMatrix::ParseIndices: **Indices"); 619 619 line << name << FRAGMENTPREFIX << FORCESFILE; … … 621 621 //Log() << Verbose(0) << "Opening " << line.str() << " ... " << input << endl; 622 622 if (input == NULL) { 623 Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;623 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl); 624 624 return false; 625 625 } … … 700 700 input.open(file.str().c_str(), ios::in); 701 701 if (input == NULL) { 702 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;702 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 703 703 return false; 704 704 } … … 724 724 725 725 // allocate last plus one matrix 726 Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;726 DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl); 727 727 Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 728 728 for(int j=0;j<=RowCounter[MatrixCounter];j++) … … 753 753 stringstream line; 754 754 755 Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl;755 DoLog(0) && (Log() << Verbose(0) << "Parsing hessian indices for " << MatrixCounter << " matrices." << endl); 756 756 Indices = Malloc<int*>(MatrixCounter + 1, "HessianMatrix::ParseIndices: **Indices"); 757 757 line << name << FRAGMENTPREFIX << FORCESFILE; … … 759 759 //Log() << Verbose(0) << "Opening " << line.str() << " ... " << input << endl; 760 760 if (input == NULL) { 761 Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl;761 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << line.str() << ", is the directory correct?" << endl); 762 762 return false; 763 763 } … … 930 930 input.open(file.str().c_str(), ios::in); 931 931 if (input == NULL) { 932 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;932 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 933 933 return false; 934 934 } … … 952 952 953 953 // allocate last plus one matrix 954 Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl;954 DoLog(0) && (Log() << Verbose(0) << "Allocating last plus one matrix with " << (RowCounter[MatrixCounter]+1) << " rows and " << ColumnCounter[MatrixCounter] << " columns." << endl); 955 955 Matrix[MatrixCounter] = Malloc<double*>(RowCounter[MatrixCounter] + 1, "MatrixContainer::ParseFragmentMatrix: **Matrix[]"); 956 956 for(int j=0;j<=RowCounter[MatrixCounter];j++) … … 1007 1007 1008 1008 FragmentCounter = FCounter; 1009 Log() << Verbose(0) << "Parsing key sets." << endl;1009 DoLog(0) && (Log() << Verbose(0) << "Parsing key sets." << endl); 1010 1010 KeySets = Malloc<int*>(FragmentCounter, "KeySetsContainer::ParseKeySets: **KeySets"); 1011 1011 for(int i=FragmentCounter;i--;) … … 1014 1014 input.open(file.str().c_str(), ios::in); 1015 1015 if (input == NULL) { 1016 Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl;1016 DoLog(0) && (Log() << Verbose(0) << endl << "Unable to open " << file.str() << ", is the directory correct?" << endl); 1017 1017 return false; 1018 1018 } … … 1048 1048 int Counter; 1049 1049 1050 Log() << Verbose(0) << "Creating Fragment terms." << endl;1050 DoLog(0) && (Log() << Verbose(0) << "Creating Fragment terms." << endl); 1051 1051 // scan through all to determine maximum order 1052 1052 Order=0; … … 1059 1059 Order = Counter; 1060 1060 } 1061 Log() << Verbose(0) << "Found Order is " << Order << "." << endl;1061 DoLog(0) && (Log() << Verbose(0) << "Found Order is " << Order << "." << endl); 1062 1062 1063 1063 // scan through all to determine fragments per order … … 1073 1073 } 1074 1074 for(int i=0;i<Order;i++) 1075 Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl;1075 DoLog(0) && (Log() << Verbose(0) << "Found No. of Fragments of Order " << i+1 << " is " << FragmentsPerOrder[i] << "." << endl); 1076 1076 1077 1077 // scan through all to gather indices to each order set … … 1089 1089 FragmentsPerOrder[Counter-1]++; 1090 1090 } 1091 Log() << Verbose(0) << "Printing OrderSet." << endl;1091 DoLog(0) && (Log() << Verbose(0) << "Printing OrderSet." << endl); 1092 1092 for(int i=0;i<Order;i++) { 1093 1093 for (int j=0;j<FragmentsPerOrder[i];j++) { 1094 Log() << Verbose(0) << " " << OrderSet[i][j];1095 } 1096 Log() << Verbose(0) << endl;1097 } 1098 Log() << Verbose(0) << endl;1094 DoLog(0) && (Log() << Verbose(0) << " " << OrderSet[i][j]); 1095 } 1096 DoLog(0) && (Log() << Verbose(0) << endl); 1097 } 1098 DoLog(0) && (Log() << Verbose(0) << endl); 1099 1099 1100 1100 -
src/periodentafel.cpp
r6613ec ra67d19 49 49 pointer->sort = &pointer->Z; 50 50 if (pointer->Z < 1 && pointer->Z >= MAX_ELEMENTS) 51 Log() << Verbose(0) << "Invalid Z number!\n";51 DoLog(0) && (Log() << Verbose(0) << "Invalid Z number!\n"); 52 52 return add(pointer, end); 53 53 }; … … 104 104 int Z; 105 105 do { 106 Log() << Verbose(0) << "Atomic number Z: ";106 DoLog(0) && (Log() << Verbose(0) << "Atomic number Z: "); 107 107 cin >> Z; 108 108 walker = this->FindElement(Z); // give type … … 118 118 element *walker = NULL; 119 119 int Z = -1; 120 Log() << Verbose(0) << "Atomic number: " << Z << endl;120 DoLog(0) && (Log() << Verbose(0) << "Atomic number: " << Z << endl); 121 121 cin >> Z; 122 122 walker = FindElement(Z); 123 123 if (walker == NULL) { 124 Log() << Verbose(0) << "Element not found in database, please enter." << endl;124 DoLog(0) && (Log() << Verbose(0) << "Element not found in database, please enter." << endl); 125 125 walker = new element; 126 126 walker->Z = Z; 127 Log() << Verbose(0) << "Mass: " << endl;127 DoLog(0) && (Log() << Verbose(0) << "Mass: " << endl); 128 128 cin >> walker->mass; 129 Log() << Verbose(0) << "Name [max 64 chars]: " << endl;129 DoLog(0) && (Log() << Verbose(0) << "Name [max 64 chars]: " << endl); 130 130 cin >> walker->name; 131 Log() << Verbose(0) << "Short form [max 3 chars]: " << endl;131 DoLog(0) && (Log() << Verbose(0) << "Short form [max 3 chars]: " << endl); 132 132 cin >> walker->symbol; 133 133 periodentafel::AddElement(walker); … … 198 198 infile.getline(header1, MAXSTRINGSIZE); 199 199 infile.getline(header2, MAXSTRINGSIZE); // skip first two header lines 200 Log() << Verbose(0) << "Parsed elements:";200 DoLog(0) && (Log() << Verbose(0) << "Parsed elements:"); 201 201 while (!infile.eof()) { 202 202 element *neues = new element; … … 220 220 //infile >> ws; 221 221 infile >> ws; 222 Log() << Verbose(0) << " " << neues->symbol;222 DoLog(0) && (Log() << Verbose(0) << " " << neues->symbol); 223 223 //neues->Output((ofstream *)&cout); 224 224 if ((neues->Z > 0) && (neues->Z < MAX_ELEMENTS)) 225 225 periodentafel::AddElement(neues); 226 226 else { 227 Log() << Verbose(0) << "Could not parse element: ";227 DoLog(0) && (Log() << Verbose(0) << "Could not parse element: "); 228 228 neues->Output((ofstream *)&cout); 229 229 delete(neues); 230 230 } 231 231 } 232 Log() << Verbose(0) << endl;232 DoLog(0) && (Log() << Verbose(0) << endl); 233 233 infile.close(); 234 234 infile.clear(); -
src/stackclass.hpp
r6613ec ra67d19 130 130 { 131 131 bool found = false; 132 Log() << Verbose(5) << "First " << CurrentFirstEntry<< "\tLast " << CurrentLastEntry<< "\tNext " << NextFreeField<< "\tCount " << EntryCount<< "." << endl;132 DoLog(5) && (Log() << Verbose(5) << "First " << CurrentFirstEntry<< "\tLast " << CurrentLastEntry<< "\tNext " << NextFreeField<< "\tCount " << EntryCount<< "." << endl); 133 133 int i=CurrentFirstEntry; 134 134 if (!IsEmpty()) 135 135 do { 136 136 if (StackList[i] == ptr) { // if item found, remove 137 Log() << Verbose(5) << "Item " << *ptr << " was number " << i << " on stack, removing it." << endl;137 DoLog(5) && (Log() << Verbose(5) << "Item " << *ptr << " was number " << i << " on stack, removing it." << endl); 138 138 found = true; 139 139 StackList[i] = NULL; … … 141 141 if ((found) && (StackList[i] != NULL)) { // means we have to shift (and not the removed item) 142 142 if (i == 0) { // we are down to first item in stack, have to put onto last item 143 Log() << Verbose(5) << "Shifting item 0 to place " << EntryCount-1 << "." << endl;143 DoLog(5) && (Log() << Verbose(5) << "Shifting item 0 to place " << EntryCount-1 << "." << endl); 144 144 StackList[EntryCount-1] = StackList[0]; 145 145 } else { 146 Log() << Verbose(5) << "Shifting item " << i << " to place " << i-1 << "." << endl;146 DoLog(5) && (Log() << Verbose(5) << "Shifting item " << i << " to place " << i-1 << "." << endl); 147 147 StackList[i-1] = StackList[i]; 148 148 } -
src/tesselation.cpp
r6613ec ra67d19 28 28 { 29 29 Info FunctionInfo(__func__); 30 Log() << Verbose(1) << "Adding noname." << endl;30 DoLog(1) && (Log() << Verbose(1) << "Adding noname." << endl); 31 31 } 32 32 ; … … 39 39 { 40 40 Info FunctionInfo(__func__); 41 Log() << Verbose(1) << "Adding Node " << *Walker << endl;41 DoLog(1) && (Log() << Verbose(1) << "Adding Node " << *Walker << endl); 42 42 } 43 43 ; … … 63 63 { 64 64 Info FunctionInfo(__func__); 65 Log() << Verbose(1) << "Adding " << *this << " to line " << *line << "." << endl;65 DoLog(1) && (Log() << Verbose(1) << "Adding " << *this << " to line " << *line << "." << endl); 66 66 if (line->endpoints[0] == this) { 67 67 lines.insert(LinePair(line->endpoints[1]->Nr, line)); … … 115 115 skipped = false; 116 116 // clear triangles list 117 Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl;117 DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl); 118 118 } 119 119 ; … … 138 138 skipped = false; 139 139 // clear triangles list 140 Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl;140 DoLog(0) && (Log() << Verbose(0) << "New Line with endpoints " << *this << "." << endl); 141 141 } 142 142 ; … … 196 196 { 197 197 Info FunctionInfo(__func__); 198 Log() << Verbose(0) << "Add " << triangle->Nr << " to line " << *this << "." << endl;198 DoLog(0) && (Log() << Verbose(0) << "Add " << triangle->Nr << " to line " << *this << "." << endl); 199 199 triangles.insert(TrianglePair(triangle->Nr, triangle)); 200 200 } … … 270 270 //Log() << Verbose(0) << "INFO: BaselineNormal is " << BaseLineNormal << "." << endl; 271 271 if (NormalCheck.NormSquared() < MYEPSILON) { 272 Log() << Verbose(0) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl;272 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Normalvectors of both triangles are the same: convex." << endl); 273 273 return true; 274 274 } … … 276 276 double angle = GetAngle(helper[0], helper[1], BaseLineNormal); 277 277 if ((angle - M_PI) > -MYEPSILON) { 278 Log() << Verbose(0) << "ACCEPT: Angle is greater than pi: convex." << endl;278 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Angle is greater than pi: convex." << endl); 279 279 return true; 280 280 } else { 281 Log() << Verbose(0) << "REJECT: Angle is less than pi: concave." << endl;281 DoLog(0) && (Log() << Verbose(0) << "REJECT: Angle is less than pi: concave." << endl); 282 282 return false; 283 283 } … … 364 364 // set endpoints 365 365 int Counter = 0; 366 Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl;366 DoLog(0) && (Log() << Verbose(0) << "New triangle " << Nr << " with end points: " << endl); 367 367 for (PointMap::iterator runner = OrderMap.begin(); runner != OrderMap.end(); runner++) { 368 368 endpoints[Counter] = runner->second; 369 Log() << Verbose(0) << " " << *endpoints[Counter] << endl;369 DoLog(0) && (Log() << Verbose(0) << " " << *endpoints[Counter] << endl); 370 370 Counter++; 371 371 } … … 413 413 if (NormalVector.ScalarProduct(&OtherVector) > 0.) 414 414 NormalVector.Scale(-1.); 415 Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl;415 DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << NormalVector << "." << endl); 416 416 } 417 417 ; … … 440 440 } 441 441 442 Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl;443 Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl;444 Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl;442 DoLog(1) && (Log() << Verbose(1) << "INFO: Triangle is " << *this << "." << endl); 443 DoLog(1) && (Log() << Verbose(1) << "INFO: Line is from " << *MolCenter << " to " << *x << "." << endl); 444 DoLog(1) && (Log() << Verbose(1) << "INFO: Intersection is " << *Intersection << "." << endl); 445 445 446 446 if (Intersection->DistanceSquared(endpoints[0]->node->node) < MYEPSILON) { 447 Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl;447 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with first endpoint." << endl); 448 448 return true; 449 449 } else if (Intersection->DistanceSquared(endpoints[1]->node->node) < MYEPSILON) { 450 Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl;450 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with second endpoint." << endl); 451 451 return true; 452 452 } else if (Intersection->DistanceSquared(endpoints[2]->node->node) < MYEPSILON) { 453 Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl;453 DoLog(1) && (Log() << Verbose(1) << "Intersection coindices with third endpoint." << endl); 454 454 return true; 455 455 } … … 462 462 CrossPoint.SubtractVector(endpoints[i % 3]->node->node); // cross point was returned as absolute vector 463 463 const double s = CrossPoint.ScalarProduct(&helper) / helper.NormSquared(); 464 Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl;464 DoLog(1) && (Log() << Verbose(1) << "INFO: Factor s is " << s << "." << endl); 465 465 if ((s < -MYEPSILON) || ((s - 1.) > MYEPSILON)) { 466 Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl;466 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << "outside of triangle." << endl); 467 467 i = 4; 468 468 break; … … 473 473 } while (i < 3); 474 474 if (i == 3) { 475 Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl;475 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " inside of triangle." << endl); 476 476 return true; 477 477 } else { 478 Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl;478 DoLog(1) && (Log() << Verbose(1) << "INFO: Crosspoint " << CrossPoint << " outside of triangle." << endl); 479 479 return false; 480 480 } … … 500 500 501 501 // 1. get intersection with plane 502 Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << *x << "." << endl;502 DoLog(1) && (Log() << Verbose(1) << "INFO: Looking for closest point of triangle " << *this << " to " << *x << "." << endl); 503 503 GetCenter(&Direction); 504 504 if (!ClosestPoint->GetIntersectionWithPlane(&NormalVector, endpoints[0]->node->node, x, &Direction)) { … … 513 513 InPlane.AddVector(ClosestPoint); 514 514 515 Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl;516 Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << *x << "." << endl;517 Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl;515 DoLog(2) && (Log() << Verbose(2) << "INFO: Triangle is " << *this << "." << endl); 516 DoLog(2) && (Log() << Verbose(2) << "INFO: Line is from " << Direction << " to " << *x << "." << endl); 517 DoLog(2) && (Log() << Verbose(2) << "INFO: In-plane part is " << InPlane << "." << endl); 518 518 519 519 // Calculate cross point between one baseline and the desired point such that distance is shortest … … 533 533 CrossPoint[i].SubtractVector(endpoints[i % 3]->node->node); // cross point was returned as absolute vector 534 534 const double s = CrossPoint[i].ScalarProduct(&Direction) / Direction.NormSquared(); 535 Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl;535 DoLog(2) && (Log() << Verbose(2) << "INFO: Factor s is " << s << "." << endl); 536 536 if ((s >= -MYEPSILON) && ((s - 1.) <= MYEPSILON)) { 537 537 CrossPoint[i].AddVector(endpoints[i % 3]->node->node); // make cross point absolute again 538 Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << *endpoints[i % 3]->node->node << " and " << *endpoints[(i + 1) % 3]->node->node << "." << endl;538 DoLog(2) && (Log() << Verbose(2) << "INFO: Crosspoint is " << CrossPoint[i] << ", intersecting BoundaryLine between " << *endpoints[i % 3]->node->node << " and " << *endpoints[(i + 1) % 3]->node->node << "." << endl); 539 539 const double distance = CrossPoint[i].DistanceSquared(x); 540 540 if ((ShortestDistance < 0.) || (ShortestDistance > distance)) { … … 565 565 } 566 566 } 567 Log() << Verbose(1) << "INFO: Closest Point is " << *ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl;567 DoLog(1) && (Log() << Verbose(1) << "INFO: Closest Point is " << *ClosestPoint << " with shortest squared distance is " << ShortestDistance << "." << endl); 568 568 return ShortestDistance; 569 569 } … … 619 619 { 620 620 Info FunctionInfo(__func__); 621 Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl;621 DoLog(1) && (Log() << Verbose(1) << "INFO: Checking " << Points[0] << "," << Points[1] << "," << Points[2] << " against " << endpoints[0] << "," << endpoints[1] << "," << endpoints[2] << "." << endl); 622 622 return (((endpoints[0] == Points[0]) || (endpoints[0] == Points[1]) || (endpoints[0] == Points[2])) && ((endpoints[1] == Points[0]) || (endpoints[1] == Points[1]) || (endpoints[1] == Points[2])) && ((endpoints[2] == Points[0]) || (endpoints[2] == Points[1]) || (endpoints[2] == Points[2]) 623 623 … … 668 668 center->AddVector(endpoints[i]->node->node); 669 669 center->Scale(1. / 3.); 670 Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl;670 DoLog(1) && (Log() << Verbose(1) << "INFO: Center is at " << *center << "." << endl); 671 671 } 672 672 … … 703 703 Info FunctionInfo(__func__); 704 704 endpoints.clear(); 705 Log() << Verbose(1) << "Erasing polygon Nr." << Nr << " itself." << endl;705 DoLog(1) && (Log() << Verbose(1) << "Erasing polygon Nr." << Nr << " itself." << endl); 706 706 } 707 707 ; … … 742 742 if (TotalNormal->ScalarProduct(&OtherVector) > 0.) 743 743 TotalNormal->Scale(-1.); 744 Log() << Verbose(1) << "Normal Vector is " << *TotalNormal << "." << endl;744 DoLog(1) && (Log() << Verbose(1) << "Normal Vector is " << *TotalNormal << "." << endl); 745 745 746 746 return TotalNormal; … … 762 762 } 763 763 center->Scale(1. / (double) counter); 764 Log() << Verbose(1) << "Center is at " << *center << "." << endl;764 DoLog(1) && (Log() << Verbose(1) << "Center is at " << *center << "." << endl); 765 765 } 766 766 … … 795 795 Info FunctionInfo(__func__); 796 796 for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++) { 797 Log() << Verbose(0) << "Checking against " << **Runner << endl;797 DoLog(0) && (Log() << Verbose(0) << "Checking against " << **Runner << endl); 798 798 if (point == (*Runner)) { 799 Log() << Verbose(0) << " Contained." << endl;799 DoLog(0) && (Log() << Verbose(0) << " Contained." << endl); 800 800 return true; 801 801 } 802 802 } 803 Log() << Verbose(0) << " Not contained." << endl;803 DoLog(0) && (Log() << Verbose(0) << " Not contained." << endl); 804 804 return false; 805 805 } … … 815 815 for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++) 816 816 if (point == (*Runner)->node) { 817 Log() << Verbose(0) << " Contained." << endl;817 DoLog(0) && (Log() << Verbose(0) << " Contained." << endl); 818 818 return true; 819 819 } 820 Log() << Verbose(0) << " Not contained." << endl;820 DoLog(0) && (Log() << Verbose(0) << " Not contained." << endl); 821 821 return false; 822 822 } … … 832 832 Info FunctionInfo(__func__); 833 833 int counter = 0; 834 Log() << Verbose(1) << "Polygon is " << *this << endl;834 DoLog(1) && (Log() << Verbose(1) << "Polygon is " << *this << endl); 835 835 for (int i = 0; i < dim; i++) { 836 Log() << Verbose(1) << " Testing endpoint " << *Points[i] << endl;836 DoLog(1) && (Log() << Verbose(1) << " Testing endpoint " << *Points[i] << endl); 837 837 if (ContainsBoundaryPoint(Points[i])) { 838 838 counter++; … … 855 855 Info FunctionInfo(__func__); 856 856 size_t counter = 0; 857 Log() << Verbose(1) << "Polygon is " << *this << endl;857 DoLog(1) && (Log() << Verbose(1) << "Polygon is " << *this << endl); 858 858 for (PointSet::const_iterator Runner = endpoints.begin(); Runner != endpoints.end(); Runner++) { 859 Log() << Verbose(1) << " Testing endpoint " << **Runner << endl;859 DoLog(1) && (Log() << Verbose(1) << " Testing endpoint " << **Runner << endl); 860 860 if (ContainsBoundaryPoint(*Runner)) 861 861 counter++; … … 895 895 Tester = triangles->insert(Sprinter->second); 896 896 if (Tester.second) 897 Log() << Verbose(0) << "Adding triangle " << *(Sprinter->second) << endl;897 DoLog(0) && (Log() << Verbose(0) << "Adding triangle " << *(Sprinter->second) << endl); 898 898 } 899 899 } 900 900 901 Log() << Verbose(1) << "The Polygon of " << endpoints.size() << " endpoints has " << triangles->size() << " unique triangles in total." << endl;901 DoLog(1) && (Log() << Verbose(1) << "The Polygon of " << endpoints.size() << " endpoints has " << triangles->size() << " unique triangles in total." << endl); 902 902 return triangles; 903 903 } … … 914 914 if (line == NULL) 915 915 return false; 916 Log() << Verbose(1) << "Filling polygon from line " << *line << endl;916 DoLog(1) && (Log() << Verbose(1) << "Filling polygon from line " << *line << endl); 917 917 for (TriangleMap::const_iterator Runner = line->triangles.begin(); Runner != line->triangles.end(); Runner++) { 918 918 for (int i = 0; i < 3; i++) { 919 919 Tester = endpoints.insert((Runner->second)->endpoints[i]); 920 920 if (Tester.second) 921 Log() << Verbose(1) << " Inserting endpoint " << *((Runner->second)->endpoints[i]) << endl;921 DoLog(1) && (Log() << Verbose(1) << " Inserting endpoint " << *((Runner->second)->endpoints[i]) << endl); 922 922 } 923 923 } … … 1071 1071 return false; 1072 1072 } else { 1073 Log() << Verbose(1) << "Candidate " << *Walker << " is inside by " << distance << "." << endl;1073 DoLog(1) && (Log() << Verbose(1) << "Candidate " << *Walker << " is inside by " << distance << "." << endl); 1074 1074 } 1075 1075 } … … 1082 1082 TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, (*VRunner)); 1083 1083 1084 Log() << Verbose(1) << "The following atoms are inside sphere at " << OtherOptCenter << ":" << endl;1084 DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << OtherOptCenter << ":" << endl); 1085 1085 for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner) 1086 Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&OtherOptCenter) << "." << endl;1086 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&OtherOptCenter) << "." << endl); 1087 1087 1088 1088 // remove baseline's endpoints and candidates 1089 1089 for (int i = 0; i < 2; i++) { 1090 Log() << Verbose(1) << "INFO: removing baseline tesselpoint " << *BaseLine->endpoints[i]->node << "." << endl;1090 DoLog(1) && (Log() << Verbose(1) << "INFO: removing baseline tesselpoint " << *BaseLine->endpoints[i]->node << "." << endl); 1091 1091 ListofPoints->remove(BaseLine->endpoints[i]->node); 1092 1092 } 1093 1093 for (TesselPointList::const_iterator Runner = pointlist.begin(); Runner != pointlist.end(); ++Runner) { 1094 Log() << Verbose(1) << "INFO: removing candidate tesselpoint " << *(*Runner) << "." << endl;1094 DoLog(1) && (Log() << Verbose(1) << "INFO: removing candidate tesselpoint " << *(*Runner) << "." << endl); 1095 1095 ListofPoints->remove(*Runner); 1096 1096 } … … 1106 1106 // check with animate_sphere.tcl VMD script 1107 1107 if (ThirdPoint != NULL) { 1108 Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " " << ThirdPoint->Nr + 1 << " " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl;1108 DoLog(1) && (Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " " << ThirdPoint->Nr + 1 << " " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl); 1109 1109 } else { 1110 Log() << Verbose(1) << "Check by: ... missing third point ..." << endl;1111 Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " ??? " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl;1110 DoLog(1) && (Log() << Verbose(1) << "Check by: ... missing third point ..." << endl); 1111 DoLog(1) && (Log() << Verbose(1) << "Check by: animate_sphere 0 " << BaseLine->endpoints[0]->Nr + 1 << " " << BaseLine->endpoints[1]->Nr + 1 << " ??? " << RADIUS << " " << OldCenter.x[0] << " " << OldCenter.x[1] << " " << OldCenter.x[2] << " " << (*VRunner)->x[0] << " " << (*VRunner)->x[1] << " " << (*VRunner)->x[2] << endl); 1112 1112 } 1113 1113 } … … 1157 1157 { 1158 1158 Info FunctionInfo(__func__); 1159 Log() << Verbose(0) << "Free'ing TesselStruct ... " << endl;1159 DoLog(0) && (Log() << Verbose(0) << "Free'ing TesselStruct ... " << endl); 1160 1160 for (TriangleMap::iterator runner = TrianglesOnBoundary.begin(); runner != TrianglesOnBoundary.end(); runner++) { 1161 1161 if (runner->second != NULL) { … … 1165 1165 DoeLog(1) && (eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl); 1166 1166 } 1167 Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl;1167 DoLog(0) && (Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl); 1168 1168 } 1169 1169 ; … … 1319 1319 // 3. construct plane vector 1320 1320 PlaneVector.MakeNormalVector(A->second->node->node, baseline->second.first->second->node->node, baseline->second.second->second->node->node); 1321 Log() << Verbose(2) << "Plane vector of candidate triangle is " << PlaneVector << endl;1321 DoLog(2) && (Log() << Verbose(2) << "Plane vector of candidate triangle is " << PlaneVector << endl); 1322 1322 // 4. loop over all points 1323 1323 double sign = 0.; … … 1333 1333 if (fabs(distance) < 1e-4) // we need to have a small epsilon around 0 which is still ok 1334 1334 continue; 1335 Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl;1335 DoLog(2) && (Log() << Verbose(2) << "Projection of " << checker->second->node->Name << " yields distance of " << distance << "." << endl); 1336 1336 tmp = distance / fabs(distance); 1337 1337 // 4b. Any have different sign to than before? (i.e. would lie outside convex hull with this starting triangle) 1338 1338 if ((sign != 0) && (tmp != sign)) { 1339 1339 // 4c. If so, break 4. loop and continue with next candidate in 1. loop 1340 Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl;1340 DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leaves " << checker->second->node->Name << " outside the convex hull." << endl); 1341 1341 break; 1342 1342 } else { // note the sign for later 1343 Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl;1343 DoLog(2) && (Log() << Verbose(2) << "Current candidates: " << A->second->node->Name << "," << baseline->second.first->second->node->Name << "," << baseline->second.second->second->node->Name << " leave " << checker->second->node->Name << " inside the convex hull." << endl); 1344 1344 sign = tmp; 1345 1345 } … … 1361 1361 // 5. come this far, all on same side? Then break 1. loop and construct triangle 1362 1362 if (checker == PointsOnBoundary.end()) { 1363 Log() << Verbose(2) << "Looks like we have a candidate!" << endl;1363 DoLog(2) && (Log() << Verbose(2) << "Looks like we have a candidate!" << endl); 1364 1364 break; 1365 1365 } … … 1385 1385 } 1386 1386 1387 Log() << Verbose(1) << "Starting triangle is " << *BTS << "." << endl;1387 DoLog(1) && (Log() << Verbose(1) << "Starting triangle is " << *BTS << "." << endl); 1388 1388 } else { 1389 1389 DoeLog(0) && (eLog() << Verbose(0) << "No starting triangle found." << endl); … … 1426 1426 // get peak point with respect to this base line's only triangle 1427 1427 BTS = baseline->second->triangles.begin()->second; // there is only one triangle so far 1428 Log() << Verbose(0) << "Current baseline is between " << *(baseline->second) << "." << endl;1428 DoLog(0) && (Log() << Verbose(0) << "Current baseline is between " << *(baseline->second) << "." << endl); 1429 1429 for (int i = 0; i < 3; i++) 1430 1430 if ((BTS->endpoints[i] != baseline->second->endpoints[0]) && (BTS->endpoints[i] != baseline->second->endpoints[1])) 1431 1431 peak = BTS->endpoints[i]; 1432 Log() << Verbose(1) << " and has peak " << *peak << "." << endl;1432 DoLog(1) && (Log() << Verbose(1) << " and has peak " << *peak << "." << endl); 1433 1433 1434 1434 // prepare some auxiliary vectors … … 1445 1445 CenterVector.AddVector(BTS->endpoints[i]->node->node); 1446 1446 CenterVector.Scale(1. / 3.); 1447 Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl;1447 DoLog(2) && (Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl); 1448 1448 1449 1449 // normal vector of triangle … … 1452 1452 BTS->GetNormalVector(NormalVector); 1453 1453 NormalVector.CopyVector(&BTS->NormalVector); 1454 Log() << Verbose(2) << "NormalVector of base triangle is " << NormalVector << endl;1454 DoLog(2) && (Log() << Verbose(2) << "NormalVector of base triangle is " << NormalVector << endl); 1455 1455 1456 1456 // vector in propagation direction (out of triangle) … … 1462 1462 if (PropagationVector.ScalarProduct(&TempVector) > 0) // make sure normal propagation vector points outward from baseline 1463 1463 PropagationVector.Scale(-1.); 1464 Log() << Verbose(2) << "PropagationVector of base triangle is " << PropagationVector << endl;1464 DoLog(2) && (Log() << Verbose(2) << "PropagationVector of base triangle is " << PropagationVector << endl); 1465 1465 winner = PointsOnBoundary.end(); 1466 1466 … … 1468 1468 for (PointMap::iterator target = PointsOnBoundary.begin(); target != PointsOnBoundary.end(); target++) { 1469 1469 if ((target->second != baseline->second->endpoints[0]) && (target->second != baseline->second->endpoints[1])) { // don't take the same endpoints 1470 Log() << Verbose(1) << "Target point is " << *(target->second) << ":" << endl;1470 DoLog(1) && (Log() << Verbose(1) << "Target point is " << *(target->second) << ":" << endl); 1471 1471 1472 1472 // first check direction, so that triangles don't intersect … … 1475 1475 VirtualNormalVector.ProjectOntoPlane(&NormalVector); 1476 1476 TempAngle = VirtualNormalVector.Angle(&PropagationVector); 1477 Log() << Verbose(2) << "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << "." << endl;1477 DoLog(2) && (Log() << Verbose(2) << "VirtualNormalVector is " << VirtualNormalVector << " and PropagationVector is " << PropagationVector << "." << endl); 1478 1478 if (TempAngle > (M_PI / 2.)) { // no bends bigger than Pi/2 (90 degrees) 1479 Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!" << endl;1479 DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", bad direction!" << endl); 1480 1480 continue; 1481 1481 } else 1482 Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!" << endl;1482 DoLog(2) && (Log() << Verbose(2) << "Angle on triangle plane between propagation direction and base line to " << *(target->second) << " is " << TempAngle << ", good direction!" << endl); 1483 1483 1484 1484 // check first and second endpoint (if any connecting line goes to target has at least not more than 1 triangle) … … 1486 1486 LineChecker[1] = baseline->second->endpoints[1]->lines.find(target->first); 1487 1487 if (((LineChecker[0] != baseline->second->endpoints[0]->lines.end()) && (LineChecker[0]->second->triangles.size() == 2))) { 1488 Log() << Verbose(2) << *(baseline->second->endpoints[0]) << " has line " << *(LineChecker[0]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[0]->second->triangles.size() << " triangles." << endl;1488 DoLog(2) && (Log() << Verbose(2) << *(baseline->second->endpoints[0]) << " has line " << *(LineChecker[0]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[0]->second->triangles.size() << " triangles." << endl); 1489 1489 continue; 1490 1490 } 1491 1491 if (((LineChecker[1] != baseline->second->endpoints[1]->lines.end()) && (LineChecker[1]->second->triangles.size() == 2))) { 1492 Log() << Verbose(2) << *(baseline->second->endpoints[1]) << " has line " << *(LineChecker[1]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[1]->second->triangles.size() << " triangles." << endl;1492 DoLog(2) && (Log() << Verbose(2) << *(baseline->second->endpoints[1]) << " has line " << *(LineChecker[1]->second) << " to " << *(target->second) << " as endpoint with " << LineChecker[1]->second->triangles.size() << " triangles." << endl); 1493 1493 continue; 1494 1494 } … … 1496 1496 // check whether the envisaged triangle does not already exist (if both lines exist and have same endpoint) 1497 1497 if ((((LineChecker[0] != baseline->second->endpoints[0]->lines.end()) && (LineChecker[1] != baseline->second->endpoints[1]->lines.end()) && (GetCommonEndpoint(LineChecker[0]->second, LineChecker[1]->second) == peak)))) { 1498 Log() << Verbose(4) << "Current target is peak!" << endl;1498 DoLog(4) && (Log() << Verbose(4) << "Current target is peak!" << endl); 1499 1499 continue; 1500 1500 } … … 1507 1507 helper.ProjectOntoPlane(&TempVector); 1508 1508 if (fabs(helper.NormSquared()) < MYEPSILON) { 1509 Log() << Verbose(2) << "Chosen set of vectors is linear dependent." << endl;1509 DoLog(2) && (Log() << Verbose(2) << "Chosen set of vectors is linear dependent." << endl); 1510 1510 continue; 1511 1511 } … … 1524 1524 // calculate angle 1525 1525 TempAngle = NormalVector.Angle(&VirtualNormalVector); 1526 Log() << Verbose(2) << "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << "." << endl;1526 DoLog(2) && (Log() << Verbose(2) << "NormalVector is " << VirtualNormalVector << " and the angle is " << TempAngle << "." << endl); 1527 1527 if ((SmallestAngle - TempAngle) > MYEPSILON) { // set to new possible winner 1528 1528 SmallestAngle = TempAngle; 1529 1529 winner = target; 1530 Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl;1530 DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl); 1531 1531 } else if (fabs(SmallestAngle - TempAngle) < MYEPSILON) { // check the angle to propagation, both possible targets are in one plane! (their normals have same angle) 1532 1532 // hence, check the angles to some normal direction from our base line but in this common plane of both targets... … … 1546 1546 SmallestAngle = TempAngle; 1547 1547 winner = target; 1548 Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction." << endl;1548 DoLog(2) && (Log() << Verbose(2) << "New winner " << *winner->second->node << " due to smaller angle " << TempAngle << " to propagation direction." << endl); 1549 1549 } else 1550 Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction." << endl;1550 DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle to propagation direction." << endl); 1551 1551 } else 1552 Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl;1552 DoLog(2) && (Log() << Verbose(2) << "Keeping old winner " << *winner->second->node << " due to smaller angle between normal vectors." << endl); 1553 1553 } 1554 1554 } // end of loop over all boundary points … … 1556 1556 // 5b. The point of the above whose triangle has the greatest angle with the triangle the current line belongs to (it only belongs to one, remember!): New triangle 1557 1557 if (winner != PointsOnBoundary.end()) { 1558 Log() << Verbose(0) << "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << "." << endl;1558 DoLog(0) && (Log() << Verbose(0) << "Winning target point is " << *(winner->second) << " with angle " << SmallestAngle << "." << endl); 1559 1559 // create the lins of not yet present 1560 1560 BLS[0] = baseline->second; … … 1591 1591 // 5d. If the set of lines is not yet empty, go to 5. and continue 1592 1592 } else 1593 Log() << Verbose(0) << "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << "." << endl;1593 DoLog(0) && (Log() << Verbose(0) << "Baseline candidate " << *(baseline->second) << " has a triangle count of " << baseline->second->triangles.size() << "." << endl); 1594 1594 } while (flag); 1595 1595 … … 1624 1624 } 1625 1625 Walker = cloud->GetPoint(); 1626 Log() << Verbose(0) << "Current point is " << *Walker << "." << endl;1626 DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Walker << "." << endl); 1627 1627 // get the next triangle 1628 1628 triangles = FindClosestTrianglesToVector(Walker->node, BoundaryPoints); 1629 1629 BTS = triangles->front(); 1630 1630 if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) { 1631 Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl;1631 DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl); 1632 1632 cloud->GoToNext(); 1633 1633 continue; 1634 1634 } else { 1635 1635 } 1636 Log() << Verbose(0) << "Closest triangle is " << *BTS << "." << endl;1636 DoLog(0) && (Log() << Verbose(0) << "Closest triangle is " << *BTS << "." << endl); 1637 1637 // get the intersection point 1638 1638 if (BTS->GetIntersectionInsideTriangle(Center, Walker->node, &Intersection)) { 1639 Log() << Verbose(0) << "We have an intersection at " << Intersection << "." << endl;1639 DoLog(0) && (Log() << Verbose(0) << "We have an intersection at " << Intersection << "." << endl); 1640 1640 // we have the intersection, check whether in- or outside of boundary 1641 1641 if ((Center->DistanceSquared(Walker->node) - Center->DistanceSquared(&Intersection)) < -MYEPSILON) { 1642 1642 // inside, next! 1643 Log() << Verbose(0) << *Walker << " is inside wrt triangle " << *BTS << "." << endl;1643 DoLog(0) && (Log() << Verbose(0) << *Walker << " is inside wrt triangle " << *BTS << "." << endl); 1644 1644 } else { 1645 1645 // outside! 1646 Log() << Verbose(0) << *Walker << " is outside wrt triangle " << *BTS << "." << endl;1646 DoLog(0) && (Log() << Verbose(0) << *Walker << " is outside wrt triangle " << *BTS << "." << endl); 1647 1647 class BoundaryLineSet *OldLines[3], *NewLines[3]; 1648 1648 class BoundaryPointSet *OldPoints[3], *NewPoint; … … 1654 1654 Normal.CopyVector(&BTS->NormalVector); 1655 1655 // add Walker to boundary points 1656 Log() << Verbose(0) << "Adding " << *Walker << " to BoundaryPoints." << endl;1656 DoLog(0) && (Log() << Verbose(0) << "Adding " << *Walker << " to BoundaryPoints." << endl); 1657 1657 AddFlag = true; 1658 1658 if (AddBoundaryPoint(Walker, 0)) … … 1661 1661 continue; 1662 1662 // remove triangle 1663 Log() << Verbose(0) << "Erasing triangle " << *BTS << "." << endl;1663 DoLog(0) && (Log() << Verbose(0) << "Erasing triangle " << *BTS << "." << endl); 1664 1664 TrianglesOnBoundary.erase(BTS->Nr); 1665 1665 delete (BTS); … … 1669 1669 BPS[1] = OldPoints[i]; 1670 1670 NewLines[i] = new class BoundaryLineSet(BPS, LinesOnBoundaryCount); 1671 Log() << Verbose(1) << "Creating new line " << *NewLines[i] << "." << endl;1671 DoLog(1) && (Log() << Verbose(1) << "Creating new line " << *NewLines[i] << "." << endl); 1672 1672 LinesOnBoundary.insert(LinePair(LinesOnBoundaryCount, NewLines[i])); // no need for check for unique insertion as BPS[0] is definitely a new one 1673 1673 LinesOnBoundaryCount++; … … 1691 1691 BTS->GetNormalVector(Normal); 1692 1692 Normal.Scale(-1.); 1693 Log() << Verbose(0) << "Created new triangle " << *BTS << "." << endl;1693 DoLog(0) && (Log() << Verbose(0) << "Created new triangle " << *BTS << "." << endl); 1694 1694 TrianglesOnBoundary.insert(TrianglePair(TrianglesOnBoundaryCount, BTS)); 1695 1695 TrianglesOnBoundaryCount++; … … 1746 1746 } else { 1747 1747 delete TPS[n]; 1748 Log() << Verbose(0) << "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl;1748 DoLog(0) && (Log() << Verbose(0) << "Node " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl); 1749 1749 TPS[n] = (InsertUnique.first)->second; 1750 1750 } … … 1783 1783 BoundaryLineSet *WinningLine = NULL; 1784 1784 if (FindLine != a->lines.end()) { 1785 Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl;1785 DoLog(1) && (Log() << Verbose(1) << "INFO: There is at least one line between " << *a << " and " << *b << ": " << *(FindLine->second) << "." << endl); 1786 1786 1787 1787 pair<LineMap::iterator, LineMap::iterator> FindPair; … … 1789 1789 1790 1790 for (FindLine = FindPair.first; (FindLine != FindPair.second) && (insertNewLine); FindLine++) { 1791 Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl;1791 DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl); 1792 1792 // If there is a line with less than two attached triangles, we don't need a new line. 1793 1793 if (FindLine->second->triangles.size() == 1) { 1794 1794 CandidateMap::iterator Finder = OpenLines.find(FindLine->second); 1795 1795 if (!Finder->second->pointlist.empty()) 1796 Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl;1796 DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl); 1797 1797 else 1798 Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate." << endl;1798 DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate." << endl); 1799 1799 // get open line 1800 1800 for (TesselPointList::const_iterator CandidateChecker = Finder->second->pointlist.begin(); CandidateChecker != Finder->second->pointlist.end(); ++CandidateChecker) { … … 1828 1828 { 1829 1829 Info FunctionInfo(__func__); 1830 Log() << Verbose(0) << "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl;1830 DoLog(0) && (Log() << Verbose(0) << "Adding open line [" << LinesOnBoundaryCount << "|" << *(a->node) << " and " << *(b->node) << "." << endl); 1831 1831 BPS[0] = a; 1832 1832 BPS[1] = b; … … 1850 1850 { 1851 1851 Info FunctionInfo(__func__); 1852 Log() << Verbose(0) << "Using existing line " << *Line << endl;1852 DoLog(0) && (Log() << Verbose(0) << "Using existing line " << *Line << endl); 1853 1853 1854 1854 // set endpoints and line … … 1859 1859 CandidateMap::iterator CandidateLine = OpenLines.find(BLS[n]); 1860 1860 if (CandidateLine != OpenLines.end()) { 1861 Log() << Verbose(1) << " Removing line from OpenLines." << endl;1861 DoLog(1) && (Log() << Verbose(1) << " Removing line from OpenLines." << endl); 1862 1862 delete (CandidateLine->second); 1863 1863 OpenLines.erase(CandidateLine); … … 1874 1874 { 1875 1875 Info FunctionInfo(__func__); 1876 Log() << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl;1876 DoLog(1) && (Log() << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl); 1877 1877 1878 1878 // add triangle to global map … … 1894 1894 { 1895 1895 Info FunctionInfo(__func__); 1896 Log() << Verbose(0) << "Adding triangle to global TrianglesOnBoundary map." << endl;1896 DoLog(0) && (Log() << Verbose(0) << "Adding triangle to global TrianglesOnBoundary map." << endl); 1897 1897 1898 1898 // add triangle to global map … … 1918 1918 for (int i = 0; i < 3; i++) { 1919 1919 if (triangle->lines[i] != NULL) { 1920 Log() << Verbose(0) << "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << "." << endl;1920 DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr." << triangle->Nr << " in line " << *triangle->lines[i] << "." << endl); 1921 1921 triangle->lines[i]->triangles.erase(triangle->Nr); 1922 1922 if (triangle->lines[i]->triangles.empty()) { 1923 Log() << Verbose(0) << *triangle->lines[i] << " is no more attached to any triangle, erasing." << endl;1923 DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is no more attached to any triangle, erasing." << endl); 1924 1924 RemoveTesselationLine(triangle->lines[i]); 1925 1925 } else { 1926 Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: ";1926 DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: "); 1927 1927 OpenLines.insert(pair<BoundaryLineSet *, CandidateForTesselation *> (triangle->lines[i], NULL)); 1928 1928 for (TriangleMap::iterator TriangleRunner = triangle->lines[i]->triangles.begin(); TriangleRunner != triangle->lines[i]->triangles.end(); TriangleRunner++) 1929 Log() << Verbose(0) << "[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t";1930 Log() << Verbose(0) << endl;1929 DoLog(0) && (Log() << Verbose(0) << "[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t"); 1930 DoLog(0) && (Log() << Verbose(0) << endl); 1931 1931 // for (int j=0;j<2;j++) { 1932 1932 // Log() << Verbose(0) << "Lines of endpoint " << *(triangle->lines[i]->endpoints[j]) << ": "; … … 1942 1942 1943 1943 if (TrianglesOnBoundary.erase(triangle->Nr)) 1944 Log() << Verbose(0) << "Removing triangle Nr. " << triangle->Nr << "." << endl;1944 DoLog(0) && (Log() << Verbose(0) << "Removing triangle Nr. " << triangle->Nr << "." << endl); 1945 1945 delete (triangle); 1946 1946 } … … 1974 1974 for (LineMap::iterator Runner = erasor.first; Runner != erasor.second; Runner++) 1975 1975 if ((*Runner).second == line) { 1976 Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl;1976 DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl); 1977 1977 line->endpoints[i]->lines.erase(Runner); 1978 1978 break; … … 1980 1980 } else { // there's just a single line left 1981 1981 if (line->endpoints[i]->lines.erase(line->Nr)) 1982 Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl;1982 DoLog(0) && (Log() << Verbose(0) << "Removing Line Nr. " << line->Nr << " in boundary point " << *line->endpoints[i] << "." << endl); 1983 1983 } 1984 1984 if (line->endpoints[i]->lines.empty()) { 1985 Log() << Verbose(0) << *line->endpoints[i] << " has no more lines it's attached to, erasing." << endl;1985 DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has no more lines it's attached to, erasing." << endl); 1986 1986 RemoveTesselationPoint(line->endpoints[i]); 1987 1987 } else { 1988 Log() << Verbose(0) << *line->endpoints[i] << " has still lines it's attached to: ";1988 DoLog(0) && (Log() << Verbose(0) << *line->endpoints[i] << " has still lines it's attached to: "); 1989 1989 for (LineMap::iterator LineRunner = line->endpoints[i]->lines.begin(); LineRunner != line->endpoints[i]->lines.end(); LineRunner++) 1990 Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t";1991 Log() << Verbose(0) << endl;1990 DoLog(0) && (Log() << Verbose(0) << "[" << *(LineRunner->second) << "] \t"); 1991 DoLog(0) && (Log() << Verbose(0) << endl); 1992 1992 } 1993 1993 line->endpoints[i] = NULL; // free'd or not: disconnect … … 1999 1999 2000 2000 if (LinesOnBoundary.erase(line->Nr)) 2001 Log() << Verbose(0) << "Removing line Nr. " << line->Nr << "." << endl;2001 DoLog(0) && (Log() << Verbose(0) << "Removing line Nr. " << line->Nr << "." << endl); 2002 2002 delete (line); 2003 2003 } … … 2015 2015 return; 2016 2016 if (PointsOnBoundary.erase(point->Nr)) 2017 Log() << Verbose(0) << "Removing point Nr. " << point->Nr << "." << endl;2017 DoLog(0) && (Log() << Verbose(0) << "Removing point Nr. " << point->Nr << "." << endl); 2018 2018 delete (point); 2019 2019 } … … 2035 2035 bool flag = true; 2036 2036 2037 Log() << Verbose(1) << "Check by: draw sphere {" << CandidateLine.OtherOptCenter.x[0] << " " << CandidateLine.OtherOptCenter.x[1] << " " << CandidateLine.OtherOptCenter.x[2] << "} radius " << RADIUS << " resolution 30" << endl;2037 DoLog(1) && (Log() << Verbose(1) << "Check by: draw sphere {" << CandidateLine.OtherOptCenter.x[0] << " " << CandidateLine.OtherOptCenter.x[1] << " " << CandidateLine.OtherOptCenter.x[2] << "} radius " << RADIUS << " resolution 30" << endl); 2038 2038 // get all points inside the sphere 2039 2039 TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, &CandidateLine.OtherOptCenter); 2040 2040 2041 Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl;2041 DoLog(1) && (Log() << Verbose(1) << "The following atoms are inside sphere at " << CandidateLine.OtherOptCenter << ":" << endl); 2042 2042 for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner) 2043 Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl;2043 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl); 2044 2044 2045 2045 // remove triangles's endpoints … … 2053 2053 // check for other points 2054 2054 if (!ListofPoints->empty()) { 2055 Log() << Verbose(1) << "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere." << endl;2055 DoLog(1) && (Log() << Verbose(1) << "CheckDegeneracy: There are still " << ListofPoints->size() << " points inside the sphere." << endl); 2056 2056 flag = false; 2057 Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl;2057 DoLog(1) && (Log() << Verbose(1) << "External atoms inside of sphere at " << CandidateLine.OtherOptCenter << ":" << endl); 2058 2058 for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->end(); ++Runner) 2059 Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl;2059 DoLog(1) && (Log() << Verbose(1) << " " << *(*Runner) << " with distance " << (*Runner)->node->Distance(&CandidateLine.OtherOptCenter) << "." << endl); 2060 2060 } 2061 2061 delete (ListofPoints); … … 2098 2098 for (; (FindLine != Points[i]->lines.end()) && (FindLine->first == Points[j]->node->nr); FindLine++) { 2099 2099 TriangleMap *triangles = &FindLine->second->triangles; 2100 Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl;2100 DoLog(1) && (Log() << Verbose(1) << "Current line is " << FindLine->first << ": " << *(FindLine->second) << " with triangles " << triangles << "." << endl); 2101 2101 for (TriangleMap::const_iterator FindTriangle = triangles->begin(); FindTriangle != triangles->end(); FindTriangle++) { 2102 2102 if (FindTriangle->second->IsPresentTupel(Points)) { … … 2104 2104 } 2105 2105 } 2106 Log() << Verbose(1) << "end." << endl;2106 DoLog(1) && (Log() << Verbose(1) << "end." << endl); 2107 2107 } 2108 2108 // Only one of the triangle lines must be considered for the triangle count. … … 2114 2114 } 2115 2115 2116 Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl;2116 DoLog(0) && (Log() << Verbose(0) << "Found " << adjacentTriangleCount << " adjacent triangles for the point set." << endl); 2117 2117 return adjacentTriangleCount; 2118 2118 } … … 2211 2211 for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) { 2212 2212 if ((*Runner)->node->x[i] > maxCoordinate[i]) { 2213 Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl;2213 DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl); 2214 2214 maxCoordinate[i] = (*Runner)->node->x[i]; 2215 2215 MaxPoint[i] = (*Runner); … … 2222 2222 } 2223 2223 2224 Log() << Verbose(1) << "Found maximum coordinates: ";2224 DoLog(1) && (Log() << Verbose(1) << "Found maximum coordinates: "); 2225 2225 for (int i = 0; i < NDIM; i++) 2226 Log() << Verbose(0) << i << ": " << *MaxPoint[i] << "\t";2227 Log() << Verbose(0) << endl;2226 DoLog(0) && (Log() << Verbose(0) << i << ": " << *MaxPoint[i] << "\t"); 2227 DoLog(0) && (Log() << Verbose(0) << endl); 2228 2228 2229 2229 BTS = NULL; … … 2233 2233 BaseLine = new BoundaryLineSet(); 2234 2234 BaseLine->endpoints[0] = new BoundaryPointSet(MaxPoint[k]); 2235 Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl;2235 DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl); 2236 2236 2237 2237 double ShortestAngle; … … 2271 2271 2272 2272 // adding point 1 and point 2 and add the line between them 2273 Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl;2274 Log() << Verbose(0) << "Found second point is at " << *BaseLine->endpoints[1]->node << ".\n";2273 DoLog(0) && (Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine->endpoints[0]->node << "." << endl); 2274 DoLog(0) && (Log() << Verbose(0) << "Found second point is at " << *BaseLine->endpoints[1]->node << ".\n"); 2275 2275 2276 2276 //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << helper << ".\n"; 2277 2277 CandidateForTesselation OptCandidates(BaseLine); 2278 2278 FindThirdPointForTesselation(NormalVector, SearchDirection, SphereCenter, OptCandidates, NULL, RADIUS, LC); 2279 Log() << Verbose(0) << "List of third Points is:" << endl;2279 DoLog(0) && (Log() << Verbose(0) << "List of third Points is:" << endl); 2280 2280 for (TesselPointList::iterator it = OptCandidates.pointlist.begin(); it != OptCandidates.pointlist.end(); it++) { 2281 Log() << Verbose(0) << " " << *(*it) << endl;2281 DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl); 2282 2282 } 2283 2283 if (!OptCandidates.pointlist.empty()) { … … 2465 2465 break; 2466 2466 } 2467 Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << "." << endl;2467 DoLog(0) && (Log() << Verbose(0) << "Current baseline is " << *CandidateLine.BaseLine << " with ThirdPoint " << *ThirdPoint << " of triangle " << T << "." << endl); 2468 2468 2469 2469 CandidateLine.T = &T; … … 2487 2487 CircleRadius = RADIUS * RADIUS - radius / 4.; 2488 2488 CirclePlaneNormal.Normalize(); 2489 Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;2490 2491 Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl;2489 DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl); 2490 2491 DoLog(1) && (Log() << Verbose(1) << "INFO: OldSphereCenter is at " << T.SphereCenter << "." << endl); 2492 2492 2493 2493 // construct SearchDirection and an "outward pointer" … … 2497 2497 if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON)// ohoh, SearchDirection points inwards! 2498 2498 SearchDirection.Scale(-1.); 2499 Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;2499 DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl); 2500 2500 if (fabs(RelativeSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { 2501 2501 // rotated the wrong way! … … 2507 2507 2508 2508 } else { 2509 Log() << Verbose(0) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!" << endl;2509 DoLog(0) && (Log() << Verbose(0) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and base triangle " << T << " is too big!" << endl); 2510 2510 } 2511 2511 … … 2514 2514 return false; 2515 2515 } 2516 Log() << Verbose(0) << "Third Points are: " << endl;2516 DoLog(0) && (Log() << Verbose(0) << "Third Points are: " << endl); 2517 2517 for (TesselPointList::iterator it = CandidateLine.pointlist.begin(); it != CandidateLine.pointlist.end(); ++it) { 2518 Log() << Verbose(0) << " " << *(*it) << endl;2518 DoLog(0) && (Log() << Verbose(0) << " " << *(*it) << endl); 2519 2519 } 2520 2520 … … 2539 2539 if (baseline->pointlist.empty()) { 2540 2540 T = (((baseline->BaseLine->triangles.begin()))->second); 2541 Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl;2541 DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl); 2542 2542 TesselationFailFlag = TesselationFailFlag && FindNextSuitableTriangle(*baseline, *T, RADIUS, LCList); //the line is there, so there is a triangle, but only one. 2543 2543 } … … 2569 2569 TesselPointList *connectedClosestPoints = GetCircleOfSetOfPoints(&SetOfNeighbours, TurningPoint, CandidateLine.BaseLine->endpoints[1]->node->node); 2570 2570 2571 Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl;2571 DoLog(0) && (Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl); 2572 2572 for (TesselPointList::iterator TesselRunner = connectedClosestPoints->begin(); TesselRunner != connectedClosestPoints->end(); ++TesselRunner) 2573 Log() << Verbose(0) << " " << **TesselRunner << endl;2573 DoLog(0) && (Log() << Verbose(0) << " " << **TesselRunner << endl); 2574 2574 2575 2575 // go through all angle-sorted candidates (in degenerate n-nodes case we may have to add multiple triangles) … … 2578 2578 Sprinter++; 2579 2579 while (Sprinter != connectedClosestPoints->end()) { 2580 Log() << Verbose(0) << "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << "." << endl;2580 DoLog(0) && (Log() << Verbose(0) << "Current Runner is " << *(*Runner) << " and sprinter is " << *(*Sprinter) << "." << endl); 2581 2581 2582 2582 AddTesselationPoint(TurningPoint, 0); … … 2591 2591 // fill the internal open lines with its respective candidate (otherwise lines in degenerate case are not picked) 2592 2592 FindDegeneratedCandidatesforOpenLines(*Sprinter, &CandidateLine.OptCenter); 2593 Log() << Verbose(0) << " There are still more triangles to add." << endl;2593 DoLog(0) && (Log() << Verbose(0) << " There are still more triangles to add." << endl); 2594 2594 } 2595 2595 // pick candidates for other open lines as well … … 2599 2599 if (CheckDegeneracy(CandidateLine, RADIUS, LC)) { 2600 2600 // add normal and degenerate triangles 2601 Log() << Verbose(1) << "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides." << endl;2601 DoLog(1) && (Log() << Verbose(1) << "Triangle of endpoints " << *TPS[0] << "," << *TPS[1] << " and " << *TPS[2] << " is degenerated, adding both sides." << endl); 2602 2602 AddCandidateTriangle(CandidateLine, OtherOpt); 2603 2603 … … 2623 2623 pair<LineMap::iterator, LineMap::iterator> FindPair = TPS[0]->lines.equal_range(TPS[2]->node->nr); 2624 2624 for (LineMap::const_iterator FindLine = FindPair.first; FindLine != FindPair.second; FindLine++) { 2625 Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl;2625 DoLog(1) && (Log() << Verbose(1) << "INFO: Checking line " << *(FindLine->second) << " ..." << endl); 2626 2626 // If there is a line with less than two attached triangles, we don't need a new line. 2627 2627 if (FindLine->second->triangles.size() == 1) { 2628 2628 CandidateMap::iterator Finder = OpenLines.find(FindLine->second); 2629 2629 if (!Finder->second->pointlist.empty()) 2630 Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl;2630 DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with candidate " << **(Finder->second->pointlist.begin()) << "." << endl); 2631 2631 else { 2632 Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter) << endl;2632 DoLog(1) && (Log() << Verbose(1) << "INFO: line " << *(FindLine->second) << " is open with no candidate, setting to next Sprinter" << (*Sprinter) << endl); 2633 2633 Finder->second->pointlist.push_back(Sprinter); 2634 2634 Finder->second->ShortestAngle = 0.; … … 2654 2654 2655 2655 /// 1. Create or pick the lines for the first triangle 2656 Log() << Verbose(0) << "INFO: Creating/Picking lines for first triangle ..." << endl;2656 DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for first triangle ..." << endl); 2657 2657 for (int i = 0; i < 3; i++) { 2658 2658 BLS[i] = NULL; 2659 Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;2659 DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl); 2660 2660 AddTesselationLine(&CandidateLine.OptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i); 2661 2661 } 2662 2662 2663 2663 /// 2. create the first triangle and NormalVector and so on 2664 Log() << Verbose(0) << "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ..." << endl;2664 DoLog(0) && (Log() << Verbose(0) << "INFO: Adding first triangle with center at " << CandidateLine.OptCenter << " ..." << endl); 2665 2665 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 2666 2666 AddTesselationTriangle(); … … 2673 2673 // give some verbose output about the whole procedure 2674 2674 if (CandidateLine.T != NULL) 2675 Log() << Verbose(0) << "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;2675 DoLog(0) && (Log() << Verbose(0) << "--> New triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl); 2676 2676 else 2677 Log() << Verbose(0) << "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;2677 DoLog(0) && (Log() << Verbose(0) << "--> New starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl); 2678 2678 triangle = BTS; 2679 2679 2680 2680 /// 3. Gather candidates for each new line 2681 Log() << Verbose(0) << "INFO: Adding candidates to new lines ..." << endl;2681 DoLog(0) && (Log() << Verbose(0) << "INFO: Adding candidates to new lines ..." << endl); 2682 2682 for (int i = 0; i < 3; i++) { 2683 Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;2683 DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl); 2684 2684 CandidateCheck = OpenLines.find(BLS[i]); 2685 2685 if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) { … … 2691 2691 2692 2692 /// 4. Create or pick the lines for the second triangle 2693 Log() << Verbose(0) << "INFO: Creating/Picking lines for second triangle ..." << endl;2693 DoLog(0) && (Log() << Verbose(0) << "INFO: Creating/Picking lines for second triangle ..." << endl); 2694 2694 for (int i = 0; i < 3; i++) { 2695 Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;2695 DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl); 2696 2696 AddTesselationLine(&CandidateLine.OtherOptCenter, TPS[(i + 2) % 3], TPS[(i + 0) % 3], TPS[(i + 1) % 3], i); 2697 2697 } 2698 2698 2699 2699 /// 5. create the second triangle and NormalVector and so on 2700 Log() << Verbose(0) << "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ..." << endl;2700 DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangle with center at " << CandidateLine.OtherOptCenter << " ..." << endl); 2701 2701 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 2702 2702 AddTesselationTriangle(); … … 2708 2708 // give some verbose output about the whole procedure 2709 2709 if (CandidateLine.T != NULL) 2710 Log() << Verbose(0) << "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;2710 DoLog(0) && (Log() << Verbose(0) << "--> New degenerate triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl); 2711 2711 else 2712 Log() << Verbose(0) << "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;2712 DoLog(0) && (Log() << Verbose(0) << "--> New degenerate starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl); 2713 2713 2714 2714 /// 6. Adding triangle to new lines 2715 Log() << Verbose(0) << "INFO: Adding second triangles to new lines ..." << endl;2715 DoLog(0) && (Log() << Verbose(0) << "INFO: Adding second triangles to new lines ..." << endl); 2716 2716 for (int i = 0; i < 3; i++) { 2717 Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl;2717 DoLog(0) && (Log() << Verbose(0) << "Current line is between " << *TPS[(i + 0) % 3] << " and " << *TPS[(i + 1) % 3] << ":" << endl); 2718 2718 CandidateCheck = OpenLines.find(BLS[i]); 2719 2719 if ((CandidateCheck != OpenLines.end()) && (CandidateCheck->second->pointlist.empty())) { … … 2753 2753 // give some verbose output about the whole procedure 2754 2754 if (CandidateLine.T != NULL) 2755 Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl;2755 DoLog(0) && (Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "triangle with " << *BTS << " and normal vector " << BTS->NormalVector << ", from " << *CandidateLine.T << " and angle " << CandidateLine.ShortestAngle << "." << endl); 2756 2756 else 2757 Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl;2757 DoLog(0) && (Log() << Verbose(0) << "--> New" << ((type == OtherOpt) ? " degenerate " : " ") << "starting triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " and no top triangle." << endl); 2758 2758 } 2759 2759 ; … … 2780 2780 OtherBase = new class BoundaryLineSet(BPS, -1); 2781 2781 2782 Log() << Verbose(1) << "INFO: Current base line is " << *Base << "." << endl;2783 Log() << Verbose(1) << "INFO: Other base line is " << *OtherBase << "." << endl;2782 DoLog(1) && (Log() << Verbose(1) << "INFO: Current base line is " << *Base << "." << endl); 2783 DoLog(1) && (Log() << Verbose(1) << "INFO: Other base line is " << *OtherBase << "." << endl); 2784 2784 2785 2785 // get the closest point on each line to the other line … … 2801 2801 delete (ClosestPoint); 2802 2802 if ((distance[0] * distance[1]) > 0) { // have same sign? 2803 Log() << Verbose(1) << "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave." << endl;2803 DoLog(1) && (Log() << Verbose(1) << "REJECT: Both SKPs have same sign: " << distance[0] << " and " << distance[1] << ". " << *Base << "' rectangle is concave." << endl); 2804 2804 if (distance[0] < distance[1]) { 2805 2805 Spot = Base->endpoints[0]; … … 2809 2809 return Spot; 2810 2810 } else { // different sign, i.e. we are in between 2811 Log() << Verbose(0) << "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex." << endl;2811 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Rectangle of triangles of base line " << *Base << " is convex." << endl); 2812 2812 return NULL; 2813 2813 } … … 2820 2820 Info FunctionInfo(__func__); 2821 2821 // print all lines 2822 Log() << Verbose(0) << "Printing all boundary points for debugging:" << endl;2822 DoLog(0) && (Log() << Verbose(0) << "Printing all boundary points for debugging:" << endl); 2823 2823 for (PointMap::const_iterator PointRunner = PointsOnBoundary.begin(); PointRunner != PointsOnBoundary.end(); PointRunner++) 2824 Log() << Verbose(0) << *(PointRunner->second) << endl;2824 DoLog(0) && (Log() << Verbose(0) << *(PointRunner->second) << endl); 2825 2825 } 2826 2826 ; … … 2830 2830 Info FunctionInfo(__func__); 2831 2831 // print all lines 2832 Log() << Verbose(0) << "Printing all boundary lines for debugging:" << endl;2832 DoLog(0) && (Log() << Verbose(0) << "Printing all boundary lines for debugging:" << endl); 2833 2833 for (LineMap::const_iterator LineRunner = LinesOnBoundary.begin(); LineRunner != LinesOnBoundary.end(); LineRunner++) 2834 Log() << Verbose(0) << *(LineRunner->second) << endl;2834 DoLog(0) && (Log() << Verbose(0) << *(LineRunner->second) << endl); 2835 2835 } 2836 2836 ; … … 2840 2840 Info FunctionInfo(__func__); 2841 2841 // print all triangles 2842 Log() << Verbose(0) << "Printing all boundary triangles for debugging:" << endl;2842 DoLog(0) && (Log() << Verbose(0) << "Printing all boundary triangles for debugging:" << endl); 2843 2843 for (TriangleMap::const_iterator TriangleRunner = TrianglesOnBoundary.begin(); TriangleRunner != TrianglesOnBoundary.end(); TriangleRunner++) 2844 Log() << Verbose(0) << *(TriangleRunner->second) << endl;2844 DoLog(0) && (Log() << Verbose(0) << *(TriangleRunner->second) << endl); 2845 2845 } 2846 2846 ; … … 2865 2865 OtherBase = new class BoundaryLineSet(BPS, -1); 2866 2866 2867 Log() << Verbose(0) << "INFO: Current base line is " << *Base << "." << endl;2868 Log() << Verbose(0) << "INFO: Other base line is " << *OtherBase << "." << endl;2867 DoLog(0) && (Log() << Verbose(0) << "INFO: Current base line is " << *Base << "." << endl); 2868 DoLog(0) && (Log() << Verbose(0) << "INFO: Other base line is " << *OtherBase << "." << endl); 2869 2869 2870 2870 // get the closest point on each line to the other line … … 2886 2886 2887 2887 if (Distance.NormSquared() < MYEPSILON) { // check for intersection 2888 Log() << Verbose(0) << "REJECT: Both lines have an intersection: Nothing to do." << endl;2888 DoLog(0) && (Log() << Verbose(0) << "REJECT: Both lines have an intersection: Nothing to do." << endl); 2889 2889 return false; 2890 2890 } else { // check for sign against BaseLineNormal … … 2896 2896 } 2897 2897 for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) { 2898 Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl;2898 DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl); 2899 2899 BaseLineNormal.AddVector(&(runner->second->NormalVector)); 2900 2900 } … … 2902 2902 2903 2903 if (Distance.ScalarProduct(&BaseLineNormal) > MYEPSILON) { // Distance points outwards, hence OtherBase higher than Base -> flip 2904 Log() << Verbose(0) << "ACCEPT: Other base line would be higher: Flipping baseline." << endl;2904 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: Other base line would be higher: Flipping baseline." << endl); 2905 2905 // calculate volume summand as a general tetraeder 2906 2906 return volume; 2907 2907 } else { // Base higher than OtherBase -> do nothing 2908 Log() << Verbose(0) << "REJECT: Base line is higher: Nothing to do." << endl;2908 DoLog(0) && (Log() << Verbose(0) << "REJECT: Base line is higher: Nothing to do." << endl); 2909 2909 return 0.; 2910 2910 } … … 2936 2936 } 2937 2937 for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) { 2938 Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl;2938 DoLog(1) && (Log() << Verbose(1) << "INFO: Adding NormalVector " << runner->second->NormalVector << " of triangle " << *(runner->second) << "." << endl); 2939 2939 BaseLineNormal.AddVector(&(runner->second->NormalVector)); 2940 2940 } … … 2949 2949 i = 0; 2950 2950 m = 0; 2951 Log() << Verbose(0) << "The four old lines are: ";2951 DoLog(0) && (Log() << Verbose(0) << "The four old lines are: "); 2952 2952 for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) 2953 2953 for (int j = 0; j < 3; j++) // all of their endpoints and baselines 2954 2954 if (runner->second->lines[j] != Base) { // pick not the central baseline 2955 2955 OldLines[i++] = runner->second->lines[j]; 2956 Log() << Verbose(0) << *runner->second->lines[j] << "\t";2956 DoLog(0) && (Log() << Verbose(0) << *runner->second->lines[j] << "\t"); 2957 2957 } 2958 Log() << Verbose(0) << endl;2959 Log() << Verbose(0) << "The two old points are: ";2958 DoLog(0) && (Log() << Verbose(0) << endl); 2959 DoLog(0) && (Log() << Verbose(0) << "The two old points are: "); 2960 2960 for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) 2961 2961 for (int j = 0; j < 3; j++) // all of their endpoints and baselines 2962 2962 if (!Base->ContainsBoundaryPoint(runner->second->endpoints[j])) { // and neither of its endpoints 2963 2963 OldPoints[m++] = runner->second->endpoints[j]; 2964 Log() << Verbose(0) << *runner->second->endpoints[j] << "\t";2964 DoLog(0) && (Log() << Verbose(0) << *runner->second->endpoints[j] << "\t"); 2965 2965 } 2966 Log() << Verbose(0) << endl;2966 DoLog(0) && (Log() << Verbose(0) << endl); 2967 2967 2968 2968 // check whether everything is in place to create new lines and triangles … … 2983 2983 2984 2984 // remove triangles and baseline removes itself 2985 Log() << Verbose(0) << "INFO: Deleting baseline " << *Base << " from global list." << endl;2985 DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting baseline " << *Base << " from global list." << endl); 2986 2986 OldBaseLineNr = Base->Nr; 2987 2987 m = 0; 2988 2988 for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) { 2989 Log() << Verbose(0) << "INFO: Deleting triangle " << *(runner->second) << "." << endl;2989 DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting triangle " << *(runner->second) << "." << endl); 2990 2990 OldTriangleNrs[m++] = runner->second->Nr; 2991 2991 RemoveTesselationTriangle(runner->second); … … 2997 2997 NewLine = new class BoundaryLineSet(BPS, OldBaseLineNr); 2998 2998 LinesOnBoundary.insert(LinePair(OldBaseLineNr, NewLine)); // no need for check for unique insertion as NewLine is definitely a new one 2999 Log() << Verbose(0) << "INFO: Created new baseline " << *NewLine << "." << endl;2999 DoLog(0) && (Log() << Verbose(0) << "INFO: Created new baseline " << *NewLine << "." << endl); 3000 3000 3001 3001 // construct new triangles with flipped baseline … … 3012 3012 BTS->GetNormalVector(BaseLineNormal); 3013 3013 AddTesselationTriangle(OldTriangleNrs[0]); 3014 Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl;3014 DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl); 3015 3015 3016 3016 BLS[0] = (i == 2 ? OldLines[3] : OldLines[2]); … … 3020 3020 BTS->GetNormalVector(BaseLineNormal); 3021 3021 AddTesselationTriangle(OldTriangleNrs[1]); 3022 Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl;3022 DoLog(0) && (Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl); 3023 3023 } else { 3024 3024 DoeLog(0) && (eLog() << Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl); … … 3061 3061 Nupper[i] = ((N[i] + 1) < LC->N[i]) ? N[i] + 1 : LC->N[i] - 1; 3062 3062 } 3063 Log() << Verbose(0) << "LC Intervals from [" << N[0] << "<->" << LC->N[0] << ", " << N[1] << "<->" << LC->N[1] << ", " << N[2] << "<->" << LC->N[2] << "] :" << " [" << Nlower[0] << "," << Nupper[0] << "], " << " [" << Nlower[1] << "," << Nupper[1] << "], " << " [" << Nlower[2] << "," << Nupper[2] << "], " << endl;3063 DoLog(0) && (Log() << Verbose(0) << "LC Intervals from [" << N[0] << "<->" << LC->N[0] << ", " << N[1] << "<->" << LC->N[1] << ", " << N[2] << "<->" << LC->N[2] << "] :" << " [" << Nlower[0] << "," << Nupper[0] << "], " << " [" << Nlower[1] << "," << Nupper[1] << "], " << " [" << Nlower[2] << "," << Nupper[2] << "], " << endl); 3064 3064 3065 3065 for (LC->n[0] = Nlower[0]; LC->n[0] <= Nupper[0]; LC->n[0]++) … … 3099 3099 if (angle < Storage[0]) { 3100 3100 //Log() << Verbose(1) << "Old values of Storage: %lf %lf \n", Storage[0], Storage[1]); 3101 Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n";3101 DoLog(1) && (Log() << Verbose(1) << "Current candidate is " << *Candidate << ": Is a better candidate with distance " << norm << " and angle " << angle << " to oben " << Oben << ".\n"); 3102 3102 OptCandidate = Candidate; 3103 3103 Storage[0] = angle; … … 3114 3114 } 3115 3115 } else { 3116 Log() << Verbose(0) << "Linked cell list is empty." << endl;3116 DoLog(0) && (Log() << Verbose(0) << "Linked cell list is empty." << endl); 3117 3117 } 3118 3118 } … … 3169 3169 TesselPoint *Candidate = NULL; 3170 3170 3171 Log() << Verbose(1) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl;3171 DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of BaseTriangle is " << NormalVector << "." << endl); 3172 3172 3173 3173 // copy old center … … 3193 3193 CircleRadius = RADIUS * RADIUS - radius; 3194 3194 CirclePlaneNormal.Normalize(); 3195 Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;3195 DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl); 3196 3196 3197 3197 // test whether old center is on the band's plane … … 3202 3202 radius = RelativeOldSphereCenter.NormSquared(); 3203 3203 if (fabs(radius - CircleRadius) < HULLEPSILON) { 3204 Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl;3204 DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeOldSphereCenter is at " << RelativeOldSphereCenter << "." << endl); 3205 3205 3206 3206 // check SearchDirection 3207 Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;3207 DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl); 3208 3208 if (fabs(RelativeOldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { // rotated the wrong way! 3209 3209 DoeLog(1) && (eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl); … … 3237 3237 3238 3238 // check for three unique points 3239 Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl;3239 DoLog(2) && (Log() << Verbose(2) << "INFO: Current Candidate is " << *Candidate << " for BaseLine " << *CandidateLine.BaseLine << " with OldSphereCenter " << OldSphereCenter << "." << endl); 3240 3240 if ((Candidate != CandidateLine.BaseLine->endpoints[0]->node) && (Candidate != CandidateLine.BaseLine->endpoints[1]->node)) { 3241 3241 3242 3242 // find center on the plane 3243 3243 GetCenterofCircumcircle(&NewPlaneCenter, *CandidateLine.BaseLine->endpoints[0]->node->node, *CandidateLine.BaseLine->endpoints[1]->node->node, *Candidate->node); 3244 Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl;3244 DoLog(1) && (Log() << Verbose(1) << "INFO: NewPlaneCenter is " << NewPlaneCenter << "." << endl); 3245 3245 3246 3246 if (NewNormalVector.MakeNormalVector(CandidateLine.BaseLine->endpoints[0]->node->node, CandidateLine.BaseLine->endpoints[1]->node->node, Candidate->node) && (fabs(NewNormalVector.NormSquared()) > HULLEPSILON)) { 3247 Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl;3247 DoLog(1) && (Log() << Verbose(1) << "INFO: NewNormalVector is " << NewNormalVector << "." << endl); 3248 3248 radius = CandidateLine.BaseLine->endpoints[0]->node->node->DistanceSquared(&NewPlaneCenter); 3249 Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl;3250 Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl;3251 Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl;3249 DoLog(1) && (Log() << Verbose(1) << "INFO: CircleCenter is at " << CircleCenter << ", CirclePlaneNormal is " << CirclePlaneNormal << " with circle radius " << sqrt(CircleRadius) << "." << endl); 3250 DoLog(1) && (Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl); 3251 DoLog(1) && (Log() << Verbose(1) << "INFO: Radius of CircumCenterCircle is " << radius << "." << endl); 3252 3252 if (radius < RADIUS * RADIUS) { 3253 3253 otherradius = CandidateLine.BaseLine->endpoints[1]->node->node->DistanceSquared(&NewPlaneCenter); … … 3260 3260 helper.CopyVector(&NewNormalVector); 3261 3261 helper.Scale(sqrt(RADIUS * RADIUS - radius)); 3262 Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl;3262 DoLog(2) && (Log() << Verbose(2) << "INFO: Distance of NewPlaneCenter " << NewPlaneCenter << " to either NewSphereCenter is " << helper.Norm() << " of vector " << helper << " with sphere radius " << RADIUS << "." << endl); 3263 3263 NewSphereCenter.AddVector(&helper); 3264 Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl;3264 DoLog(2) && (Log() << Verbose(2) << "INFO: NewSphereCenter is at " << NewSphereCenter << "." << endl); 3265 3265 // OtherNewSphereCenter is created by the same vector just in the other direction 3266 3266 helper.Scale(-1.); 3267 3267 OtherNewSphereCenter.AddVector(&helper); 3268 Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl;3268 DoLog(2) && (Log() << Verbose(2) << "INFO: OtherNewSphereCenter is at " << OtherNewSphereCenter << "." << endl); 3269 3269 3270 3270 alpha = GetPathLengthonCircumCircle(CircleCenter, CirclePlaneNormal, CircleRadius, NewSphereCenter, OldSphereCenter, NormalVector, SearchDirection); … … 3285 3285 if ((CandidateLine.ShortestAngle - HULLEPSILON) < alpha) { 3286 3286 CandidateLine.pointlist.push_back(Candidate); 3287 Log() << Verbose(0) << "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl;3287 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found an equally good candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl); 3288 3288 } else { 3289 3289 // remove all candidates from the list and then the list itself 3290 3290 CandidateLine.pointlist.clear(); 3291 3291 CandidateLine.pointlist.push_back(Candidate); 3292 Log() << Verbose(0) << "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl;3292 DoLog(0) && (Log() << Verbose(0) << "ACCEPT: We have found a better candidate: " << *(Candidate) << " with " << alpha << " and circumsphere's center at " << CandidateLine.OptCenter << "." << endl); 3293 3293 } 3294 3294 CandidateLine.ShortestAngle = alpha; 3295 Log() << Verbose(0) << "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now." << endl;3295 DoLog(0) && (Log() << Verbose(0) << "INFO: There are " << CandidateLine.pointlist.size() << " candidates in the list now." << endl); 3296 3296 } else { 3297 3297 if ((Candidate != NULL) && (CandidateLine.pointlist.begin() != CandidateLine.pointlist.end())) { 3298 Log() << Verbose(1) << "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl;3298 DoLog(1) && (Log() << Verbose(1) << "REJECT: Old candidate " << *(*CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl); 3299 3299 } else { 3300 Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl;3300 DoLog(1) && (Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl); 3301 3301 } 3302 3302 } 3303 3303 } else { 3304 Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl;3304 DoLog(1) && (Log() << Verbose(1) << "REJECT: NewSphereCenter " << NewSphereCenter << " for " << *Candidate << " is too far away: " << radius << "." << endl); 3305 3305 } 3306 3306 } else { 3307 Log() << Verbose(1) << "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent." << endl;3307 DoLog(1) && (Log() << Verbose(1) << "REJECT: Three points from " << *CandidateLine.BaseLine << " and Candidate " << *Candidate << " are linear-dependent." << endl); 3308 3308 } 3309 3309 } else { 3310 3310 if (ThirdPoint != NULL) { 3311 Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << "." << endl;3311 DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " and " << *ThirdPoint << " contains Candidate " << *Candidate << "." << endl); 3312 3312 } else { 3313 Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << "." << endl;3313 DoLog(1) && (Log() << Verbose(1) << "REJECT: Base triangle " << *CandidateLine.BaseLine << " contains Candidate " << *Candidate << "." << endl); 3314 3314 } 3315 3315 } … … 3322 3322 } else { 3323 3323 if (ThirdPoint != NULL) 3324 Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!" << endl;3324 DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " and third node " << *ThirdPoint << " is too big!" << endl); 3325 3325 else 3326 Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!" << endl;3326 DoLog(1) && (Log() << Verbose(1) << "Circumcircle for base line " << *CandidateLine.BaseLine << " is too big!" << endl); 3327 3327 } 3328 3328 … … 3358 3358 if (!OrderTest.second) { // if insertion fails, we have common endpoint 3359 3359 node = OrderTest.first->second; 3360 Log() << Verbose(1) << "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << "." << endl;3360 DoLog(1) && (Log() << Verbose(1) << "Common endpoint of lines " << *line1 << " and " << *line2 << " is: " << *node << "." << endl); 3361 3361 j = 2; 3362 3362 i = 2; … … 3388 3388 for (int i = 0; i < NDIM; i++) // store indices of this cell 3389 3389 N[i] = LC->n[i]; 3390 Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;3390 DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl); 3391 3391 DistanceToPointMap * points = new DistanceToPointMap; 3392 3392 LC->GetNeighbourBounds(Nlower, Nupper); … … 3402 3402 if (FindPoint != PointsOnBoundary.end()) { 3403 3403 points->insert(DistanceToPointPair(FindPoint->second->node->node->DistanceSquared(x), FindPoint->second)); 3404 Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl;3404 DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *FindPoint->second << " into the list." << endl); 3405 3405 } 3406 3406 } … … 3436 3436 3437 3437 // for each point, check its lines, remember closest 3438 Log() << Verbose(1) << "Finding closest BoundaryLine to " << *x << " ... " << endl;3438 DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryLine to " << *x << " ... " << endl); 3439 3439 BoundaryLineSet *ClosestLine = NULL; 3440 3440 double MinDistance = -1.; … … 3467 3467 ClosestLine = LineRunner->second; 3468 3468 MinDistance = distance; 3469 Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl;3469 DoLog(1) && (Log() << Verbose(1) << "ACCEPT: New closest line is " << *ClosestLine << " with projected distance " << MinDistance << "." << endl); 3470 3470 } else { 3471 Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl;3471 DoLog(1) && (Log() << Verbose(1) << "REJECT: Intersection is outside of the line section: " << lengthA << " and " << lengthB << "." << endl); 3472 3472 } 3473 3473 } else { 3474 Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl;3474 DoLog(1) && (Log() << Verbose(1) << "REJECT: Point is too further away than present line: " << distance << " >> " << MinDistance << "." << endl); 3475 3475 } 3476 3476 } … … 3479 3479 // check whether closest line is "too close" :), then it's inside 3480 3480 if (ClosestLine == NULL) { 3481 Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;3481 DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl); 3482 3482 return NULL; 3483 3483 } … … 3502 3502 3503 3503 // for each point, check its lines, remember closest 3504 Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << *x << " ... " << endl;3504 DoLog(1) && (Log() << Verbose(1) << "Finding closest BoundaryTriangle to " << *x << " ... " << endl); 3505 3505 LineSet ClosestLines; 3506 3506 double MinDistance = 1e+16; … … 3530 3530 ClosestLines.insert(LineRunner->second); 3531 3531 MinDistance = lengthEnd; 3532 Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl;3532 DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[0]->node << " is closer with " << lengthEnd << "." << endl); 3533 3533 } else if (fabs(lengthEnd - MinDistance) < MYEPSILON) { // additional best candidate 3534 3534 ClosestLines.insert(LineRunner->second); 3535 Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl;3535 DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Line " << *LineRunner->second << " to endpoint " << *LineRunner->second->endpoints[1]->node << " is equally good with " << lengthEnd << "." << endl); 3536 3536 } else { // line is worse 3537 Log() << Verbose(1) << "REJECT: Line " << *LineRunner->second << " to either endpoints is further away than present closest line candidate: " << lengthEndA << ", " << lengthEndB << ", and distance is longer than baseline:" << lengthBase << "." << endl;3537 DoLog(1) && (Log() << Verbose(1) << "REJECT: Line " << *LineRunner->second << " to either endpoints is further away than present closest line candidate: " << lengthEndA << ", " << lengthEndB << ", and distance is longer than baseline:" << lengthBase << "." << endl); 3538 3538 } 3539 3539 } else { // intersection is closer, calculate … … 3551 3551 ClosestLines.insert(LineRunner->second); 3552 3552 MinDistance = distance; 3553 Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl;3553 DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Intersection in between endpoints, new closest line " << *LineRunner->second << " is " << *ClosestLines.begin() << " with projected distance " << MinDistance << "." << endl); 3554 3554 } else { 3555 Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl;3555 DoLog(2) && (Log() << Verbose(2) << "REJECT: Point is further away from line " << *LineRunner->second << " than present closest line: " << distance << " >> " << MinDistance << "." << endl); 3556 3556 } 3557 3557 } … … 3562 3562 // check whether closest line is "too close" :), then it's inside 3563 3563 if (ClosestLines.empty()) { 3564 Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl;3564 DoLog(0) && (Log() << Verbose(0) << "Is the only point, no one else is closeby." << endl); 3565 3565 return NULL; 3566 3566 } … … 3603 3603 result = *Runner; 3604 3604 MinAlignment = Alignment; 3605 Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl;3605 DoLog(1) && (Log() << Verbose(1) << "ACCEPT: Triangle " << *result << " is better aligned with " << MinAlignment << "." << endl); 3606 3606 } else { 3607 Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl;3607 DoLog(1) && (Log() << Verbose(1) << "REJECT: Triangle " << *result << " is worse aligned with " << MinAlignment << "." << endl); 3608 3608 } 3609 3609 } … … 3658 3658 3659 3659 if (triangle == NULL) {// is boundary point or only point in point cloud? 3660 Log() << Verbose(1) << "No triangle given!" << endl;3660 DoLog(1) && (Log() << Verbose(1) << "No triangle given!" << endl); 3661 3661 return -1.; 3662 3662 } else { 3663 Log() << Verbose(1) << "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << "." << endl;3663 DoLog(1) && (Log() << Verbose(1) << "INFO: Closest triangle found is " << *triangle << " with normal vector " << triangle->NormalVector << "." << endl); 3664 3664 } 3665 3665 3666 3666 triangle->GetCenter(&Center); 3667 Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl;3667 DoLog(2) && (Log() << Verbose(2) << "INFO: Central point of the triangle is " << Center << "." << endl); 3668 3668 DistanceToCenter.CopyVector(&Center); 3669 3669 DistanceToCenter.SubtractVector(&Point); 3670 Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl;3670 DoLog(2) && (Log() << Verbose(2) << "INFO: Vector from point to test to center is " << DistanceToCenter << "." << endl); 3671 3671 3672 3672 // check whether we are on boundary … … 3677 3677 Center.SubtractVector(&triangle->NormalVector); // points towards MolCenter 3678 3678 DistanceToCenter.AddVector(&triangle->NormalVector); // points outside 3679 Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl;3679 DoLog(1) && (Log() << Verbose(1) << "INFO: Calling Intersection with " << Center << " and " << DistanceToCenter << "." << endl); 3680 3680 if (triangle->GetIntersectionInsideTriangle(&Center, &DistanceToCenter, &Intersection)) { 3681 Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl;3681 DoLog(1) && (Log() << Verbose(1) << Point << " is inner point: sufficiently close to boundary, " << Intersection << "." << endl); 3682 3682 return 0.; 3683 3683 } else { 3684 Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl;3684 DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point: on triangle plane but outside of triangle bounds." << endl); 3685 3685 return false; 3686 3686 } … … 3688 3688 // calculate smallest distance 3689 3689 distance = triangle->GetClosestPointInsideTriangle(&Point, &Intersection); 3690 Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl;3690 DoLog(1) && (Log() << Verbose(1) << "Closest point on triangle is " << Intersection << "." << endl); 3691 3691 3692 3692 // then check direction to boundary 3693 3693 if (DistanceToCenter.ScalarProduct(&triangle->NormalVector) > MYEPSILON) { 3694 Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl;3694 DoLog(1) && (Log() << Verbose(1) << Point << " is an inner point, " << distance << " below surface." << endl); 3695 3695 return -distance; 3696 3696 } else { 3697 Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl;3697 DoLog(1) && (Log() << Verbose(1) << Point << " is NOT an inner point, " << distance << " above surface." << endl); 3698 3698 return +distance; 3699 3699 } … … 3775 3775 3776 3776 if (takePoint) { 3777 Log() << Verbose(1) << "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted." << endl;3777 DoLog(1) && (Log() << Verbose(1) << "INFO: Endpoint " << *current << " of line " << *(findLines->second) << " is enlisted." << endl); 3778 3778 connectedPoints->insert(current); 3779 3779 } … … 3831 3831 } 3832 3832 PlaneNormal.Scale(1.0 / triangles->size()); 3833 Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl;3833 DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated PlaneNormal of all circle points is " << PlaneNormal << "." << endl); 3834 3834 PlaneNormal.Normalize(); 3835 3835 … … 3841 3841 } 3842 3842 if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON)) { 3843 Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl;3843 DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl); 3844 3844 AngleZero.CopyVector((*SetOfNeighbours->begin())->node); 3845 3845 AngleZero.SubtractVector(Point->node); … … 3850 3850 } 3851 3851 } 3852 Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl;3852 DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl); 3853 3853 if (AngleZero.NormSquared() > MYEPSILON) 3854 3854 OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero); 3855 3855 else 3856 3856 OrthogonalVector.MakeNormalVector(&PlaneNormal); 3857 Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl;3857 DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl); 3858 3858 3859 3859 // go through all connected points and calculate angle … … 3863 3863 helper.ProjectOntoPlane(&PlaneNormal); 3864 3864 double angle = GetAngle(helper, AngleZero, OrthogonalVector); 3865 Log() << Verbose(0) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl;3865 DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle is " << angle << " for point " << **listRunner << "." << endl); 3866 3866 anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner))); 3867 3867 } … … 3909 3909 } 3910 3910 3911 Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << *Reference << "." << endl;3911 DoLog(1) && (Log() << Verbose(1) << "INFO: Point is " << *Point << " and Reference is " << *Reference << "." << endl); 3912 3912 // calculate central point 3913 3913 TesselPointSet::const_iterator TesselA = SetOfNeighbours->begin(); … … 3920 3920 while (TesselC != SetOfNeighbours->end()) { 3921 3921 helper.MakeNormalVector((*TesselA)->node, (*TesselB)->node, (*TesselC)->node); 3922 Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl;3922 DoLog(0) && (Log() << Verbose(0) << "Making normal vector out of " << *(*TesselA) << ", " << *(*TesselB) << " and " << *(*TesselC) << ":" << helper << endl); 3923 3923 counter++; 3924 3924 TesselA++; … … 3936 3936 // PlaneNormal.SubtractVector(¢er); 3937 3937 // PlaneNormal.Normalize(); 3938 Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl;3938 DoLog(1) && (Log() << Verbose(1) << "INFO: Calculated plane normal of circle is " << PlaneNormal << "." << endl); 3939 3939 3940 3940 // construct one orthogonal vector … … 3945 3945 } 3946 3946 if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON)) { 3947 Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl;3947 DoLog(1) && (Log() << Verbose(1) << "Using alternatively " << *(*SetOfNeighbours->begin())->node << " as angle 0 referencer." << endl); 3948 3948 AngleZero.CopyVector((*SetOfNeighbours->begin())->node); 3949 3949 AngleZero.SubtractVector(Point->node); … … 3954 3954 } 3955 3955 } 3956 Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl;3956 DoLog(1) && (Log() << Verbose(1) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl); 3957 3957 if (AngleZero.NormSquared() > MYEPSILON) 3958 3958 OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero); 3959 3959 else 3960 3960 OrthogonalVector.MakeNormalVector(&PlaneNormal); 3961 Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl;3961 DoLog(1) && (Log() << Verbose(1) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl); 3962 3962 3963 3963 // go through all connected points and calculate angle … … 3970 3970 if (angle > M_PI) // the correction is of no use here (and not desired) 3971 3971 angle = 2. * M_PI - angle; 3972 Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl;3972 DoLog(0) && (Log() << Verbose(0) << "INFO: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "." << endl); 3973 3973 InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner))); 3974 3974 if (!InserterTest.second) { … … 4037 4037 StartLine = CurrentLine; 4038 4038 CurrentPoint = CurrentLine->GetOtherEndpoint(ReferencePoint); 4039 Log() << Verbose(1) << "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << "." << endl;4039 DoLog(1) && (Log() << Verbose(1) << "INFO: Beginning path retrieval at " << *CurrentPoint << " of line " << *CurrentLine << "." << endl); 4040 4040 do { 4041 4041 // push current one 4042 Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl;4042 DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl); 4043 4043 connectedPath->push_back(CurrentPoint->node); 4044 4044 4045 4045 // find next triangle 4046 4046 for (TriangleMap::iterator Runner = CurrentLine->triangles.begin(); Runner != CurrentLine->triangles.end(); Runner++) { 4047 Log() << Verbose(1) << "INFO: Inspecting triangle " << *Runner->second << "." << endl;4047 DoLog(1) && (Log() << Verbose(1) << "INFO: Inspecting triangle " << *Runner->second << "." << endl); 4048 4048 if ((Runner->second != triangle)) { // look for first triangle not equal to old one 4049 4049 triangle = Runner->second; … … 4052 4052 if (!TriangleRunner->second) { 4053 4053 TriangleRunner->second = true; 4054 Log() << Verbose(1) << "INFO: Connecting triangle is " << *triangle << "." << endl;4054 DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting triangle is " << *triangle << "." << endl); 4055 4055 break; 4056 4056 } else { 4057 Log() << Verbose(1) << "INFO: Skipping " << *triangle << ", as we have already visited it." << endl;4057 DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *triangle << ", as we have already visited it." << endl); 4058 4058 triangle = NULL; 4059 4059 } … … 4070 4070 if ((triangle->lines[i] != CurrentLine) && (triangle->lines[i]->ContainsBoundaryPoint(ReferencePoint))) { // not the current line and still containing Point 4071 4071 CurrentLine = triangle->lines[i]; 4072 Log() << Verbose(1) << "INFO: Connecting line is " << *CurrentLine << "." << endl;4072 DoLog(1) && (Log() << Verbose(1) << "INFO: Connecting line is " << *CurrentLine << "." << endl); 4073 4073 break; 4074 4074 } … … 4084 4084 } while (CurrentLine != StartLine); 4085 4085 // last point is missing, as it's on start line 4086 Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl;4086 DoLog(1) && (Log() << Verbose(1) << "INFO: Putting " << *CurrentPoint << " at end of path." << endl); 4087 4087 if (StartLine->GetOtherEndpoint(ReferencePoint)->node != connectedPath->back()) 4088 4088 connectedPath->push_back(StartLine->GetOtherEndpoint(ReferencePoint)->node); … … 4090 4090 ListOfPaths->push_back(connectedPath); 4091 4091 } else { 4092 Log() << Verbose(1) << "INFO: Skipping " << *runner->second << ", as we have already visited it." << endl;4092 DoLog(1) && (Log() << Verbose(1) << "INFO: Skipping " << *runner->second << ", as we have already visited it." << endl); 4093 4093 } 4094 4094 } … … 4120 4120 connectedPath = *ListRunner; 4121 4121 4122 Log() << Verbose(1) << "INFO: Current path is " << connectedPath << "." << endl;4122 DoLog(1) && (Log() << Verbose(1) << "INFO: Current path is " << connectedPath << "." << endl); 4123 4123 4124 4124 // go through list, look for reappearance of starting Point and count … … 4129 4129 if ((*CircleRunner == *CircleStart) && (CircleRunner != CircleStart)) { // is not the very first point 4130 4130 // we have a closed circle from Marker to new Marker 4131 Log() << Verbose(1) << count + 1 << ". closed path consists of: ";4131 DoLog(1) && (Log() << Verbose(1) << count + 1 << ". closed path consists of: "); 4132 4132 newPath = new TesselPointList; 4133 4133 TesselPointList::iterator CircleSprinter = Marker; 4134 4134 for (; CircleSprinter != CircleRunner; CircleSprinter++) { 4135 4135 newPath->push_back(*CircleSprinter); 4136 Log() << Verbose(0) << (**CircleSprinter) << " <-> ";4136 DoLog(0) && (Log() << Verbose(0) << (**CircleSprinter) << " <-> "); 4137 4137 } 4138 Log() << Verbose(0) << ".." << endl;4138 DoLog(0) && (Log() << Verbose(0) << ".." << endl); 4139 4139 count++; 4140 4140 Marker = CircleRunner; … … 4145 4145 } 4146 4146 } 4147 Log() << Verbose(1) << "INFO: " << count << " closed additional path(s) have been created." << endl;4147 DoLog(1) && (Log() << Verbose(1) << "INFO: " << count << " closed additional path(s) have been created." << endl); 4148 4148 4149 4149 // delete list of paths … … 4207 4207 return 0.; 4208 4208 } else 4209 Log() << Verbose(0) << "Removing point " << *point << " from tesselated boundary ..." << endl;4209 DoLog(0) && (Log() << Verbose(0) << "Removing point " << *point << " from tesselated boundary ..." << endl); 4210 4210 4211 4211 // copy old location for the volume … … 4237 4237 NormalVector.Zero(); 4238 4238 for (TriangleMap::iterator Runner = Candidates.begin(); Runner != Candidates.end(); Runner++) { 4239 Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl;4239 DoLog(1) && (Log() << Verbose(1) << "INFO: Removing triangle " << *(Runner->second) << "." << endl); 4240 4240 NormalVector.SubtractVector(&Runner->second->NormalVector); // has to point inward 4241 4241 RemoveTesselationTriangle(Runner->second); 4242 4242 count++; 4243 4243 } 4244 Log() << Verbose(1) << count << " triangles were removed." << endl;4244 DoLog(1) && (Log() << Verbose(1) << count << " triangles were removed." << endl); 4245 4245 4246 4246 list<TesselPointList *>::iterator ListAdvance = ListOfClosedPaths->begin(); … … 4266 4266 smallestangle = 0.; 4267 4267 for (MiddleNode = connectedPath->begin(); MiddleNode != connectedPath->end(); MiddleNode++) { 4268 Log() << Verbose(1) << "INFO: MiddleNode is " << **MiddleNode << "." << endl;4268 DoLog(1) && (Log() << Verbose(1) << "INFO: MiddleNode is " << **MiddleNode << "." << endl); 4269 4269 // construct vectors to next and previous neighbour 4270 4270 StartNode = MiddleNode; … … 4304 4304 if (EndNode == connectedPath->end()) 4305 4305 EndNode = connectedPath->begin(); 4306 Log() << Verbose(2) << "INFO: StartNode is " << **StartNode << "." << endl;4307 Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl;4308 Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl;4309 Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl;4306 DoLog(2) && (Log() << Verbose(2) << "INFO: StartNode is " << **StartNode << "." << endl); 4307 DoLog(2) && (Log() << Verbose(2) << "INFO: MiddleNode is " << **MiddleNode << "." << endl); 4308 DoLog(2) && (Log() << Verbose(2) << "INFO: EndNode is " << **EndNode << "." << endl); 4309 DoLog(1) && (Log() << Verbose(1) << "INFO: Attempting to create triangle " << (*StartNode)->Name << ", " << (*MiddleNode)->Name << " and " << (*EndNode)->Name << "." << endl); 4310 4310 TriangleCandidates[0] = *StartNode; 4311 4311 TriangleCandidates[1] = *MiddleNode; … … 4325 4325 continue; 4326 4326 } 4327 Log() << Verbose(3) << "Adding new triangle points." << endl;4327 DoLog(3) && (Log() << Verbose(3) << "Adding new triangle points." << endl); 4328 4328 AddTesselationPoint(*StartNode, 0); 4329 4329 AddTesselationPoint(*MiddleNode, 1); 4330 4330 AddTesselationPoint(*EndNode, 2); 4331 Log() << Verbose(3) << "Adding new triangle lines." << endl;4331 DoLog(3) && (Log() << Verbose(3) << "Adding new triangle lines." << endl); 4332 4332 AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0); 4333 4333 AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1); … … 4344 4344 // prepare nodes for next triangle 4345 4345 StartNode = EndNode; 4346 Log() << Verbose(2) << "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "." << endl;4346 DoLog(2) && (Log() << Verbose(2) << "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "." << endl); 4347 4347 connectedPath->remove(*MiddleNode); // remove the middle node (it is surrounded by triangles) 4348 4348 if (connectedPath->size() == 2) { // we are done … … 4380 4380 if (maxgain != 0) { 4381 4381 volume += maxgain; 4382 Log() << Verbose(1) << "Flipping baseline with highest volume" << **Candidate << "." << endl;4382 DoLog(1) && (Log() << Verbose(1) << "Flipping baseline with highest volume" << **Candidate << "." << endl); 4383 4383 OtherBase = FlipBaseline(*Candidate); 4384 4384 NewLines.erase(Candidate); … … 4391 4391 delete (connectedPath); 4392 4392 } 4393 Log() << Verbose(0) << count << " triangles were created." << endl;4393 DoLog(0) && (Log() << Verbose(0) << count << " triangles were created." << endl); 4394 4394 } else { 4395 4395 while (!ListOfClosedPaths->empty()) { … … 4399 4399 delete (connectedPath); 4400 4400 } 4401 Log() << Verbose(0) << "No need to create any triangles." << endl;4401 DoLog(0) && (Log() << Verbose(0) << "No need to create any triangles." << endl); 4402 4402 } 4403 4403 delete (ListOfClosedPaths); 4404 4404 4405 Log() << Verbose(0) << "Removed volume is " << volume << "." << endl;4405 DoLog(0) && (Log() << Verbose(0) << "Removed volume is " << volume << "." << endl); 4406 4406 4407 4407 return volume; … … 4568 4568 AllLines.clear(); 4569 4569 4570 Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl;4570 DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedLines() found " << DegeneratedLines->size() << " lines." << endl); 4571 4571 IndexToIndex::iterator it; 4572 4572 for (it = DegeneratedLines->begin(); it != DegeneratedLines->end(); it++) { … … 4574 4574 const LineMap::const_iterator Line2 = LinesOnBoundary.find((*it).second); 4575 4575 if (Line1 != LinesOnBoundary.end() && Line2 != LinesOnBoundary.end()) 4576 Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl;4576 DoLog(0) && (Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl); 4577 4577 else 4578 4578 DoeLog(1) && (eLog() << Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl); … … 4616 4616 delete (DegeneratedLines); 4617 4617 4618 Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl;4618 DoLog(0) && (Log() << Verbose(0) << "FindAllDegeneratedTriangles() found " << DegeneratedTriangles->size() << " triangles:" << endl); 4619 4619 IndexToIndex::iterator it; 4620 4620 for (it = DegeneratedTriangles->begin(); it != DegeneratedTriangles->end(); it++) 4621 Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;4621 DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl); 4622 4622 4623 4623 return DegeneratedTriangles; … … 4687 4687 // erase the pair 4688 4688 count += (int) DegeneratedTriangles->erase(triangle->Nr); 4689 Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl;4689 DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *triangle << "." << endl); 4690 4690 RemoveTesselationTriangle(triangle); 4691 4691 count += (int) DegeneratedTriangles->erase(partnerTriangle->Nr); 4692 Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl;4692 DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removes triangle " << *partnerTriangle << "." << endl); 4693 4693 RemoveTesselationTriangle(partnerTriangle); 4694 4694 } else { 4695 Log() << Verbose(0) << "RemoveDegeneratedTriangles() does not remove triangle " << *triangle << " and its partner " << *partnerTriangle << " because it is essential for at" << " least one of the endpoints to be kept in the tesselation structure." << endl;4695 DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() does not remove triangle " << *triangle << " and its partner " << *partnerTriangle << " because it is essential for at" << " least one of the endpoints to be kept in the tesselation structure." << endl); 4696 4696 } 4697 4697 } … … 4700 4700 LastTriangle = NULL; 4701 4701 4702 Log() << Verbose(0) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl;4702 DoLog(0) && (Log() << Verbose(0) << "RemoveDegeneratedTriangles() removed " << count << " triangles:" << endl); 4703 4703 } 4704 4704 … … 4729 4729 return; 4730 4730 } 4731 Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl;4731 DoLog(0) && (Log() << Verbose(0) << "Nearest point on boundary is " << NearestPoint->Name << "." << endl); 4732 4732 4733 4733 // go through its lines and find the best one to split … … 4762 4762 4763 4763 // create new triangle to connect point (connects automatically with the missing spot of the chosen line) 4764 Log() << Verbose(2) << "Adding new triangle points." << endl;4764 DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl); 4765 4765 AddTesselationPoint((BestLine->endpoints[0]->node), 0); 4766 4766 AddTesselationPoint((BestLine->endpoints[1]->node), 1); 4767 4767 AddTesselationPoint(point, 2); 4768 Log() << Verbose(2) << "Adding new triangle lines." << endl;4768 DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl); 4769 4769 AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0); 4770 4770 AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1); … … 4773 4773 BTS->GetNormalVector(TempTriangle->NormalVector); 4774 4774 BTS->NormalVector.Scale(-1.); 4775 Log() << Verbose(1) << "INFO: NormalVector of new triangle is " << BTS->NormalVector << "." << endl;4775 DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of new triangle is " << BTS->NormalVector << "." << endl); 4776 4776 AddTesselationTriangle(); 4777 4777 4778 4778 // create other side of this triangle and close both new sides of the first created triangle 4779 Log() << Verbose(2) << "Adding new triangle points." << endl;4779 DoLog(2) && (Log() << Verbose(2) << "Adding new triangle points." << endl); 4780 4780 AddTesselationPoint((BestLine->endpoints[0]->node), 0); 4781 4781 AddTesselationPoint((BestLine->endpoints[1]->node), 1); 4782 4782 AddTesselationPoint(point, 2); 4783 Log() << Verbose(2) << "Adding new triangle lines." << endl;4783 DoLog(2) && (Log() << Verbose(2) << "Adding new triangle lines." << endl); 4784 4784 AddTesselationLine(NULL, NULL, TPS[0], TPS[1], 0); 4785 4785 AddTesselationLine(NULL, NULL, TPS[0], TPS[2], 1); … … 4787 4787 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 4788 4788 BTS->GetNormalVector(TempTriangle->NormalVector); 4789 Log() << Verbose(1) << "INFO: NormalVector of other new triangle is " << BTS->NormalVector << "." << endl;4789 DoLog(1) && (Log() << Verbose(1) << "INFO: NormalVector of other new triangle is " << BTS->NormalVector << "." << endl); 4790 4790 AddTesselationTriangle(); 4791 4791 … … 4825 4825 NameofTempFile.erase(npos, 1); 4826 4826 NameofTempFile.append(TecplotSuffix); 4827 Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";4827 DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n"); 4828 4828 tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc); 4829 4829 WriteTecplotFile(tempstream, this, cloud, TriangleFilesWritten); … … 4839 4839 NameofTempFile.erase(npos, 1); 4840 4840 NameofTempFile.append(Raster3DSuffix); 4841 Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n";4841 DoLog(0) && (Log() << Verbose(0) << "Writing temporary non convex hull to file " << NameofTempFile << ".\n"); 4842 4842 tempstream = new ofstream(NameofTempFile.c_str(), ios::trunc); 4843 4843 WriteRaster3dFile(tempstream, this, cloud); … … 4891 4891 pair<map<int, Vector *>::iterator, bool> TriangleInsertionTester; 4892 4892 for (PointMap::const_iterator Runner = PointsOnBoundary.begin(); Runner != PointsOnBoundary.end(); Runner++) { 4893 Log() << Verbose(0) << "Current point is " << *Runner->second << "." << endl;4893 DoLog(0) && (Log() << Verbose(0) << "Current point is " << *Runner->second << "." << endl); 4894 4894 map<int, Vector *> TriangleVectors; 4895 4895 // gather all NormalVectors 4896 Log() << Verbose(1) << "Gathering triangles ..." << endl;4896 DoLog(1) && (Log() << Verbose(1) << "Gathering triangles ..." << endl); 4897 4897 for (LineMap::const_iterator LineRunner = (Runner->second)->lines.begin(); LineRunner != (Runner->second)->lines.end(); LineRunner++) 4898 4898 for (TriangleMap::const_iterator TriangleRunner = (LineRunner->second)->triangles.begin(); TriangleRunner != (LineRunner->second)->triangles.end(); TriangleRunner++) { … … 4900 4900 TriangleInsertionTester = TriangleVectors.insert(pair<int, Vector *> ((TriangleRunner->second)->Nr, &((TriangleRunner->second)->NormalVector))); 4901 4901 if (TriangleInsertionTester.second) 4902 Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl;4902 DoLog(1) && (Log() << Verbose(1) << " Adding triangle " << *(TriangleRunner->second) << " to triangles to check-list." << endl); 4903 4903 } else { 4904 Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl;4904 DoLog(1) && (Log() << Verbose(1) << " NOT adding triangle " << *(TriangleRunner->second) << " as it's a simply degenerated one." << endl); 4905 4905 } 4906 4906 } 4907 4907 // check whether there are two that are parallel 4908 Log() << Verbose(1) << "Finding two parallel triangles ..." << endl;4908 DoLog(1) && (Log() << Verbose(1) << "Finding two parallel triangles ..." << endl); 4909 4909 for (map<int, Vector *>::iterator VectorWalker = TriangleVectors.begin(); VectorWalker != TriangleVectors.end(); VectorWalker++) 4910 4910 for (map<int, Vector *>::iterator VectorRunner = VectorWalker; VectorRunner != TriangleVectors.end(); VectorRunner++) 4911 4911 if (VectorWalker != VectorRunner) { // skip equals 4912 4912 const double SCP = VectorWalker->second->ScalarProduct(VectorRunner->second); // ScalarProduct should result in -1. for degenerated triangles 4913 Log() << Verbose(1) << "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP << endl;4913 DoLog(1) && (Log() << Verbose(1) << "Checking " << *VectorWalker->second << " against " << *VectorRunner->second << ": " << SCP << endl); 4914 4914 if (fabs(SCP + 1.) < ParallelEpsilon) { 4915 4915 InsertionTester = EndpointCandidateList.insert((Runner->second)); 4916 4916 if (InsertionTester.second) 4917 Log() << Verbose(0) << " Adding " << *Runner->second << " to endpoint candidate list." << endl;4917 DoLog(0) && (Log() << Verbose(0) << " Adding " << *Runner->second << " to endpoint candidate list." << endl); 4918 4918 // and break out of both loops 4919 4919 VectorWalker = TriangleVectors.end(); … … 4933 4933 Walker = *(EndpointCandidateList.begin()); 4934 4934 if (Current == NULL) { // create a new polygon with current candidate 4935 Log() << Verbose(0) << "Starting new polygon set at point " << *Walker << endl;4935 DoLog(0) && (Log() << Verbose(0) << "Starting new polygon set at point " << *Walker << endl); 4936 4936 Current = new BoundaryPolygonSet; 4937 4937 Current->endpoints.insert(Walker); … … 4946 4946 for (LineMap::const_iterator LineWalker = Walker->lines.begin(); LineWalker != Walker->lines.end(); LineWalker++) { 4947 4947 OtherWalker = (LineWalker->second)->GetOtherEndpoint(Walker); 4948 Log() << Verbose(1) << "Checking " << *OtherWalker << endl;4948 DoLog(1) && (Log() << Verbose(1) << "Checking " << *OtherWalker << endl); 4949 4949 set<BoundaryPointSet *>::iterator Finder = EndpointCandidateList.find(OtherWalker); 4950 4950 if (Finder != EndpointCandidateList.end()) { // found a connected partner 4951 Log() << Verbose(1) << " Adding to polygon." << endl;4951 DoLog(1) && (Log() << Verbose(1) << " Adding to polygon." << endl); 4952 4952 Current->endpoints.insert(OtherWalker); 4953 4953 EndpointCandidateList.erase(Finder); // remove from candidates 4954 4954 ToCheckConnecteds.push(OtherWalker); // but check its partners too 4955 4955 } else { 4956 Log() << Verbose(1) << " is not connected to " << *Walker << endl;4956 DoLog(1) && (Log() << Verbose(1) << " is not connected to " << *Walker << endl); 4957 4957 } 4958 4958 } 4959 4959 } 4960 4960 4961 Log() << Verbose(0) << "Final polygon is " << *Current << endl;4961 DoLog(0) && (Log() << Verbose(0) << "Final polygon is " << *Current << endl); 4962 4962 ListofDegeneratedPolygons.insert(Current); 4963 4963 Current = NULL; … … 4966 4966 const int counter = ListofDegeneratedPolygons.size(); 4967 4967 4968 Log() << Verbose(0) << "The following " << counter << " degenerated polygons have been found: " << endl;4968 DoLog(0) && (Log() << Verbose(0) << "The following " << counter << " degenerated polygons have been found: " << endl); 4969 4969 for (UniquePolygonSet::iterator PolygonRunner = ListofDegeneratedPolygons.begin(); PolygonRunner != ListofDegeneratedPolygons.end(); PolygonRunner++) 4970 Log() << Verbose(0) << " " << **PolygonRunner << endl;4970 DoLog(0) && (Log() << Verbose(0) << " " << **PolygonRunner << endl); 4971 4971 4972 4972 /// 4. Go through all these degenerated polygons … … 4979 4979 // check whether number is bigger than 2, otherwise it's just a simply degenerated one and nothing to do. 4980 4980 if (T->size() == 2) { 4981 Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl;4981 DoLog(1) && (Log() << Verbose(1) << " Skipping degenerated polygon, is just a (already simply degenerated) triangle." << endl); 4982 4982 delete (T); 4983 4983 continue; … … 4995 4995 /// 4a. Get NormalVector for one side (this is "front") 4996 4996 NormalVector.CopyVector(&(*TriangleWalker)->NormalVector); 4997 Log() << Verbose(1) << "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector << endl;4997 DoLog(1) && (Log() << Verbose(1) << "\"front\" defining triangle is " << **TriangleWalker << " and Normal vector of \"front\" side is " << NormalVector << endl); 4998 4998 TriangleWalker++; 4999 4999 TriangleSet::iterator TriangleSprinter = TriangleWalker; // is the inner advanced iterator … … 5004 5004 triangle = *TriangleWalker; 5005 5005 TriangleSprinter++; 5006 Log() << Verbose(1) << "Current triangle to test for removal: " << *triangle << endl;5006 DoLog(1) && (Log() << Verbose(1) << "Current triangle to test for removal: " << *triangle << endl); 5007 5007 if (triangle->NormalVector.ScalarProduct(&NormalVector) < 0) { // if from other side, then delete and remove from list 5008 Log() << Verbose(1) << " Removing ... " << endl;5008 DoLog(1) && (Log() << Verbose(1) << " Removing ... " << endl); 5009 5009 TriangleNrs.push(triangle->Nr); 5010 5010 T->erase(TriangleWalker); 5011 5011 RemoveTesselationTriangle(triangle); 5012 5012 } else 5013 Log() << Verbose(1) << " Keeping ... " << endl;5013 DoLog(1) && (Log() << Verbose(1) << " Keeping ... " << endl); 5014 5014 } 5015 5015 /// 4c. Copy all "front" triangles but with inverse NormalVector 5016 5016 TriangleWalker = T->begin(); 5017 5017 while (TriangleWalker != T->end()) { // go through all front triangles 5018 Log() << Verbose(1) << " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector << endl;5018 DoLog(1) && (Log() << Verbose(1) << " Re-creating triangle " << **TriangleWalker << " with NormalVector " << (*TriangleWalker)->NormalVector << endl); 5019 5019 for (int i = 0; i < 3; i++) 5020 5020 AddTesselationPoint((*TriangleWalker)->endpoints[i]->node, i); … … 5037 5037 } 5038 5038 IndexToIndex * SimplyDegeneratedTriangles = FindAllDegeneratedTriangles(); 5039 Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl;5039 DoLog(0) && (Log() << Verbose(0) << "Final list of simply degenerated triangles found, containing " << SimplyDegeneratedTriangles->size() << " triangles:" << endl); 5040 5040 IndexToIndex::iterator it; 5041 5041 for (it = SimplyDegeneratedTriangles->begin(); it != SimplyDegeneratedTriangles->end(); it++) 5042 Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl;5042 DoLog(0) && (Log() << Verbose(0) << (*it).first << " => " << (*it).second << endl); 5043 5043 delete (SimplyDegeneratedTriangles); 5044 5044 /// 5. exit -
src/tesselationhelpers.cpp
r6613ec ra67d19 132 132 Center->Scale(1./(sin(2.*alpha) + sin(2.*beta) + sin(2.*gamma))); 133 133 NewUmkreismittelpunkt->CopyVector(Center); 134 Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n";134 DoLog(1) && (Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n"); 135 135 // Here we calculated center of circumscribing circle, using barycentric coordinates 136 Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n";136 DoLog(1) && (Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n"); 137 137 138 138 TempNormal.CopyVector(&a); … … 158 158 TempNormal.Normalize(); 159 159 Restradius = sqrt(RADIUS*RADIUS - Umkreisradius*Umkreisradius); 160 Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n";160 DoLog(1) && (Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n"); 161 161 TempNormal.Scale(Restradius); 162 Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n";162 DoLog(1) && (Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n"); 163 163 164 164 Center->AddVector(&TempNormal); 165 Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n";165 DoLog(1) && (Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n"); 166 166 GetSphere(&OtherCenter, a, b, c, RADIUS); 167 Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n";167 DoLog(1) && (Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n"); 168 168 }; 169 169 … … 247 247 if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON) // acos is not unique on [0, 2.*M_PI), hence extra check to decide between two half intervals 248 248 alpha = 2.*M_PI - alpha; 249 Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl;249 DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl); 250 250 radius = helper.Distance(&RelativeOldSphereCenter); 251 251 helper.ProjectOntoPlane(&NormalVector); 252 252 // check whether new center is somewhat away or at least right over the current baseline to prevent intersecting triangles 253 253 if ((radius > HULLEPSILON) || (helper.Norm() < HULLEPSILON)) { 254 Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl;254 DoLog(1) && (Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl); 255 255 return alpha; 256 256 } else { 257 Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl;257 DoLog(1) && (Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl); 258 258 return 2.*M_PI; 259 259 } … … 364 364 365 365 if (status == GSL_SUCCESS) { 366 Log() << Verbose(1) << "converged to minimum" << endl;366 DoLog(1) && (Log() << Verbose(1) << "converged to minimum" << endl); 367 367 } 368 368 } while (status == GSL_CONTINUE && iter < 100); … … 394 394 395 395 if (((t1 >= 0) && (t1 <= 1)) && ((t2 >= 0) && (t2 <= 1))) { 396 Log() << Verbose(1) << "true intersection." << endl;396 DoLog(1) && (Log() << Verbose(1) << "true intersection." << endl); 397 397 result = true; 398 398 } else { 399 Log() << Verbose(1) << "intersection out of region of interest." << endl;399 DoLog(1) && (Log() << Verbose(1) << "intersection out of region of interest." << endl); 400 400 result = false; 401 401 } … … 432 432 } 433 433 434 Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl;434 DoLog(1) && (Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl); 435 435 436 436 return phi; … … 479 479 for (int j=i+1; j<3; j++) { 480 480 if (nodes[i] == NULL) { 481 Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl;481 DoLog(1) && (Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl); 482 482 result = true; 483 483 } else if (nodes[i]->lines.find(nodes[j]->node->nr) != nodes[i]->lines.end()) { // there already is a line … … 493 493 } 494 494 } else { // no line 495 Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl;495 DoLog(1) && (Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl); 496 496 result = true; 497 497 } 498 498 } 499 499 if ((!result) && (counter > 1)) { 500 Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl;500 DoLog(1) && (Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl); 501 501 result = true; 502 502 } … … 571 571 for(int i=0;i<NDIM;i++) // store indices of this cell 572 572 N[i] = LC->n[i]; 573 Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;573 DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl); 574 574 575 575 LC->GetNeighbourBounds(Nlower, Nupper); … … 626 626 for(int i=0;i<NDIM;i++) // store indices of this cell 627 627 N[i] = LC->n[i]; 628 Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;628 DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl); 629 629 630 630 LC->GetNeighbourBounds(Nlower, Nupper); … … 659 659 // output 660 660 if (closestPoint != NULL) { 661 Log() << Verbose(1) << "Closest point is " << *closestPoint;661 DoLog(1) && (Log() << Verbose(1) << "Closest point is " << *closestPoint); 662 662 if (SecondPoint != NULL) 663 Log() << Verbose(0) << " and second closest is " << *SecondPoint;664 Log() << Verbose(0) << "." << endl;663 DoLog(0) && (Log() << Verbose(0) << " and second closest is " << *SecondPoint); 664 DoLog(0) && (Log() << Verbose(0) << "." << endl); 665 665 } 666 666 return closestPoint; … … 686 686 Normal.VectorProduct(&OtherBaseline); 687 687 Normal.Normalize(); 688 Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl;688 DoLog(1) && (Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl); 689 689 690 690 // project one offset point of OtherBase onto this plane (and add plane offset vector) … … 703 703 Normal.CopyVector(Intersection); 704 704 Normal.SubtractVector(Base->endpoints[0]->node->node); 705 Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl;705 DoLog(1) && (Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl); 706 706 707 707 return Intersection; … … 885 885 *tecplot << endl; 886 886 // print connectivity 887 Log() << Verbose(1) << "The following triangles were created:" << endl;887 DoLog(1) && (Log() << Verbose(1) << "The following triangles were created:" << endl); 888 888 for (TriangleMap::const_iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) { 889 Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl;889 DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl); 890 890 *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl; 891 891 } … … 908 908 for (PointMap::const_iterator PointRunner = TesselStruct->PointsOnBoundary.begin(); PointRunner != TesselStruct->PointsOnBoundary.end(); PointRunner++) { 909 909 point = PointRunner->second; 910 Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl;910 DoLog(1) && (Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl); 911 911 point->value = 0; 912 912 for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) { … … 932 932 int counter = 0; 933 933 934 Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl;934 DoLog(1) && (Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl); 935 935 for (testline = TesselStruct->LinesOnBoundary.begin(); testline != TesselStruct->LinesOnBoundary.end(); testline++) { 936 936 if (testline->second->triangles.size() != 2) { 937 Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl;937 DoLog(2) && (Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl); 938 938 counter++; 939 939 } 940 940 } 941 941 if (counter == 0) { 942 Log() << Verbose(1) << "None." << endl;942 DoLog(1) && (Log() << Verbose(1) << "None." << endl); 943 943 result = true; 944 944 } … … 965 965 } 966 966 967 Log() << Verbose(0) << "Polygon is " << *P << endl;967 DoLog(0) && (Log() << Verbose(0) << "Polygon is " << *P << endl); 968 968 // create each pair, get the endpoints and check whether *P is contained. 969 969 int counter = 0; … … 981 981 const int size = PairTrianglenodes.endpoints.size(); 982 982 if (size == 4) { 983 Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl;983 DoLog(0) && (Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl); 984 984 // now check 985 985 if (PairTrianglenodes.ContainsPresentTupel(P)) { 986 986 counter++; 987 Log() << Verbose(0) << " ACCEPT: Matches with " << *P << endl;987 DoLog(0) && (Log() << Verbose(0) << " ACCEPT: Matches with " << *P << endl); 988 988 } else { 989 Log() << Verbose(0) << " REJECT: No match with " << *P << endl;989 DoLog(0) && (Log() << Verbose(0) << " REJECT: No match with " << *P << endl); 990 990 } 991 991 } else { 992 Log() << Verbose(0) << " REJECT: Less than four endpoints." << endl;992 DoLog(0) && (Log() << Verbose(0) << " REJECT: Less than four endpoints." << endl); 993 993 } 994 994 } … … 1011 1011 if (P2->ContainsBoundaryPoint((*Runner))) { 1012 1012 counter++; 1013 Log() << Verbose(1) << *(*Runner) << " of second polygon is found in the first one." << endl;1013 DoLog(1) && (Log() << Verbose(1) << *(*Runner) << " of second polygon is found in the first one." << endl); 1014 1014 return true; 1015 1015 } … … 1029 1029 Tester = P1->endpoints.insert((*Runner)); 1030 1030 if (Tester.second) 1031 Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl;1031 DoLog(0) && (Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl); 1032 1032 } 1033 1033 P2->endpoints.clear(); -
src/unittests/logunittest.cpp
r6613ec ra67d19 35 35 { 36 36 logger::getInstance()->setVerbosity(2); 37 Log() << Verbose(0) << "Verbosity level is set to 2." << endl;38 Log() << Verbose(0) << "Test level 0" << endl;39 Log() << Verbose(1) << "Test level 1" << endl;40 Log() << Verbose(2) << "Test level 2" << endl;41 Log() << Verbose(3) << "Test level 3" << endl;42 Log() << Verbose(4) << "Test level 4" << endl;37 DoLog(0) && (Log() << Verbose(0) << "Verbosity level is set to 2." << endl); 38 DoLog(0) && (Log() << Verbose(0) << "Test level 0" << endl); 39 DoLog(1) && (Log() << Verbose(1) << "Test level 1" << endl); 40 DoLog(2) && (Log() << Verbose(2) << "Test level 2" << endl); 41 DoLog(3) && (Log() << Verbose(3) << "Test level 3" << endl); 42 DoLog(4) && (Log() << Verbose(4) << "Test level 4" << endl); 43 43 44 Log() << Verbose(0) << "Output a log message." << endl;44 DoLog(0) && (Log() << Verbose(0) << "Output a log message." << endl); 45 45 DoeLog(0) && (eLog()<< Verbose(0) << "Output an error message." << endl); 46 46 setVerbosity(3); 47 Log() << Verbose(4) << "This should not be printed." << endl;47 DoLog(4) && (Log() << Verbose(4) << "This should not be printed." << endl); 48 48 DoeLog(4) && (eLog()<< Verbose(4) << "This should not be printed." << endl); 49 49 }; -
src/unittests/memoryallocatorunittest.cpp
r6613ec ra67d19 46 46 char* buffer3 = NULL; 47 47 buffer3 = Malloc<char>(4, ""); 48 Log() << Verbose(0) << buffer3 << endl;48 DoLog(0) && (Log() << Verbose(0) << buffer3 << endl); 49 49 Free(&buffer3); 50 50 -
src/unittests/tesselation_insideoutsideunittest.cpp
r6613ec ra67d19 94 94 while ((!TesselStruct->OpenLines.empty()) && (OneLoopWithoutSuccessFlag)) { 95 95 // 2a. fill all new OpenLines 96 Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl;96 DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl); 97 97 for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) 98 Log() << Verbose(2) << *(Runner->second) << endl;98 DoLog(2) && (Log() << Verbose(2) << *(Runner->second) << endl); 99 99 100 100 for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) { … … 102 102 if (baseline->pointlist.empty()) { 103 103 T = (((baseline->BaseLine->triangles.begin()))->second); 104 Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl;104 DoLog(1) && (Log() << Verbose(1) << "Finding best candidate for open line " << *baseline->BaseLine << " of triangle " << *T << endl); 105 105 TesselationFailFlag = TesselStruct->FindNextSuitableTriangle(*baseline, *T, SPHERERADIUS, LinkedList); //the line is there, so there is a triangle, but only one. 106 106 } … … 109 109 // 2b. search for smallest ShortestAngle among all candidates 110 110 double ShortestAngle = 4.*M_PI; 111 Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl;111 DoLog(1) && (Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl); 112 112 for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) 113 Log() << Verbose(2) << *(Runner->second) << endl;113 DoLog(2) && (Log() << Verbose(2) << *(Runner->second) << endl); 114 114 115 115 for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) { -
src/vector.cpp
r6613ec ra67d19 253 253 Direction.SubtractVector(Origin); 254 254 Direction.Normalize(); 255 Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl;255 DoLog(1) && (Log() << Verbose(1) << "INFO: Direction is " << Direction << "." << endl); 256 256 //Log() << Verbose(1) << "INFO: PlaneNormal is " << *PlaneNormal << " and PlaneOffset is " << *PlaneOffset << "." << endl; 257 257 factor = Direction.ScalarProduct(PlaneNormal); 258 258 if (fabs(factor) < MYEPSILON) { // Uniqueness: line parallel to plane? 259 Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl;259 DoLog(1) && (Log() << Verbose(1) << "BAD: Line is parallel to plane, no intersection." << endl); 260 260 return false; 261 261 } … … 264 264 factor = helper.ScalarProduct(PlaneNormal)/factor; 265 265 if (fabs(factor) < MYEPSILON) { // Origin is in-plane 266 Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl;266 DoLog(1) && (Log() << Verbose(1) << "GOOD: Origin of line is in-plane." << endl); 267 267 CopyVector(Origin); 268 268 return true; … … 271 271 Direction.Scale(factor); 272 272 CopyVector(Origin); 273 Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl;273 DoLog(1) && (Log() << Verbose(1) << "INFO: Scaled direction is " << Direction << "." << endl); 274 274 AddVector(&Direction); 275 275 … … 278 278 helper.SubtractVector(PlaneOffset); 279 279 if (helper.ScalarProduct(PlaneNormal) < MYEPSILON) { 280 Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl;280 DoLog(1) && (Log() << Verbose(1) << "GOOD: Intersection is " << *this << "." << endl); 281 281 return true; 282 282 } else { … … 359 359 //} 360 360 if (fabs(M->Determinant()) > MYEPSILON) { 361 Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl;361 DoLog(1) && (Log() << Verbose(1) << "Determinant of coefficient matrix is NOT zero." << endl); 362 362 return false; 363 363 } 364 Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl;364 DoLog(1) && (Log() << Verbose(1) << "INFO: Line1a = " << *Line1a << ", Line1b = " << *Line1b << ", Line2a = " << *Line2a << ", Line2b = " << *Line2b << "." << endl); 365 365 366 366 … … 378 378 d.CopyVector(Line2b); 379 379 d.SubtractVector(Line1b); 380 Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl;380 DoLog(1) && (Log() << Verbose(1) << "INFO: a = " << a << ", b = " << b << ", c = " << c << "." << endl); 381 381 if ((a.NormSquared() < MYEPSILON) || (b.NormSquared() < MYEPSILON)) { 382 382 Zero(); 383 Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl;383 DoLog(1) && (Log() << Verbose(1) << "At least one of the lines is ill-defined, i.e. offset equals second vector." << endl); 384 384 return false; 385 385 } … … 394 394 if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) { 395 395 CopyVector(Line2a); 396 Log() << Verbose(1) << "Lines conincide." << endl;396 DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl); 397 397 return true; 398 398 } else { … … 402 402 if ((factor >= -MYEPSILON) && (factor - 1. < MYEPSILON)) { 403 403 CopyVector(Line2b); 404 Log() << Verbose(1) << "Lines conincide." << endl;404 DoLog(1) && (Log() << Verbose(1) << "Lines conincide." << endl); 405 405 return true; 406 406 } 407 407 } 408 Log() << Verbose(1) << "Lines are parallel." << endl;408 DoLog(1) && (Log() << Verbose(1) << "Lines are parallel." << endl); 409 409 Zero(); 410 410 return false; … … 418 418 temp2.CopyVector(&a); 419 419 temp2.VectorProduct(&b); 420 Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl;420 DoLog(1) && (Log() << Verbose(1) << "INFO: temp1 = " << temp1 << ", temp2 = " << temp2 << "." << endl); 421 421 if (fabs(temp2.NormSquared()) > MYEPSILON) 422 422 s = temp1.ScalarProduct(&temp2)/temp2.NormSquared(); 423 423 else 424 424 s = 0.; 425 Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl;425 DoLog(1) && (Log() << Verbose(1) << "Factor s is " << temp1.ScalarProduct(&temp2) << "/" << temp2.NormSquared() << " = " << s << "." << endl); 426 426 427 427 // construct intersection … … 429 429 Scale(s); 430 430 AddVector(Line1a); 431 Log() << Verbose(1) << "Intersection is at " << *this << "." << endl;431 DoLog(1) && (Log() << Verbose(1) << "Intersection is at " << *this << "." << endl); 432 432 433 433 return true; … … 702 702 void Vector::Output() const 703 703 { 704 Log() << Verbose(0) << "(";704 DoLog(0) && (Log() << Verbose(0) << "("); 705 705 for (int i=0;i<NDIM;i++) { 706 Log() << Verbose(0) << x[i];706 DoLog(0) && (Log() << Verbose(0) << x[i]); 707 707 if (i != 2) 708 Log() << Verbose(0) << ",";709 } 710 Log() << Verbose(0) << ")";708 DoLog(0) && (Log() << Verbose(0) << ","); 709 } 710 DoLog(0) && (Log() << Verbose(0) << ")"); 711 711 }; 712 712 … … 843 843 projection = ScalarProduct(n)/n->ScalarProduct(n); // remove constancy from n (keep as logical one) 844 844 // withdraw projected vector twice from original one 845 Log() << Verbose(1) << "Vector: ";845 DoLog(1) && (Log() << Verbose(1) << "Vector: "); 846 846 Output(); 847 Log() << Verbose(0) << "\t";847 DoLog(0) && (Log() << Verbose(0) << "\t"); 848 848 for (int i=NDIM;i--;) 849 849 x[i] -= 2.*projection*n->x[i]; 850 Log() << Verbose(0) << "Projected vector: ";850 DoLog(0) && (Log() << Verbose(0) << "Projected vector: "); 851 851 Output(); 852 Log() << Verbose(0) << endl;852 DoLog(0) && (Log() << Verbose(0) << endl); 853 853 }; 854 854 … … 954 954 double norm; 955 955 956 Log() << Verbose(4);956 DoLog(4) && (Log() << Verbose(4)); 957 957 GivenVector->Output(); 958 Log() << Verbose(0) << endl;958 DoLog(0) && (Log() << Verbose(0) << endl); 959 959 for (j=NDIM;j--;) 960 960 Components[j] = -1; … … 963 963 if (fabs(GivenVector->x[j]) > MYEPSILON) 964 964 Components[Last++] = j; 965 Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl;965 DoLog(4) && (Log() << Verbose(4) << Last << " Components != 0: (" << Components[0] << "," << Components[1] << "," << Components[2] << ")" << endl); 966 966 967 967 switch(Last) { … … 1013 1013 1014 1014 for (j=0;j<num;j++) { 1015 Log() << Verbose(1) << j << "th atom's vector: ";1015 DoLog(1) && (Log() << Verbose(1) << j << "th atom's vector: "); 1016 1016 (vectors[j])->Output(); 1017 Log() << Verbose(0) << endl;1017 DoLog(0) && (Log() << Verbose(0) << endl); 1018 1018 } 1019 1019 … … 1135 1135 j += i+1; 1136 1136 do { 1137 Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: ";1137 DoLog(0) && (Log() << Verbose(0) << coords[i] << "[0.." << cell_size[j] << "]: "); 1138 1138 cin >> x[i]; 1139 1139 } while (((x[i] < 0) || (x[i] >= cell_size[j])) && (check)); … … 1166 1166 B2 = cos(beta) * x2->Norm() * c; 1167 1167 C = c * c; 1168 Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl;1168 DoLog(2) && (Log() << Verbose(2) << "A " << A << "\tB " << B1 << "\tC " << C << endl); 1169 1169 int flag = 0; 1170 1170 if (fabs(x1->x[0]) < MYEPSILON) { // check for zero components for the later flipping and back-flipping … … 1205 1205 D2 = -y->x[0]/x1->x[0]*x1->x[2]+y->x[2]; 1206 1206 D3 = y->x[0]/x1->x[0]*A-B1; 1207 Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n";1207 DoLog(2) && (Log() << Verbose(2) << "D1 " << D1 << "\tD2 " << D2 << "\tD3 " << D3 << "\n"); 1208 1208 if (fabs(D1) < MYEPSILON) { 1209 Log() << Verbose(2) << "D1 == 0!\n";1209 DoLog(2) && (Log() << Verbose(2) << "D1 == 0!\n"); 1210 1210 if (fabs(D2) > MYEPSILON) { 1211 Log() << Verbose(3) << "D2 != 0!\n";1211 DoLog(3) && (Log() << Verbose(3) << "D2 != 0!\n"); 1212 1212 x[2] = -D3/D2; 1213 1213 E1 = A/x1->x[0] + x1->x[2]/x1->x[0]*D3/D2; 1214 1214 E2 = -x1->x[1]/x1->x[0]; 1215 Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n";1215 DoLog(3) && (Log() << Verbose(3) << "E1 " << E1 << "\tE2 " << E2 << "\n"); 1216 1216 F1 = E1*E1 + 1.; 1217 1217 F2 = -E1*E2; 1218 1218 F3 = E1*E1 + D3*D3/(D2*D2) - C; 1219 Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";1219 DoLog(3) && (Log() << Verbose(3) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n"); 1220 1220 if (fabs(F1) < MYEPSILON) { 1221 Log() << Verbose(4) << "F1 == 0!\n";1222 Log() << Verbose(4) << "Gleichungssystem linear\n";1221 DoLog(4) && (Log() << Verbose(4) << "F1 == 0!\n"); 1222 DoLog(4) && (Log() << Verbose(4) << "Gleichungssystem linear\n"); 1223 1223 x[1] = F3/(2.*F2); 1224 1224 } else { 1225 1225 p = F2/F1; 1226 1226 q = p*p - F3/F1; 1227 Log() << Verbose(4) << "p " << p << "\tq " << q << endl;1227 DoLog(4) && (Log() << Verbose(4) << "p " << p << "\tq " << q << endl); 1228 1228 if (q < 0) { 1229 Log() << Verbose(4) << "q < 0" << endl;1229 DoLog(4) && (Log() << Verbose(4) << "q < 0" << endl); 1230 1230 return false; 1231 1231 } … … 1234 1234 x[0] = A/x1->x[0] - x1->x[1]/x1->x[0]*x[1] + x1->x[2]/x1->x[0]*x[2]; 1235 1235 } else { 1236 Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n";1236 DoLog(2) && (Log() << Verbose(2) << "Gleichungssystem unterbestimmt\n"); 1237 1237 return false; 1238 1238 } … … 1240 1240 E1 = A/x1->x[0]+x1->x[1]/x1->x[0]*D3/D1; 1241 1241 E2 = x1->x[1]/x1->x[0]*D2/D1 - x1->x[2]; 1242 Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n";1242 DoLog(2) && (Log() << Verbose(2) << "E1 " << E1 << "\tE2 " << E2 << "\n"); 1243 1243 F1 = E2*E2 + D2*D2/(D1*D1) + 1.; 1244 1244 F2 = -(E1*E2 + D2*D3/(D1*D1)); 1245 1245 F3 = E1*E1 + D3*D3/(D1*D1) - C; 1246 Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n";1246 DoLog(2) && (Log() << Verbose(2) << "F1 " << F1 << "\tF2 " << F2 << "\tF3 " << F3 << "\n"); 1247 1247 if (fabs(F1) < MYEPSILON) { 1248 Log() << Verbose(3) << "F1 == 0!\n";1249 Log() << Verbose(3) << "Gleichungssystem linear\n";1248 DoLog(3) && (Log() << Verbose(3) << "F1 == 0!\n"); 1249 DoLog(3) && (Log() << Verbose(3) << "Gleichungssystem linear\n"); 1250 1250 x[2] = F3/(2.*F2); 1251 1251 } else { 1252 1252 p = F2/F1; 1253 1253 q = p*p - F3/F1; 1254 Log() << Verbose(3) << "p " << p << "\tq " << q << endl;1254 DoLog(3) && (Log() << Verbose(3) << "p " << p << "\tq " << q << endl); 1255 1255 if (q < 0) { 1256 Log() << Verbose(3) << "q < 0" << endl;1256 DoLog(3) && (Log() << Verbose(3) << "q < 0" << endl); 1257 1257 return false; 1258 1258 } … … 1292 1292 for (j=2;j>=0;j--) { 1293 1293 k = (i & pot(2,j)) << j; 1294 Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl;1294 DoLog(2) && (Log() << Verbose(2) << "k " << k << "\tpot(2,j) " << pot(2,j) << endl); 1295 1295 sign[j] = (k == 0) ? 1. : -1.; 1296 1296 } 1297 Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n";1297 DoLog(2) && (Log() << Verbose(2) << i << ": sign matrix is " << sign[0] << "\t" << sign[1] << "\t" << sign[2] << "\n"); 1298 1298 // apply sign matrix 1299 1299 for (j=NDIM;j--;) … … 1301 1301 // calculate angle and check 1302 1302 ang = x2->Angle (this); 1303 Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t";1303 DoLog(1) && (Log() << Verbose(1) << i << "th angle " << ang << "\tbeta " << cos(beta) << " :\t"); 1304 1304 if (fabs(ang - cos(beta)) < MYEPSILON) { 1305 1305 break;
Note:
See TracChangeset
for help on using the changeset viewer.
