Changeset 717e0c for src/tesselation.cpp


Ignore:
Timestamp:
Nov 23, 2009, 6:22:33 PM (15 years ago)
Author:
Frederik Heber <heber@…>
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:
e359a8
Parents:
f1ef60a
Message:

Verbosity corrected for ERROR and WARNING

  • present ERROR and WARNING prefixes removed and placed by eLog() and respective Verbosity().
  • -v... is scanned for number of 'v's and verbosity is set accordingly
  • standard verbosity is now 0.

Signed-off-by: Frederik Heber <heber@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.cpp

    rf1ef60a r717e0c  
    4848  //Log() << Verbose(5) << "Erasing point nr. " << Nr << "." << endl;
    4949  if (!lines.empty())
    50     eLog() << Verbose(0) << "WARNING: Memory Leak! I " << *this << " am still connected to some lines." << endl;
     50    eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some lines." << endl;
    5151  node = NULL;
    5252};
     
    153153  }
    154154  if (!triangles.empty())
    155     eLog() << Verbose(0) << "WARNING: Memory Leak! I " << *this << " am still connected to some triangles." << endl;
     155    eLog() << Verbose(2) << "Memory Leak! I " << *this << " am still connected to some triangles." << endl;
    156156};
    157157
     
    188188  // get the two triangles
    189189  if (triangles.size() != 2) {
    190     Log() << Verbose(1) << "ERROR: Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl;
     190    eLog() << Verbose(1) << "Baseline " << *this << " is connected to less than two triangles, Tesselation incomplete!" << endl;
    191191    return true;
    192192  }
     
    226226      i++;
    227227    } else {
    228       //Log() << Verbose(2) << "ERROR: I cannot find third node in triangle, something's wrong." << endl;
     228      //eLog() << Verbose(1) << "I cannot find third node in triangle, something's wrong." << endl;
    229229      return true;
    230230    }
     
    409409  } while (CrossPoint.NormSquared() < MYEPSILON);
    410410  if (i==3) {
    411     Log() << Verbose(1) << "ERROR: Could not find any cross points, something's utterly wrong here!" << endl;
     411    eLog() << Verbose(1) << "Could not find any cross points, something's utterly wrong here!" << endl;
    412412    exit(255);
    413413  }
     
    634634      runner->second = NULL;
    635635    } else
    636       eLog() << Verbose(1) << "ERROR: The triangle " << runner->first << " has already been free'd." << endl;
     636      eLog() << Verbose(1) << "The triangle " << runner->first << " has already been free'd." << endl;
    637637  }
    638638  Log() << Verbose(1) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl;
     
    11741174            if (NewLines[j]->IsConnectedTo(BLS[0])) {
    11751175              if (n>2) {
    1176                 Log() << Verbose(1) << "ERROR: " << BLS[0] << " connects to all of the new lines?!" << endl;
     1176                Log() << Verbose(1) << BLS[0] << " connects to all of the new lines?!" << endl;
    11771177                return false;
    11781178              } else
     
    11911191      }
    11921192    } else { // something is wrong with FindClosestTriangleToPoint!
    1193       Log() << Verbose(1) << "ERROR: The closest triangle did not produce an intersection!" << endl;
     1193      eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl;
    11941194      return false;
    11951195    }
     
    13791379      triangle->lines[i] = NULL;  // free'd or not: disconnect
    13801380    } else
    1381       eLog() << Verbose(0) << "ERROR: This line " << i << " has already been free'd." << endl;
     1381      eLog() << Verbose(1) << "This line " << i << " has already been free'd." << endl;
    13821382  }
    13831383
     
    14321432      line->endpoints[i] = NULL;  // free'd or not: disconnect
    14331433    } else
    1434       eLog() << Verbose(0) << "ERROR: Endpoint " << i << " has already been free'd." << endl;
     1434      eLog() << Verbose(1) << "Endpoint " << i << " has already been free'd." << endl;
    14351435  }
    14361436  if (!line->triangles.empty())
    1437     eLog() << Verbose(0) << "WARNING: Memory Leak! I " << *line << " am still connected to some triangles." << endl;
     1437    eLog() << Verbose(2) << "Memory Leak! I " << *line << " am still connected to some triangles." << endl;
    14381438
    14391439  if (LinesOnBoundary.erase(line->Nr))
     
    16041604          }
    16051605        } else {
    1606           eLog() << Verbose(0) << "ERROR: The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;
     1606          eLog() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << " is invalid!" << endl;
    16071607        }
    16081608      }
     
    17861786            if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
    17871787              // rotated the wrong way!
    1788               eLog() << Verbose(0) << "ERROR: SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;
     1788              eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;
    17891789            }
    17901790
     
    19241924    if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {
    19251925      // rotated the wrong way!
    1926       eLog() << Verbose(0) << "ERROR: SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;
     1926      eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are still not orthogonal!" << endl;
    19271927    }
    19281928
     
    19351935
    19361936  if (OptCandidates->begin() == OptCandidates->end()) {
    1937     eLog() << Verbose(0) << "WARNING: Could not find a suitable candidate." << endl;
     1937    eLog() << Verbose(2) << "Could not find a suitable candidate." << endl;
    19381938    return false;
    19391939  }
     
    19831983        //Log() << Verbose(1) << "We have "<< TrianglesOnBoundaryCount << " for line " << *BaseRay << "." << endl;
    19841984        } else {
    1985           Log() << Verbose(1) << "WARNING: This triangle consisting of ";
     1985          eLog() << Verbose(2) << "This triangle consisting of ";
    19861986          Log() << Verbose(0) << *(*it)->point << ", ";
    19871987          Log() << Verbose(0) << *BaseRay->endpoints[0]->node << " and ";
     
    20092009            (*it)->OtherOptCenter.Scale(-1.);
    20102010
    2011             Log() << Verbose(0) << "--> WARNING: Special new triangle with " << *BTS << " and normal vector " << BTS->NormalVector
    2012             << " for this triangle ... " << endl;
     2011            eLog() << Verbose(2) << "--> WARNING: Special new triangle with " << *BTS << " and normal vector " << BTS->NormalVector << " for this triangle ... " << endl;
    20132012            Log() << Verbose(1) << "We have "<< BaseRay->triangles.size() << " for line " << BaseRay << "." << endl;
    20142013          } else {
    2015             Log() << Verbose(1) << "WARNING: This triangle consisting of ";
    2016             Log() << Verbose(0) << *(*it)->point << ", ";
    2017             Log() << Verbose(0) << *BaseRay->endpoints[0]->node << " and ";
    2018             Log() << Verbose(0) << *BaseRay->endpoints[1]->node << " ";
    2019             Log() << Verbose(0) << "exists and is not added, as it does not seem helpful!" << endl;
     2014            eLog() << Verbose(2) << "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;
    20202015            result = false;
    20212016          }
     
    20332028    BaseRay = BLS[0];
    20342029    if ((BTS != NULL) && (BTS->NormalVector.NormSquared() < MYEPSILON)) {
    2035       Log() << Verbose(1) << "CRITICAL: Triangle " << *BTS << " has zero normal vector!" << endl;
     2030      eLog() << Verbose(1) << "Triangle " << *BTS << " has zero normal vector!" << endl;
    20362031      exit(255);
    20372032    }
     
    21742169    BaseLineNormal.Zero();
    21752170    if (Base->triangles.size() < 2) {
    2176       Log() << Verbose(2) << "ERROR: Less than two triangles are attached to this baseline!" << endl;
     2171      eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;
    21772172      return 0.;
    21782173    }
     
    22142209  BaseLineNormal.Zero();
    22152210  if (Base->triangles.size() < 2) {
    2216     Log() << Verbose(2) << "ERROR: Less than two triangles are attached to this baseline!" << endl;
     2211    eLog() << Verbose(1) << "Less than two triangles are attached to this baseline!" << endl;
    22172212    return NULL;
    22182213  }
     
    22502245  // check whether everything is in place to create new lines and triangles
    22512246  if (i<4) {
    2252     Log() << Verbose(1) << "ERROR: We have not gathered enough baselines!" << endl;
     2247    eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;
    22532248    return NULL;
    22542249  }
    22552250  for (int j=0;j<4;j++)
    22562251    if (OldLines[j] == NULL) {
    2257       Log() << Verbose(1) << "ERROR: We have not gathered enough baselines!" << endl;
     2252      eLog() << Verbose(1) << "We have not gathered enough baselines!" << endl;
    22582253      return NULL;
    22592254    }
    22602255  for (int j=0;j<2;j++)
    22612256    if (OldPoints[j] == NULL) {
    2262       Log() << Verbose(1) << "ERROR: We have not gathered enough endpoints!" << endl;
     2257      eLog() << Verbose(1) << "We have not gathered enough endpoints!" << endl;
    22632258      return NULL;
    22642259    }
     
    23362331      N[i] = LC->n[i];
    23372332  } else {
    2338     eLog() << Verbose(0) << "ERROR: Point " << *a << " is not found in cell " << LC->index << "." << endl;
     2333    eLog() << Verbose(1) << "Point " << *a << " is not found in cell " << LC->index << "." << endl;
    23392334    return;
    23402335  }
     
    24752470    // test whether old center is on the band's plane
    24762471    if (fabs(OldSphereCenter.ScalarProduct(&CirclePlaneNormal)) > HULLEPSILON) {
    2477       eLog() << Verbose(0) << "ERROR: Something's very wrong here: OldSphereCenter is not on the band's plane as desired by " << fabs(OldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;
     2472      eLog() << Verbose(1) << "Something's very wrong here: OldSphereCenter is not on the band's plane as desired by " << fabs(OldSphereCenter.ScalarProduct(&CirclePlaneNormal)) << "!" << endl;
    24782473      OldSphereCenter.ProjectOntoPlane(&CirclePlaneNormal);
    24792474    }
     
    24852480      //Log() << Verbose(2) << "INFO: SearchDirection is " << SearchDirection << "." << endl;
    24862481      if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) {  // rotated the wrong way!
    2487         eLog() << Verbose(0) << "ERROR: SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl;
     2482        eLog() << Verbose(1) << "SearchDirection and RelativeOldSphereCenter are not orthogonal!" << endl;
    24882483      }
    24892484
     
    24942489        //Log() << Verbose(2) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;
    24952490      } else {
    2496         eLog() << Verbose(0) << "ERROR: Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl;
     2491        eLog() << Verbose(1) << "Vector " << CircleCenter << " is outside of LinkedCell's bounding box." << endl;
    24972492        return;
    24982493      }
     
    25992594          }
    26002595    } else {
    2601       eLog() << Verbose(2) << "ERROR: The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;
     2596      eLog() << Verbose(1) << "The projected center of the old sphere has radius " << radius << " instead of " << CircleRadius << "." << endl;
    26022597    }
    26032598  } else {
     
    26902685        triangles->unique();
    26912686      } else {
    2692         Log() << Verbose(1) << "ERROR: I cannot find a boundary point to the tessel point " << *trianglePoints[0] << "." << endl;
     2687        eLog() << Verbose(1) << "I cannot find a boundary point to the tessel point " << *trianglePoints[0] << "." << endl;
    26932688        return NULL;
    26942689      }
     
    27012696      for (int i=0;i<3;i++) {
    27022697        if (trianglePoints[i] == NULL) {
    2703           Log() << Verbose(1) << "ERROR: IsInnerPoint encounters serious error, point " << i << " not found." << endl;
     2698          eLog() << Verbose(1) << "IsInnerPoint encounters serious error, point " << i << " not found." << endl;
    27042699        }
    27052700        //Log() << Verbose(2) << "List of triangle points:" << endl;
     
    27202715 
    27212716  if ((triangles == NULL) || (triangles->empty())) {
    2722     Log() << Verbose(0) << "ERROR: There is no nearest triangle. Please check the tesselation structure.";
     2717    eLog() << Verbose(1) << "There is no nearest triangle. Please check the tesselation structure.";
    27232718    delete(triangles);
    27242719    return NULL;
     
    27542749      Log() << Verbose(2) << "Normal Vector of this back side is " << result->NormalVector << "." << endl;
    27552750      if (Center.ScalarProduct(&result->NormalVector) < 0) {
    2756         Log() << Verbose(1) << "ERROR: Front and back side yield NormalVector in wrong direction!" << endl;
     2751        eLog() << Verbose(1) << "Front and back side yield NormalVector in wrong direction!" << endl;
    27572752      }
    27582753    }
     
    28562851
    28572852  if (connectedPoints->size() == 0) { // if have not found any points
    2858     Log() << Verbose(1) << "ERROR: We have not found any connected points to " << *Point<< "." << endl;
     2853    eLog() << Verbose(1) << "We have not found any connected points to " << *Point<< "." << endl;
    28592854    return NULL;
    28602855  }
     
    29792974    ReferencePoint = PointRunner->second;
    29802975  } else {
    2981     Log() << Verbose(2) << "ERROR: GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;
     2976    eLog() << Verbose(1) << "GetPathOfConnectedPoints() could not find the BoundaryPoint belonging to " << *Point << "." << endl;
    29822977    return NULL;
    29832978  }
     
    29962991      LineRunner = TouchedLine.find(runner->second);
    29972992      if (LineRunner == TouchedLine.end()) {
    2998         Log() << Verbose(2) << "ERROR: I could not find " << *runner->second << " in the touched list." << endl;
     2993        eLog() << Verbose(1) << "I could not find " << *runner->second << " in the touched list." << endl;
    29992994      } else if (!LineRunner->second) {
    30002995        LineRunner->second = true;
     
    30263021                }
    30273022              } else {
    3028                 Log() << Verbose(2) << "ERROR: I could not find " << *triangle << " in the touched list." << endl;
     3023                eLog() << Verbose(1) << "I could not find " << *triangle << " in the touched list." << endl;
    30293024                triangle = NULL;
    30303025              }
     
    30433038          LineRunner = TouchedLine.find(CurrentLine);
    30443039          if (LineRunner == TouchedLine.end())
    3045             Log() << Verbose(2) << "ERROR: I could not find " << *CurrentLine << " in the touched list." << endl;
     3040            eLog() << Verbose(1) << "I could not find " << *CurrentLine << " in the touched list." << endl;
    30463041          else
    30473042            LineRunner->second = true;
     
    30613056    }
    30623057  } else {
    3063     Log() << Verbose(1) << "ERROR: There are no lines attached to " << *ReferencePoint << "." << endl;
     3058    eLog() << Verbose(1) << "There are no lines attached to " << *ReferencePoint << "." << endl;
    30643059  }
    30653060
     
    31393134
    31403135  if (Point == NULL) {
    3141     Log() << Verbose(1) << "ERROR: Point given is NULL." << endl;
     3136    eLog() << Verbose(1) << "Point given is NULL." << endl;
    31423137  } else {
    31433138    // go through its lines and insert all triangles
     
    31713166
    31723167  if (point == NULL) {
    3173     Log() << Verbose(1) << "ERROR: Cannot remove the point " << point << ", it's NULL!" << endl;
     3168    eLog() << Verbose(1) << "Cannot remove the point " << point << ", it's NULL!" << endl;
    31743169    return 0.;
    31753170  } else
     
    31813176  // get list of connected points
    31823177  if (point->lines.empty()) {
    3183     Log() << Verbose(1) << "ERROR: Cannot remove the point " << *point << ", it's connected to no lines!" << endl;
     3178    eLog() << Verbose(1) << "Cannot remove the point " << *point << ", it's connected to no lines!" << endl;
    31843179    return 0.;
    31853180  }
     
    32813276        triangle = GetPresentTriangle(TriangleCandidates);
    32823277        if (triangle != NULL) {
    3283           Log() << Verbose(1) << "WARNING: New triangle already present, skipping!" << endl;
     3278          eLog() << Verbose(2) << "New triangle already present, skipping!" << endl;
    32843279          StartNode++;
    32853280          MiddleNode++;
     
    36193614    NearestBoundaryPoint = PointRunner->second;
    36203615  } else {
    3621     Log() << Verbose(1) << "ERROR: I cannot find the boundary point." << endl;
     3616    eLog() << Verbose(1) << "I cannot find the boundary point." << endl;
    36223617    return;
    36233618  }
Note: See TracChangeset for help on using the changeset viewer.