Changeset a67d19 for src/tesselationhelpers.cpp
- Timestamp:
- Apr 22, 2010, 2:00:03 PM (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:
- 299554
- Parents:
- 6613ec
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselationhelpers.cpp
r6613ec ra67d19 132 132 Center->Scale(1./(sin(2.*alpha) + sin(2.*beta) + sin(2.*gamma))); 133 133 NewUmkreismittelpunkt->CopyVector(Center); 134 Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n";134 DoLog(1) && (Log() << Verbose(1) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n"); 135 135 // Here we calculated center of circumscribing circle, using barycentric coordinates 136 Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n";136 DoLog(1) && (Log() << Verbose(1) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n"); 137 137 138 138 TempNormal.CopyVector(&a); … … 158 158 TempNormal.Normalize(); 159 159 Restradius = sqrt(RADIUS*RADIUS - Umkreisradius*Umkreisradius); 160 Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n";160 DoLog(1) && (Log() << Verbose(1) << "Height of center of circumference to center of sphere is " << Restradius << ".\n"); 161 161 TempNormal.Scale(Restradius); 162 Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n";162 DoLog(1) && (Log() << Verbose(1) << "Shift vector to sphere of circumference is " << TempNormal << ".\n"); 163 163 164 164 Center->AddVector(&TempNormal); 165 Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n";165 DoLog(1) && (Log() << Verbose(1) << "Center of sphere of circumference is " << *Center << ".\n"); 166 166 GetSphere(&OtherCenter, a, b, c, RADIUS); 167 Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n";167 DoLog(1) && (Log() << Verbose(1) << "OtherCenter of sphere of circumference is " << OtherCenter << ".\n"); 168 168 }; 169 169 … … 247 247 if (helper.ScalarProduct(&SearchDirection) < -HULLEPSILON) // acos is not unique on [0, 2.*M_PI), hence extra check to decide between two half intervals 248 248 alpha = 2.*M_PI - alpha; 249 Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl;249 DoLog(1) && (Log() << Verbose(1) << "INFO: RelativeNewSphereCenter is " << helper << ", RelativeOldSphereCenter is " << RelativeOldSphereCenter << " and resulting angle is " << alpha << "." << endl); 250 250 radius = helper.Distance(&RelativeOldSphereCenter); 251 251 helper.ProjectOntoPlane(&NormalVector); 252 252 // check whether new center is somewhat away or at least right over the current baseline to prevent intersecting triangles 253 253 if ((radius > HULLEPSILON) || (helper.Norm() < HULLEPSILON)) { 254 Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl;254 DoLog(1) && (Log() << Verbose(1) << "INFO: Distance between old and new center is " << radius << " and between new center and baseline center is " << helper.Norm() << "." << endl); 255 255 return alpha; 256 256 } else { 257 Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl;257 DoLog(1) && (Log() << Verbose(1) << "INFO: NewSphereCenter " << RelativeNewSphereCenter << " is too close to RelativeOldSphereCenter" << RelativeOldSphereCenter << "." << endl); 258 258 return 2.*M_PI; 259 259 } … … 364 364 365 365 if (status == GSL_SUCCESS) { 366 Log() << Verbose(1) << "converged to minimum" << endl;366 DoLog(1) && (Log() << Verbose(1) << "converged to minimum" << endl); 367 367 } 368 368 } while (status == GSL_CONTINUE && iter < 100); … … 394 394 395 395 if (((t1 >= 0) && (t1 <= 1)) && ((t2 >= 0) && (t2 <= 1))) { 396 Log() << Verbose(1) << "true intersection." << endl;396 DoLog(1) && (Log() << Verbose(1) << "true intersection." << endl); 397 397 result = true; 398 398 } else { 399 Log() << Verbose(1) << "intersection out of region of interest." << endl;399 DoLog(1) && (Log() << Verbose(1) << "intersection out of region of interest." << endl); 400 400 result = false; 401 401 } … … 432 432 } 433 433 434 Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl;434 DoLog(1) && (Log() << Verbose(1) << "INFO: " << point << " has angle " << phi << " with respect to reference " << reference << "." << endl); 435 435 436 436 return phi; … … 479 479 for (int j=i+1; j<3; j++) { 480 480 if (nodes[i] == NULL) { 481 Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl;481 DoLog(1) && (Log() << Verbose(1) << "Node nr. " << i << " is not yet present." << endl); 482 482 result = true; 483 483 } else if (nodes[i]->lines.find(nodes[j]->node->nr) != nodes[i]->lines.end()) { // there already is a line … … 493 493 } 494 494 } else { // no line 495 Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl;495 DoLog(1) && (Log() << Verbose(1) << "The line between " << *nodes[i] << " and " << *nodes[j] << " is not yet present, hence no need for a degenerate triangle." << endl); 496 496 result = true; 497 497 } 498 498 } 499 499 if ((!result) && (counter > 1)) { 500 Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl;500 DoLog(1) && (Log() << Verbose(1) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl); 501 501 result = true; 502 502 } … … 571 571 for(int i=0;i<NDIM;i++) // store indices of this cell 572 572 N[i] = LC->n[i]; 573 Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;573 DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl); 574 574 575 575 LC->GetNeighbourBounds(Nlower, Nupper); … … 626 626 for(int i=0;i<NDIM;i++) // store indices of this cell 627 627 N[i] = LC->n[i]; 628 Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl;628 DoLog(1) && (Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl); 629 629 630 630 LC->GetNeighbourBounds(Nlower, Nupper); … … 659 659 // output 660 660 if (closestPoint != NULL) { 661 Log() << Verbose(1) << "Closest point is " << *closestPoint;661 DoLog(1) && (Log() << Verbose(1) << "Closest point is " << *closestPoint); 662 662 if (SecondPoint != NULL) 663 Log() << Verbose(0) << " and second closest is " << *SecondPoint;664 Log() << Verbose(0) << "." << endl;663 DoLog(0) && (Log() << Verbose(0) << " and second closest is " << *SecondPoint); 664 DoLog(0) && (Log() << Verbose(0) << "." << endl); 665 665 } 666 666 return closestPoint; … … 686 686 Normal.VectorProduct(&OtherBaseline); 687 687 Normal.Normalize(); 688 Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl;688 DoLog(1) && (Log() << Verbose(1) << "First direction is " << Baseline << ", second direction is " << OtherBaseline << ", normal of intersection plane is " << Normal << "." << endl); 689 689 690 690 // project one offset point of OtherBase onto this plane (and add plane offset vector) … … 703 703 Normal.CopyVector(Intersection); 704 704 Normal.SubtractVector(Base->endpoints[0]->node->node); 705 Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl;705 DoLog(1) && (Log() << Verbose(1) << "Found closest point on " << *Base << " at " << *Intersection << ", factor in line is " << fabs(Normal.ScalarProduct(&Baseline)/Baseline.NormSquared()) << "." << endl); 706 706 707 707 return Intersection; … … 885 885 *tecplot << endl; 886 886 // print connectivity 887 Log() << Verbose(1) << "The following triangles were created:" << endl;887 DoLog(1) && (Log() << Verbose(1) << "The following triangles were created:" << endl); 888 888 for (TriangleMap::const_iterator runner = TesselStruct->TrianglesOnBoundary.begin(); runner != TesselStruct->TrianglesOnBoundary.end(); runner++) { 889 Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl;889 DoLog(1) && (Log() << Verbose(1) << " " << runner->second->endpoints[0]->node->Name << "<->" << runner->second->endpoints[1]->node->Name << "<->" << runner->second->endpoints[2]->node->Name << endl); 890 890 *tecplot << LookupList[runner->second->endpoints[0]->node->nr] << " " << LookupList[runner->second->endpoints[1]->node->nr] << " " << LookupList[runner->second->endpoints[2]->node->nr] << endl; 891 891 } … … 908 908 for (PointMap::const_iterator PointRunner = TesselStruct->PointsOnBoundary.begin(); PointRunner != TesselStruct->PointsOnBoundary.end(); PointRunner++) { 909 909 point = PointRunner->second; 910 Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl;910 DoLog(1) && (Log() << Verbose(1) << "INFO: Current point is " << *point << "." << endl); 911 911 point->value = 0; 912 912 for (LineMap::iterator LineRunner = point->lines.begin(); LineRunner != point->lines.end(); LineRunner++) { … … 932 932 int counter = 0; 933 933 934 Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl;934 DoLog(1) && (Log() << Verbose(1) << "Check: List of Baselines with not two connected triangles:" << endl); 935 935 for (testline = TesselStruct->LinesOnBoundary.begin(); testline != TesselStruct->LinesOnBoundary.end(); testline++) { 936 936 if (testline->second->triangles.size() != 2) { 937 Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl;937 DoLog(2) && (Log() << Verbose(2) << *testline->second << "\t" << testline->second->triangles.size() << endl); 938 938 counter++; 939 939 } 940 940 } 941 941 if (counter == 0) { 942 Log() << Verbose(1) << "None." << endl;942 DoLog(1) && (Log() << Verbose(1) << "None." << endl); 943 943 result = true; 944 944 } … … 965 965 } 966 966 967 Log() << Verbose(0) << "Polygon is " << *P << endl;967 DoLog(0) && (Log() << Verbose(0) << "Polygon is " << *P << endl); 968 968 // create each pair, get the endpoints and check whether *P is contained. 969 969 int counter = 0; … … 981 981 const int size = PairTrianglenodes.endpoints.size(); 982 982 if (size == 4) { 983 Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl;983 DoLog(0) && (Log() << Verbose(0) << " Current pair of triangles: " << **Walker << "," << **PairWalker << " with " << size << " distinct endpoints:" << PairTrianglenodes << endl); 984 984 // now check 985 985 if (PairTrianglenodes.ContainsPresentTupel(P)) { 986 986 counter++; 987 Log() << Verbose(0) << " ACCEPT: Matches with " << *P << endl;987 DoLog(0) && (Log() << Verbose(0) << " ACCEPT: Matches with " << *P << endl); 988 988 } else { 989 Log() << Verbose(0) << " REJECT: No match with " << *P << endl;989 DoLog(0) && (Log() << Verbose(0) << " REJECT: No match with " << *P << endl); 990 990 } 991 991 } else { 992 Log() << Verbose(0) << " REJECT: Less than four endpoints." << endl;992 DoLog(0) && (Log() << Verbose(0) << " REJECT: Less than four endpoints." << endl); 993 993 } 994 994 } … … 1011 1011 if (P2->ContainsBoundaryPoint((*Runner))) { 1012 1012 counter++; 1013 Log() << Verbose(1) << *(*Runner) << " of second polygon is found in the first one." << endl;1013 DoLog(1) && (Log() << Verbose(1) << *(*Runner) << " of second polygon is found in the first one." << endl); 1014 1014 return true; 1015 1015 } … … 1029 1029 Tester = P1->endpoints.insert((*Runner)); 1030 1030 if (Tester.second) 1031 Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl;1031 DoLog(0) && (Log() << Verbose(0) << "Inserting endpoint " << *(*Runner) << " into first polygon." << endl); 1032 1032 } 1033 1033 P2->endpoints.clear();
Note:
See TracChangeset
for help on using the changeset viewer.