Changeset 81ffd8 for src/Tesselation
- Timestamp:
- Oct 19, 2014, 5:13:11 PM (10 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:
- 2ef2cc
- Parents:
- d289c6
- git-author:
- Frederik Heber <heber@…> (10/08/14 13:08:11)
- git-committer:
- Frederik Heber <heber@…> (10/19/14 17:13:11)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Tesselation/boundary.cpp
rd289c6 r81ffd8 575 575 LineRunner = TesselStruct->LinesOnBoundary.begin(); 576 576 LineAdvance = LineRunner; // we need an advanced line, as the LineRunner might get removed 577 std::map<double, BoundaryLineSet *> GainMap;577 std::map<double, std::pair<BoundaryLineSet *, double> > GainMap; 578 578 while (LineRunner != TesselStruct->LinesOnBoundary.end()) { 579 579 LineAdvance++; … … 681 681 if (no_line_intersects) { 682 682 // calculate the volume 683 const double tmp = 684 CalculateVolumeofGeneralTetraeder( 685 BPS[0]->node->getPosition(), 686 BPS[1]->node->getPosition(), 687 BPS[2]->node->getPosition(), 688 BPS[3]->node->getPosition()); 689 GainMap.insert(std::make_pair(tmp, line)); 683 const double tmp = line->CalculateConvexity(); 684 const double gain = 685 CalculateVolumeofGeneralTetraeder( 686 BPS[0]->node->getPosition(), 687 BPS[1]->node->getPosition(), 688 BPS[2]->node->getPosition(), 689 BPS[3]->node->getPosition()); 690 691 GainMap.insert(std::make_pair(tmp, std::make_pair(line,gain) )); 690 692 LOG(2, "DEBUG: Adding concave line " << *line << " with gain of " 691 << tmp<< ".");693 << gain << "."); 692 694 } else { 693 695 // if 2 or 3 don't … … 701 703 // flip line with most gain 702 704 if (!GainMap.empty()) { 703 line = GainMap. rbegin()->second;704 const double tmp = GainMap. rbegin()->first;705 line = GainMap.begin()->second.first; 706 const double tmp = GainMap.begin()->second.second; 705 707 volume += tmp; 708 706 709 // GainMap.clear(); 707 710 708 711 // and flip the line 709 LOG(1, "INFO: Flipping c oncave line " << *line << " with gain of "712 LOG(1, "INFO: Flipping current most concave line " << *line << " with gain of " 710 713 << tmp << "."); 711 714 TesselStruct->FlipBaseline(line);
Note:
See TracChangeset
for help on using the changeset viewer.