Changeset 4e10f5 for src/boundary.cpp


Ignore:
Timestamp:
Jul 7, 2010, 4:08:32 PM (15 years ago)
Author:
Tillmann Crueger <crueger@…>
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, Candidate_v1.7.0, 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:
77a570
Parents:
5630bd (diff), 192f6e (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 'stable' into StructureRefactoring

Conflicts:

src/Actions/WorldAction/CenterOnEdgeAction.cpp
src/Actions/WorldAction/ChangeBoxAction.cpp
src/Actions/WorldAction/RepeatBoxAction.cpp
src/Actions/WorldAction/ScaleBoxAction.cpp
src/World.cpp
src/boundary.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    r5630bd r4e10f5  
    301301 * \param *out output stream for debugging
    302302 * \param *mol molecule structure with Atom's and Bond's.
     303 * \param *BoundaryPts set of boundary points to use or NULL
    303304 * \param *TesselStruct Tesselation filled with points, lines and triangles on boundary on return
    304305 * \param *LCList atoms in LinkedCell list
     
    306307 * \return *TesselStruct is filled with convex boundary and tesselation is stored under \a *filename.
    307308 */
    308 void FindConvexBorder(const molecule* mol, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename)
     309void FindConvexBorder(const molecule* mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell *LCList, const char *filename)
    309310{
    310311        Info FunctionInfo(__func__);
     
    317318
    318319  // 1. Find all points on the boundary
    319   if (BoundaryPoints == NULL) {
    320       BoundaryFreeFlag = true;
    321       BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
     320  if (BoundaryPts == NULL) {
     321    BoundaryFreeFlag = true;
     322    BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    322323  } else {
    323       DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl);
     324    BoundaryPoints = BoundaryPts;
     325    DoLog(0) && (Log() << Verbose(0) << "Using given boundary points set." << endl);
    324326  }
    325327
    326328// printing all inserted for debugging
    327   for (int axis=0; axis < NDIM; axis++)
    328     {
    329       DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl);
    330       int i=0;
    331       for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
    332         if (runner != BoundaryPoints[axis].begin())
    333           DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second);
    334         else
    335           DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second);
    336         i++;
    337       }
    338       DoLog(0) && (Log() << Verbose(0) << endl);
    339     }
     329  for (int axis=0; axis < NDIM; axis++) {
     330    DoLog(1) && (Log() << Verbose(1) << "Printing list of candidates for axis " << axis << " which we have inserted so far." << endl);
     331    int i=0;
     332    for(Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++) {
     333      if (runner != BoundaryPoints[axis].begin())
     334        DoLog(0) && (Log() << Verbose(0) << ", " << i << ": " << *runner->second.second);
     335      else
     336        DoLog(0) && (Log() << Verbose(0) << i << ": " << *runner->second.second);
     337      i++;
     338    }
     339    DoLog(0) && (Log() << Verbose(0) << endl);
     340  }
    340341
    341342  // 2. fill the boundary point list
     
    343344    for (Boundaries::iterator runner = BoundaryPoints[axis].begin(); runner != BoundaryPoints[axis].end(); runner++)
    344345        if (!TesselStruct->AddBoundaryPoint(runner->second.second, 0))
    345           DoeLog(2) && (eLog()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present!" << endl);
     346          DoLog(2) && (Log()<< Verbose(2) << "Point " << *(runner->second.second) << " is already present." << endl);
    346347
    347348  DoLog(0) && (Log() << Verbose(0) << "I found " << TesselStruct->PointsOnBoundaryCount << " points on the convex boundary." << endl);
     
    677678
    678679  IsAngstroem = configuration->GetIsAngstroem();
     680  BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    679681  GreatestDiameter = GetDiametersOfCluster(BoundaryPoints, mol, TesselStruct, IsAngstroem);
    680   BoundaryPoints = GetBoundaryPoints(mol, TesselStruct);
    681682  LinkedCell *LCList = new LinkedCell(mol, 10.);
    682   FindConvexBorder(mol, TesselStruct, (const LinkedCell *&)LCList, NULL);
     683  FindConvexBorder(mol, BoundaryPoints, TesselStruct, (const LinkedCell *&)LCList, NULL);
    683684  delete (LCList);
     685  delete[] BoundaryPoints;
    684686
    685687
     
    689691  else
    690692    clustervolume = ClusterVolume;
     693
     694  delete TesselStruct;
    691695
    692696  for (int i = 0; i < NDIM; i++)
     
    741745    mol->CenterInBox();
    742746  }
     747  delete GreatestDiameter;
    743748  // update Box of atoms by boundary
    744749  mol->SetBoxDimension(&BoxLengths);
     
    895900            }
    896901      }
     902  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) {
     903    delete LCList[*ListRunner];
     904    delete TesselStruct[(*ListRunner)];
     905  }
    897906
    898907  return Filling;
Note: See TracChangeset for help on using the changeset viewer.