Changeset 58ed4a
- Timestamp:
- Mar 18, 2010, 11:33:54 AM (15 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- b48ba6
- Parents:
- 7ee87f
- git-author:
- Frederik Heber <heber@…> (03/18/10 10:26:55)
- git-committer:
- Frederik Heber <heber@…> (03/18/10 11:33:54)
- Location:
- src
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
src/analysis_bonds.cpp
r7ee87f r58ed4a 37 37 } 38 38 if (((int)Mean % 2) != 0) 39 eLog() << Verbose(1) << "Something is wrong with the bond structure, the number of bonds is not even!" << endl;39 DoeLog(1) && (eLog()<< Verbose(1) << "Something is wrong with the bond structure, the number of bonds is not even!" << endl); 40 40 Mean /= (double)AtomCount; 41 41 }; -
src/analysis_correlation.cpp
r7ee87f r58ed4a 36 36 37 37 if (molecules->ListOfMolecules.empty()) { 38 eLog() << Verbose(1) <<"No molecule given." << endl;38 DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl); 39 39 return outmap; 40 40 } … … 42 42 for (MoleculeList::const_iterator MolWalker = molecules->ListOfMolecules.begin(); MolWalker != molecules->ListOfMolecules.end(); MolWalker++) 43 43 if ((*MolWalker)->ActiveFlag) { 44 eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;44 DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 45 45 atom *Walker = (*MolWalker)->start; 46 46 while (Walker->next != (*MolWalker)->end) { … … 92 92 93 93 if (molecules->ListOfMolecules.empty()) { 94 eLog() << Verbose(1) <<"No molecule given." << endl;94 DoeLog(1) && (eLog()<< Verbose(1) <<"No molecule given." << endl); 95 95 return outmap; 96 96 } … … 100 100 double * FullMatrix = ReturnFullMatrixforSymmetric(World::get()->cell_size); 101 101 double * FullInverseMatrix = InverseMatrix(FullMatrix); 102 eLog() << Verbose(2) << "Current molecule is " << *MolWalker << "." << endl;102 DoeLog(2) && (eLog()<< Verbose(2) << "Current molecule is " << *MolWalker << "." << endl); 103 103 atom *Walker = (*MolWalker)->start; 104 104 while (Walker->next != (*MolWalker)->end) { … … 257 257 258 258 if ((Surface == NULL) || (LC == NULL) || (molecules->ListOfMolecules.empty())) { 259 eLog() << Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl;259 DoeLog(1) && (eLog()<< Verbose(1) <<"No Tesselation, no LinkedCell or no molecule given." << endl); 260 260 return outmap; 261 261 } … … 333 333 checkX.AddVector(&periodicX); 334 334 checkX.MatrixMultiplication(FullMatrix); 335 triangle = Surface->FindClosestTriangleToVector(&checkX, LC); 336 distance = Surface->GetDistanceSquaredToTriangle(checkX, triangle); 335 TriangleIntersectionList Intersections(&checkX,Surface,LC); 336 distance = Intersections.GetSmallestDistance(); 337 triangle = Intersections.GetClosestTriangle(); 337 338 if ((ShortestDistance == -1.) || (distance < ShortestDistance)) { 338 339 ShortestDistance = distance; … … 341 342 } 342 343 // insert 343 ShortestDistance = sqrt(ShortestDistance);344 344 outmap->insert ( pair<double, pair<atom *, BoundaryTriangleSet*> >(ShortestDistance, pair<atom *, BoundaryTriangleSet*> (Walker, ShortestTriangle) ) ); 345 345 //Log() << Verbose(1) << "INFO: Inserting " << Walker << " with distance " << ShortestDistance << " to " << *ShortestTriangle << "." << endl; -
src/analysis_correlation.hpp
r7ee87f r58ed4a 71 71 72 72 if (map == NULL) { 73 eLog() << Verbose(0) << "Nothing to min/max, map is NULL!" << endl;73 DoeLog(0) && (eLog()<< Verbose(0) << "Nothing to min/max, map is NULL!" << endl); 74 74 performCriticalExit(); 75 75 return; … … 109 109 110 110 if (map == NULL) { 111 eLog() << Verbose(0) << "Nothing to bin, is NULL!" << endl;111 DoeLog(0) && (eLog()<< Verbose(0) << "Nothing to bin, is NULL!" << endl); 112 112 performCriticalExit(); 113 113 return outmap; -
src/analyzer.cpp
r7ee87f r58ed4a 96 96 if (!Hcorrection.ParseFragmentMatrix(argv[1], "", HCORRECTIONSUFFIX,0,0)) { 97 97 NoHCorrection = true; 98 eLog() << Verbose(2) << "No HCorrection file found, skipping these." << endl;98 DoeLog(2) && (eLog()<< Verbose(2) << "No HCorrection file found, skipping these." << endl); 99 99 } 100 100 … … 102 102 if (!Hessian.ParseFragmentMatrix(argv[1], dir, HessianSuffix,0,0)) { 103 103 NoHessian = true; 104 eLog() << Verbose(2) << "No Hessian file found, skipping these." << endl;104 DoeLog(2) && (eLog()<< Verbose(2) << "No Hessian file found, skipping these." << endl); 105 105 } 106 106 if (!Time.ParseFragmentMatrix(argv[1], dir, TimeSuffix, 10,1)) { 107 107 NoTime = true; 108 eLog() << Verbose(2) << "No speed file found, skipping these." << endl;108 DoeLog(2) && (eLog()<< Verbose(2) << "No speed file found, skipping these." << endl); 109 109 } 110 110 if (periode != NULL) { // also look for PAS values -
src/atom_bondedparticle.cpp
r7ee87f r58ed4a 86 86 status = true; 87 87 } else { 88 eLog() << Verbose(1) << *Binder << " does not contain " << *this << "." << endl;88 DoeLog(1) && (eLog()<< Verbose(1) << *Binder << " does not contain " << *this << "." << endl); 89 89 } 90 90 } else { 91 eLog() << Verbose(1) << "Binder is " << Binder << "." << endl;91 DoeLog(1) && (eLog()<< Verbose(1) << "Binder is " << Binder << "." << endl); 92 92 } 93 93 return status; … … 105 105 status = true; 106 106 } else { 107 eLog() << Verbose(1) << *Binder << " does not contain " << *this << "." << endl;107 DoeLog(1) && (eLog()<< Verbose(1) << *Binder << " does not contain " << *this << "." << endl); 108 108 } 109 109 } else { 110 eLog() << Verbose(1) << "Binder is " << Binder << "." << endl;110 DoeLog(1) && (eLog()<< Verbose(1) << "Binder is " << Binder << "." << endl); 111 111 } 112 112 return status; … … 150 150 //Log() << Verbose(2) << "Increased bond degree for bond " << *CandidateBond << "." << endl; 151 151 } else { 152 eLog() << Verbose(2) << "Could not find correct degree for atom " << *this << "." << endl;152 DoeLog(2) && (eLog()<< Verbose(2) << "Could not find correct degree for atom " << *this << "." << endl); 153 153 FalseBondDegree++; 154 154 } -
src/bond.cpp
r7ee87f r58ed4a 63 63 if(rightatom == Atom) 64 64 return leftatom; 65 eLog() << Verbose(1) << "Bond " << *this << " does not contain atom " << *Atom << "!" << endl;65 DoeLog(1) && (eLog()<< Verbose(1) << "Bond " << *this << " does not contain atom " << *Atom << "!" << endl); 66 66 return NULL; 67 67 }; … … 99 99 bool bond::MarkUsed(const enum Shading color) { 100 100 if (Used == black) { 101 eLog() << Verbose(1) << "Bond " << this << " was already marked black!." << endl;101 DoeLog(1) && (eLog()<< Verbose(1) << "Bond " << this << " was already marked black!." << endl); 102 102 return false; 103 103 } else { -
src/bondgraph.cpp
r7ee87f r58ed4a 58 58 Log() << Verbose(1) << "Parsing bond length matrix successful." << endl; 59 59 } else { 60 eLog() << Verbose(1) << "Parsing bond length matrix failed." << endl;60 DoeLog(1) && (eLog()<< Verbose(1) << "Parsing bond length matrix failed." << endl); 61 61 } 62 62 … … 159 159 { 160 160 if (BondLengthMatrix == NULL) {// safety measure if no matrix has been parsed yet 161 eLog() << Verbose(2) << "BondLengthMatrixMinMaxDistance() called without having parsed the bond length matrix yet!" << endl;161 DoeLog(2) && (eLog()<< Verbose(2) << "BondLengthMatrixMinMaxDistance() called without having parsed the bond length matrix yet!" << endl); 162 162 CovalentMinMaxDistance(Walker, OtherWalker, MinDistance, MaxDistance, IsAngstroem); 163 163 } else { -
src/boundary.cpp
r7ee87f r58ed4a 342 342 for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) 343 343 if (!TesselStruct->AddBoundaryPoint(runner->second.second, 0)) 344 eLog() << Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl;344 DoeLog(2) && (eLog()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl); 345 345 346 346 Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl; … … 362 362 // 3c. check whether all atoms lay inside the boundary, if not, add to boundary points, segment triangle into three with the new point 363 363 if (!TesselStruct->InsertStraddlingPoints(mol, LCList)) 364 eLog() << Verbose(1) << "Insertion of straddling points failed!" << endl;364 DoeLog(1) && (eLog()<< Verbose(1) << "Insertion of straddling points failed!" << endl); 365 365 366 366 Log() << Verbose(0) << "I created " << TesselStruct->TrianglesOnBoundary.size() << " intermediate triangles with " << TesselStruct->LinesOnBoundary.size() << " lines and " << TesselStruct->PointsOnBoundary.size() << " points." << endl; … … 401 401 // flip the line 402 402 if (TesselStruct->PickFarthestofTwoBaselines(line) == 0.) 403 eLog() << Verbose(1) << "Correction of concave baselines failed!" << endl;403 DoeLog(1) && (eLog()<< Verbose(1) << "Correction of concave baselines failed!" << endl); 404 404 else { 405 405 TesselStruct->FlipBaseline(line); … … 456 456 457 457 if ((TesselStruct == NULL) || (TesselStruct->PointsOnBoundary.empty())) { 458 eLog() << Verbose(1) << "TesselStruct is empty." << endl;458 DoeLog(1) && (eLog()<< Verbose(1) << "TesselStruct is empty." << endl); 459 459 return false; 460 460 } … … 521 521 // check whether there is something to work on 522 522 if (TesselStruct == NULL) { 523 eLog() << Verbose(1) << "TesselStruct is empty!" << endl;523 DoeLog(1) && (eLog()<< Verbose(1) << "TesselStruct is empty!" << endl); 524 524 return volume; 525 525 } … … 748 748 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 eLog() << Verbose(1) << "the containing box already has a greater volume than the envisaged cell volume!" << endl;750 DoeLog(1) && (eLog()<< Verbose(1) << "the containing box already has a greater volume than the envisaged cell volume!" << endl); 751 751 Log() << Verbose(0) << "Setting Box dimensions to minimum possible, the greatest diameters." << endl; 752 752 for (int i = 0; i < NDIM; i++) -
src/builder.cpp
r7ee87f r58ed4a 85 85 bool valid; 86 86 87 Log()<< Verbose(0) << "===========ADD ATOM============================" << endl;88 Log()<< Verbose(0) << " a - state absolute coordinates of atom" << endl;89 Log()<< Verbose(0) << " b - state relative coordinates of atom wrt to reference point" << endl;90 Log()<< Verbose(0) << " c - state relative coordinates of atom wrt to already placed atom" << endl;91 Log()<< Verbose(0) << " d - state two atoms, two angles and a distance" << endl;92 Log()<< Verbose(0) << " e - least square distance position to a set of atoms" << endl;93 Log()<< Verbose(0) << "all else - go back" << endl;94 Log()<< Verbose(0) << "===============================================" << endl;95 Log()<< Verbose(0) << "Note: Specifiy angles in degrees not multiples of Pi!" << endl;96 Log()<< Verbose(0) << "INPUT: ";87 cout << Verbose(0) << "===========ADD ATOM============================" << endl; 88 cout << Verbose(0) << " a - state absolute coordinates of atom" << endl; 89 cout << Verbose(0) << " b - state relative coordinates of atom wrt to reference point" << endl; 90 cout << Verbose(0) << " c - state relative coordinates of atom wrt to already placed atom" << endl; 91 cout << Verbose(0) << " d - state two atoms, two angles and a distance" << endl; 92 cout << Verbose(0) << " e - least square distance position to a set of atoms" << endl; 93 cout << Verbose(0) << "all else - go back" << endl; 94 cout << Verbose(0) << "===============================================" << endl; 95 cout << Verbose(0) << "Note: Specifiy angles in degrees not multiples of Pi!" << endl; 96 cout << Verbose(0) << "INPUT: "; 97 97 cin >> choice; 98 98 99 99 switch (choice) { 100 100 default: 101 eLog() << Verbose(2) << "Not a valid choice." << endl;101 DoeLog(2) && (eLog()<< Verbose(2) << "Not a valid choice." << endl); 102 102 break; 103 103 case 'a': // absolute coordinates of atom 104 Log()<< Verbose(0) << "Enter absolute coordinates." << endl;104 cout << Verbose(0) << "Enter absolute coordinates." << endl; 105 105 first = new atom; 106 106 first->x.AskPosition(World::get()->cell_size, false); … … 113 113 valid = true; 114 114 do { 115 if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;116 Log()<< Verbose(0) << "Enter reference coordinates." << endl;115 if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl); 116 cout << Verbose(0) << "Enter reference coordinates." << endl; 117 117 x.AskPosition(World::get()->cell_size, true); 118 Log()<< Verbose(0) << "Enter relative coordinates." << endl;118 cout << Verbose(0) << "Enter relative coordinates." << endl; 119 119 first->x.AskPosition(World::get()->cell_size, false); 120 120 first->x.AddVector((const Vector *)&x); 121 Log()<< Verbose(0) << "\n";121 cout << Verbose(0) << "\n"; 122 122 } while (!(valid = mol->CheckBounds((const Vector *)&first->x))); 123 123 first->type = periode->AskElement(); // give type … … 129 129 valid = true; 130 130 do { 131 if (!valid) eLog() << Verbose(2) << "Resulting position out of cell." << endl;131 if (!valid) DoeLog(2) && (eLog()<< Verbose(2) << "Resulting position out of cell." << endl); 132 132 second = mol->AskAtom("Enter atom number: "); 133 133 Log() << Verbose(0) << "Enter relative coordinates." << endl; … … 146 146 do { 147 147 if (!valid) { 148 eLog() << Verbose(2) << "Resulting coordinates out of cell - " << first->x << endl;148 DoeLog(2) && (eLog()<< Verbose(2) << "Resulting coordinates out of cell - " << first->x << endl); 149 149 } 150 Log()<< Verbose(0) << "First, we need two atoms, the first atom is the central, while the second is the outer one." << endl;150 cout << Verbose(0) << "First, we need two atoms, the first atom is the central, while the second is the outer one." << endl; 151 151 second = mol->AskAtom("Enter central atom: "); 152 152 third = mol->AskAtom("Enter second atom (specifying the axis for first angle): "); … … 159 159 c *= M_PI/180.; 160 160 bound(&c, -M_PI, M_PI); 161 Log()<< Verbose(0) << "radius: " << a << "\t phi: " << b*180./M_PI << "\t theta: " << c*180./M_PI << endl;161 cout << Verbose(0) << "radius: " << a << "\t phi: " << b*180./M_PI << "\t theta: " << c*180./M_PI << endl; 162 162 /* 163 163 second->Output(1,1,(ofstream *)&cout); … … 171 171 172 172 if (!z.SolveSystem(&x,&y,&n, b, c, a)) { 173 Log() << Verbose(0) << "Failure solving self-dependent linear system!" << endl;173 coutg() << Verbose(0) << "Failure solving self-dependent linear system!" << endl; 174 174 continue; 175 175 } … … 248 248 atoms[i] = NULL; 249 249 int i=0, j=0; 250 Log()<< Verbose(0) << "Now we need at least three molecules.\n";250 cout << Verbose(0) << "Now we need at least three molecules.\n"; 251 251 do { 252 Log()<< Verbose(0) << "Enter " << i+1 << "th atom: ";252 cout << Verbose(0) << "Enter " << i+1 << "th atom: "; 253 253 cin >> j; 254 254 if (j != -1) { … … 265 265 } else { 266 266 delete first; 267 Log()<< Verbose(0) << "Please enter at least two vectors!\n";267 cout << Verbose(0) << "Please enter at least two vectors!\n"; 268 268 } 269 269 break; … … 279 279 char choice; // menu choice char 280 280 281 Log()<< Verbose(0) << "===========CENTER ATOMS=========================" << endl;282 Log()<< Verbose(0) << " a - on origin" << endl;283 Log()<< Verbose(0) << " b - on center of gravity" << endl;284 Log()<< Verbose(0) << " c - within box with additional boundary" << endl;285 Log()<< Verbose(0) << " d - within given simulation box" << endl;286 Log()<< Verbose(0) << "all else - go back" << endl;287 Log()<< Verbose(0) << "===============================================" << endl;288 Log()<< Verbose(0) << "INPUT: ";281 cout << Verbose(0) << "===========CENTER ATOMS=========================" << endl; 282 cout << Verbose(0) << " a - on origin" << endl; 283 cout << Verbose(0) << " b - on center of gravity" << endl; 284 cout << Verbose(0) << " c - within box with additional boundary" << endl; 285 cout << Verbose(0) << " d - within given simulation box" << endl; 286 cout << Verbose(0) << "all else - go back" << endl; 287 cout << Verbose(0) << "===============================================" << endl; 288 cout << Verbose(0) << "INPUT: "; 289 289 cin >> choice; 290 290 291 291 switch (choice) { 292 292 default: 293 Log()<< Verbose(0) << "Not a valid choice." << endl;293 cout << Verbose(0) << "Not a valid choice." << endl; 294 294 break; 295 295 case 'a': 296 Log()<< Verbose(0) << "Centering atoms in config file on origin." << endl;296 cout << Verbose(0) << "Centering atoms in config file on origin." << endl; 297 297 mol->CenterOrigin(); 298 298 break; 299 299 case 'b': 300 Log()<< Verbose(0) << "Centering atoms in config file on center of gravity." << endl;300 cout << Verbose(0) << "Centering atoms in config file on center of gravity." << endl; 301 301 mol->CenterPeriodic(); 302 302 break; 303 303 case 'c': 304 Log()<< Verbose(0) << "Centering atoms in config file within given additional boundary." << endl;304 cout << Verbose(0) << "Centering atoms in config file within given additional boundary." << endl; 305 305 for (int i=0;i<NDIM;i++) { 306 Log()<< Verbose(0) << "Enter axis " << i << " boundary: ";306 cout << Verbose(0) << "Enter axis " << i << " boundary: "; 307 307 cin >> y.x[i]; 308 308 } … … 315 315 break; 316 316 case 'd': 317 Log()<< Verbose(1) << "Centering atoms in config file within given simulation box." << endl;317 cout << Verbose(1) << "Centering atoms in config file within given simulation box." << endl; 318 318 for (int i=0;i<NDIM;i++) { 319 Log()<< Verbose(0) << "Enter axis " << i << " boundary: ";319 cout << Verbose(0) << "Enter axis " << i << " boundary: "; 320 320 cin >> x.x[i]; 321 321 } … … 338 338 char choice; // menu choice char 339 339 340 Log()<< Verbose(0) << "===========ALIGN ATOMS=========================" << endl;341 Log()<< Verbose(0) << " a - state three atoms defining align plane" << endl;342 Log()<< Verbose(0) << " b - state alignment vector" << endl;343 Log()<< Verbose(0) << " c - state two atoms in alignment direction" << endl;344 Log()<< Verbose(0) << " d - align automatically by least square fit" << endl;345 Log()<< Verbose(0) << "all else - go back" << endl;346 Log()<< Verbose(0) << "===============================================" << endl;347 Log()<< Verbose(0) << "INPUT: ";340 cout << Verbose(0) << "===========ALIGN ATOMS=========================" << endl; 341 cout << Verbose(0) << " a - state three atoms defining align plane" << endl; 342 cout << Verbose(0) << " b - state alignment vector" << endl; 343 cout << Verbose(0) << " c - state two atoms in alignment direction" << endl; 344 cout << Verbose(0) << " d - align automatically by least square fit" << endl; 345 cout << Verbose(0) << "all else - go back" << endl; 346 cout << Verbose(0) << "===============================================" << endl; 347 cout << Verbose(0) << "INPUT: "; 348 348 cin >> choice; 349 349 … … 358 358 break; 359 359 case 'b': // normal vector of mirror plane 360 Log()<< Verbose(0) << "Enter normal vector of mirror plane." << endl;360 cout << Verbose(0) << "Enter normal vector of mirror plane." << endl; 361 361 n.AskPosition(World::get()->cell_size,0); 362 362 n.Normalize(); … … 378 378 fscanf(stdin, "%3s", shorthand); 379 379 } while ((param.type = periode->FindElement(shorthand)) == NULL); 380 Log()<< Verbose(0) << "Element is " << param.type->name << endl;380 cout << Verbose(0) << "Element is " << param.type->name << endl; 381 381 mol->GetAlignvector(¶m); 382 382 for (int i=NDIM;i--;) { … … 385 385 } 386 386 gsl_vector_free(param.x); 387 Log()<< Verbose(0) << "Offset vector: ";387 cout << Verbose(0) << "Offset vector: "; 388 388 x.Output(); 389 389 Log() << Verbose(0) << endl; … … 674 674 Log() << Verbose(0) << "===============================================" << endl; 675 675 if (molecules->NumberOfActiveMolecules() > 1) 676 eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;676 DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl); 677 677 Log() << Verbose(0) << "INPUT: "; 678 678 cin >> choice; … … 830 830 Log() << Verbose(0) << "===============================================" << endl; 831 831 if (molecules->NumberOfActiveMolecules() > 1) 832 eLog() << Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl;832 DoeLog(2) && (eLog()<< Verbose(2) << "There is more than one molecule active! Atoms will be added to each." << endl); 833 833 Log() << Verbose(0) << "INPUT: "; 834 834 cin >> choice; … … 863 863 } 864 864 if (count != j) 865 eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;865 DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl); 866 866 x.Zero(); 867 867 y.Zero(); … … 1208 1208 mol = (molecules->ListOfMolecules.front())->CopyMolecule(); 1209 1209 else { 1210 eLog() << Verbose(0) << "I don't have anything to test on ... ";1210 DoeLog(0) && (eLog()<< Verbose(0) << "I don't have anything to test on ... "); 1211 1211 performCriticalExit(); 1212 1212 return; … … 1289 1289 1290 1290 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { 1291 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;1291 DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl); 1292 1292 } 1293 1293 … … 1393 1393 1394 1394 if (!strcmp(configuration->configpath, configuration->GetDefaultPath())) { 1395 eLog() << Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl;1395 DoeLog(2) && (eLog()<< Verbose(2) << "config is found under different path then stated in config file::defaultpath!" << endl); 1396 1396 } 1397 1397 … … 1496 1496 return (1); 1497 1497 break; 1498 case 'B': 1499 if (ExitFlag == 0) ExitFlag = 1; 1500 if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) { 1501 ExitFlag = 255; 1502 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl); 1503 performCriticalExit(); 1504 } else { 1505 SaveFlag = true; 1506 j = -1; 1507 Log() << Verbose(1) << "Centering atoms in config file within given simulation box." << endl; 1508 double * const cell_size = World::get()->cell_size; 1509 for (int i=0;i<6;i++) { 1510 cell_size[i] = atof(argv[argptr+i]); 1511 } 1512 argptr+=6; 1513 } 1514 break; 1498 1515 case 'e': 1499 1516 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1500 eLog() << Verbose(0) << "Not enough or invalid arguments for specifying element db: -e <db file>" << endl;1517 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for specifying element db: -e <db file>" << endl); 1501 1518 performCriticalExit(); 1502 1519 } else { … … 1508 1525 case 'g': 1509 1526 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1510 eLog() << Verbose(0) << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl;1527 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for specifying bond length table: -g <table file>" << endl); 1511 1528 performCriticalExit(); 1512 1529 } else { … … 1605 1622 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1606 1623 } else { 1607 eLog() << Verbose(1) << "Bond length table loading failed." << endl;1624 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); 1608 1625 } 1609 1626 } … … 1621 1638 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1622 1639 ExitFlag = 255; 1623 eLog() << Verbose(0) << "Not enough arguments for parsing: -p <xyz file>" << endl;1640 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough arguments for parsing: -p <xyz file>" << endl); 1624 1641 performCriticalExit(); 1625 1642 } else { … … 1638 1655 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3]))) { 1639 1656 ExitFlag = 255; 1640 eLog() << Verbose(0) << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl;1657 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for adding atom: -a <element> <x> <y> <z>" << endl); 1641 1658 performCriticalExit(); 1642 1659 } else { … … 1654 1671 configPresent = present; 1655 1672 } else 1656 eLog() << Verbose(1) << "Could not find the specified element." << endl;1673 DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the specified element." << endl); 1657 1674 argptr+=4; 1658 1675 } … … 1667 1684 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1668 1685 ExitFlag = 255; 1669 eLog() << Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -B <basis name>" << endl;1686 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for setting MPQC basis: -B <basis name>" << endl); 1670 1687 performCriticalExit(); 1671 1688 } else { … … 1727 1744 break; 1728 1745 case 'C': 1729 if (ExitFlag == 0) ExitFlag = 1; 1730 if ((argptr >= argc)) { 1731 ExitFlag = 255; 1732 eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output> <BinStart> <BinEnd>" << endl; 1733 performCriticalExit(); 1734 } else { 1735 switch(argv[argptr][0]) { 1736 case 'E': 1737 { 1738 if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+2])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-')) { 1739 ExitFlag = 255; 1740 eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output>" << endl; 1741 performCriticalExit(); 1742 } else { 1743 ofstream output(argv[argptr+3]); 1744 ofstream binoutput(argv[argptr+4]); 1745 const double BinStart = atof(argv[argptr+5]); 1746 const double BinEnd = atof(argv[argptr+6]); 1747 1748 element *elemental = periode->FindElement((const int) atoi(argv[argptr+1])); 1749 element *elemental2 = periode->FindElement((const int) atoi(argv[argptr+2])); 1750 PairCorrelationMap *correlationmap = PairCorrelation(molecules, elemental, elemental2); 1751 //OutputCorrelationToSurface(&output, correlationmap); 1752 BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd ); 1753 OutputCorrelation ( &binoutput, binmap ); 1754 output.close(); 1755 binoutput.close(); 1756 delete(binmap); 1757 delete(correlationmap); 1758 argptr+=7; 1746 { 1747 int ranges[3] = {1, 1, 1}; 1748 bool periodic = (argv[argptr-1][2] =='p'); 1749 if (ExitFlag == 0) ExitFlag = 1; 1750 if ((argptr >= argc)) { 1751 ExitFlag = 255; 1752 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C[p] <type: E/P/S> [more params] <output> <bin output> <BinStart> <BinEnd>" << endl); 1753 performCriticalExit(); 1754 } else { 1755 switch(argv[argptr][0]) { 1756 case 'E': 1757 { 1758 if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (!IsValidNumber(argv[argptr+2])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-')) { 1759 ExitFlag = 255; 1760 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C E <Z1> <Z2> <output> <bin output>" << endl); 1761 performCriticalExit(); 1762 } else { 1763 ofstream output(argv[argptr+3]); 1764 ofstream binoutput(argv[argptr+4]); 1765 const double BinStart = atof(argv[argptr+5]); 1766 const double BinEnd = atof(argv[argptr+6]); 1767 1768 element *elemental = periode->FindElement((const int) atoi(argv[argptr+1])); 1769 element *elemental2 = periode->FindElement((const int) atoi(argv[argptr+2])); 1770 PairCorrelationMap *correlationmap = NULL; 1771 if (periodic) 1772 correlationmap = PeriodicPairCorrelation(molecules, elemental, elemental2, ranges); 1773 else 1774 correlationmap = PairCorrelation(molecules, elemental, elemental2); 1775 //OutputCorrelationToSurface(&output, correlationmap); 1776 BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd ); 1777 OutputCorrelation ( &binoutput, binmap ); 1778 output.close(); 1779 binoutput.close(); 1780 delete(binmap); 1781 delete(correlationmap); 1782 argptr+=7; 1783 } 1759 1784 } 1760 } 1761 break; 1762 1763 case 'P': 1764 { 1765 if ((argptr+8 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+7])) || (!IsValidNumber(argv[argptr+8])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-') || (argv[argptr+5][0] == '-') || (argv[argptr+6][0] == '-')) { 1766 ExitFlag = 255; 1767 eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output>" << endl; 1768 performCriticalExit(); 1769 } else { 1770 ofstream output(argv[argptr+5]); 1771 ofstream binoutput(argv[argptr+6]); 1772 const double BinStart = atof(argv[argptr+7]); 1773 const double BinEnd = atof(argv[argptr+8]); 1774 1775 element *elemental = periode->FindElement((const int) atoi(argv[argptr+1])); 1776 Vector *Point = new Vector((const double) atof(argv[argptr+1]),(const double) atof(argv[argptr+2]),(const double) atof(argv[argptr+3])); 1777 CorrelationToPointMap *correlationmap = CorrelationToPoint(molecules, elemental, Point); 1778 //OutputCorrelationToSurface(&output, correlationmap); 1779 BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd ); 1780 OutputCorrelation ( &binoutput, binmap ); 1781 output.close(); 1782 binoutput.close(); 1783 delete(Point); 1784 delete(binmap); 1785 delete(correlationmap); 1786 argptr+=9; 1785 break; 1786 1787 case 'P': 1788 { 1789 if ((argptr+8 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+7])) || (!IsValidNumber(argv[argptr+8])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-') || (argv[argptr+4][0] == '-') || (argv[argptr+5][0] == '-') || (argv[argptr+6][0] == '-')) { 1790 ExitFlag = 255; 1791 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C P <Z1> <x> <y> <z> <output> <bin output>" << endl); 1792 performCriticalExit(); 1793 } else { 1794 ofstream output(argv[argptr+5]); 1795 ofstream binoutput(argv[argptr+6]); 1796 const double BinStart = atof(argv[argptr+7]); 1797 const double BinEnd = atof(argv[argptr+8]); 1798 1799 element *elemental = periode->FindElement((const int) atoi(argv[argptr+1])); 1800 Vector *Point = new Vector((const double) atof(argv[argptr+1]),(const double) atof(argv[argptr+2]),(const double) atof(argv[argptr+3])); 1801 CorrelationToPointMap *correlationmap = NULL; 1802 if (periodic) 1803 correlationmap = PeriodicCorrelationToPoint(molecules, elemental, Point, ranges); 1804 else 1805 correlationmap = CorrelationToPoint(molecules, elemental, Point); 1806 //OutputCorrelationToSurface(&output, correlationmap); 1807 BinPairMap *binmap = BinData( correlationmap, 0.5, BinStart, BinEnd ); 1808 OutputCorrelation ( &binoutput, binmap ); 1809 output.close(); 1810 binoutput.close(); 1811 delete(Point); 1812 delete(binmap); 1813 delete(correlationmap); 1814 argptr+=9; 1815 } 1787 1816 } 1788 } 1789 break; 1790 1791 case 'S': 1792 { 1793 if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-')) { 1794 ExitFlag = 255; 1795 eLog() << Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C S <Z> <output> <bin output> <BinWidth> <BinStart> <BinEnd>" << endl; 1796 performCriticalExit(); 1797 } else { 1798 ofstream output(argv[argptr+2]); 1799 ofstream binoutput(argv[argptr+3]); 1800 const double radius = 4.; 1801 const double BinWidth = atof(argv[argptr+4]); 1802 const double BinStart = atof(argv[argptr+5]); 1803 const double BinEnd = atof(argv[argptr+6]); 1804 double LCWidth = 20.; 1805 if (BinEnd > 0) { 1806 if (BinEnd > 2.*radius) 1807 LCWidth = BinEnd; 1817 break; 1818 1819 case 'S': 1820 { 1821 if ((argptr+6 >= argc) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) || (!IsValidNumber(argv[argptr+6])) || (argv[argptr+1][0] == '-') || (argv[argptr+2][0] == '-') || (argv[argptr+3][0] == '-')) { 1822 ExitFlag = 255; 1823 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for pair correlation analysis: -C S <Z> <output> <bin output> <BinWidth> <BinStart> <BinEnd>" << endl); 1824 performCriticalExit(); 1825 } else { 1826 ofstream output(argv[argptr+2]); 1827 ofstream binoutput(argv[argptr+3]); 1828 const double radius = 4.; 1829 const double BinWidth = atof(argv[argptr+4]); 1830 const double BinStart = atof(argv[argptr+5]); 1831 const double BinEnd = atof(argv[argptr+6]); 1832 double LCWidth = 20.; 1833 if (BinEnd > 0) { 1834 if (BinEnd > 2.*radius) 1835 LCWidth = BinEnd; 1836 else 1837 LCWidth = 2.*radius; 1838 } 1839 1840 // get the boundary 1841 class molecule *Boundary = NULL; 1842 class Tesselation *TesselStruct = NULL; 1843 const LinkedCell *LCList = NULL; 1844 // find biggest molecule 1845 int counter = 0; 1846 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1847 if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) { 1848 Boundary = *BigFinder; 1849 } 1850 counter++; 1851 } 1852 bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives"); 1853 counter = 0; 1854 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) { 1855 Actives[counter++] = (*BigFinder)->ActiveFlag; 1856 (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true; 1857 } 1858 LCList = new LinkedCell(Boundary, LCWidth); 1859 element *elemental = periode->FindElement((const int) atoi(argv[argptr+1])); 1860 FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL); 1861 CorrelationToSurfaceMap *surfacemap = NULL; 1862 if (periodic) 1863 surfacemap = PeriodicCorrelationToSurface( molecules, elemental, TesselStruct, LCList, ranges); 1808 1864 else 1809 LCWidth = 2.*radius; 1865 surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList); 1866 OutputCorrelationToSurface(&output, surfacemap); 1867 // check whether radius was appropriate 1868 { 1869 double start; double end; 1870 GetMinMax( surfacemap, start, end); 1871 if (LCWidth < end) 1872 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl); 1873 } 1874 BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd ); 1875 OutputCorrelation ( &binoutput, binmap ); 1876 output.close(); 1877 binoutput.close(); 1878 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) 1879 (*BigFinder)->ActiveFlag = Actives[counter++]; 1880 Free(&Actives); 1881 delete(LCList); 1882 delete(TesselStruct); 1883 delete(binmap); 1884 delete(surfacemap); 1885 argptr+=7; 1810 1886 } 1811 1812 // get the boundary1813 class molecule *Boundary = NULL;1814 class Tesselation *TesselStruct = NULL;1815 const LinkedCell *LCList = NULL;1816 // find biggest molecule1817 int counter = 0;1818 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {1819 if ((Boundary == NULL) || (Boundary->AtomCount < (*BigFinder)->AtomCount)) {1820 Boundary = *BigFinder;1821 }1822 counter++;1823 }1824 bool *Actives = Malloc<bool>(counter, "ParseCommandLineOptions() - case C -- *Actives");1825 counter = 0;1826 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++) {1827 Actives[counter++] = (*BigFinder)->ActiveFlag;1828 (*BigFinder)->ActiveFlag = (*BigFinder == Boundary) ? false : true;1829 }1830 LCList = new LinkedCell(Boundary, LCWidth);1831 element *elemental = periode->FindElement((const int) atoi(argv[argptr+1]));1832 FindNonConvexBorder(Boundary, TesselStruct, LCList, radius, NULL);1833 //int ranges[NDIM] = {1,1,1};1834 CorrelationToSurfaceMap *surfacemap = CorrelationToSurface( molecules, elemental, TesselStruct, LCList); // for Periodic..(): ..., ranges );1835 OutputCorrelationToSurface(&output, surfacemap);1836 // check whether radius was appropriate1837 {1838 double start; double end;1839 GetMinMax( surfacemap, start, end);1840 if (LCWidth < end)1841 eLog() << Verbose(1) << "Linked Cell width is smaller than the found range of values! Bins can only be correct up to: " << radius << "." << endl;1842 }1843 BinPairMap *binmap = BinData( surfacemap, BinWidth, BinStart, BinEnd );1844 OutputCorrelation ( &binoutput, binmap );1845 output.close();1846 binoutput.close();1847 for (MoleculeList::iterator BigFinder = molecules->ListOfMolecules.begin(); BigFinder != molecules->ListOfMolecules.end(); BigFinder++)1848 (*BigFinder)->ActiveFlag = Actives[counter++];1849 Free(&Actives);1850 delete(LCList);1851 delete(TesselStruct);1852 delete(binmap);1853 delete(surfacemap);1854 argptr+=7;1855 1887 } 1856 }1857 break; 1858 1859 default:1860 ExitFlag = 255;1861 eLog() << Verbose(0) << "Invalid type given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output>" << endl;1862 performCriticalExit();1863 break;1888 break; 1889 1890 default: 1891 ExitFlag = 255; 1892 DoeLog(0) && (eLog()<< Verbose(0) << "Invalid type given for pair correlation analysis: -C <type: E/P/S> [more params] <output> <bin output>" << endl); 1893 performCriticalExit(); 1894 break; 1895 } 1864 1896 } 1865 }1866 break;1897 break; 1898 } 1867 1899 case 'E': 1868 1900 if (ExitFlag == 0) ExitFlag = 1; 1869 1901 if ((argptr+1 >= argc) || (!IsValidNumber(argv[argptr])) || (argv[argptr+1][0] == '-')) { 1870 1902 ExitFlag = 255; 1871 eLog() << Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl;1903 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for changing element: -E <atom nr.> <element>" << endl); 1872 1904 performCriticalExit(); 1873 1905 } else { … … 1882 1914 if (ExitFlag == 0) ExitFlag = 1; 1883 1915 MaxDistance = -1; 1884 if (argv[argptr-1][2] == 'F') { 1916 if (argv[argptr-1][2] == 'F') { // option is -FF? 1885 1917 // fetch first argument as max distance to surface 1886 1918 MaxDistance = atof(argv[argptr++]); … … 1889 1921 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]))) { 1890 1922 ExitFlag = 255; 1891 eLog() << Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <xyz of filler> <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl;1923 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for filling box with water: -F <xyz of filler> <dist_x> <dist_y> <dist_z> <boundary> <randatom> <randmol> <DoRotate>" << endl); 1892 1924 performCriticalExit(); 1893 1925 } else { … … 1897 1929 molecule *filler = new molecule(periode); 1898 1930 if (!filler->AddXYZFile(argv[argptr])) { 1899 eLog() << Verbose(0) << "Could not parse filler molecule from " << argv[argptr] << "." << endl;1931 DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse filler molecule from " << argv[argptr] << "." << endl); 1900 1932 } 1901 1933 filler->SetNameFromFilename(argv[argptr]); … … 1919 1951 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1920 1952 ExitFlag =255; 1921 eLog() << Verbose(0) << "Missing source file for bonds in molecule: -A <bond sourcefile>" << endl;1953 DoeLog(0) && (eLog()<< Verbose(0) << "Missing source file for bonds in molecule: -A <bond sourcefile>" << endl); 1922 1954 performCriticalExit(); 1923 1955 } else { … … 1934 1966 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1935 1967 ExitFlag =255; 1936 eLog() << Verbose(0) << "Missing path of adjacency file: -j <path>" << endl;1968 DoeLog(0) && (eLog()<< Verbose(0) << "Missing path of adjacency file: -j <path>" << endl); 1937 1969 performCriticalExit(); 1938 1970 } else { 1939 1971 Log() << Verbose(0) << "Storing adjacency to path " << argv[argptr] << "." << endl; 1940 1972 configuration.BG->ConstructBondGraph(mol); 1941 mol->StoreAdjacencyToFile( argv[argptr]);1973 mol->StoreAdjacencyToFile(NULL, argv[argptr]); 1942 1974 argptr+=1; 1943 1975 } … … 1948 1980 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1949 1981 ExitFlag =255; 1950 eLog() << Verbose(0) << "Missing path of bonds file: -j <path>" << endl;1982 DoeLog(0) && (eLog()<< Verbose(0) << "Missing path of bonds file: -j <path>" << endl); 1951 1983 performCriticalExit(); 1952 1984 } else { 1953 1985 Log() << Verbose(0) << "Storing bonds to path " << argv[argptr] << "." << endl; 1954 1986 configuration.BG->ConstructBondGraph(mol); 1955 mol->StoreBondsToFile( argv[argptr]);1987 mol->StoreBondsToFile(NULL, argv[argptr]); 1956 1988 argptr+=1; 1957 1989 } … … 1962 1994 if ((argptr+1 >= argc) || (argv[argptr+1][0] == '-')){ 1963 1995 ExitFlag = 255; 1964 eLog() << Verbose(0) << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl;1996 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for non-convex envelope: -o <radius> <tecplot output file>" << endl); 1965 1997 performCriticalExit(); 1966 1998 } else { … … 1998 2030 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 1999 2031 ExitFlag = 255; 2000 eLog() << Verbose(0) << "Not enough or invalid arguments given for storing tempature: -S <temperature file>" << endl;2032 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for storing tempature: -S <temperature file>" << endl); 2001 2033 performCriticalExit(); 2002 2034 } else { … … 2016 2048 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 2017 2049 ExitFlag = 255; 2018 eLog() << Verbose(0) << "Not enough or invalid arguments given for storing tempature: -L <step0> <step1> <prefix> <identity mapping?>" << endl;2050 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for storing tempature: -L <step0> <step1> <prefix> <identity mapping?>" << endl); 2019 2051 performCriticalExit(); 2020 2052 } else { … … 2034 2066 if ((argptr >= argc) || (argv[argptr][0] == '-')) { 2035 2067 ExitFlag = 255; 2036 eLog() << Verbose(0) << "Not enough or invalid arguments given for parsing and integrating forces: -P <forces file>" << endl;2068 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for parsing and integrating forces: -P <forces file>" << endl); 2037 2069 performCriticalExit(); 2038 2070 } else { … … 2050 2082 if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) { 2051 2083 ExitFlag = 255; 2052 eLog() << Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl;2084 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -R <id> <distance>" << endl); 2053 2085 performCriticalExit(); 2054 2086 } else { … … 2067 2099 } 2068 2100 } else { 2069 eLog() << Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl;2101 DoeLog(1) && (eLog()<< Verbose(1) << "Removal failed due to missing atoms on molecule or wrong id." << endl); 2070 2102 } 2071 2103 argptr+=2; … … 2076 2108 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 2077 2109 ExitFlag = 255; 2078 eLog() << Verbose(0) << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl;2110 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for translation: -t <x> <y> <z>" << endl); 2079 2111 performCriticalExit(); 2080 2112 } else { … … 2092 2124 if ((argptr+2 >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 2093 2125 ExitFlag = 255; 2094 eLog() << Verbose(0) << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl;2126 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for periodic translation: -T <x> <y> <z>" << endl); 2095 2127 performCriticalExit(); 2096 2128 } else { … … 2108 2140 if ((argptr >= argc) || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 2109 2141 ExitFlag = 255; 2110 eLog() << Verbose(0) << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl;2142 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for scaling: -s <factor_x> [factor_y] [factor_z]" << endl); 2111 2143 performCriticalExit(); 2112 2144 } else { … … 2133 2165 if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) { 2134 2166 ExitFlag = 255; 2135 eLog() << Verbose(0) << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl;2167 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for centering in box: -b <xx> <xy> <xz> <yy> <yz> <zz>" << endl); 2136 2168 performCriticalExit(); 2137 2169 } else { … … 2152 2184 if ((argptr+5 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) || (!IsValidNumber(argv[argptr+3])) || (!IsValidNumber(argv[argptr+4])) || (!IsValidNumber(argv[argptr+5])) ) { 2153 2185 ExitFlag = 255; 2154 eLog() << Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl;2186 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for bounding in box: -B <xx> <xy> <xz> <yy> <yz> <zz>" << endl); 2155 2187 performCriticalExit(); 2156 2188 } else { … … 2171 2203 if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 2172 2204 ExitFlag = 255; 2173 eLog() << Verbose(0) << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl;2205 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for centering with boundary: -c <boundary_x> <boundary_y> <boundary_z>" << endl); 2174 2206 performCriticalExit(); 2175 2207 } else { … … 2206 2238 if ((argptr >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr]))) { 2207 2239 ExitFlag = 255; 2208 eLog() << Verbose(0) << "Not enough or invalid arguments given for removing atoms: -r <id>" << endl;2240 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for removing atoms: -r <id>" << endl); 2209 2241 performCriticalExit(); 2210 2242 } else { … … 2220 2252 if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1]))) { 2221 2253 ExitFlag = 255; 2222 eLog() << Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl;2254 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments for fragmentation: -f <max. bond distance> <bond order>" << endl); 2223 2255 performCriticalExit(); 2224 2256 } else { … … 2240 2272 j = atoi(argv[argptr++]); 2241 2273 if ((j<0) || (j>1)) { 2242 eLog() << Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl;2274 DoeLog(1) && (eLog()<< Verbose(1) << "Argument of '-m' should be either 0 for no-rotate or 1 for rotate." << endl); 2243 2275 j = 0; 2244 2276 } … … 2254 2286 if ((argptr+1 >= argc) || (argv[argptr][0] == '-')){ 2255 2287 ExitFlag = 255; 2256 eLog() << Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl;2288 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for convex envelope: -o <convex output file> <non-convex output file>" << endl); 2257 2289 performCriticalExit(); 2258 2290 } else { … … 2279 2311 if ((argptr+1 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) ) { 2280 2312 ExitFlag = 255; 2281 eLog() << Verbose(0) << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl;2313 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for suspension with specified volume: -U <volume> <density>" << endl); 2282 2314 performCriticalExit(); 2283 2315 } else { … … 2290 2322 if (volume != -1) 2291 2323 ExitFlag = 255; 2292 eLog() << Verbose(0) << "Not enough or invalid arguments given for suspension: -u <density>" << endl;2324 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for suspension: -u <density>" << endl); 2293 2325 performCriticalExit(); 2294 2326 } else { … … 2298 2330 density = atof(argv[argptr++]); 2299 2331 if (density < 1.0) { 2300 eLog() << Verbose(1) << "Density must be greater than 1.0g/cm^3 !" << endl;2332 DoeLog(1) && (eLog()<< Verbose(1) << "Density must be greater than 1.0g/cm^3 !" << endl); 2301 2333 density = 1.3; 2302 2334 } … … 2304 2336 // repetition[i] = atoi(argv[argptr++]); 2305 2337 // if (repetition[i] < 1) 2306 // eLog() << Verbose(1) << "repetition value must be greater 1!" << endl;2338 // DoeLog(1) && (eLog()<< Verbose(1) << "repetition value must be greater 1!" << endl); 2307 2339 // repetition[i] = 1; 2308 2340 // } … … 2314 2346 if ((argptr+2 >= argc) || (argv[argptr][0] == '-') || (!IsValidNumber(argv[argptr])) || (!IsValidNumber(argv[argptr+1])) || (!IsValidNumber(argv[argptr+2])) ) { 2315 2347 ExitFlag = 255; 2316 eLog() << Verbose(0) << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl;2348 DoeLog(0) && (eLog()<< Verbose(0) << "Not enough or invalid arguments given for repeating cells: -d <repeat_x> <repeat_y> <repeat_z>" << endl); 2317 2349 performCriticalExit(); 2318 2350 } else { … … 2325 2357 Vector ** vectors; 2326 2358 if (faktor < 1) { 2327 eLog() << Verbose(1) << "Repetition factor mus be greater than 1!" << endl;2359 DoeLog(1) && (eLog()<< Verbose(1) << "Repetition factor mus be greater than 1!" << endl); 2328 2360 faktor = 1; 2329 2361 } … … 2342 2374 } 2343 2375 if (count != j) 2344 eLog() << Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl;2376 DoeLog(1) && (eLog()<< Verbose(1) << "AtomCount " << count << " is not equal to number of atoms in molecule " << j << "!" << endl); 2345 2377 x.Zero(); 2346 2378 y.Zero(); … … 2409 2441 cout << ESPACKVersion << endl; 2410 2442 2443 Log() << Verbose(1) << "test" << endl; 2444 DoLog(3) && (Log() << Verbose(1) << "test"); 2445 2411 2446 setVerbosity(0); 2412 2447 -
src/config.cpp
r7ee87f r58ed4a 74 74 file= new ifstream(filename); 75 75 if (file == NULL) { 76 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;76 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 77 77 return; 78 78 } … … 89 89 // allocate buffer's 1st dimension 90 90 if (buffer != NULL) { 91 eLog() << Verbose(1) << "FileBuffer->buffer is not NULL!" << endl;91 DoeLog(1) && (eLog()<< Verbose(1) << "FileBuffer->buffer is not NULL!" << endl); 92 92 return; 93 93 } else … … 144 144 map<const char *, int, IonTypeCompare> IonTypeLineMap; 145 145 if (LineMapping == NULL) { 146 eLog() << Verbose(0) << "map pointer is NULL: " << LineMapping << endl;146 DoeLog(0) && (eLog()<< Verbose(0) << "map pointer is NULL: " << LineMapping << endl); 147 147 performCriticalExit(); 148 148 return; … … 160 160 LineMapping[CurrentLine+(nr++)] = runner->second; 161 161 else { 162 eLog() << Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl;162 DoeLog(0) && (eLog()<< Verbose(0) << "config::MapIonTypesInBuffer - NoAtoms is wrong: We are past the end of the file!" << endl); 163 163 performCriticalExit(); 164 164 } … … 659 659 { 660 660 if (FileBuffer != NULL) { 661 eLog() << Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl;661 DoeLog(2) && (eLog()<< Verbose(2) << "deleting present FileBuffer in PrepareFileBuffer()." << endl); 662 662 delete(FileBuffer); 663 663 } … … 685 685 686 686 if (mol == NULL) { 687 eLog() << Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit.";687 DoeLog(0) && (eLog()<< Verbose(0) << "Molecule is not allocated in LoadMolecule(), exit."); 688 688 performCriticalExit(); 689 689 } … … 691 691 ParseForParameter(verbose,FileBuffer,"MaxTypes", 0, 1, 1, int_type, &(MaxTypes), 1, critical); 692 692 if (MaxTypes == 0) { 693 eLog() << Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl;693 DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms according to MaxTypes in this config file." << endl); 694 694 //performCriticalExit(); 695 695 } else { … … 710 710 sprintf(name,"Ion_Type%i",MaxTypes); 711 711 if (!ParseForParameter(verbose,FileBuffer, (const char*)name, 1, 1, 1, int_type, &value[0], 1, critical)) { 712 eLog() << Verbose(0) << "There are no atoms in the config file!" << endl;712 DoeLog(0) && (eLog()<< Verbose(0) << "There are no atoms in the config file!" << endl); 713 713 performCriticalExit(); 714 714 return; … … 855 855 ifstream *file = new ifstream(filename); 856 856 if (file == NULL) { 857 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;857 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 858 858 return; 859 859 } … … 1065 1065 Log() << Verbose(0) << "Bond length table loaded successfully." << endl; 1066 1066 } else { 1067 eLog() << Verbose(1) << "Bond length table loading failed." << endl;1067 DoeLog(1) && (eLog()<< Verbose(1) << "Bond length table loading failed." << endl); 1068 1068 } 1069 1069 } … … 1094 1094 ifstream *file = new ifstream(filename); 1095 1095 if (file == NULL) { 1096 eLog() << Verbose(1) << "config file " << filename << " missing!" << endl;1096 DoeLog(1) && (eLog()<< Verbose(1) << "config file " << filename << " missing!" << endl); 1097 1097 return; 1098 1098 } … … 1433 1433 return result; 1434 1434 } else { 1435 eLog() << Verbose(1) << "Cannot open output file:" << filename << endl;1435 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open output file:" << filename << endl); 1436 1436 return false; 1437 1437 } … … 1455 1455 output = new ofstream(fname->str().c_str(), ios::out); 1456 1456 if (output == NULL) { 1457 eLog() << Verbose(1) << "Cannot open mpqc output file:" << fname << endl;1457 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc output file:" << fname << endl); 1458 1458 delete(fname); 1459 1459 return false; … … 1498 1498 output = new ofstream(fname->str().c_str(), ios::out); 1499 1499 if (output == NULL) { 1500 eLog() << Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl;1500 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open mpqc hessian output file:" << fname << endl); 1501 1501 delete(fname); 1502 1502 return false; … … 1554 1554 f = fopen(name, "w" ); 1555 1555 if (f == NULL) { 1556 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;1556 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl); 1557 1557 return false; 1558 1558 } … … 1609 1609 f = fopen(name, "w" ); 1610 1610 if (f == NULL) { 1611 eLog() << Verbose(1) << "Cannot open pdb output file:" << name << endl;1611 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open pdb output file:" << name << endl); 1612 1612 Free(&elementNo); 1613 1613 return false; … … 1659 1659 output = new ofstream(fname->str().c_str(), ios::out); 1660 1660 if (output == NULL) { 1661 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;1661 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl); 1662 1662 delete(fname); 1663 1663 return false; … … 1714 1714 output = new ofstream(fname->str().c_str(), ios::out); 1715 1715 if (output == NULL) { 1716 eLog() << Verbose(1) << "Cannot open tremolo output file:" << fname << endl;1716 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot open tremolo output file:" << fname << endl); 1717 1717 delete(fname); 1718 1718 return false; -
src/ellipsoid.cpp
r7ee87f r58ed4a 241 241 x = new Vector[PointsToPick]; 242 242 } else { 243 eLog() << Verbose(2) << "Given pointer to vector array seems already allocated." << endl;243 DoeLog(2) && (eLog()<< Verbose(2) << "Given pointer to vector array seems already allocated." << endl); 244 244 } 245 245 … … 341 341 x = new Vector[PointsToPick]; 342 342 } else { 343 eLog() << Verbose(2) << "Given pointer to vector array seems already allocated." << endl;343 DoeLog(2) && (eLog()<< Verbose(2) << "Given pointer to vector array seems already allocated." << endl); 344 344 } 345 345 -
src/helpers.hpp
r7ee87f r58ed4a 134 134 LookupTable = Calloc<T*>(count, "CreateFatherLookupTable - **LookupTable"); 135 135 if (LookupTable == NULL) { 136 eLog() << Verbose(0) << "LookupTable memory allocation failed!" << endl;136 DoeLog(0) && (eLog()<< Verbose(0) << "LookupTable memory allocation failed!" << endl); 137 137 performCriticalExit(); 138 138 status = false; -
src/linkedcell.cpp
r7ee87f r58ed4a 47 47 Log() << Verbose(1) << "Begin of LinkedCell" << endl; 48 48 if ((set == NULL) || (set->IsEmpty())) { 49 eLog() << Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl;49 DoeLog(1) && (eLog()<< Verbose(1) << "set is NULL or contains no linked cell nodes!" << endl); 50 50 return; 51 51 } … … 79 79 Log() << Verbose(2) << "Allocating cells ... "; 80 80 if (LC != NULL) { 81 eLog() << Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl;81 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl); 82 82 return; 83 83 } … … 122 122 Log() << Verbose(1) << "Begin of LinkedCell" << endl; 123 123 if (set->empty()) { 124 eLog() << Verbose(1) << "set contains no linked cell nodes!" << endl;124 DoeLog(1) && (eLog()<< Verbose(1) << "set contains no linked cell nodes!" << endl); 125 125 return; 126 126 } … … 151 151 Log() << Verbose(2) << "Allocating cells ... "; 152 152 if (LC != NULL) { 153 eLog() << Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl;153 DoeLog(1) && (eLog()<< Verbose(1) << "Linked Cell list is already allocated, I do nothing." << endl); 154 154 return; 155 155 } … … 199 199 status = status && ((n[i] >=0) && (n[i] < N[i])); 200 200 if (!status) 201 eLog() << Verbose(1) << "indices are out of bounds!" << endl;201 DoeLog(1) && (eLog()<< Verbose(1) << "indices are out of bounds!" << endl); 202 202 return status; 203 203 }; … … 260 260 return status; 261 261 } else { 262 eLog() << Verbose(1) << "Node at " << *Walker << " is out of bounds." << endl;262 DoeLog(1) && (eLog()<< Verbose(1) << "Node at " << *Walker << " is out of bounds." << endl); 263 263 return false; 264 264 } -
src/log.cpp
r7ee87f r58ed4a 28 28 } 29 29 30 /** Checks verbosity for logger. 31 * Is supposed to be used in construct as this: 32 * DoLog(2) && (Log() << Verbose(2) << "message." << endl); 33 * If DoLog does not return true, the right-hand side is not evaluated and we save some time. 34 * \param verbose verbosity level of this message 35 * \return true - print, false - don't 36 */ 37 bool DoLog(int verbose) { 38 return verbose <= logger::getInstance()->verbosity; 39 } 40 41 /** Checks verbosity for errorlogger. 42 * Is supposed to be used in construct as this: 43 * DoLog(2) && (Log() << Verbose(2) << "message." << endl); 44 * If DoLog does not return true, the right-hand side is not evaluated and we save some time. 45 * \param verbose verbosity level of this message 46 * \return true - print, false - don't 47 */ 48 bool DoeLog(int verbose) { 49 return verbose <= errorLogger::getInstance()->verbosity; 50 } 51 30 52 /** 31 53 * Prints an error log entry. -
src/log.hpp
r7ee87f r58ed4a 15 15 class errorLogger * eLog(); 16 16 void setVerbosity(int verbosityLevel); 17 bool DoLog(int verbose); 18 bool DoeLog(int verbose); 17 19 18 20 #endif /* LOG_HPP_ */ -
src/molecule.cpp
r7ee87f r58ed4a 194 194 BondRescale = TopOrigin->type->HBondDistance[TopBond->BondDegree-1]; 195 195 if (BondRescale == -1) { 196 eLog() << Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;196 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl); 197 197 return false; 198 198 BondRescale = bondlength; … … 237 237 SecondOtherAtom = (*Runner)->GetOtherAtom(TopOrigin); 238 238 } else { 239 eLog() << Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->Name;239 DoeLog(2) && (eLog()<< Verbose(2) << "Detected more than four bonds for atom " << TopOrigin->Name); 240 240 } 241 241 } … … 274 274 bondangle = TopOrigin->type->HBondAngle[1]; 275 275 if (bondangle == -1) { 276 eLog() << Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;276 DoeLog(1) && (eLog()<< Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl); 277 277 return false; 278 278 bondangle = 0; … … 396 396 break; 397 397 default: 398 eLog() << Verbose(1) << "BondDegree does not state single, double or triple bond!" << endl;398 DoeLog(1) && (eLog()<< Verbose(1) << "BondDegree does not state single, double or triple bond!" << endl); 399 399 AllWentWell = false; 400 400 break; … … 447 447 Walker->type = elemente->FindElement(shorthand); 448 448 if (Walker->type == NULL) { 449 eLog() << Verbose(1) << "Could not parse the element at line: '" << line << "', setting to H.";449 DoeLog(1) && (eLog()<< Verbose(1) << "Could not parse the element at line: '" << line << "', setting to H."); 450 450 Walker->type = elemente->FindElement(1); 451 451 } … … 543 543 add(Binder, last); 544 544 } else { 545 eLog() << Verbose(1) << "Could not add bond between " << atom1->Name << " and " << atom2->Name << " as one or both are not present in the molecule." << endl;545 DoeLog(1) && (eLog()<< Verbose(1) << "Could not add bond between " << atom1->Name << " and " << atom2->Name << " as one or both are not present in the molecule." << endl); 546 546 } 547 547 return Binder; … … 555 555 bool molecule::RemoveBond(bond *pointer) 556 556 { 557 // eLog() << Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl;557 //DoeLog(1) && (eLog()<< Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl); 558 558 pointer->leftatom->RegisterBond(pointer); 559 559 pointer->rightatom->RegisterBond(pointer); … … 569 569 bool molecule::RemoveBonds(atom *BondPartner) 570 570 { 571 // eLog() << Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl;571 //DoeLog(1) && (eLog()<< Verbose(1) << "molecule::RemoveBond: Function not implemented yet." << endl); 572 572 BondList::const_iterator ForeRunner; 573 573 while (!BondPartner->ListOfBonds.empty()) { … … 622 622 AtomCount--; 623 623 } else 624 eLog() << Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl;624 DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl); 625 625 if (ElementsInMolecule[pointer->type->Z] == 0) // was last atom of this element? 626 626 ElementCount--; … … 640 640 ElementsInMolecule[pointer->type->Z]--; // decrease number of atom of this element 641 641 else 642 eLog() << Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl;642 DoeLog(1) && (eLog()<< Verbose(1) << "Atom " << pointer->Name << " is of element " << pointer->type->Z << " but the entry in the table of the molecule is 0!" << endl); 643 643 if (ElementsInMolecule[pointer->type->Z] == 0) // was last atom of this element? 644 644 ElementCount--; -
src/molecule_dynamics.cpp
r7ee87f r58ed4a 306 306 for (int i=mol->AtomCount; i--;) // now each single entry in the DoubleList should be <=1 307 307 if (Params.DoubleList[i] > 1) { 308 eLog() << Verbose(0) << "Failed to create an injective PermutationMap!" << endl;308 DoeLog(0) && (eLog()<< Verbose(0) << "Failed to create an injective PermutationMap!" << endl); 309 309 performCriticalExit(); 310 310 } … … 428 428 } 429 429 if (Potential > Params.PenaltyConstants[2]) { 430 eLog() << Verbose(1) << "The two-step permutation procedure did not maintain injectivity!" << endl;430 DoeLog(1) && (eLog()<< Verbose(1) << "The two-step permutation procedure did not maintain injectivity!" << endl); 431 431 exit(255); 432 432 } 433 433 //Log() << Verbose(0) << endl; 434 434 } else { 435 eLog() << Verbose(1) << *Runner << " was not the owner of " << *Sprinter << "!" << endl;435 DoeLog(1) && (eLog()<< Verbose(1) << *Runner << " was not the owner of " << *Sprinter << "!" << endl); 436 436 exit(255); 437 437 } … … 568 568 // parse file into ForceMatrix 569 569 if (!Force.ParseMatrix(file, 0,0,0)) { 570 eLog() << Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl;570 DoeLog(0) && (eLog()<< Verbose(0) << "Could not parse Force Matrix file " << file << "." << endl); 571 571 performCriticalExit(); 572 572 return false; 573 573 } 574 574 if (Force.RowCounter[0] != AtomCount) { 575 eLog() << Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl;575 DoeLog(0) && (eLog()<< Verbose(0) << "Mismatch between number of atoms in file " << Force.RowCounter[0] << " and in molecule " << AtomCount << "." << endl); 576 576 performCriticalExit(); 577 577 return false; -
src/molecule_fragmentation.cpp
r7ee87f r58ed4a 113 113 testGraphInsert = FragmentList->insert(GraphPair (CurrentSet,pair<int,double>(NumberOfFragments++,1))); // store fragment number and current factor 114 114 if (!testGraphInsert.second) { 115 eLog() << Verbose(0) << "KeySet file must be corrupt as there are two equal key sets therein!" << endl;115 DoeLog(0) && (eLog()<< Verbose(0) << "KeySet file must be corrupt as there are two equal key sets therein!" << endl); 116 116 performCriticalExit(); 117 117 } … … 214 214 Log() << Verbose(0) << "done." << endl; 215 215 } else { 216 eLog() << Verbose(0) << "Unable to open " << line << " for writing keysets!" << endl;216 DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open " << line << " for writing keysets!" << endl); 217 217 performCriticalExit(); 218 218 status = false; … … 372 372 } 373 373 } else { 374 eLog() << Verbose(0) << "Atom No. " << (*runner).second.first << " was not found in this molecule." << endl;374 DoeLog(0) && (eLog()<< Verbose(0) << "Atom No. " << (*runner).second.first << " was not found in this molecule." << endl); 375 375 performCriticalExit(); 376 376 } … … 447 447 // transmorph graph keyset list into indexed KeySetList 448 448 if (GlobalKeySetList == NULL) { 449 eLog() << Verbose(1) << "Given global key set list (graph) is NULL!" << endl;449 DoeLog(1) && (eLog()<< Verbose(1) << "Given global key set list (graph) is NULL!" << endl); 450 450 return false; 451 451 } … … 455 455 map<int, pair<double,int> > *AdaptiveCriteriaList = ScanAdaptiveFileIntoMap(path, *IndexKeySetList); // (Root No., (Value, Order)) ! 456 456 if (AdaptiveCriteriaList->empty()) { 457 eLog() << Verbose(2) << "Unable to parse file, incrementing all." << endl;457 DoeLog(2) && (eLog()<< Verbose(2) << "Unable to parse file, incrementing all." << endl); 458 458 while (Walker->next != end) { 459 459 Walker = Walker->next; … … 644 644 MolecularWalker->Leaf->FragmentBOSSANOVA(FragmentList[FragmentCounter], RootStack[FragmentCounter], MinimumRingSize); 645 645 } else { 646 eLog() << Verbose(1) << "Subgraph " << MolecularWalker << " has no atoms!" << endl;646 DoeLog(1) && (eLog()<< Verbose(1) << "Subgraph " << MolecularWalker << " has no atoms!" << endl); 647 647 } 648 648 FragmentCounter++; // next fragment list … … 902 902 } 903 903 } else { 904 eLog() << Verbose(1) << "Son " << Runner->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl;904 DoeLog(1) && (eLog()<< Verbose(1) << "Son " << Runner->Name << " has father " << FatherOfRunner->Name << " but its entry in SonList is " << SonList[FatherOfRunner->nr] << "!" << endl); 905 905 } 906 906 if ((LonelyFlag) && (Leaf->AtomCount > 1)) { … … 1137 1137 Log() << Verbose(0) << endl; 1138 1138 //if (!CheckForConnectedSubgraph(FragmentSearch->FragmentSet)) 1139 // eLog() << Verbose(1) << "The found fragment is not a connected subgraph!" << endl;1139 //DoeLog(1) && (eLog()<< Verbose(1) << "The found fragment is not a connected subgraph!" << endl); 1140 1140 InsertFragmentIntoGraph(FragmentSearch); 1141 1141 } -
src/molecule_graph.cpp
r7ee87f r58ed4a 931 931 } 932 932 if (i == vertex->ListOfBonds.size()) { 933 eLog() << Verbose(0) << "Error: All Component entries are already occupied!" << endl;933 DoeLog(0) && (eLog()<< Verbose(0) << "Error: All Component entries are already occupied!" << endl); 934 934 performCriticalExit(); 935 935 } 936 936 } else { 937 eLog() << Verbose(0) << "Error: Given vertex is NULL!" << endl;937 DoeLog(0) && (eLog()<< Verbose(0) << "Error: Given vertex is NULL!" << endl); 938 938 performCriticalExit(); 939 939 } -
src/moleculelist.cpp
r7ee87f r58ed4a 314 314 Tesselation *TesselStruct = NULL; 315 315 if ((srcmol == NULL) || (mol == NULL)) { 316 eLog() << Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl;316 DoeLog(1) && (eLog()<< Verbose(1) << "Either fixed or variable molecule is given as NULL." << endl); 317 317 return false; 318 318 } … … 322 322 FindNonConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, 4., NULL); 323 323 if (TesselStruct == NULL) { 324 eLog() << Verbose(1) << "Could not tesselate the fixed molecule." << endl;324 DoeLog(1) && (eLog()<< Verbose(1) << "Could not tesselate the fixed molecule." << endl); 325 325 return false; 326 326 } … … 443 443 input.open(line.c_str()); 444 444 if (input == NULL) { 445 eLog() << Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl;445 DoeLog(0) && (eLog()<< Verbose(0) << endl << "Unable to open " << line << ", is the directory correct?" << endl); 446 446 performCriticalExit(); 447 447 return false; … … 652 652 strcpy(PathBackup, path); 653 653 else { 654 eLog() << Verbose(0) << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl;654 DoeLog(0) && (eLog()<< Verbose(0) << "OutputConfigForListOfFragments: NULL default path obtained from config!" << endl); 655 655 performCriticalExit(); 656 656 } … … 788 788 if (!configuration->BG->ConstructBondGraph(mol)) { 789 789 delete (mol); 790 eLog() << Verbose(1) << "There are no bonds." << endl;790 DoeLog(1) && (eLog()<< Verbose(1) << "There are no bonds." << endl); 791 791 return; 792 792 } … … 799 799 if ((Subgraphs == NULL) || (Subgraphs->next == NULL)) { 800 800 delete (mol); 801 eLog() << Verbose(1) << "There are no atoms." << endl;801 DoeLog(1) && (eLog()<< Verbose(1) << "There are no atoms." << endl); 802 802 return; 803 803 } … … 843 843 Walker = mol->start->next; 844 844 if ((Walker->nr <0) || (Walker->nr >= mol->AtomCount)) { 845 eLog() << Verbose(0) << "Index of atom " << *Walker << " is invalid!" << endl;845 DoeLog(0) && (eLog()<< Verbose(0) << "Index of atom " << *Walker << " is invalid!" << endl); 846 846 performCriticalExit(); 847 847 } … … 852 852 molecules[FragmentCounter-1]->AddAtom(Walker); // counting starts at 1 853 853 } else { 854 eLog() << Verbose(0) << "Atom " << *Walker << " not associated to molecule!" << endl;854 DoeLog(0) && (eLog()<< Verbose(0) << "Atom " << *Walker << " not associated to molecule!" << endl); 855 855 performCriticalExit(); 856 856 } -
src/parser.cpp
r7ee87f r58ed4a 160 160 //Log() << Verbose(1) << "Opening " << name << " ... " << input << endl; 161 161 if (input == NULL) { 162 eLog() << Verbose(1) << endl << "Unable to open " << name << ", is the directory correct?" << endl;162 DoeLog(1) && (eLog()<< Verbose(1) << endl << "Unable to open " << name << ", is the directory correct?" << endl); 163 163 //performCriticalExit(); 164 164 return false; … … 183 183 //Log() << Verbose(1) << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << "." << endl; 184 184 if (ColumnCounter[MatrixNr] == 0) { 185 eLog() << Verbose(0) << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl;185 DoeLog(0) && (eLog()<< Verbose(0) << "ColumnCounter[" << MatrixNr << "]: " << ColumnCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl); 186 186 performCriticalExit(); 187 187 } … … 199 199 //Log() << Verbose(1) << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << "." << endl; 200 200 if (RowCounter[MatrixNr] == 0) { 201 eLog() << Verbose(0) << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl;201 DoeLog(0) && (eLog()<< Verbose(0) << "RowCounter[" << MatrixNr << "]: " << RowCounter[MatrixNr] << " from file " << name << ", this is probably an error!" << endl); 202 202 performCriticalExit(); 203 203 } … … 232 232 } 233 233 } else { 234 eLog() << Verbose(1) << "Matrix nr. " << MatrixNr << " has column and row count of (" << ColumnCounter[MatrixNr] << "," << RowCounter[MatrixNr] << "), could not allocate nor parse!" << endl;234 DoeLog(1) && (eLog()<< Verbose(1) << "Matrix nr. " << MatrixNr << " has column and row count of (" << ColumnCounter[MatrixNr] << "," << RowCounter[MatrixNr] << "), could not allocate nor parse!" << endl); 235 235 } 236 236 input.close(); … … 433 433 //Log() << Verbose(0) << "Corresponding index in CurrentFragment is " << m << "." << endl; 434 434 if (m > RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ]) { 435 eLog() << Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment] << " current force index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl;435 DoeLog(0) && (eLog()<< Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment] << " current force index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl); 436 436 performCriticalExit(); 437 437 return false; … … 477 477 output.open(line.str().c_str(), ios::out); 478 478 if (output == NULL) { 479 eLog() << Verbose(0) << "Unable to open output energy file " << line.str() << "!" << endl;479 DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output energy file " << line.str() << "!" << endl); 480 480 performCriticalExit(); 481 481 return false; … … 507 507 output.open(line.str().c_str(), ios::out); 508 508 if (output == NULL) { 509 eLog() << Verbose(0) << "Unable to open output matrix file " << line.str() << "!" << endl;509 DoeLog(0) && (eLog()<< Verbose(0) << "Unable to open output matrix file " << line.str() << "!" << endl); 510 510 performCriticalExit(); 511 511 return false; … … 664 664 int j = Indices[ FragmentNr ][l]; 665 665 if (j > RowCounter[MatrixCounter]) { 666 eLog() << Verbose(0) << "Current force index " << j << " is greater than " << RowCounter[MatrixCounter] << "!" << endl;666 DoeLog(0) && (eLog()<< Verbose(0) << "Current force index " << j << " is greater than " << RowCounter[MatrixCounter] << "!" << endl); 667 667 performCriticalExit(); 668 668 return false; … … 802 802 int j = Indices[ FragmentNr ][l]; 803 803 if (j > RowCounter[MatrixCounter]) { 804 eLog() << Verbose(0) << "Current hessian index " << j << " is greater than " << RowCounter[MatrixCounter] << ", where i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl;804 DoeLog(0) && (eLog()<< Verbose(0) << "Current hessian index " << j << " is greater than " << RowCounter[MatrixCounter] << ", where i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl); 805 805 performCriticalExit(); 806 806 return false; … … 810 810 int k = Indices[ FragmentNr ][m]; 811 811 if (k > ColumnCounter[MatrixCounter]) { 812 eLog() << Verbose(0) << "Current hessian index " << k << " is greater than " << ColumnCounter[MatrixCounter] << ", where m=" << m << ", j=" << j << ", i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl;812 DoeLog(0) && (eLog()<< Verbose(0) << "Current hessian index " << k << " is greater than " << ColumnCounter[MatrixCounter] << ", where m=" << m << ", j=" << j << ", i=" << i << ", Order=" << Order << ", l=" << l << " and FragmentNr=" << FragmentNr << "!" << endl); 813 813 performCriticalExit(); 814 814 return false; … … 863 863 //Log() << Verbose(0) << "Corresponding row index for " << k << " in CurrentFragment is " << m << "." << endl; 864 864 if (m > RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ]) { 865 eLog() << Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment] << " current row index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl;865 DoeLog(0) && (eLog()<< Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment] << " current row index " << m << " is greater than " << RowCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl); 866 866 performCriticalExit(); 867 867 return false; … … 881 881 //Log() << Verbose(0) << "Corresponding column index for " << l << " in CurrentFragment is " << n << "." << endl; 882 882 if (n > ColumnCounter[ KeySets.OrderSet[Order][CurrentFragment] ]) { 883 eLog() << Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment] << " current column index " << n << " is greater than " << ColumnCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl;883 DoeLog(0) && (eLog()<< Verbose(0) << "In fragment No. " << KeySets.OrderSet[Order][CurrentFragment] << " current column index " << n << " is greater than " << ColumnCounter[ KeySets.OrderSet[Order][CurrentFragment] ] << "!" << endl); 884 884 performCriticalExit(); 885 885 return false; -
src/periodentafel.cpp
r7ee87f r58ed4a 314 314 315 315 if (!otherstatus) 316 eLog() << Verbose(2) << "Something went wrong while parsing the other databases!" << endl;316 DoeLog(2) && (eLog()<< Verbose(2) << "Something went wrong while parsing the other databases!" << endl); 317 317 318 318 return status; -
src/stackclass.hpp
r7ee87f r58ed4a 72 72 return true; 73 73 } else { 74 eLog() << Verbose(1) << "Stack is full, " << "Stack: CurrentLastEntry " << CurrentLastEntry<< "\tCurrentFirstEntry " << CurrentFirstEntry << "\tNextFreeField " << NextFreeField << "\tEntryCount " << EntryCount << "!" << endl;74 DoeLog(1) && (eLog()<< Verbose(1) << "Stack is full, " << "Stack: CurrentLastEntry " << CurrentLastEntry<< "\tCurrentFirstEntry " << CurrentFirstEntry << "\tNextFreeField " << NextFreeField << "\tEntryCount " << EntryCount << "!" << endl); 75 75 return false; 76 76 } … … 87 87 Walker = StackList[CurrentFirstEntry]; 88 88 if (Walker == NULL) 89 eLog() << Verbose(1) << "Stack's field is empty!" << endl;89 DoeLog(1) && (eLog()<< Verbose(1) << "Stack's field is empty!" << endl); 90 90 StackList[CurrentFirstEntry] = NULL; 91 91 if (CurrentFirstEntry != CurrentLastEntry) { // hasn't last item been popped as well? … … 96 96 } 97 97 } else 98 eLog() << Verbose(1) << "Stack is empty!" << endl;98 DoeLog(1) && (eLog()<< Verbose(1) << "Stack is empty!" << endl); 99 99 return Walker; 100 100 }; … … 111 111 StackList[CurrentLastEntry] = NULL; 112 112 if (Walker == NULL) 113 eLog() << Verbose(1) << "Stack's field is empty!" << endl;113 DoeLog(1) && (eLog()<< Verbose(1) << "Stack's field is empty!" << endl); 114 114 NextFreeField = CurrentLastEntry; 115 115 if (CurrentLastEntry != CurrentFirstEntry) // has there been more than one item on stack 116 116 CurrentLastEntry = (CurrentLastEntry + (EntryCount-1)) % EntryCount; // step back from current free field to last (modulo does not work in -1, thus go EntryCount-1 instead) 117 117 } else { 118 eLog() << Verbose(1) << "Stack is empty!" << endl;118 DoeLog(1) && (eLog()<< Verbose(1) << "Stack is empty!" << endl); 119 119 } 120 120 return Walker; … … 151 151 } while (i!=NextFreeField); 152 152 else 153 eLog() << Verbose(1) << "Stack is already empty!" << endl;153 DoeLog(1) && (eLog()<< Verbose(1) << "Stack is already empty!" << endl); 154 154 if (found) { 155 155 NextFreeField = CurrentLastEntry; -
src/tesselation.cpp
r7ee87f r58ed4a 55 55 //Log() << Verbose(0) << "Erasing point nr. " << Nr << "." << endl; 56 56 if (!lines.empty()) 57 eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some lines." << endl;57 DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *this << " am still connected to some lines." << endl); 58 58 node = NULL; 59 59 }; … … 188 188 } 189 189 if (!triangles.empty()) 190 eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl;190 DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl); 191 191 }; 192 192 … … 226 226 // get the two triangles 227 227 if (triangles.size() != 2) { 228 eLog() << Verbose(0) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl;228 DoeLog(0) && (eLog()<< Verbose(0) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl); 229 229 return true; 230 230 } … … 252 252 BaseLineNormal.CopyVector(&runner->second->NormalVector); // yes, copy second on top of first 253 253 else { 254 eLog() << Verbose(0) << "Triangle " << *runner->second << " has zero normal vector!" << endl;254 DoeLog(0) && (eLog()<< Verbose(0) << "Triangle " << *runner->second << " has zero normal vector!" << endl); 255 255 } 256 256 node = runner->second->GetThirdEndpoint(this); … … 263 263 i++; 264 264 } else { 265 eLog() << Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl;265 DoeLog(1) && (eLog()<< Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl); 266 266 return true; 267 267 } … … 368 368 } 369 369 if (Counter < 3) { 370 eLog() << Verbose(0) << "We have a triangle with only two distinct endpoints!" << endl;370 DoeLog(0) && (eLog()<< Verbose(0) << "We have a triangle with only two distinct endpoints!" << endl); 371 371 performCriticalExit(); 372 372 } … … 430 430 431 431 if (!Intersection->GetIntersectionWithPlane(&NormalVector, endpoints[0]->node->node, MolCenter, x)) { 432 eLog() << Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl;432 DoeLog(1) && (eLog()<< Verbose(1) << "Alas! Intersection with plane failed - at least numerically - the intersection is not on the plane!" << endl); 433 433 return false; 434 434 } … … 726 726 Runner[i]++; 727 727 if (Runner[i] == endpoints.end()) { 728 eLog() << Verbose(0) << "There are less than three endpoints in the polygon!" << endl;728 DoeLog(0) && (eLog()<< Verbose(0) << "There are less than three endpoints in the polygon!" << endl); 729 729 performCriticalExit(); 730 730 } … … 1072 1072 runner->second = NULL; 1073 1073 } else 1074 eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl;1074 DoeLog(1) && (eLog()<< Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl); 1075 1075 } 1076 1076 Log() << Verbose(0) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl; … … 1325 1325 else 1326 1326 { 1327 eLog() << Verbose(0) << "No starting triangle found." << endl;1327 DoeLog(0) && (eLog()<< Verbose(0) << "No starting triangle found." << endl); 1328 1328 } 1329 1329 } … … 1524 1524 TrianglesOnBoundaryCount++; 1525 1525 } else { 1526 eLog() << Verbose(2) << "I could not determine a winner for this baseline " << *(baseline->second) << "." << endl;1526 DoeLog(2) && (eLog()<< Verbose(2) << "I could not determine a winner for this baseline " << *(baseline->second) << "." << endl); 1527 1527 } 1528 1528 … … 1617 1617 if (NewLines[j]->IsConnectedTo(BLS[0])) { 1618 1618 if (n>2) { 1619 eLog() << Verbose(2) << BLS[0] << " connects to all of the new lines?!" << endl;1619 DoeLog(2) && (eLog()<< Verbose(2) << BLS[0] << " connects to all of the new lines?!" << endl); 1620 1620 return false; 1621 1621 } else … … 1634 1634 } 1635 1635 } else { // something is wrong with FindClosestTriangleToPoint! 1636 eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl;1636 DoeLog(1) && (eLog()<< Verbose(1) << "The closest triangle did not produce an intersection!" << endl); 1637 1637 return false; 1638 1638 } … … 1737 1737 OpenLines.erase(CandidateLine); 1738 1738 } else { 1739 eLog() << Verbose(1) << "Line exists and is attached to less than two triangles, but not in OpenLines!" << endl;1739 DoeLog(1) && (eLog()<< Verbose(1) << "Line exists and is attached to less than two triangles, but not in OpenLines!" << endl); 1740 1740 } 1741 1741 … … 1843 1843 triangle->lines[i] = NULL; // free'd or not: disconnect 1844 1844 } else 1845 eLog() << Verbose(1) << "This line " << i << " has already been free'd." << endl;1845 DoeLog(1) && (eLog()<< Verbose(1) << "This line " << i << " has already been free'd." << endl); 1846 1846 } 1847 1847 … … 1897 1897 line->endpoints[i] = NULL; // free'd or not: disconnect 1898 1898 } else 1899 eLog() << Verbose(1) << "Endpoint " << i << " has already been free'd." << endl;1899 DoeLog(1) && (eLog()<< Verbose(1) << "Endpoint " << i << " has already been free'd." << endl); 1900 1900 } 1901 1901 if (!line->triangles.empty()) 1902 eLog() << Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl;1902 DoeLog(2) && (eLog()<< Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl); 1903 1903 1904 1904 if (LinesOnBoundary.erase(line->Nr)) … … 2073 2073 } 2074 2074 } else { 2075 eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;2075 DoeLog(1) && (eLog()<< Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl); 2076 2076 } 2077 2077 } … … 2217 2217 // if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { 2218 2218 // // rotated the wrong way! 2219 // eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;2219 // DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl); 2220 2220 // } 2221 2221 // … … 2274 2274 // } 2275 2275 // } else { 2276 // eLog() << Verbose(2) << "Baseline is connected to two triangles already?" << endl;2276 // DoeLog(2) && (eLog()<< Verbose(2) << "Baseline is connected to two triangles already?" << endl); 2277 2277 // } 2278 2278 // } else { … … 2281 2281 // } 2282 2282 // } else { 2283 // eLog() << Verbose(1) << "Could not find the TesselPoint " << *ThirdNode << "." << endl;2283 // DoeLog(1) && (eLog()<< Verbose(1) << "Could not find the TesselPoint " << *ThirdNode << "." << endl); 2284 2284 // } 2285 2285 // … … 2347 2347 if (fabs(RelativeSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { 2348 2348 // rotated the wrong way! 2349 eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;2349 DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl); 2350 2350 } 2351 2351 … … 2358 2358 2359 2359 if (CandidateLine.pointlist.empty()) { 2360 eLog() << Verbose(2) << "Could not find a suitable candidate." << endl;2360 DoeLog(2) && (eLog()<< Verbose(2) << "Could not find a suitable candidate." << endl); 2361 2361 return false; 2362 2362 } … … 2400 2400 // CandidateLine.ShortestAngle = ShortestAngle; 2401 2401 // } else { 2402 //// eLog() << Verbose(1) << "This triangle consisting of ";2402 //// DoeLog(1) && (eLog()<< Verbose(1) << "This triangle consisting of "); 2403 2403 //// Log() << Verbose(0) << *(*it)->point << ", "; 2404 2404 //// Log() << Verbose(0) << *BaseRay->endpoints[0]->node << " and "; … … 2421 2421 // 2422 2422 // } else { 2423 //// eLog() << Verbose(1) << "This triangle consisting of " << *(*it)->point << ", " << *BaseRay->endpoints[0]->node << " and " << *BaseRay->endpoints[1]->node << " " << "exists and is not added, as it does not seem helpful!" << endl;2423 //// DoeLog(1) && (eLog()<< Verbose(1) << "This triangle consisting of " << *(*it)->point << ", " << *BaseRay->endpoints[0]->node << " and " << *BaseRay->endpoints[1]->node << " " << "exists and is not added, as it does not seem helpful!" << endl); 2424 2424 // result = false; 2425 2425 // } … … 2437 2437 // BaseRay = BLS[0]; 2438 2438 // if ((BTS != NULL) && (BTS->NormalVector.NormSquared() < MYEPSILON)) { 2439 // eLog() << Verbose(1) << "Triangle " << *BTS << " has zero normal vector!" << endl;2439 // DoeLog(1) && (eLog()<< Verbose(1) << "Triangle " << *BTS << " has zero normal vector!" << endl); 2440 2440 // exit(255); 2441 2441 // } … … 2635 2635 BaseLineNormal.Zero(); 2636 2636 if (Base->triangles.size() < 2) { 2637 eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;2637 DoeLog(1) && (eLog()<< Verbose(1) << "Less than two triangles are attached to this baseline!" << endl); 2638 2638 return 0.; 2639 2639 } … … 2674 2674 BaseLineNormal.Zero(); 2675 2675 if (Base->triangles.size() < 2) { 2676 eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;2676 DoeLog(1) && (eLog()<< Verbose(1) << "Less than two triangles are attached to this baseline!" << endl); 2677 2677 return NULL; 2678 2678 } … … 2710 2710 // check whether everything is in place to create new lines and triangles 2711 2711 if (i<4) { 2712 eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;2712 DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough baselines!" << endl); 2713 2713 return NULL; 2714 2714 } 2715 2715 for (int j=0;j<4;j++) 2716 2716 if (OldLines[j] == NULL) { 2717 eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;2717 DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough baselines!" << endl); 2718 2718 return NULL; 2719 2719 } 2720 2720 for (int j=0;j<2;j++) 2721 2721 if (OldPoints[j] == NULL) { 2722 eLog() << Verbose(1) << "We have not gathered enough endpoints!" << endl;2722 DoeLog(1) && (eLog()<< Verbose(1) << "We have not gathered enough endpoints!" << endl); 2723 2723 return NULL; 2724 2724 } … … 2764 2764 Log() << Verbose(0) << "INFO: Created new triangle " << *BTS << "." << endl; 2765 2765 } else { 2766 eLog() << Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl;2766 DoeLog(0) && (eLog()<< Verbose(0) << "The four old lines do not connect, something's utterly wrong here!" << endl); 2767 2767 return NULL; 2768 2768 } … … 2795 2795 N[i] = LC->n[i]; 2796 2796 } else { 2797 eLog() << Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl;2797 DoeLog(1) && (eLog()<< Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl); 2798 2798 return; 2799 2799 } … … 2935 2935 // test whether old center is on the band's plane 2936 2936 if (fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) { 2937 eLog() << Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;2937 DoeLog(1) && (eLog()<< Verbose(1) << "Something's very wrong here: RelativeOldSphereCenter is not on the band's plane as desired by " << fabs(RelativeOldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl); 2938 2938 RelativeOldSphereCenter.ProjectOntoPlane(&CirclePlaneNormal); 2939 2939 } … … 2945 2945 Log() << Verbose(1) << "INFO: SearchDirection is " << SearchDirection << "." << endl; 2946 2946 if (fabs(RelativeOldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { // rotated the wrong way! 2947 eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl;2947 DoeLog(1) && (eLog()<< Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl); 2948 2948 } 2949 2949 … … 2954 2954 //Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl; 2955 2955 } else { 2956 eLog() << Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl;2956 DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl); 2957 2957 return; 2958 2958 } … … 2993 2993 otherradius = CandidateLine.BaseLine->endpoints[1]->node->node->DistanceSquared(&NewPlaneCenter); 2994 2994 if (fabs(radius - otherradius) > HULLEPSILON) { 2995 eLog() << Verbose(1) << "Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius-otherradius) << endl;2995 DoeLog(1) && (eLog()<< Verbose(1) << "Distance to center of circumcircle is not the same from each corner of the triangle: " << fabs(radius-otherradius) << endl); 2996 2996 } 2997 2997 // construct both new centers … … 3060 3060 } 3061 3061 } else { 3062 eLog() << Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;3062 DoeLog(1) && (eLog()<< Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl); 3063 3063 } 3064 3064 } else { … … 3119 3119 3120 3120 if (LinesOnBoundary.empty()) { 3121 eLog() << Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl;3121 DoeLog(1) && (eLog()<< Verbose(1) << "There is no tesselation structure to compare the point with, please create one first." << endl); 3122 3122 return NULL; 3123 3123 } … … 3146 3146 } 3147 3147 } else { 3148 eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;3148 DoeLog(1) && (eLog()<< Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl); 3149 3149 } 3150 3150 } … … 3152 3152 // check whether we found some points 3153 3153 if (points->empty()) { 3154 eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;3154 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl); 3155 3155 delete(points); 3156 3156 return NULL; … … 3171 3171 DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC); 3172 3172 if (points == NULL) { 3173 eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;3173 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl); 3174 3174 return NULL; 3175 3175 } … … 3237 3237 DistanceToPointMap * points = FindClosestBoundaryPointsToVector(x,LC); 3238 3238 if (points == NULL) { 3239 eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;3239 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl); 3240 3240 return NULL; 3241 3241 } … … 3286 3286 const double distance = BaseLineIntersection.NormSquared(); 3287 3287 if (Center.NormSquared() > BaseLine.NormSquared()) { 3288 eLog() << Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl;3288 DoeLog(0) && (eLog()<< Verbose(0) << "Algorithmic error: In second case we have intersection outside of baseline!" << endl); 3289 3289 } 3290 3290 if ((ClosestLines.empty()) || (distance < MinDistance)) { … … 3485 3485 ReferencePoint = PointRunner->second; 3486 3486 } else { 3487 eLog() << Verbose(2) << "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;3487 DoeLog(2) && (eLog()<< Verbose(2) << "GetAllConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl); 3488 3488 ReferencePoint = NULL; 3489 3489 } … … 3517 3517 3518 3518 if (connectedPoints->empty()) { // if have not found any points 3519 eLog() << Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl;3519 DoeLog(1) && (eLog()<< Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl); 3520 3520 return NULL; 3521 3521 } … … 3550 3550 3551 3551 if (SetOfNeighbours == NULL) { 3552 eLog() << Verbose(2) << "Could not find any connected points!" << endl;3552 DoeLog(2) && (eLog()<< Verbose(2) << "Could not find any connected points!" << endl); 3553 3553 delete(connectedCircle); 3554 3554 return NULL; … … 3561 3561 PlaneNormal.AddVector(&(*Runner)->NormalVector); 3562 3562 } else { 3563 eLog() << Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl;3563 DoeLog(0) && (eLog()<< Verbose(0) << "Could not find any triangles for point " << *Point << "." << endl); 3564 3564 performCriticalExit(); 3565 3565 } … … 3580 3580 AngleZero.ProjectOntoPlane(&PlaneNormal); 3581 3581 if (AngleZero.NormSquared() < MYEPSILON) { 3582 eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl;3582 DoeLog(0) && (eLog()<< Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl); 3583 3583 performCriticalExit(); 3584 3584 } … … 3631 3631 3632 3632 if (SetOfNeighbours == NULL) { 3633 eLog() << Verbose(2) << "Could not find any connected points!" << endl;3633 DoeLog(2) && (eLog()<< Verbose(2) << "Could not find any connected points!" << endl); 3634 3634 delete(connectedCircle); 3635 3635 return NULL; … … 3685 3685 AngleZero.ProjectOntoPlane(&PlaneNormal); 3686 3686 if (AngleZero.NormSquared() < MYEPSILON) { 3687 eLog() << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl;3687 DoeLog(0) && (eLog()<< Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl); 3688 3688 performCriticalExit(); 3689 3689 } … … 3708 3708 InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*>(angle, (*listRunner))); 3709 3709 if (!InserterTest.second) { 3710 eLog() << Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl;3710 DoeLog(0) && (eLog()<< Verbose(0) << "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner) << endl); 3711 3711 performCriticalExit(); 3712 3712 } … … 3748 3748 ReferencePoint = PointRunner->second; 3749 3749 } else { 3750 eLog() << Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;3750 DoeLog(1) && (eLog()<< Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl); 3751 3751 return NULL; 3752 3752 } … … 3765 3765 LineRunner = TouchedLine.find(runner->second); 3766 3766 if (LineRunner == TouchedLine.end()) { 3767 eLog() << Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl;3767 DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl); 3768 3768 } else if (!LineRunner->second) { 3769 3769 LineRunner->second = true; … … 3795 3795 } 3796 3796 } else { 3797 eLog() << Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl;3797 DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl); 3798 3798 triangle = NULL; 3799 3799 } … … 3812 3812 LineRunner = TouchedLine.find(CurrentLine); 3813 3813 if (LineRunner == TouchedLine.end()) 3814 eLog() << Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl;3814 DoeLog(1) && (eLog()<< Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl); 3815 3815 else 3816 3816 LineRunner->second = true; … … 3830 3830 } 3831 3831 } else { 3832 eLog() << Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl;3832 DoeLog(1) && (eLog()<< Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl); 3833 3833 } 3834 3834 … … 3910 3910 3911 3911 if (Point == NULL) { 3912 eLog() << Verbose(1) << "Point given is NULL." << endl;3912 DoeLog(1) && (eLog()<< Verbose(1) << "Point given is NULL." << endl); 3913 3913 } else { 3914 3914 // go through its lines and insert all triangles … … 3942 3942 3943 3943 if (point == NULL) { 3944 eLog() << Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl;3944 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl); 3945 3945 return 0.; 3946 3946 } else … … 3952 3952 // get list of connected points 3953 3953 if (point->lines.empty()) { 3954 eLog() << Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl;3954 DoeLog(1) && (eLog()<< Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl); 3955 3955 return 0.; 3956 3956 } … … 4033 4033 MiddleNode = EndNode; 4034 4034 if (MiddleNode == connectedPath->end()) { 4035 eLog() << Verbose(0) << "CRITICAL: Could not find a smallest angle!" << endl;4035 DoeLog(0) && (eLog()<< Verbose(0) << "CRITICAL: Could not find a smallest angle!" << endl); 4036 4036 performCriticalExit(); 4037 4037 } … … 4052 4052 triangle = GetPresentTriangle(TriangleCandidates); 4053 4053 if (triangle != NULL) { 4054 eLog() << Verbose(0) << "New triangle already present, skipping!" << endl;4054 DoeLog(0) && (eLog()<< Verbose(0) << "New triangle already present, skipping!" << endl); 4055 4055 StartNode++; 4056 4056 MiddleNode++; … … 4090 4090 break; 4091 4091 } else if (connectedPath->size() < 2) { // something's gone wrong! 4092 eLog() << Verbose(0) << "CRITICAL: There are only two endpoints left!" << endl;4092 DoeLog(0) && (eLog()<< Verbose(0) << "CRITICAL: There are only two endpoints left!" << endl); 4093 4093 performCriticalExit(); 4094 4094 } else { … … 4243 4243 } 4244 4244 default: 4245 eLog() << Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl;4245 DoeLog(0) && (eLog()<< Verbose(0) << "Number of wildcards is greater than 3, cannot happen!" << endl); 4246 4246 performCriticalExit(); 4247 4247 break; … … 4296 4296 // sanity check 4297 4297 if (LinesOnBoundary.empty()) { 4298 eLog() << Verbose(2) << "FindAllDegeneratedTriangles() was called without any tesselation structure.";4298 DoeLog(2) && (eLog()<< Verbose(2) << "FindAllDegeneratedTriangles() was called without any tesselation structure."); 4299 4299 return DegeneratedLines; 4300 4300 } … … 4320 4320 Log() << Verbose(0) << *Line1->second << " => " << *Line2->second << endl; 4321 4321 else 4322 eLog() << Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl;4322 DoeLog(1) && (eLog()<< Verbose(1) << "Either " << (*it).first << " or " << (*it).second << " are not in LinesOnBoundary!" << endl); 4323 4323 } 4324 4324 … … 4480 4480 NearestBoundaryPoint = PointRunner->second; 4481 4481 } else { 4482 eLog() << Verbose(1) << "I cannot find the boundary point." << endl;4482 DoeLog(1) && (eLog()<< Verbose(1) << "I cannot find the boundary point." << endl); 4483 4483 return; 4484 4484 } … … 4548 4548 if ((BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[0])) && (BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[1]))) { 4549 4549 if (BestLine == BTS->lines[i]){ 4550 eLog() << Verbose(0) << "BestLine is same as found line, something's wrong here!" << endl;4550 DoeLog(0) && (eLog()<< Verbose(0) << "BestLine is same as found line, something's wrong here!" << endl); 4551 4551 performCriticalExit(); 4552 4552 } … … 4740 4740 // connections to either polygon ... 4741 4741 if (T->size() % 2 != 0) { 4742 eLog() << Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl;4742 DoeLog(0) && (eLog()<< Verbose(0) << " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!" << endl); 4743 4743 performCriticalExit(); 4744 4744 } … … 4775 4775 AddTesselationLine(TPS[1], TPS[2], 2); 4776 4776 if (TriangleNrs.empty()) 4777 eLog() << Verbose(0) << "No more free triangle numbers!" << endl;4777 DoeLog(0) && (eLog()<< Verbose(0) << "No more free triangle numbers!" << endl); 4778 4778 BTS = new BoundaryTriangleSet(BLS, TriangleNrs.top()); // copy triangle ... 4779 4779 AddTesselationTriangle(); // ... and add … … 4784 4784 } 4785 4785 if (!TriangleNrs.empty()) { 4786 eLog() << Verbose(0) << "There have been less triangles created than removed!" << endl;4786 DoeLog(0) && (eLog()<< Verbose(0) << "There have been less triangles created than removed!" << endl); 4787 4787 } 4788 4788 delete(T); // remove the triangleset -
src/tesselationhelpers.cpp
r7ee87f r58ed4a 81 81 82 82 if (fabs(m11) < MYEPSILON) 83 eLog() << Verbose(1) << "three points are colinear." << endl;83 DoeLog(1) && (eLog()<< Verbose(1) << "three points are colinear." << endl); 84 84 85 85 center->x[0] = 0.5 * m12/ m11; … … 88 88 89 89 if (fabs(a.Distance(center) - RADIUS) > MYEPSILON) 90 eLog() << Verbose(1) << "The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl;90 DoeLog(1) && (eLog()<< Verbose(1) << "The given center is further way by " << fabs(a.Distance(center) - RADIUS) << " from a than RADIUS." << endl); 91 91 92 92 gsl_matrix_free(A); … … 192 192 //Log() << Verbose(1) << "INFO: alpha = " << alpha/M_PI*180. << ", beta = " << beta/M_PI*180. << ", gamma = " << gamma/M_PI*180. << "." << endl; 193 193 if (fabs(M_PI - alpha - beta - gamma) > HULLEPSILON) { 194 eLog() << Verbose(1) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl;194 DoeLog(1) && (eLog()<< Verbose(1) << "GetCenterofCircumcircle: Sum of angles " << (alpha+beta+gamma)/M_PI*180. << " > 180 degrees by " << fabs(M_PI - alpha - beta - gamma)/M_PI*180. << "!" << endl); 195 195 } 196 196 … … 236 236 // test whether new center is on the parameter circle's plane 237 237 if (fabs(helper.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) { 238 eLog() << Verbose(1) << "Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;238 DoeLog(1) && (eLog()<< Verbose(1) << "Something's very wrong here: NewSphereCenter is not on the band's plane as desired by " <<fabs(helper.ScalarProduct(&CirclePlaneNormal)) << "!" << endl); 239 239 helper.ProjectOntoPlane(&CirclePlaneNormal); 240 240 } … … 242 242 // test whether the new center vector has length of CircleRadius 243 243 if (fabs(radius - CircleRadius) > HULLEPSILON) 244 eLog() << Verbose(1) << "The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;244 DoeLog(1) && (eLog()<< Verbose(1) << "The projected center of the new sphere has radius " << radius << " instead of " << CircleRadius << "." << endl); 245 245 alpha = helper.Angle(&RelativeOldSphereCenter); 246 246 // make the angle unique by checking the halfplanes/search direction … … 512 512 // Vector BaseLineVector, OrthogonalVector, helper; 513 513 // if (candidate1->BaseLine != candidate2->BaseLine) { // sanity check 514 // eLog() << Verbose(1) << "sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl;514 // DoeLog(1) && (eLog()<< Verbose(1) << "sortCandidates was called for two different baselines: " << candidate1->BaseLine << " and " << candidate2->BaseLine << "." << endl); 515 515 // //return false; 516 516 // exit(1); … … 764 764 } 765 765 } else { 766 eLog() << Verbose(1) << "Given vrmlfile is " << vrmlfile << "." << endl;766 DoeLog(1) && (eLog()<< Verbose(1) << "Given vrmlfile is " << vrmlfile << "." << endl); 767 767 } 768 768 delete(center); … … 839 839 *rasterfile << "9\n# terminating special property\n"; 840 840 } else { 841 eLog() << Verbose(1) << "Given rasterfile is " << rasterfile << "." << endl;841 DoeLog(1) && (eLog()<< Verbose(1) << "Given rasterfile is " << rasterfile << "." << endl); 842 842 } 843 843 IncludeSphereinRaster3D(rasterfile, Tess, cloud); … … 951 951 // check number of endpoints in *P 952 952 if (P->endpoints.size() != 4) { 953 eLog() << Verbose(1) << "CountTrianglePairContainingPolygon works only on polygons with 4 nodes!" << endl;953 DoeLog(1) && (eLog()<< Verbose(1) << "CountTrianglePairContainingPolygon works only on polygons with 4 nodes!" << endl); 954 954 return 0; 955 955 } … … 957 957 // check number of triangles in *T 958 958 if (T->size() < 2) { 959 eLog() << Verbose(1) << "Not enough triangles to have pairs!" << endl;959 DoeLog(1) && (eLog()<< Verbose(1) << "Not enough triangles to have pairs!" << endl); 960 960 return 0; 961 961 } -
src/triangleintersectionlist.cpp
r7ee87f r58ed4a 119 119 DistanceToPointMap * points = Tess->FindClosestBoundaryPointsToVector(Point,Vicinity); 120 120 if (points == NULL) { 121 eLog() << Verbose(1) << "There is no nearest point: too far away from the surface." << endl;121 DoeLog(1) && (eLog()<< Verbose(1) << "There is no nearest point: too far away from the surface." << endl); 122 122 return; 123 123 } -
src/unittests/logunittest.cpp
r7ee87f r58ed4a 43 43 44 44 Log() << Verbose(0) << "Output a log message." << endl; 45 eLog() << Verbose(0) << "Output an error message." << endl;45 DoeLog(0) && (eLog()<< Verbose(0) << "Output an error message." << endl); 46 46 setVerbosity(3); 47 47 Log() << Verbose(4) << "This should not be printed." << endl; 48 eLog() << Verbose(4) << "This should not be printed." << endl;48 DoeLog(4) && (eLog()<< Verbose(4) << "This should not be printed." << endl); 49 49 }; 50 50 -
src/vector.cpp
r7ee87f r58ed4a 281 281 return true; 282 282 } else { 283 eLog() << Verbose(2) << "Intersection point " << *this << " is not on plane." << endl;283 DoeLog(2) && (eLog()<< Verbose(2) << "Intersection point " << *this << " is not on plane." << endl); 284 284 return false; 285 285 } … … 816 816 x[i] = C.x[i]; 817 817 } else { 818 eLog() << Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl;818 DoeLog(1) && (eLog()<< Verbose(1) << "inverse of matrix does not exists: det A = " << detA << "." << endl); 819 819 } 820 820 }; … … 868 868 x2.SubtractVector(y2); 869 869 if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) { 870 eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;870 DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl); 871 871 return false; 872 872 } … … 902 902 Zero(); 903 903 if ((fabs(x1.Norm()) < MYEPSILON) || (fabs(x2.Norm()) < MYEPSILON) || (fabs(x1.Angle(&x2)) < MYEPSILON)) { 904 eLog() << Verbose(2) << "Given vectors are linear dependent." << endl;904 DoeLog(2) && (eLog()<< Verbose(2) << "Given vectors are linear dependent." << endl); 905 905 return false; 906 906 }
Note:
See TracChangeset
for help on using the changeset viewer.