Changeset 7273fc
- Timestamp:
- Nov 25, 2009, 3:52:27 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:
- 27bd2f
- Parents:
- f67b6e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/tesselation.cpp
rf67b6e r7273fc 1657 1657 Info FunctionInfo(__func__); 1658 1658 int i = 0; 1659 TesselPoint* FirstPoint = NULL;1660 TesselPoint* SecondPoint = NULL;1661 1659 TesselPoint* MaxPoint[NDIM]; 1660 TesselPoint* Temporary; 1662 1661 double maxCoordinate[NDIM]; 1662 BoundaryLineSet BaseLine; 1663 1663 Vector Oben; 1664 1664 Vector helper; … … 1703 1703 Oben.Zero(); 1704 1704 Oben.x[k] = 1.; 1705 FirstPoint = MaxPoint[k];1706 Log() << Verbose(0) << "Coordinates of start node at " << * FirstPoint->node << "." << endl;1705 BaseLine.endpoints[0] = new BoundaryPointSet(MaxPoint[k]); 1706 Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine.endpoints[0]->node << "." << endl; 1707 1707 1708 1708 double ShortestAngle; 1709 TesselPoint* OptCandidate = NULL;1710 1709 ShortestAngle = 999999.; // This will contain the angle, which will be always positive (when looking for second point), when looking for third point this will be the quadrant. 1711 1710 1712 FindSecondPointForTesselation(FirstPoint, Oben, OptCandidate, &ShortestAngle, RADIUS, LC); // we give same point as next candidate as its bonds are looked into in find_second_... 1713 SecondPoint = OptCandidate; 1714 if (SecondPoint == NULL) // have we found a second point? 1711 FindSecondPointForTesselation(BaseLine.endpoints[0]->node, Oben, Temporary, &ShortestAngle, RADIUS, LC); // we give same point as next candidate as its bonds are looked into in find_second_... 1712 if (Temporary == NULL) // have we found a second point? 1715 1713 continue; 1716 1717 helper.CopyVector(FirstPoint->node); 1718 helper.SubtractVector(SecondPoint->node); 1714 BaseLine.endpoints[1] = new BoundaryPointSet(Temporary); 1715 1716 helper.CopyVector(BaseLine.endpoints[0]->node->node); 1717 helper.SubtractVector(BaseLine.endpoints[1]->node->node); 1719 1718 helper.Normalize(); 1720 1719 Oben.ProjectOntoPlane(&helper); … … 1723 1722 ShortestAngle = 2.*M_PI; // This will indicate the quadrant. 1724 1723 1725 Chord.CopyVector( FirstPoint->node); // bring into calling function1726 Chord.SubtractVector( SecondPoint->node);1724 Chord.CopyVector(BaseLine.endpoints[0]->node->node); // bring into calling function 1725 Chord.SubtractVector(BaseLine.endpoints[1]->node->node); 1727 1726 double radius = Chord.ScalarProduct(&Chord); 1728 1727 double CircleRadius = sqrt(RADIUS*RADIUS - radius/4.); … … 1735 1734 1736 1735 // adding point 1 and point 2 and add the line between them 1737 Log() << Verbose(0) << "Coordinates of start node at " << *FirstPoint->node << "." << endl; 1738 AddTesselationPoint(FirstPoint, 0); 1739 Log() << Verbose(0) << "Found second point is at " << *SecondPoint->node << ".\n"; 1740 AddTesselationPoint(SecondPoint, 1); 1741 AddTesselationLine(TPS[0], TPS[1], 0); 1736 Log() << Verbose(0) << "Coordinates of start node at " << *BaseLine.endpoints[0]->node << "." << endl; 1737 Log() << Verbose(0) << "Found second point is at " << *BaseLine.endpoints[1]->node << ".\n"; 1742 1738 1743 1739 //Log() << Verbose(1) << "INFO: OldSphereCenter is at " << helper << ".\n"; 1744 CandidateForTesselation OptCandidates( BLS[0]);1740 CandidateForTesselation OptCandidates(&BaseLine); 1745 1741 FindThirdPointForTesselation(Oben, SearchDirection, helper, OptCandidates, NULL, RADIUS, LC); 1746 1742 Log() << Verbose(0) << "List of third Points is:" << endl; … … 1749 1745 } 1750 1746 1751 for (TesselPointList::iterator it = OptCandidates.pointlist.begin(); it != OptCandidates.pointlist.end(); it++) { 1752 // add third triangle point 1753 AddTesselationPoint((*it), 2); 1754 // add the second and third line 1755 AddTesselationLine(TPS[1], TPS[2], 1); 1756 AddTesselationLine(TPS[0], TPS[2], 2); 1757 // ... and triangles to the Maps of the Tesselation class 1758 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 1759 AddTesselationTriangle(); 1760 // ... and calculate its normal vector (with correct orientation) 1761 OptCandidates.OptCenter.Scale(-1.); 1762 Log() << Verbose(1) << "Anti-Oben is currently " << OptCandidates.OptCenter << "." << endl; 1763 BTS->GetNormalVector(OptCandidates.OptCenter); // vector to compare with should point inwards 1764 OptCandidates.OptCenter.Scale(-1.); 1765 Log() << Verbose(0) << "==> Found starting triangle consists of " << *FirstPoint << ", " << *SecondPoint << " and " 1766 << (*it) << " with normal vector " << BTS->NormalVector << ".\n"; 1767 1768 // // if we do not reach the end with the next step of iteration, we need to setup a new first line 1769 // if (it != OptCandidates->end()--) { 1770 // FirstPoint = (*it)->BaseLine->endpoints[0]->node; 1771 // SecondPoint = (*it)->point; 1772 // // adding point 1 and point 2 and the line between them 1773 // AddTesselationPoint(FirstPoint, 0); 1774 // AddTesselationPoint(SecondPoint, 1); 1775 // AddTesselationLine(TPS[0], TPS[1], 0); 1776 // } 1777 Log() << Verbose(1) << "Projection is " << BTS->NormalVector.ScalarProduct(&Oben) << "." << endl; 1778 } 1747 BTS = NULL; 1748 AddCandidateTriangle(OptCandidates); 1749 // delete(BaseLine.endpoints[0]); 1750 // delete(BaseLine.endpoints[1]); 1751 1779 1752 if (BTS != NULL) // we have created one starting triangle 1780 1753 break; 1781 1754 else { 1782 1755 // remove all candidates from the list and then the list itself 1756 OptCandidates.pointlist.clear(); 1783 1757 } 1784 1758 } … … 2107 2081 Log() << Verbose(2) << "BaseLine is :" << *(BaseLine) << " with current candidate " << *(*Runner) << "." << endl; 2108 2082 // add the points 2109 AddTesselationPoint( (*Runner), 0);2110 AddTesselationPoint(BaseLine->endpoints[ 0]->node, 1);2111 AddTesselationPoint( BaseLine->endpoints[1]->node, 2);2083 AddTesselationPoint(BaseLine->endpoints[0]->node, 0); 2084 AddTesselationPoint(BaseLine->endpoints[1]->node, 1); 2085 AddTesselationPoint((*Runner), 2); 2112 2086 2113 2087 Center.CopyVector(&CandidateLine.OptCenter); 2114 2088 // add the lines 2115 AddTesselationLine(TPS[ 0], TPS[1], 0);2116 AddTesselationLine(TPS[ 0], TPS[2], 1);2117 AddTesselationLine(TPS[ 1], TPS[2], 2);2089 AddTesselationLine(TPS[2], TPS[0], 0); 2090 AddTesselationLine(TPS[2], TPS[1], 1); 2091 AddTesselationLine(TPS[0], TPS[1], 2); 2118 2092 2119 2093 // add the triangles
Note:
See TracChangeset
for help on using the changeset viewer.