Changeset 10af0d
- Timestamp:
- Dec 17, 2008, 3:56:07 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:
- e9fa06f
- Parents:
- e4ea46
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
re4ea46 r10af0d 1444 1444 /* OldNormal is normal vector on the old triangle 1445 1445 * d1 is normal on the triangle line, from which we come, as well as on OldNormal. 1446 * Chord points from a to b.1446 * Chord points from b to a!!! 1447 1447 */ 1448 1448 Vector dif_a; //Vector from a to candidate … … 1495 1495 1496 1496 Umkreisradius = SideA / 2.0 / sin(alpha); 1497 cout << Umkreisradius << endl;1498 cout << SideB / 2.0 / sin(beta) << endl;1499 cout << SideC / 2.0 / sin(gamma) << endl;1497 //cout << Umkreisradius << endl; 1498 //cout << SideB / 2.0 / sin(beta) << endl; 1499 //cout << SideC / 2.0 / sin(gamma) << endl; 1500 1500 1501 1501 if (Umkreisradius < RADIUS) … … 1510 1510 Umkreismittelpunkt.Scale(1/(sin(2*alpha) + sin(2*beta) + sin(2*gamma))); 1511 1511 1512 cout << "Umkreismittelpunkt has coordinates" << Umkreismittelpunkt.x[0] << " "<< Umkreismittelpunkt.x[1] <<" "<<Umkreismittelpunkt.x[2] << endl;1513 cout << "Candidate has coordinates" << Candidate->x.x[0]<< " " << Candidate->x.x[1] << " " << Candidate->x.x[2] << endl;1514 cout << "a has coordinates" << a->x.x[0]<< " " << a->x.x[1] << " " << a->x.x[2] << endl;1515 cout << "b has coordinates" << b->x.x[0]<< " " << b->x.x[1] << " " << b->x.x[2] << endl;1516 1512 1517 1513 TempNormal.CopyVector(&dif_a); … … 1523 1519 TempNormal.Normalize(); 1524 1520 Restradius = sqrt(RADIUS*RADIUS - Umkreisradius*Umkreisradius); 1525 cout << "Umkreisradius ist " << Umkreisradius << endl; 1526 cout << "Restradius ist " << Restradius << endl; 1521 1527 1522 TempNormal.Scale(Restradius); 1528 cout << "TempNormal has coordinates " << TempNormal.x[0] << " " << TempNormal.x[1] << " " << TempNormal.x[2] << " " << endl; 1523 1529 1524 Mittelpunkt.CopyVector(&Umkreismittelpunkt); 1530 1525 Mittelpunkt.AddVector(&TempNormal); //this is center of sphere supported by a, b and Candidate 1531 cout << "Mittelpunkt has coordinates" << Mittelpunkt.x[0] << " " << Mittelpunkt.x[1]<< " " <<Mittelpunkt.x[2] << endl; 1532 cout << "Dist a to UmkreisMittelpunkt " << a->x.Distance(&Umkreismittelpunkt) << endl; 1533 cout << "Dist b to UmkreisMittelpunkt " << b->x.Distance(&Umkreismittelpunkt) << endl; 1534 cout << "Dist Candidate to UmkreisMittelpunkt " << Candidate->x.Distance(&Umkreismittelpunkt) << endl; 1535 cout << "Dist a to Mittelpunkt " << a->x.Distance(&Mittelpunkt) << endl; 1536 cout << "Dist b to Mittelpunkt " << b->x.Distance(&Mittelpunkt) << endl; 1537 cout << "Dist Candidate to Mittelpunkt " << Candidate->x.Distance(&Mittelpunkt) << endl; 1526 1527 1538 1528 1539 1529 if (Storage[0]< -1.5) // first Candidate at all … … 1547 1537 cout << "Angle is " << Storage[1] << ", Halbraum ist " 1548 1538 << Storage[0] << endl; 1539 1540 1549 1541 } 1550 1542 else … … 1554 1546 1555 1547 Distance = Opt_Candidate->x.Distance(&Mittelpunkt); 1556 cout << "Opt_Candidate " << Opt_Candidate << " has distance " << Distance << " to Center of Candidate " << endl;1548 //cout << "Opt_Candidate " << Opt_Candidate << " has distance " << Distance << " to Center of Candidate " << endl; 1557 1549 1558 1550 1559 1551 if (Distance >RADIUS) // We have no interference and may now check whether the new point is better. 1560 1552 { 1561 cout << "Atom " << Candidate << " has distance " << Candidate->x.Distance(Opt_Mittelpunkt) << " to Center of Candidate " << endl;1562 1563 if (( Storage[0] < 0 && fabs(sign - Storage[0]) > CurrentEpsilon))//|| //This will give absolute preference to those in "right-hand" quadrants1564 //sqrt(Candidate->x.Distance(Opt_Mittelpunkt)) < RADIUS) //and those where Candidate would be within old Sphere.1553 //cout << "Atom " << Candidate << " has distance " << Candidate->x.Distance(Opt_Mittelpunkt) << " to Center of Candidate " << endl; 1554 1555 if (((Storage[0] < 0 && fabs(sign - Storage[0]) > CurrentEpsilon)) || //This will give absolute preference to those in "right-hand" quadrants 1556 (Candidate->x.Distance(Opt_Mittelpunkt) < RADIUS)) //and those where Candidate would be within old Sphere. 1565 1557 { 1566 1558 cout << "Next better candidate is " << *Candidate << " with "; … … 1571 1563 cout << "Angle is " << Storage[1] << ", Halbraum ist " 1572 1564 << Storage[0] << endl; 1565 /* 1566 cout << "Umkreismittelpunkt has coordinates" << Umkreismittelpunkt.x[0] << " "<< Umkreismittelpunkt.x[1] <<" "<<Umkreismittelpunkt.x[2] << endl; 1567 cout << "Candidate has coordinates" << Candidate->x.x[0]<< " " << Candidate->x.x[1] << " " << Candidate->x.x[2] << endl; 1568 cout << "a has coordinates" << a->x.x[0]<< " " << a->x.x[1] << " " << a->x.x[2] << endl; 1569 cout << "b has coordinates" << b->x.x[0]<< " " << b->x.x[1] << " " << b->x.x[2] << endl; 1570 cout << "Mittelpunkt has coordinates" << Mittelpunkt.x[0] << " " << Mittelpunkt.x[1]<< " " <<Mittelpunkt.x[2] << endl; 1571 cout << "Umkreisradius ist " << Umkreisradius << endl; 1572 cout << "Restradius ist " << Restradius << endl; 1573 cout << "TempNormal has coordinates " << TempNormal.x[0] << " " << TempNormal.x[1] << " " << TempNormal.x[2] << " " << endl; 1574 cout << "OldNormal has coordinates " << OldNormal->x[0] << " " << OldNormal->x[1] << " " << OldNormal->x[2] << " " << endl; 1575 cout << "Dist a to UmkreisMittelpunkt " << a->x.Distance(&Umkreismittelpunkt) << endl; 1576 cout << "Dist b to UmkreisMittelpunkt " << b->x.Distance(&Umkreismittelpunkt) << endl; 1577 cout << "Dist Candidate to UmkreisMittelpunkt " << Candidate->x.Distance(&Umkreismittelpunkt) << endl; 1578 cout << "Dist a to Mittelpunkt " << a->x.Distance(&Mittelpunkt) << endl; 1579 cout << "Dist b to Mittelpunkt " << b->x.Distance(&Mittelpunkt) << endl; 1580 cout << "Dist Candidate to Mittelpunkt " << Candidate->x.Distance(&Mittelpunkt) << endl; 1581 */ 1582 1573 1583 } 1574 1584 else … … 1592 1602 else 1593 1603 { 1594 if (DEBUG) 1595 cout << "Looses to better candidate" << endl; 1604 if (sign>0 && AngleCheck.Angle(OldNormal)>0 && Storage[0]<0) 1605 { 1606 cout << "Next better candidate is " << *Candidate << " with "; 1607 Opt_Candidate = Candidate; 1608 Storage[0] = sign; 1609 Storage[1] = AngleCheck.Angle(OldNormal); 1610 Opt_Mittelpunkt->CopyVector(&Mittelpunkt); 1611 cout << "Angle is " << Storage[1] << ", Halbraum ist " 1612 << Storage[0] << endl; 1613 1614 /* 1615 cout << "Umkreismittelpunkt has coordinates" << Umkreismittelpunkt.x[0] << " "<< Umkreismittelpunkt.x[1] <<" "<<Umkreismittelpunkt.x[2] << endl; 1616 cout << "Candidate has coordinates" << Candidate->x.x[0]<< " " << Candidate->x.x[1] << " " << Candidate->x.x[2] << endl; 1617 cout << "a has coordinates" << a->x.x[0]<< " " << a->x.x[1] << " " << a->x.x[2] << endl; 1618 cout << "b has coordinates" << b->x.x[0]<< " " << b->x.x[1] << " " << b->x.x[2] << endl; 1619 cout << "Mittelpunkt has coordinates" << Mittelpunkt.x[0] << " " << Mittelpunkt.x[1]<< " " <<Mittelpunkt.x[2] << endl; 1620 cout << "Umkreisradius ist " << Umkreisradius << endl; 1621 cout << "Restradius ist " << Restradius << endl; 1622 cout << "TempNormal has coordinates " << TempNormal.x[0] << " " << TempNormal.x[1] << " " << TempNormal.x[2] << " " << endl; 1623 cout << "OldNormal has coordinates " << OldNormal->x[0] << " " << OldNormal->x[1] << " " << OldNormal->x[2] << " " << endl; 1624 cout << "Dist a to UmkreisMittelpunkt " << a->x.Distance(&Umkreismittelpunkt) << endl; 1625 cout << "Dist b to UmkreisMittelpunkt " << b->x.Distance(&Umkreismittelpunkt) << endl; 1626 cout << "Dist Candidate to UmkreisMittelpunkt " << Candidate->x.Distance(&Umkreismittelpunkt) << endl; 1627 cout << "Dist a to Mittelpunkt " << a->x.Distance(&Mittelpunkt) << endl; 1628 cout << "Dist b to Mittelpunkt " << b->x.Distance(&Mittelpunkt) << endl; 1629 cout << "Dist Candidate to Mittelpunkt " << Candidate->x.Distance(&Mittelpunkt) << endl; 1630 */ 1631 1632 1633 } 1634 else 1635 { 1636 if (DEBUG) 1637 cout << "Looses to better candidate" << endl; 1638 } 1596 1639 } 1597 1640 } … … 1612 1655 } 1613 1656 1614 if (RecursionLevel < 7) // Five is the recursion level threshold.1657 if (RecursionLevel < 9) // Five is the recursion level threshold. 1615 1658 { 1616 1659 for (int i = 0; i < mol->NumberOfBondsPerAtom[Candidate->nr]; i++) // go through all bond … … 1685 1728 Chord.SubtractVector(&(Line.endpoints[1]->node->x)); 1686 1729 1687 cout << Verbose(1) << "Looking for third point candidates for triangle ... " 1688 << endl; 1730 cout << Verbose(1) << "Looking for third point candidates for triangle ... " << endl; 1731 1689 1732 Find_next_suitable_point(Line.endpoints[0]->node, Line.endpoints[1]->node, 1690 1733 Line.endpoints[0]->node, Line.endpoints[1]->node, 0, &Chord, &direction1, … … 1693 1736 Line.endpoints[1]->node, Line.endpoints[0]->node, 0, &Chord, &direction1, 1694 1737 &(T.NormalVector), Opt_Candidate, &Opt_Mittelpunkt, Storage, RADIUS, mol); 1738 1695 1739 1696 1740 if ((TrianglesOnBoundaryCount % 10) == 0) … … 1704 1748 } 1705 1749 1706 if ( (Opt_Candidate == NULL) || (N<12))1750 if (TrianglesOnBoundaryCount >1000 ) 1707 1751 { 1708 1752 cout << Verbose(1) 1709 1753 << "No new Atom found, triangle construction will crash" << endl; 1710 1754 write_tecplot_file(out, tecplot, this, mol, TriangleFilesWritten); 1711 Find_next_suitable_point(Line.endpoints[0]->node, 1712 Line.endpoints[1]->node, Line.endpoints[0]->node, 1713 Line.endpoints[1]->node, 0, &Chord, &direction1, &(T.NormalVector), 1714 Opt_Candidate, &Opt_Mittelpunkt, Storage, RADIUS, mol); 1715 Find_next_suitable_point(Line.endpoints[0]->node, 1716 Line.endpoints[1]->node, Line.endpoints[1]->node, 1717 Line.endpoints[0]->node, 0, &Chord, &direction1, &(T.NormalVector), 1718 Opt_Candidate, &Opt_Mittelpunkt, Storage, RADIUS, mol); 1755 cout << "This is currently added candidate" << Opt_Candidate << endl; 1719 1756 } 1720 1757 // Konstruiere nun neues Dreieck am Ende der Liste der Dreiecke … … 1733 1770 AddTriangleToLines(); 1734 1771 cout << "New triangle with " << *BTS << endl; 1735 1736 cout << Verbose(1) << "Constructing normal vector for this triangle ... " 1737 << endl; 1772 cout << "We have "<< TrianglesOnBoundaryCount << endl; 1773 cout << Verbose(1) << "Constructing normal vector for this triangle ... " << endl; 1738 1774 1739 1775 BTS->GetNormalVector(BTS->NormalVector); 1740 1776 1741 if ((BTS->NormalVector.ScalarProduct(&(T.NormalVector)) < 0 && Storage[0] > 0) 1742 || ((BTS->NormalVector.ScalarProduct(&(T.NormalVector)) > 0 && Storage[0] 1743 < 0))) 1777 if ((BTS->NormalVector.ScalarProduct(&(T.NormalVector)) < 0 && Storage[0] > 0) || 1778 (BTS->NormalVector.ScalarProduct(&(T.NormalVector)) > 0 && Storage[0] < 0)) 1744 1779 { 1745 1780 BTS->NormalVector.Scale(-1);
Note:
See TracChangeset
for help on using the changeset viewer.