Changeset 717e0c for src/tesselation.cpp
- Timestamp:
- Nov 23, 2009, 6:22:33 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:
- e359a8
- Parents:
- f1ef60a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselation.cpp
rf1ef60a r717e0c 48 48 //Log() << Verbose(5) << "Erasing point nr. " << Nr << "." << endl; 49 49 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; 51 51 node = NULL; 52 52 }; … … 153 153 } 154 154 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; 156 156 }; 157 157 … … 188 188 // get the two triangles 189 189 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; 191 191 return true; 192 192 } … … 226 226 i++; 227 227 } 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; 229 229 return true; 230 230 } … … 409 409 } while (CrossPoint.NormSquared() < MYEPSILON); 410 410 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; 412 412 exit(255); 413 413 } … … 634 634 runner->second = NULL; 635 635 } 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; 637 637 } 638 638 Log() << Verbose(1) << "This envelope was written to file " << TriangleFilesWritten << " times(s)." << endl; … … 1174 1174 if (NewLines[j]->IsConnectedTo(BLS[0])) { 1175 1175 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; 1177 1177 return false; 1178 1178 } else … … 1191 1191 } 1192 1192 } 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; 1194 1194 return false; 1195 1195 } … … 1379 1379 triangle->lines[i] = NULL; // free'd or not: disconnect 1380 1380 } 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; 1382 1382 } 1383 1383 … … 1432 1432 line->endpoints[i] = NULL; // free'd or not: disconnect 1433 1433 } 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; 1435 1435 } 1436 1436 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; 1438 1438 1439 1439 if (LinesOnBoundary.erase(line->Nr)) … … 1604 1604 } 1605 1605 } 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; 1607 1607 } 1608 1608 } … … 1786 1786 if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { 1787 1787 // 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; 1789 1789 } 1790 1790 … … 1924 1924 if (fabs(OldSphereCenter.ScalarProduct(&SearchDirection)) > HULLEPSILON) { 1925 1925 // 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; 1927 1927 } 1928 1928 … … 1935 1935 1936 1936 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; 1938 1938 return false; 1939 1939 } … … 1983 1983 //Log() << Verbose(1) << "We have "<< TrianglesOnBoundaryCount << " for line " << *BaseRay << "." << endl; 1984 1984 } else { 1985 Log() << Verbose(1) << "WARNING:This triangle consisting of ";1985 eLog() << Verbose(2) << "This triangle consisting of "; 1986 1986 Log() << Verbose(0) << *(*it)->point << ", "; 1987 1987 Log() << Verbose(0) << *BaseRay->endpoints[0]->node << " and "; … … 2009 2009 (*it)->OtherOptCenter.Scale(-1.); 2010 2010 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; 2013 2012 Log() << Verbose(1) << "We have "<< BaseRay->triangles.size() << " for line " << BaseRay << "." << endl; 2014 2013 } 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; 2020 2015 result = false; 2021 2016 } … … 2033 2028 BaseRay = BLS[0]; 2034 2029 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; 2036 2031 exit(255); 2037 2032 } … … 2174 2169 BaseLineNormal.Zero(); 2175 2170 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; 2177 2172 return 0.; 2178 2173 } … … 2214 2209 BaseLineNormal.Zero(); 2215 2210 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; 2217 2212 return NULL; 2218 2213 } … … 2250 2245 // check whether everything is in place to create new lines and triangles 2251 2246 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; 2253 2248 return NULL; 2254 2249 } 2255 2250 for (int j=0;j<4;j++) 2256 2251 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; 2258 2253 return NULL; 2259 2254 } 2260 2255 for (int j=0;j<2;j++) 2261 2256 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; 2263 2258 return NULL; 2264 2259 } … … 2336 2331 N[i] = LC->n[i]; 2337 2332 } 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; 2339 2334 return; 2340 2335 } … … 2475 2470 // test whether old center is on the band's plane 2476 2471 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; 2478 2473 OldSphereCenter.ProjectOntoPlane(&CirclePlaneNormal); 2479 2474 } … … 2485 2480 //Log() << Verbose(2) << "INFO: SearchDirection is " << SearchDirection << "." << endl; 2486 2481 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; 2488 2483 } 2489 2484 … … 2494 2489 //Log() << Verbose(2) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << LC->index << "." << endl; 2495 2490 } 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; 2497 2492 return; 2498 2493 } … … 2599 2594 } 2600 2595 } 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; 2602 2597 } 2603 2598 } else { … … 2690 2685 triangles->unique(); 2691 2686 } 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; 2693 2688 return NULL; 2694 2689 } … … 2701 2696 for (int i=0;i<3;i++) { 2702 2697 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; 2704 2699 } 2705 2700 //Log() << Verbose(2) << "List of triangle points:" << endl; … … 2720 2715 2721 2716 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."; 2723 2718 delete(triangles); 2724 2719 return NULL; … … 2754 2749 Log() << Verbose(2) << "Normal Vector of this back side is " << result->NormalVector << "." << endl; 2755 2750 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; 2757 2752 } 2758 2753 } … … 2856 2851 2857 2852 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; 2859 2854 return NULL; 2860 2855 } … … 2979 2974 ReferencePoint = PointRunner->second; 2980 2975 } 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; 2982 2977 return NULL; 2983 2978 } … … 2996 2991 LineRunner = TouchedLine.find(runner->second); 2997 2992 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; 2999 2994 } else if (!LineRunner->second) { 3000 2995 LineRunner->second = true; … … 3026 3021 } 3027 3022 } 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; 3029 3024 triangle = NULL; 3030 3025 } … … 3043 3038 LineRunner = TouchedLine.find(CurrentLine); 3044 3039 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; 3046 3041 else 3047 3042 LineRunner->second = true; … … 3061 3056 } 3062 3057 } 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; 3064 3059 } 3065 3060 … … 3139 3134 3140 3135 if (Point == NULL) { 3141 Log() << Verbose(1) << "ERROR:Point given is NULL." << endl;3136 eLog() << Verbose(1) << "Point given is NULL." << endl; 3142 3137 } else { 3143 3138 // go through its lines and insert all triangles … … 3171 3166 3172 3167 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; 3174 3169 return 0.; 3175 3170 } else … … 3181 3176 // get list of connected points 3182 3177 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; 3184 3179 return 0.; 3185 3180 } … … 3281 3276 triangle = GetPresentTriangle(TriangleCandidates); 3282 3277 if (triangle != NULL) { 3283 Log() << Verbose(1) << "WARNING:New triangle already present, skipping!" << endl;3278 eLog() << Verbose(2) << "New triangle already present, skipping!" << endl; 3284 3279 StartNode++; 3285 3280 MiddleNode++; … … 3619 3614 NearestBoundaryPoint = PointRunner->second; 3620 3615 } else { 3621 Log() << Verbose(1) << "ERROR:I cannot find the boundary point." << endl;3616 eLog() << Verbose(1) << "I cannot find the boundary point." << endl; 3622 3617 return; 3623 3618 }
Note:
See TracChangeset
for help on using the changeset viewer.