Changeset accebe


Ignore:
Timestamp:
Jun 2, 2010, 2:30:31 PM (15 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:
116f37
Parents:
7fd416
git-author:
Frederik Heber <heber@…> (06/02/10 14:25:12)
git-committer:
Frederik Heber <heber@…> (06/02/10 14:30:31)
Message:

Fix of PrepareClustersInWater (at least it does not stumble over memory issues).

  • note: this was just done to make check test Filling/2 work again (which only runs and does not check the output)
  • GetBoundaryPoints() - using now left and right to have a good runner even if it is discarded/deleted, flag check when loop is through
  • PrepareClustersinWater() - LCList is now a pointer and removed after FindConvexBorder()
  • DOCUFIX: Tesselation::RemoveTesselationTriangle() - triangles attached to lines are printed starting on next line, not current
  • BUGFIX: Tesselation::FlipBaseline() - as we remove the two connected triangles, the baseline who they are attached to will be deleted and removed, hence the loop over the line's triangles does not work. Now, we first put all into a list, then delete the triangles.

This was the last test to fail. All unit tests (33), all testsuite cases (45) and all tesselation tests (15) work.

Signed-off-by: Frederik Heber <heber@…>

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    r7fd416 raccebe  
    224224    do { // do as long as we still throw one out per round
    225225      flag = false;
    226       Boundaries::iterator left = BoundaryPoints[axis].end();
    227       Boundaries::iterator right = BoundaryPoints[axis].end();
    228       for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
     226      Boundaries::iterator left = BoundaryPoints[axis].begin();
     227      Boundaries::iterator right = BoundaryPoints[axis].begin();
     228      Boundaries::iterator runner = BoundaryPoints[axis].begin();
     229      bool LoopOnceDone = false;
     230      while (!LoopOnceDone) {
     231        runner = right;
     232        right++;
    229233        // set neighbours correctly
    230234        if (runner == BoundaryPoints[axis].begin()) {
     
    234238        }
    235239        left--;
    236         right = runner;
    237         right++;
    238240        if (right == BoundaryPoints[axis].end()) {
    239241          right = BoundaryPoints[axis].begin();
     242          LoopOnceDone = true;
    240243        }
    241244        // check distance
     
    277280            DoLog(1) && (Log() << Verbose(1) << "Throwing out " << *runner->second.second << "." << endl);
    278281            BoundaryPoints[axis].erase(runner);
     282            runner = right;
    279283            flag = true;
    280284          }
     
    376380          TesselStruct->FlipBaseline(line);
    377381          DoLog(1) && (Log() << Verbose(1) << "INFO: Correction of concave baselines worked." << endl);
     382          LineRunner = TesselStruct->LinesOnBoundary.begin(); // LineRunner may have been erase if line was deleted from LinesOnBoundary
    378383        }
    379384      }
     
    639644/** Creates multiples of the by \a *mol given cluster and suspends them in water with a given final density.
    640645 * We get cluster volume by VolumeOfConvexEnvelope() and its diameters by GetDiametersOfCluster()
     646 * TODO: Here, we need a VolumeOfGeneralEnvelope (i.e. non-convex one)
    641647 * \param *out output stream for debugging
    642648 * \param *configuration needed for path to store convex envelope file
     
    666672  GreatestDiameter = GetDiametersOfCluster(BoundaryPoints, mol, TesselStruct, IsAngstroem);
    667673  BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    668   LinkedCell LCList(mol, 10.);
    669   FindConvexBorder(mol, TesselStruct, &LCList, NULL);
     674  LinkedCell *LCList = new LinkedCell(mol, 10.);
     675  FindConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, NULL);
     676  delete (LCList);
     677
    670678
    671679  // some preparations beforehand
  • src/tesselation.cpp

    r7fd416 raccebe  
    19221922        RemoveTesselationLine(triangle->lines[i]);
    19231923      } else {
    1924         DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: ");
     1924        DoLog(0) && (Log() << Verbose(0) << *triangle->lines[i] << " is still attached to another triangle: " << endl);
    19251925        OpenLines.insert(pair<BoundaryLineSet *, CandidateForTesselation *> (triangle->lines[i], NULL));
    19261926        for (TriangleMap::iterator TriangleRunner = triangle->lines[i]->triangles.begin(); TriangleRunner != triangle->lines[i]->triangles.end(); TriangleRunner++)
    1927           DoLog(0) && (Log() << Verbose(0) << "[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t");
     1927          DoLog(0) && (Log() << Verbose(0) << "\t[" << (TriangleRunner->second)->Nr << "|" << *((TriangleRunner->second)->endpoints[0]) << ", " << *((TriangleRunner->second)->endpoints[1]) << ", " << *((TriangleRunner->second)->endpoints[2]) << "] \t");
    19281928        DoLog(0) && (Log() << Verbose(0) << endl);
    19291929        //        for (int j=0;j<2;j++) {
     
    29792979  OldBaseLineNr = Base->Nr;
    29802980  m = 0;
    2981   for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); runner++) {
    2982     DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting triangle " << *(runner->second) << "." << endl);
    2983     OldTriangleNrs[m++] = runner->second->Nr;
    2984     RemoveTesselationTriangle(runner->second);
     2981  // first obtain all triangle to delete ... (otherwise we pull the carpet (Base) from under the for-loop's feet)
     2982  list <BoundaryTriangleSet *> TrianglesOfBase;
     2983  for (TriangleMap::iterator runner = Base->triangles.begin(); runner != Base->triangles.end(); ++runner)
     2984    TrianglesOfBase.push_back(runner->second);
     2985  // .. then delete each triangle (which deletes the line as well)
     2986  for (list <BoundaryTriangleSet *>::iterator runner = TrianglesOfBase.begin(); !TrianglesOfBase.empty(); runner = TrianglesOfBase.begin()) {
     2987    DoLog(0) && (Log() << Verbose(0) << "INFO: Deleting triangle " << *(*runner) << "." << endl);
     2988    OldTriangleNrs[m++] = (*runner)->Nr;
     2989    RemoveTesselationTriangle((*runner));
     2990    TrianglesOfBase.erase(runner);
    29852991  }
    29862992
Note: See TracChangeset for help on using the changeset viewer.