Changeset 86234b for src/boundary.cpp
- Timestamp:
- Jul 9, 2009, 9:45:00 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:
- 542ab3
- Parents:
- 018741
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/boundary.cpp
r018741 r86234b 8 8 9 9 #define DEBUG 1 10 #define DoSingleStepOutput 110 #define DoSingleStepOutput 0 11 11 #define DoTecplotOutput 1 12 #define DoRaster3DOutput 112 #define DoRaster3DOutput 0 13 13 #define DoVRMLOutput 1 14 14 #define TecplotSuffix ".dat" … … 45 45 void BoundaryPointSet::AddLine(class BoundaryLineSet *line) 46 46 { 47 cout << Verbose(6) << "Adding " << *this << " to line " << *line << "." 48 << endl; 47 cout << Verbose(6) << "Adding line " << *line << " to " << *this << "." << endl; 49 48 if (line->endpoints[0] == this) 50 49 { … … 100 99 for (int i = 0; i < 2; i++) { 101 100 cout << Verbose(5) << "Erasing Line Nr. " << Nr << " in boundary point " << *endpoints[i] << "." << endl; 102 endpoints[i]->lines.erase(Numbers[i]); 101 // as there may be multiple lines with same endpoints, we have to go through each and find in the endpoint's line list this line set 102 pair<LineMap::iterator, LineMap::iterator> erasor = endpoints[i]->lines.equal_range(Numbers[i]); 103 for (LineMap::iterator Runner = erasor.first; Runner != erasor.second; Runner++) 104 if ((*Runner).second == this) { 105 endpoints[i]->lines.erase(Runner); 106 break; 107 } 103 108 if (endpoints[i]->lines.empty()) { 104 109 cout << Verbose(5) << *endpoints[i] << " has no more lines it's attached to, erasing." << endl; … … 196 201 lines[i]->triangles.erase(Nr); 197 202 if (lines[i]->triangles.empty()) { 198 cout << Verbose(5) << *lines[i] << " is no more attached to any triangle, erasing." << endl;199 203 if (lines[i] != NULL) { 204 cout << Verbose(5) << *lines[i] << " is no more attached to any triangle, erasing." << endl; 200 205 delete (lines[i]); 201 206 lines[i] = NULL; … … 203 208 cerr << "ERROR: This line " << i << " has already been free'd." << endl; 204 209 } else 205 cout << Verbose(5) << *lines[i] << " is still attached to a triangle." << endl;210 cout << Verbose(5) << *lines[i] << " is still attached to another triangle." << endl; 206 211 } 207 212 } … … 1471 1476 TPS[n] = new class BoundaryPointSet(Candidate); 1472 1477 InsertUnique = PointsOnBoundary.insert(PointPair(Candidate->nr, TPS[n])); 1473 if (InsertUnique.second) // if new point was not present before, increase counter 1474 { 1475 PointsOnBoundaryCount++; 1476 } 1477 else 1478 { 1479 delete TPS[n]; 1480 cout << Verbose(2) << "Atom " << *((InsertUnique.first)->second->node) 1481 << " gibt's schon in der PointMap." << endl; 1482 TPS[n] = (InsertUnique.first)->second; 1483 } 1478 if (InsertUnique.second) { // if new point was not present before, increase counter 1479 PointsOnBoundaryCount++; 1480 } else { 1481 delete TPS[n]; 1482 cout << Verbose(2) << "Atom " << *((InsertUnique.first)->second->node) << " is already present in PointsOnBoundary." << endl; 1483 TPS[n] = (InsertUnique.first)->second; 1484 } 1484 1485 } 1485 1486 ; … … 1504 1505 if (FindLine->second->TrianglesCount < 2) { 1505 1506 insertNewLine = false; 1506 cout << Verbose(2) 1507 << "Using existing line " << *FindLine->second << endl; 1507 cout << Verbose(2) << "Using existing line " << *FindLine->second << endl; 1508 1508 1509 1509 BPS[0] = FindLine->second->endpoints[0]; … … 1532 1532 void Tesselation::AlwaysAddTriangleLine(class BoundaryPointSet *a, class BoundaryPointSet *b, int n) 1533 1533 { 1534 cout << Verbose(2) 1535 << "Adding line which has not been used before between " 1536 << *(a->node) << " and " << *(b->node) << "." << endl; 1534 cout << Verbose(2) << "Adding line between " << *(a->node) << " and " << *(b->node) << "." << endl; 1537 1535 BPS[0] = a; 1538 1536 BPS[1] = b; 1539 BLS[n] = new class BoundaryLineSet(BPS, LinesOnBoundaryCount); 1540 1537 BLS[n] = new class BoundaryLineSet(BPS, LinesOnBoundaryCount); // this also adds the line to the local maps 1538 // add line to global map 1541 1539 LinesOnBoundary.insert(LinePair(LinesOnBoundaryCount, BLS[n])); 1540 // increase counter 1542 1541 LinesOnBoundaryCount++; 1543 1542 }; … … 1547 1546 */ 1548 1547 void 1549 Tesselation::AddTriangle ToLines()1550 { 1551 1552 cout << Verbose(1) << "Adding triangle to its lines" << endl; 1553 int i = 0;1548 Tesselation::AddTriangle() 1549 { 1550 cout << Verbose(1) << "Adding triangle to global TrianglesOnBoundary map." << endl; 1551 1552 // add triangle to global map 1554 1553 TrianglesOnBoundary.insert(TrianglePair(TrianglesOnBoundaryCount, BTS)); 1555 1554 TrianglesOnBoundaryCount++; 1556 1555 1557 /* 1558 * this is apparently done when constructing triangle 1559 1560 for (i=0; i<3; i++) 1561 { 1562 BLS[i]->AddTriangle(BTS); 1563 } 1564 */ 1556 // NOTE: add triangle to local maps is done in constructor of BoundaryTriangleSet 1565 1557 } 1566 1558 ; … … 2868 2860 // ... and triangles to the Maps of the Tesselation class 2869 2861 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 2870 AddTriangle ToLines();2862 AddTriangle(); 2871 2863 // ... and calculate its normal vector (with correct orientation) 2872 2864 (*it)->OptCenter.Scale(-1.); … … 2921 2913 } 2922 2914 if (counter > 1) { 2923 cout << Verbose(2) << "INFO: Degenerate triangle is ok, there is only at most " << counter << " new line needed." << endl;2915 cout << Verbose(2) << "INFO: Degenerate triangle is ok, at least two, here " << counter << ", existing lines are used." << endl; 2924 2916 result = true; 2925 2917 } … … 3050 3042 3051 3043 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 3052 AddTriangle ToLines();3044 AddTriangle(); 3053 3045 (*it)->OptCenter.Scale(-1.); 3054 3046 BTS->GetNormalVector((*it)->OptCenter); … … 3071 3063 3072 3064 BTS = new class BoundaryTriangleSet(BLS, TrianglesOnBoundaryCount); 3073 //TrianglesOnBoundary.insert(TrianglePair(TrianglesOnBoundaryCount, BTS)); 3074 AddTriangleToLines(); 3065 AddTriangle(); 3075 3066 3076 3067 (*it)->OtherOptCenter.Scale(-1.);
Note:
See TracChangeset
for help on using the changeset viewer.