Changeset 02bfde


Ignore:
Timestamp:
Dec 23, 2008, 1:06:36 PM (16 years ago)
Author:
Frederik Heber <heber@…>
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.
Message:

Merge branch 'ConcaveHull' of ssh://stud64dc-01/home/neuen/workspace/ESPACK into ConcaveHull

Conflicts:

molecuilder/src/boundary.cpp

+ Merge is solved (was Christian's fault :)
+ find_non_convex_hull is checked and working on Heptan boundary

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    r44fd95 r02bfde  
    13561356  LineMap::iterator LineWalker;
    13571357  //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)
    13591359  //If a line is there, how do I recognize that beyond a shadow of a doubt?
    13601360    {
     
    14211421 * @param b vector second point of triangle
    14221422 * @param c vector third point of triangle
     1423 * @param *Umkreismittelpunkt new cneter point of circumference
    14231424 * @param Direction vector indicates up/down
     1425 * @param AlternativeDirection vecotr, needed in case the triangles have 90 deg angle
    14241426 * @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
    14251428 * @param alpha double angle at a
    14261429 * @param beta double, angle at b
     
    14301433 */
    14311434
    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)
    14341437  {
    14351438    Vector TempNormal, helper;
     
    14371440    cout << Verbose(3) << "Begin of Get_center_of_sphere.\n";
    14381441    *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";
    14401445    // Here we calculated center of circumscribing circle, using barycentric coordinates
    14411446    cout << Verbose(4) << "Center of circumference is " << *Center << " in direction " << *Direction << ".\n";
     
    14461451    helper.SubtractVector(&c);
    14471452    TempNormal.VectorProduct(&helper);
    1448     if (TempNormal.ScalarProduct(Direction)<0 && HalfplaneIndicator >0 || TempNormal.ScalarProduct(Direction)>0 && HalfplaneIndicator<0)
     1453    if (fabs(HalfplaneIndicator) < MYEPSILON)
    14491454      {
    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          }
    14511466      }
    14521467
     
    14741489 * @param a first point
    14751490 * @param b second point
     1491 * *param c atom old third point of old triangle
    14761492 * @param Candidate base point along whose bonds to start looking from
    14771493 * @param Parent point to avoid during search as its wrong direction
     
    14871503 */
    14881504
    1489 void Find_next_suitable_point_via_Angle_of_Sphere(atom* a, atom* b, atom* Candidate, atom* Parent,
     1505void Find_next_suitable_point_via_Angle_of_Sphere(atom* a, atom* b, atom* c, atom* Candidate, atom* Parent,
    14901506    int RecursionLevel, Vector *Chord, Vector *direction1, Vector *OldNormal, Vector ReferencePoint,
    14911507    atom*& Opt_Candidate, double *Storage, const double RADIUS, molecule* mol)
     
    15091525  double CurrentEpsilon = 0.1;
    15101526  double alpha, beta, gamma, SideA, SideB, SideC, sign, Umkreisradius, Restradius, Distance;
    1511   double BallAngle;
     1527  double BallAngle, AlternativeSign;
    15121528  atom *Walker; // variable atom point
    15131529
    1514 
    1515   if (a != Candidate and b != Candidate)
     1530  Vector NewUmkreismittelpunkt;
     1531
     1532
     1533  if (a != Candidate and b != Candidate and c != Candidate)
    15161534    {
    15171535      cout << Verbose(3) << "We have a unique candidate!" << endl;
     
    15461564        {
    15471565          cout << Verbose(3) << "Circle of circumference would fit: " << Umkreisradius << " < " << RADIUS << "." << endl;
     1566          cout << Verbose(2) << "Candidate is "<< *Candidate << endl;
    15481567          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            }
    15511581          else
    1552             sign /= fabs(sign); // +1 if in direction of triangle plane, -1 if in other direction...
    1553           if (sign >= 0)
    15541582            {
    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             else
    15741583              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            {
    15771608              if (Storage[0]< -1.5) // first Candidate at all
    15781609                {
     
    15811612                  Opt_Candidate = Candidate;
    15821613                  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 "
    15851617                    << Storage[0] << endl;
    15861618                }
    15871619              else
    15881620                {
    1589                   if ( Storage[1] > BallAngle)
     1621                  if ( Storage[2] > BallAngle)
    15901622                    {
    15911623                      cout << Verbose(2) << "Next better candidate is " << *Candidate << " with ";
    15921624                      Opt_Candidate = Candidate;
    15931625                      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 "
    15961629                        << Storage[0] << endl;
    15971630                    }
     
    16311664
    16321665
    1633   if (RecursionLevel < 7) // Five is the recursion level threshold.
     1666  if (RecursionLevel < 9) // Seven is the recursion level threshold.
    16341667    {
    16351668      for (int i = 0; i < mol->NumberOfBondsPerAtom[Candidate->nr]; i++) // go through all bond
     
    16431676          else
    16441677            {
    1645               Find_next_suitable_point_via_Angle_of_Sphere(a, b, Walker, Candidate, RecursionLevel
     1678              Find_next_suitable_point_via_Angle_of_Sphere(a, b, c, Walker, Candidate, RecursionLevel
    16461679                  + 1, Chord, direction1, OldNormal, ReferencePoint, Opt_Candidate, Storage, RADIUS,
    16471680                  mol); //call function again
     
    19401973  double tmp;
    19411974  //atom* Walker;
    1942 
    1943   double Storage[2];
     1975  atom* OldThirdPoint;
     1976
     1977  double Storage[3];
    19441978  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.;
    19461981  atom* Opt_Candidate = NULL;
    19471982  Vector Opt_Mittelpunkt;
     
    19551990          && T.endpoints[i]->node->nr != Line.endpoints[1]->node->nr)
    19561991        {
     1992          OldThirdPoint = T.endpoints[i]->node;
    19571993          helper.SubtractVector(&T.endpoints[i]->node->x);
    19581994          break;
     
    19842020  c.SubtractVector(&(T.endpoints[0]->node->x));
    19852021
    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;
    19912037
    19922038  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;
     
    20102056  cout << Verbose(1) << "Looking for third point candidates for triangle ... " << endl;
    20112057
    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,
    20132059      Line.endpoints[0]->node, Line.endpoints[1]->node, 0, &Chord, &direction1,
    20142060      &(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,
    20162062      Line.endpoints[1]->node, Line.endpoints[0]->node, 0, &Chord, &direction1,
    20172063      &(T.NormalVector), Umkreismittelpunkt, Opt_Candidate, Storage, RADIUS, mol);
    20182064
    20192065
    2020   if ((TrianglesOnBoundaryCount % 10) == 0)
     2066      cout << "Letzter Winkel bei " << TrianglesOnBoundaryCount << " Winkel ist " << Storage[2] << endl;
     2067
     2068
     2069  if ((TrianglesOnBoundaryCount % 1) == 0)
    20212070    {
    20222071    cout << Verbose(1) << "Writing temporary non convex hull to file testEnvelope-" << TriangleFilesWritten << "d.dat.\n";
     
    20292078  }
    20302079
    2031   if (TrianglesOnBoundaryCount >1000 )
     2080  if (TrianglesOnBoundaryCount >189 and TrianglesOnBoundaryCount < 200 )
    20322081    {
    20332082      cerr << Verbose(0)
     
    20402089  cout << Verbose(2) << " Optimal candidate is " << *Opt_Candidate << endl;
    20412090
     2091  // check whether all edges of the new triangle still have space for one more triangle (i.e. TriangleCount <2)
     2092
    20422093  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  }
    20622131  cout << Verbose(1) << "End of Find_next_suitable_triangle\n";
    20632132}
     
    20652134
    20662135void 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],
    20682137    molecule* mol, double RADIUS)
    20692138{
     
    20932162              Opt_Candidate = Candidate;
    20942163              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]);
    20962165            }
    20972166          else
     
    21762245
    21772246  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];
    21792248  atom* Opt_Candidate = NULL;
    21802249  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.
    21812250  Storage[1] = 999999.; // This will be an angle looking for the third point.
     2251  Storage[2] = 999999.;
    21822252
    21832253  Find_second_point_for_Tesselation(FirstPoint, FirstPoint, FirstPoint, 0,
     
    21942264  Storage[0] = -2.; // This will indicate the quadrant.
    21952265  Storage[1] = 9999999.; // This will be an angle looking for the third point.
     2266  Storage[2] = 9999999.;
    21962267
    21972268  Chord.CopyVector(&(FirstPoint->x)); // bring into calling function
     
    22032274  Opt_Candidate = NULL;
    22042275  CenterOfFirstLine.CopyVector(&Chord);
    2205   CenterOfFirstLine.Scale(-0.5);
     2276  CenterOfFirstLine.Scale(0.5);
    22062277  CenterOfFirstLine.AddVector(&(SecondPoint->x));
    22072278
    22082279  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,
    22102281      &Chord, &helper, &Oben, CenterOfFirstLine,  Opt_Candidate, Storage, RADIUS, mol);
    22112282  // look in other direction of baseline for possible better candidate
    22122283  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,
    22142285      &Chord, &helper, &Oben, CenterOfFirstLine, Opt_Candidate, Storage, RADIUS, mol);
    22152286  cout << Verbose(1) << "Third Point is " << *Opt_Candidate << endl;
     
    22522323
    22532324  baseline = Tess->LinesOnBoundary.begin();
    2254   while ((baseline != Tess->LinesOnBoundary.end()) || (!flag))
     2325  while ((baseline != Tess->LinesOnBoundary.end()) || (flag))
    22552326    {
    22562327      if (baseline->second->TrianglesCount == 1)
     
    22632334      else
    22642335        {
    2265           cout << Verbose(1) << "Line " << &baseline << " has "
     2336          cout << Verbose(1) << "Line " << baseline->second << " has "
    22662337              << baseline->second->TrianglesCount << " triangles adjacent"
    22672338              << endl;
     
    22802351}
    22812352;
     2353
Note: See TracChangeset for help on using the changeset viewer.