Changeset 02bfde
- Timestamp:
- Dec 23, 2008, 1:06:36 PM (16 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:
- 12298c, 23e09b, cc2ee5
- Parents:
- 44fd95 (diff), 196a5a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r44fd95 r02bfde 1356 1356 LineMap::iterator LineWalker; 1357 1357 //cout << "Manually checking endpoints for line." << endl; 1358 if ((a->lines.find(b->node->nr)) ->first == b->node->nr)1358 if ((a->lines.find(b->node->nr)) != a->lines.end()) // ->first == b->node->nr) 1359 1359 //If a line is there, how do I recognize that beyond a shadow of a doubt? 1360 1360 { … … 1421 1421 * @param b vector second point of triangle 1422 1422 * @param c vector third point of triangle 1423 * @param *Umkreismittelpunkt new cneter point of circumference 1423 1424 * @param Direction vector indicates up/down 1425 * @param AlternativeDirection vecotr, needed in case the triangles have 90 deg angle 1424 1426 * @param Halfplaneindicator double indicates whether Direction is up or down 1427 * @param AlternativeIndicator doube indicates in case of orthogonal triangles which direction of AlternativeDirection is suitable 1425 1428 * @param alpha double angle at a 1426 1429 * @param beta double, angle at b … … 1430 1433 */ 1431 1434 1432 void Get_center_of_sphere(Vector* Center, Vector a, Vector b, Vector c, Vector * Direction, double HalfplaneIndicator,1433 double alpha, double beta, double gamma, double RADIUS, double Umkreisradius)1435 void Get_center_of_sphere(Vector* Center, Vector a, Vector b, Vector c, Vector *NewUmkreismittelpunkt, Vector* Direction, Vector* AlternativeDirection, 1436 double HalfplaneIndicator, double AlternativeIndicator, double alpha, double beta, double gamma, double RADIUS, double Umkreisradius) 1434 1437 { 1435 1438 Vector TempNormal, helper; … … 1437 1440 cout << Verbose(3) << "Begin of Get_center_of_sphere.\n"; 1438 1441 *Center = a * sin(2.*alpha) + b * sin(2.*beta) + c * sin(2.*gamma) ; 1439 Center->Scale(1/(sin(2*alpha) + sin(2*beta) + sin(2*gamma))); 1442 Center->Scale(1./(sin(2.*alpha) + sin(2.*beta) + sin(2.*gamma))); 1443 NewUmkreismittelpunkt->CopyVector(Center); 1444 cout << Verbose(4) << "Center of new circumference is " << *NewUmkreismittelpunkt << ".\n"; 1440 1445 // Here we calculated center of circumscribing circle, using barycentric coordinates 1441 1446 cout << Verbose(4) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n"; … … 1446 1451 helper.SubtractVector(&c); 1447 1452 TempNormal.VectorProduct(&helper); 1448 if ( TempNormal.ScalarProduct(Direction)<0 && HalfplaneIndicator >0 || TempNormal.ScalarProduct(Direction)>0 && HalfplaneIndicator<0)1453 if (fabs(HalfplaneIndicator) < MYEPSILON) 1449 1454 { 1450 TempNormal.Scale(-1); 1455 if ((TempNormal.ScalarProduct(AlternativeDirection) <0 and AlternativeIndicator >0) or (TempNormal.ScalarProduct(AlternativeDirection) >0 and AlternativeIndicator <0)) 1456 { 1457 TempNormal.Scale(-1); 1458 } 1459 } 1460 else 1461 { 1462 if (TempNormal.ScalarProduct(Direction)<0 && HalfplaneIndicator >0 || TempNormal.ScalarProduct(Direction)>0 && HalfplaneIndicator<0) 1463 { 1464 TempNormal.Scale(-1); 1465 } 1451 1466 } 1452 1467 … … 1474 1489 * @param a first point 1475 1490 * @param b second point 1491 * *param c atom old third point of old triangle 1476 1492 * @param Candidate base point along whose bonds to start looking from 1477 1493 * @param Parent point to avoid during search as its wrong direction … … 1487 1503 */ 1488 1504 1489 void Find_next_suitable_point_via_Angle_of_Sphere(atom* a, atom* b, atom* Candidate, atom* Parent,1505 void Find_next_suitable_point_via_Angle_of_Sphere(atom* a, atom* b, atom* c, atom* Candidate, atom* Parent, 1490 1506 int RecursionLevel, Vector *Chord, Vector *direction1, Vector *OldNormal, Vector ReferencePoint, 1491 1507 atom*& Opt_Candidate, double *Storage, const double RADIUS, molecule* mol) … … 1509 1525 double CurrentEpsilon = 0.1; 1510 1526 double alpha, beta, gamma, SideA, SideB, SideC, sign, Umkreisradius, Restradius, Distance; 1511 double BallAngle ;1527 double BallAngle, AlternativeSign; 1512 1528 atom *Walker; // variable atom point 1513 1529 1514 1515 if (a != Candidate and b != Candidate) 1530 Vector NewUmkreismittelpunkt; 1531 1532 1533 if (a != Candidate and b != Candidate and c != Candidate) 1516 1534 { 1517 1535 cout << Verbose(3) << "We have a unique candidate!" << endl; … … 1546 1564 { 1547 1565 cout << Verbose(3) << "Circle of circumference would fit: " << Umkreisradius << " < " << RADIUS << "." << endl; 1566 cout << Verbose(2) << "Candidate is "<< *Candidate << endl; 1548 1567 sign = AngleCheck.ScalarProduct(direction1); 1549 if (fabs(sign) < MYEPSILON) 1550 sign = 0; 1568 if (fabs(sign)<MYEPSILON) 1569 { 1570 if (AngleCheck.ScalarProduct(OldNormal)<0) 1571 { 1572 sign =0; 1573 AlternativeSign=1; 1574 } 1575 else 1576 { 1577 sign =0; 1578 AlternativeSign=-1; 1579 } 1580 } 1551 1581 else 1552 sign /= fabs(sign); // +1 if in direction of triangle plane, -1 if in other direction...1553 if (sign >= 0)1554 1582 { 1555 cout << Verbose(3) << "Candidate is in search direction: " << sign << "." << endl;1556 1557 Get_center_of_sphere(&Mittelpunkt, (a->x), (b->x), (Candidate->x), OldNormal, sign, alpha, beta, gamma, RADIUS, Umkreisradius);1558 1559 AngleCheck.CopyVector(&ReferencePoint);1560 AngleCheck.Scale(-1);1561 //cout << "AngleCheck is " << AngleCheck.x[0] << " "<< AngleCheck.x[1] << " "<< AngleCheck.x[2] << " "<< endl;1562 AngleCheck.AddVector(&Mittelpunkt);1563 //cout << "AngleCheck is " << AngleCheck.x[0] << " "<< AngleCheck.x[1] << " "<< AngleCheck.x[2] << " "<< endl;1564 cout << Verbose(4) << "Reference vector to sphere's center is " << AngleCheck << "." << endl;1565 1566 BallAngle = AngleCheck.Angle(OldNormal);1567 cout << Verbose(3) << "Angle between normal of base triangle and center of ball sphere is :" << BallAngle << "." << endl;1568 // cout << "direction1 is " << direction1->x[0] <<" "<< direction1->x[1] <<" "<< direction1->x[2] <<" " << endl;1569 // cout << "AngleCheck is " << AngleCheck.x[0] << " "<< AngleCheck.x[1] << " "<< AngleCheck.x[2] << " "<< endl;1570 sign = AngleCheck.ScalarProduct(direction1);1571 if (fabs(sign) < MYEPSILON)1572 sign = 0;1573 else1574 1583 sign /= fabs(sign); 1575 1576 1584 cout << Verbose(3) << "Candidate is in search direction: " << sign << "." << endl; 1585 } 1586 1587 Get_center_of_sphere(&Mittelpunkt, (a->x), (b->x), (Candidate->x), &NewUmkreismittelpunkt, OldNormal, direction1, sign, AlternativeSign, alpha, beta, gamma, RADIUS, Umkreisradius); 1588 1589 AngleCheck.CopyVector(&ReferencePoint); 1590 AngleCheck.Scale(-1); 1591 //cout << "AngleCheck is " << AngleCheck.x[0] << " "<< AngleCheck.x[1] << " "<< AngleCheck.x[2] << " "<< endl; 1592 AngleCheck.AddVector(&Mittelpunkt); 1593 //cout << "AngleCheck is " << AngleCheck.x[0] << " "<< AngleCheck.x[1] << " "<< AngleCheck.x[2] << " "<< endl; 1594 cout << Verbose(4) << "Reference vector to sphere's center is " << AngleCheck << "." << endl; 1595 1596 BallAngle = AngleCheck.Angle(OldNormal); 1597 cout << Verbose(3) << "Angle between normal of base triangle and center of ball sphere is :" << BallAngle << "." << endl; 1598 1599 //cout << "direction1 is " << direction1->x[0] <<" "<< direction1->x[1] <<" "<< direction1->x[2] <<" " << endl; 1600 //cout << "AngleCheck is " << AngleCheck.x[0] << " "<< AngleCheck.x[1] << " "<< AngleCheck.x[2] << " "<< endl; 1601 1602 cout << Verbose(3) << "BallAngle is " << BallAngle << " Sign is " << sign << endl; 1603 1604 NewUmkreismittelpunkt.SubtractVector(&ReferencePoint); 1605 1606 if ((AngleCheck.ScalarProduct(direction1) >=0) || (fabs(NewUmkreismittelpunkt.Norm()) < MYEPSILON)) 1607 { 1577 1608 if (Storage[0]< -1.5) // first Candidate at all 1578 1609 { … … 1581 1612 Opt_Candidate = Candidate; 1582 1613 Storage[0] = sign; 1583 Storage[1] = BallAngle; 1584 cout << " angle " << Storage[1] << " and Up/Down " 1614 Storage[1] = AlternativeSign; 1615 Storage[2] = BallAngle; 1616 cout << " angle " << Storage[2] << " and Up/Down " 1585 1617 << Storage[0] << endl; 1586 1618 } 1587 1619 else 1588 1620 { 1589 if ( Storage[ 1] > BallAngle)1621 if ( Storage[2] > BallAngle) 1590 1622 { 1591 1623 cout << Verbose(2) << "Next better candidate is " << *Candidate << " with "; 1592 1624 Opt_Candidate = Candidate; 1593 1625 Storage[0] = sign; 1594 Storage[1] = BallAngle; 1595 cout << " angle " << Storage[1] << " and Up/Down " 1626 Storage[1] = AlternativeSign; 1627 Storage[2] = BallAngle; 1628 cout << " angle " << Storage[2] << " and Up/Down " 1596 1629 << Storage[0] << endl; 1597 1630 } … … 1631 1664 1632 1665 1633 if (RecursionLevel < 7) // Fiveis the recursion level threshold.1666 if (RecursionLevel < 9) // Seven is the recursion level threshold. 1634 1667 { 1635 1668 for (int i = 0; i < mol->NumberOfBondsPerAtom[Candidate->nr]; i++) // go through all bond … … 1643 1676 else 1644 1677 { 1645 Find_next_suitable_point_via_Angle_of_Sphere(a, b, Walker, Candidate, RecursionLevel1678 Find_next_suitable_point_via_Angle_of_Sphere(a, b, c, Walker, Candidate, RecursionLevel 1646 1679 + 1, Chord, direction1, OldNormal, ReferencePoint, Opt_Candidate, Storage, RADIUS, 1647 1680 mol); //call function again … … 1940 1973 double tmp; 1941 1974 //atom* Walker; 1942 1943 double Storage[2]; 1975 atom* OldThirdPoint; 1976 1977 double Storage[3]; 1944 1978 Storage[0] = -2.; // This direction is either +1 or -1 one, so any result will take precedence over initial values 1945 Storage[1] = 9999999.; // This is also lower then any value produced by an eligible atom, which are all positive 1979 Storage[1] = -2.; // This is also lower then any value produced by an eligible atom, which are all positive 1980 Storage[2] = 9999999.; 1946 1981 atom* Opt_Candidate = NULL; 1947 1982 Vector Opt_Mittelpunkt; … … 1955 1990 && T.endpoints[i]->node->nr != Line.endpoints[1]->node->nr) 1956 1991 { 1992 OldThirdPoint = T.endpoints[i]->node; 1957 1993 helper.SubtractVector(&T.endpoints[i]->node->x); 1958 1994 break; … … 1984 2020 c.SubtractVector(&(T.endpoints[0]->node->x)); 1985 2021 1986 alpha = a.Angle(&c) - M_PI/2.; 1987 beta = b.Angle(&a); 1988 gamma = c.Angle(&b) - M_PI/2.; 1989 if (fabs(M_PI - alpha - beta - gamma) > MYEPSILON) 1990 cerr << Verbose(0) << "WARNING: sum of angles for candidate triangle " << (alpha + beta + gamma)/M_PI*180. << " != 180.\n"; 2022 // alpha = a.Angle(&c) - M_PI/2.; 2023 // beta = b.Angle(&a); 2024 // gamma = c.Angle(&b) - M_PI/2.; 2025 alpha = M_PI - a.Angle(&c); 2026 beta = M_PI - b.Angle(&a); 2027 gamma = M_PI - c.Angle(&b); 2028 if (fabs(M_PI - alpha - beta - gamma) > MYEPSILON) 2029 cerr << Verbose(0) << "WARNING: sum of angles for candidate triangle " << (alpha + beta + gamma)/M_PI*180. << " != 180.\n"; 2030 2031 Umkreismittelpunkt = (T.endpoints[0]->node->x) * sin(2.*alpha) + T.endpoints[1]->node->x * sin(2.*beta) + (T.endpoints[2]->node->x) * sin(2.*gamma) ; 2032 //cout << "UmkreisMittelpunkt is " << Umkreismittelpunkt.x[0] << " "<< Umkreismittelpunkt.x[1] << " "<< Umkreismittelpunkt.x[2] << " "<< endl; 2033 Umkreismittelpunkt.Scale(1/(sin(2*alpha) + sin(2*beta) + sin(2*gamma))); 2034 cout << "UmkreisMittelpunkt is " << Umkreismittelpunkt.x[0] << " "<< Umkreismittelpunkt.x[1] << " "<< Umkreismittelpunkt.x[2] << " "<< endl; 2035 cout << " We look over line " << Line << " in direction " << direction1.x[0] << " " << direction1.x[1] << " " << direction1.x[2] << " " << endl; 2036 cout << " Old Normal is " << (T.NormalVector.x)[0] << " " << T.NormalVector.x[1] << " " << (T.NormalVector.x)[2] << " " << endl; 1991 2037 1992 2038 cout << Verbose(2) << "Base triangle has sides " << a << ", " << b << ", " << c << " with angles " << alpha/M_PI*180. << ", " << beta/M_PI*180. << ", " << gamma/M_PI*180. << "." << endl; … … 2010 2056 cout << Verbose(1) << "Looking for third point candidates for triangle ... " << endl; 2011 2057 2012 Find_next_suitable_point_via_Angle_of_Sphere(Line.endpoints[0]->node, Line.endpoints[1]->node, 2058 Find_next_suitable_point_via_Angle_of_Sphere(Line.endpoints[0]->node, Line.endpoints[1]->node, OldThirdPoint, 2013 2059 Line.endpoints[0]->node, Line.endpoints[1]->node, 0, &Chord, &direction1, 2014 2060 &(T.NormalVector), Umkreismittelpunkt, Opt_Candidate, Storage, RADIUS, mol); 2015 Find_next_suitable_point_via_Angle_of_Sphere(Line.endpoints[0]->node, Line.endpoints[1]->node, 2061 Find_next_suitable_point_via_Angle_of_Sphere(Line.endpoints[0]->node, Line.endpoints[1]->node, OldThirdPoint, 2016 2062 Line.endpoints[1]->node, Line.endpoints[0]->node, 0, &Chord, &direction1, 2017 2063 &(T.NormalVector), Umkreismittelpunkt, Opt_Candidate, Storage, RADIUS, mol); 2018 2064 2019 2065 2020 if ((TrianglesOnBoundaryCount % 10) == 0) 2066 cout << "Letzter Winkel bei " << TrianglesOnBoundaryCount << " Winkel ist " << Storage[2] << endl; 2067 2068 2069 if ((TrianglesOnBoundaryCount % 1) == 0) 2021 2070 { 2022 2071 cout << Verbose(1) << "Writing temporary non convex hull to file testEnvelope-" << TriangleFilesWritten << "d.dat.\n"; … … 2029 2078 } 2030 2079 2031 if (TrianglesOnBoundaryCount >1 000 )2080 if (TrianglesOnBoundaryCount >189 and TrianglesOnBoundaryCount < 200 ) 2032 2081 { 2033 2082 cerr << Verbose(0) … … 2040 2089 cout << Verbose(2) << " Optimal candidate is " << *Opt_Candidate << endl; 2041 2090 2091 // check whether all edges of the new triangle still have space for one more triangle (i.e. TriangleCount <2) 2092 2042 2093 AddTrianglePoint(Opt_Candidate, 0); 2043 AddTrianglePoint(Line.endpoints[0]->node, 1); 2044 AddTrianglePoint(Line.endpoints[1]->node, 2); 2045 2046 AddTriangleLine(TPS[0], TPS[1], 0); 2047 AddTriangleLine(TPS[0], TPS[2], 1); 2048 AddTriangleLine(TPS[1], TPS[2], 2); 2049 2050 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 2051 AddTriangleToLines(); 2052 2053 BTS->GetNormalVector(T.NormalVector); 2054 2055 // if ((BTS->NormalVector.ScalarProduct(&(T.NormalVector)) < 0 && Storage[0] > 0) || 2056 // (BTS->NormalVector.ScalarProduct(&(T.NormalVector)) > 0 && Storage[0] < 0)) 2057 // { 2058 // BTS->NormalVector.Scale(-1); 2059 // }; 2060 cout << Verbose(2) << "New triangle with " << *BTS << "and normal vector " << BTS->NormalVector << " for this triangle ... " << endl; 2061 cout << Verbose(2) << "We have "<< TrianglesOnBoundaryCount << " for line " << Line << "." << endl; 2094 LineMap::iterator TryAndError; 2095 TryAndError = TPS[0]->lines.find(Line.endpoints[0]->node->nr); 2096 bool flag = true; 2097 if ((TryAndError != TPS[0]->lines.end()) && (TryAndError->second->TrianglesCount > 1)) 2098 flag = false; 2099 TryAndError = TPS[0]->lines.find(Line.endpoints[1]->node->nr); 2100 if ((TryAndError != TPS[0]->lines.end()) && (TryAndError->second->TrianglesCount > 1)) 2101 flag = false; 2102 2103 if (flag) { // if so, add 2104 AddTrianglePoint(Line.endpoints[0]->node, 1); 2105 AddTrianglePoint(Line.endpoints[1]->node, 2); 2106 2107 AddTriangleLine(TPS[0], TPS[1], 0); 2108 AddTriangleLine(TPS[0], TPS[2], 1); 2109 AddTriangleLine(TPS[1], TPS[2], 2); 2110 2111 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 2112 AddTriangleToLines(); 2113 2114 BTS->GetNormalVector(BTS->NormalVector); 2115 2116 if ((BTS->NormalVector.ScalarProduct(&(T.NormalVector)) < 0 && Storage[0] > 0) || 2117 (BTS->NormalVector.ScalarProduct(&(T.NormalVector)) > 0 && Storage[0] < 0) || 2118 (fabs(Storage[0]) < MYEPSILON && Storage[1]*BTS->NormalVector.ScalarProduct(&direction1) < 0) ) 2119 2120 { 2121 BTS->NormalVector.Scale(-1); 2122 }; 2123 cout << Verbose(2) << "New triangle with " << *BTS << "and normal vector " << BTS->NormalVector << " for this triangle ... " << endl; 2124 cout << Verbose(2) << "We have "<< TrianglesOnBoundaryCount << " for line " << Line << "." << endl; 2125 } else { // else, yell and do nothing 2126 cout << Verbose(2) << "This triangle consisting of "; 2127 for (int i=0;i<NDIM;i++) 2128 cout << BLS[i] << "(" << BLS[i]->TrianglesCount << "), "; 2129 cout << " is invalid!" << endl; 2130 } 2062 2131 cout << Verbose(1) << "End of Find_next_suitable_triangle\n"; 2063 2132 } … … 2065 2134 2066 2135 void Find_second_point_for_Tesselation(atom* a, atom* Candidate, atom* Parent, 2067 int RecursionLevel, Vector Oben, atom*& Opt_Candidate, double Storage[ 2],2136 int RecursionLevel, Vector Oben, atom*& Opt_Candidate, double Storage[3], 2068 2137 molecule* mol, double RADIUS) 2069 2138 { … … 2093 2162 Opt_Candidate = Candidate; 2094 2163 Storage[0] = AngleCheck.Angle(&Oben); 2095 //cout << Verbose(1) << "Changing something in Storage: %lf %lf. \n", Storage[0], Storage[ 1]);2164 //cout << Verbose(1) << "Changing something in Storage: %lf %lf. \n", Storage[0], Storage[2]); 2096 2165 } 2097 2166 else … … 2176 2245 2177 2246 cout << Verbose(1) << "Coordinates of start atom " << *FirstPoint << " at " << FirstPoint->x << " with " << mol->NumberOfBondsPerAtom[FirstPoint->nr] << " bonds." << endl; 2178 double Storage[ 2];2247 double Storage[3]; 2179 2248 atom* Opt_Candidate = NULL; 2180 2249 Storage[0] = 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. 2181 2250 Storage[1] = 999999.; // This will be an angle looking for the third point. 2251 Storage[2] = 999999.; 2182 2252 2183 2253 Find_second_point_for_Tesselation(FirstPoint, FirstPoint, FirstPoint, 0, … … 2194 2264 Storage[0] = -2.; // This will indicate the quadrant. 2195 2265 Storage[1] = 9999999.; // This will be an angle looking for the third point. 2266 Storage[2] = 9999999.; 2196 2267 2197 2268 Chord.CopyVector(&(FirstPoint->x)); // bring into calling function … … 2203 2274 Opt_Candidate = NULL; 2204 2275 CenterOfFirstLine.CopyVector(&Chord); 2205 CenterOfFirstLine.Scale( -0.5);2276 CenterOfFirstLine.Scale(0.5); 2206 2277 CenterOfFirstLine.AddVector(&(SecondPoint->x)); 2207 2278 2208 2279 cout << Verbose(1) << "Looking for third point candidates from " << *FirstPoint << " onward ...\n"; 2209 Find_next_suitable_point_via_Angle_of_Sphere(FirstPoint, SecondPoint, SecondPoint, FirstPoint, 0,2280 Find_next_suitable_point_via_Angle_of_Sphere(FirstPoint, SecondPoint, SecondPoint, SecondPoint, FirstPoint, 0, 2210 2281 &Chord, &helper, &Oben, CenterOfFirstLine, Opt_Candidate, Storage, RADIUS, mol); 2211 2282 // look in other direction of baseline for possible better candidate 2212 2283 cout << Verbose(1) << "Looking for third point candidates from " << *SecondPoint << " onward ...\n"; 2213 Find_next_suitable_point_via_Angle_of_Sphere(FirstPoint, SecondPoint, FirstPoint, SecondPoint, 0,2284 Find_next_suitable_point_via_Angle_of_Sphere(FirstPoint, SecondPoint, SecondPoint, FirstPoint, SecondPoint, 0, 2214 2285 &Chord, &helper, &Oben, CenterOfFirstLine, Opt_Candidate, Storage, RADIUS, mol); 2215 2286 cout << Verbose(1) << "Third Point is " << *Opt_Candidate << endl; … … 2252 2323 2253 2324 baseline = Tess->LinesOnBoundary.begin(); 2254 while ((baseline != Tess->LinesOnBoundary.end()) || ( !flag))2325 while ((baseline != Tess->LinesOnBoundary.end()) || (flag)) 2255 2326 { 2256 2327 if (baseline->second->TrianglesCount == 1) … … 2263 2334 else 2264 2335 { 2265 cout << Verbose(1) << "Line " << &baseline<< " has "2336 cout << Verbose(1) << "Line " << baseline->second << " has " 2266 2337 << baseline->second->TrianglesCount << " triangles adjacent" 2267 2338 << endl; … … 2280 2351 } 2281 2352 ; 2353
Note:
See TracChangeset
for help on using the changeset viewer.