Changeset a2028e
- Timestamp:
- Oct 14, 2009, 11:10:47 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:
- 6cd79d
- Parents:
- f74d08
- Location:
- src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselation.cpp
rf74d08 ra2028e 8 8 #include <fstream> 9 9 10 #include "helpers.hpp" 10 11 #include "linkedcell.hpp" 11 12 #include "tesselation.hpp" … … 2511 2512 return NULL; 2512 2513 } 2513 2514 *out << Verbose(1) << "Finding closest Tesselpoint to " << *x << " ... " << endl; 2514 2515 trianglePoints[0] = FindClosestPoint(x, SecondPoint, LC); 2515 2516 … … 2661 2662 bool takePoint = false; 2662 2663 2664 *out << Verbose(3) << "Begin of GetAllConnectedPoints" << endl; 2665 2663 2666 // find the respective boundary point 2664 2667 PointMap::iterator PointRunner = PointsOnBoundary.find(Point->nr); … … 2700 2703 } 2701 2704 2705 *out << Verbose(3) << "End of GetAllConnectedPoints" << endl; 2702 2706 return connectedPoints; 2703 2707 }; … … 2726 2730 Vector helper; 2727 2731 2732 *out << Verbose(2) << "Begin of GetCircleOfConnectedPoints" << endl; 2733 2728 2734 // calculate central point 2729 2735 for (set<TesselPoint*>::iterator TesselRunner = connectedPoints->begin(); TesselRunner != connectedPoints->end(); TesselRunner++) … … 2741 2747 2742 2748 // construct one orthogonal vector 2743 if (Reference != NULL) 2749 if (Reference != NULL) { 2744 2750 AngleZero.CopyVector(Reference); 2751 AngleZero.SubtractVector(Point->node); 2752 AngleZero.ProjectOntoPlane(&PlaneNormal); 2753 } 2754 if ((Reference == NULL) || (AngleZero.NormSquared() < MYEPSILON )) { 2755 *out << Verbose(4) << "Using alternatively " << *(*connectedPoints->begin())->node << " as angle 0 referencer." << endl; 2756 AngleZero.CopyVector((*connectedPoints->begin())->node); 2757 AngleZero.SubtractVector(Point->node); 2758 AngleZero.ProjectOntoPlane(&PlaneNormal); 2759 if (AngleZero.NormSquared() < MYEPSILON) { 2760 cerr << Verbose(0) << "CRITIAL: AngleZero is 0 even with alternative reference. The algorithm has to be changed here!" << endl; 2761 performCriticalExit(); 2762 } 2763 } 2764 *out << Verbose(4) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl; 2765 if (AngleZero.NormSquared() > MYEPSILON) 2766 OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero); 2745 2767 else 2746 AngleZero.CopyVector((*connectedPoints->begin())->node); 2747 AngleZero.SubtractVector(Point->node); 2748 AngleZero.ProjectOntoPlane(&PlaneNormal); 2749 *out << Verbose(4) << "INFO: Reference vector on this plane representing angle 0 is " << AngleZero << "." << endl; 2750 OrthogonalVector.MakeNormalVector(&PlaneNormal, &AngleZero); 2768 OrthogonalVector.MakeNormalVector(&PlaneNormal); 2751 2769 *out << Verbose(4) << "INFO: OrthogonalVector on plane is " << OrthogonalVector << "." << endl; 2752 2770 … … 2766 2784 2767 2785 delete(connectedPoints); 2786 2787 *out << Verbose(2) << "End of GetCircleOfConnectedPoints" << endl; 2788 2768 2789 return connectedCircle; 2769 2790 } … … 3223 3244 for (int i = 0; i < 3; i++) { 3224 3245 if (TrianglePoints[i] != NULL) { 3225 for (int j = i ; j < 3; j++) {3246 for (int j = i+1; j < 3; j++) { 3226 3247 if (TrianglePoints[j] != NULL) { 3227 FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->nr);3228 if (FindLine != TrianglePoints[i]->lines.end()) {3229 for (; FindLine->first == TrianglePoints[j]->node->nr;FindLine++) {3230 3231 for (; FindTriangle != FindLine->second->triangles.end(); FindTriangle++) {3232 if (FindTriangle->second->IsPresentTupel(TrianglePoints)) {3233 result->push_back(FindTriangle->second);3234 }3248 for (FindLine = TrianglePoints[i]->lines.find(TrianglePoints[j]->node->nr); // is a multimap! 3249 (FindLine != TrianglePoints[i]->lines.end()) && (FindLine->first == TrianglePoints[j]->node->nr); 3250 FindLine++) { 3251 for (FindTriangle = FindLine->second->triangles.begin(); 3252 FindTriangle != FindLine->second->triangles.end(); 3253 FindTriangle++) { 3254 if (FindTriangle->second->IsPresentTupel(TrianglePoints)) { 3255 result->push_back(FindTriangle->second); 3235 3256 } 3236 3257 } 3237 // Is it sufficient to consider one of the triangle lines for this.3238 return result;3239 3240 3258 } 3259 // Is it sufficient to consider one of the triangle lines for this. 3260 return result; 3241 3261 } 3242 3262 } -
src/tesselationhelpers.cpp
rf74d08 ra2028e 635 635 } 636 636 } 637 637 // output 638 if (closestPoint != NULL) { 639 cout << Verbose(2) << "Closest point is " << *closestPoint; 640 if (SecondPoint != NULL) 641 cout << " and second closest is " << *SecondPoint; 642 cout << "." << endl; 643 } 638 644 return closestPoint; 639 645 };
Note:
See TracChangeset
for help on using the changeset viewer.