Changeset 613790 for src/Tesselation/tesselation.cpp
- Timestamp:
- Oct 19, 2014, 5:13:09 PM (10 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:
- bb86bd
- Parents:
- cead3f
- git-author:
- Frederik Heber <heber@…> (09/25/14 18:26:20)
- git-committer:
- Frederik Heber <heber@…> (10/19/14 17:13:09)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tesselation/tesselation.cpp
rcead3f r613790 2331 2331 } 2332 2332 2333 if ((!CandidateLine.pointlist.empty()) && (!CandidateLine.CheckValidity(RADIUS, LC))) { 2334 ELOG(0, "There were other points contained in the rolling sphere as well!"); 2335 performCriticalExit(); 2336 } 2333 ASSERT(CandidateLine.pointlist.empty() || (CandidateLine.CheckValidity(RADIUS, LC)), 2334 std::string("Tesselation::FindThirdPointForTesselation()") 2335 +std::string("There were other points contained in the rolling sphere as well!")); 2337 2336 } 2338 2337 ; … … 2820 2819 // calculate central point 2821 2820 triangles = FindTriangles(TrianglePoints); 2822 if ((triangles != NULL) && (!triangles->empty())) { 2823 for (TriangleList::iterator Runner = triangles->begin(); Runner != triangles->end(); Runner++) 2824 PlaneNormal += (*Runner)->NormalVector; 2825 } else { 2826 ELOG(0, "Could not find any triangles for point " << *Point << "."); 2827 performCriticalExit(); 2828 } 2821 ASSERT((triangles == NULL) || (triangles->empty()), 2822 std::string("Tesselation::GetCircleOfConnectedTriangles()") 2823 +std::string("Could not find any triangles for point "+toString(*Point)+".")); 2824 for (TriangleList::iterator Runner = triangles->begin(); Runner != triangles->end(); Runner++) 2825 PlaneNormal += (*Runner)->NormalVector; 2829 2826 PlaneNormal.Scale(1.0 / triangles->size()); 2830 2827 LOG(4, "DEBUG: Calculated PlaneNormal of all circle points is " << PlaneNormal << "."); … … 2838 2835 AngleZero = ((*SetOfNeighbours->begin())->getPosition()) - (Point->getPosition()); 2839 2836 AngleZero.ProjectOntoPlane(PlaneNormal); 2840 if (AngleZero.NormSquared() < MYEPSILON) {2841 ELOG(0, "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!");2842 performCriticalExit();2843 }2837 ASSERT (AngleZero.NormSquared() > MYEPSILON, 2838 std::string("Tesselation::GetCircleOfConnectedTriangles() - ") 2839 +std::string("AngleZero is 0 even with alternative reference.") 2840 +std::string("The algorithm has to be changed here!")); 2844 2841 } 2845 2842 LOG(4, "DEBUG: Reference vector on this plane representing angle 0 is " << AngleZero << "."); … … 2940 2937 AngleZero = ((*SetOfNeighbours->begin())->getPosition()) - (Point->getPosition()); 2941 2938 AngleZero.ProjectOntoPlane(PlaneNormal); 2942 if (AngleZero.NormSquared() < MYEPSILON) {2943 ELOG(0, "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!");2944 performCriticalExit();2945 }2939 ASSERT(AngleZero.NormSquared() > MYEPSILON, 2940 std::string("Tesselation::GetCircleOfSetOfPoints() - ") 2941 +std::string("AngleZero is 0 even with alternative reference.") 2942 +std::string("The algorithm has to be changed here!")); 2946 2943 } 2947 2944 LOG(4, "DEBUG: Reference vector on this plane representing angle 0 is " << AngleZero << "."); … … 2962 2959 LOG(4, "DEBUG: Calculated angle between " << helper << " and " << AngleZero << " is " << angle << " for point " << **listRunner << "."); 2963 2960 InserterTest = anglesOfPoints.insert(pair<double, TesselPoint*> (angle, (*listRunner))); 2964 if (!InserterTest.second) {2965 ELOG(0, "GetCircleOfSetOfPoints() got two atoms with same angle: " << *((InserterTest.first)->second) << " and " << (*listRunner));2966 performCriticalExit();2967 }2961 ASSERT(InserterTest.second, 2962 std::string("Tesselation::GetCircleOfSetOfPoints() - ") 2963 +std::string("got two atoms with same angle "+toString(*((InserterTest.first)->second))) 2964 +std::string(" and "+toString((*listRunner)))); 2968 2965 } 2969 2966 … … 3304 3301 TriangleCandidates[2] = *EndNode; 3305 3302 triangle = GetPresentTriangle(TriangleCandidates); 3306 if (triangle != NULL) { 3307 ELOG(0, "New triangle already present, skipping!"); 3303 if (triangle != NULL) { 3304 // check orientation of normal vector (that points inside) 3305 ASSERT( triangle->NormalVector.ScalarProduct(NormalVector) > std::numeric_limits<double>::epsilon()*1e2, 3306 "Tesselation::RemovePointFromTesselatedSurface() - New triangle with same orientation already present as " 3307 +toString(*triangle)+"!"); 3308 } 3309 if (0) { 3308 3310 StartNode++; 3309 3311 MiddleNode++; … … 3338 3340 LOG(2, "Removing " << **MiddleNode << " from closed path, remaining points: " << connectedPath->size() << "."); 3339 3341 connectedPath->remove(*MiddleNode); // remove the middle node (it is surrounded by triangles) 3342 ASSERT(connectedPath->size() >= 2, 3343 "Tesselation::RemovePointFromTesselatedSurface() - There are only two endpoints left!"); 3340 3344 if (connectedPath->size() == 2) { // we are done 3341 3345 connectedPath->remove(*StartNode); // remove the start node 3342 3346 connectedPath->remove(*EndNode); // remove the end node 3343 3347 break; 3344 } else if (connectedPath->size() < 2) { // something's gone wrong!3345 ELOG(0, "CRITICAL: There are only two endpoints left!");3346 performCriticalExit();3347 3348 } else { 3348 3349 MiddleNode = StartNode; … … 3489 3490 } 3490 3491 default: 3491 ELOG(0, "Number of wildcards is greater than 3, cannot happen!");3492 performCriticalExit();3492 ASSERT(0, 3493 "Tesselation::FindTriangles() - Number of wildcards is greater than 3, cannot happen!"); 3493 3494 break; 3494 3495 } … … 3791 3792 for (int i = 0; i < 3; i++) { // look for the same line as BestLine (only it's its degenerated companion) 3792 3793 if ((BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[0])) && (BTS->lines[i]->ContainsBoundaryPoint(BestLine->endpoints[1]))) { 3793 if (BestLine == BTS->lines[i]) { 3794 ELOG(0, "BestLine is same as found line, something's wrong here!"); 3795 performCriticalExit(); 3796 } 3794 ASSERT(BestLine != BTS->lines[i], 3795 std::string("Tesselation::AddBoundaryPointByDegeneratedTriangle() - ") 3796 +std::string("BestLine is same as found line, something's wrong here!")); 3797 3797 BTS->lines[i]->triangles.insert(pair<int, class BoundaryTriangleSet *> (TempTriangle->Nr, TempTriangle)); 3798 3798 TempTriangle->lines[nr] = BTS->lines[i]; … … 3993 3993 // The Problem is probably due to two degenerated polygons being connected by a bridging, non-degenerated polygon, as somehow one node has 3994 3994 // connections to either polygon ... 3995 if (T->size() % 2 != 0) {3996 ELOG(0, " degenerated polygon contains an odd number of triangles, probably contains bridging non-degenerated ones, too!");3997 performCriticalExit();3998 }3995 ASSERT (T->size() % 2 == 0, 3996 std::string("Tesselation::CorrectAllDegeneratedPolygons() - ") 3997 +std::string(" degenerated polygon contains an odd number of triangles,") 3998 +std::string(" probably contains bridging non-degenerated ones, too!")); 3999 3999 TriangleSet::iterator TriangleWalker = T->begin(); // is the inner iterator 4000 4000 /// 4a. Get NormalVector for one side (this is "front")
Note:
See TracChangeset
for help on using the changeset viewer.