Changeset 1024cb for src/tesselation.cpp


Ignore:
Timestamp:
May 31, 2010, 5:32:27 PM (16 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, 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:
e08c46
Parents:
42af9e (diff), a7b761b (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.
git-author:
Frederik Heber <heber@…> (05/31/10 17:29:30)
git-committer:
Frederik Heber <heber@…> (05/31/10 17:32:27)
Message:

Merge commit 'jupiter/MoleculeStartEndSwitch' into CommandLineActionMapping

Conflicts:

molecuilder/src/Makefile.am
molecuilder/src/builder.cpp
molecuilder/src/config.cpp
molecuilder/src/helpers.hpp
molecuilder/src/molecule.cpp
molecuilder/src/molecule_dynamics.cpp
molecuilder/src/molecule_fragmentation.cpp
molecuilder/src/molecule_geometry.cpp
molecuilder/src/molecule_graph.cpp
molecuilder/src/moleculelist.cpp
molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp
molecuilder/src/unittests/listofbondsunittest.cpp

Integration of MoleculeStartEndSwitch had the following consequences:

  • no more AtomCount -> getAtomCount()
  • no more start/end -> begin(), end() and iterator
  • no more decent ordering in atomic ids (hence, Simple_configuration/8 and Domain/5, Domain/6 now check by comparing sorted xyz, not confs)

There is still a huge problem with bonds. One test runs into an endless loop.

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.cpp

    r42af9e r1024cb  
    2121#include "Plane.hpp"
    2222#include "Exceptions/LinearDependenceException.hpp"
     23#include "Helpers/Assert.hpp"
     24
     25#include "Helpers/Assert.hpp"
    2326
    2427class molecule;
     
    357360  // get ascending order of endpoints
    358361  PointMap OrderMap;
    359   for (int i = 0; i < 3; i++)
     362  for (int i = 0; i < 3; i++) {
    360363    // for all three lines
    361364    for (int j = 0; j < 2; j++) { // for both endpoints
     
    363366      // and we don't care whether insertion fails
    364367    }
     368  }
    365369  // set endpoints
    366370  int Counter = 0;
     
    371375    Counter++;
    372376  }
    373   if (Counter < 3) {
    374     DoeLog(0) && (eLog() << Verbose(0) << "We have a triangle with only two distinct endpoints!" << endl);
    375     performCriticalExit();
    376   }
    377 }
    378 ;
     377  ASSERT(Counter >= 3,"We have a triangle with only two distinct endpoints!");
     378};
     379
    379380
    380381/** Destructor of BoundaryTriangleSet.
     
    682683}
    683684
     685/**
     686 * gets the Plane defined by the three triangle Basepoints
     687 */
     688Plane BoundaryTriangleSet::getPlane() const{
     689  ASSERT(endpoints[0] && endpoints[1] && endpoints[2], "Triangle not fully defined");
     690
     691  return Plane(*endpoints[0]->node->node,
     692               *endpoints[1]->node->node,
     693               *endpoints[2]->node->node);
     694}
     695
     696Vector BoundaryTriangleSet::getEndpoint(int i) const{
     697  ASSERT(i>=0 && i<3,"Index of Endpoint out of Range");
     698
     699  return *endpoints[i]->node->node;
     700}
     701
     702string BoundaryTriangleSet::getEndpointName(int i) const{
     703  ASSERT(i>=0 && i<3,"Index of Endpoint out of Range");
     704
     705  return endpoints[i]->node->getName();
     706}
     707
    684708/** output operator for BoundaryTriangleSet.
    685709 * \param &ost output stream
     
    688712ostream &operator <<(ostream &ost, const BoundaryTriangleSet &a)
    689713{
    690   ost << "[" << a.Nr << "|" << a.endpoints[0]->node->getName() << "," << a.endpoints[1]->node->getName() << "," << a.endpoints[2]->node->getName() << "]";
     714  ost << "[" << a.Nr << "|" << a.getEndpointName(0) << "," << a.getEndpointName(1) << "," << a.getEndpointName(2) << "]";
    691715  //  ost << "[" << a.Nr << "|" << a.endpoints[0]->node->Name << " at " << *a.endpoints[0]->node->node << ","
    692716  //      << a.endpoints[1]->node->Name << " at " << *a.endpoints[1]->node->node << "," << a.endpoints[2]->node->Name << " at " << *a.endpoints[2]->node->node << "]";
     
    12081232;
    12091233
    1210 /** PointCloud implementation of GetTerminalPoint.
    1211  * Uses PointsOnBoundary and STL stuff.
    1212  */
    1213 TesselPoint * Tesselation::GetTerminalPoint() const
    1214 {
    1215   Info FunctionInfo(__func__);
    1216   PointMap::const_iterator Runner = PointsOnBoundary.end();
    1217   Runner--;
    1218   return (Runner->second->node);
    1219 }
    1220 ;
    1221 
    12221234/** PointCloud implementation of GoToNext.
    12231235 * Uses PointsOnBoundary and STL stuff.
     
    12311243;
    12321244
    1233 /** PointCloud implementation of GoToPrevious.
    1234  * Uses PointsOnBoundary and STL stuff.
    1235  */
    1236 void Tesselation::GoToPrevious() const
    1237 {
    1238   Info FunctionInfo(__func__);
    1239   if (InternalPointer != PointsOnBoundary.begin())
    1240     InternalPointer--;
    1241 }
    1242 ;
    1243 
    12441245/** PointCloud implementation of GoToFirst.
    12451246 * Uses PointsOnBoundary and STL stuff.
     
    12491250  Info FunctionInfo(__func__);
    12501251  InternalPointer = PointsOnBoundary.begin();
    1251 }
    1252 ;
    1253 
    1254 /** PointCloud implementation of GoToLast.
    1255  * Uses PointsOnBoundary and STL stuff.
    1256  */
    1257 void Tesselation::GoToLast() const
    1258 {
    1259   Info FunctionInfo(__func__);
    1260   InternalPointer = PointsOnBoundary.end();
    1261   InternalPointer--;
    12621252}
    12631253;
     
    14551445        CenterVector.Zero();
    14561446        for (int i = 0; i < 3; i++)
    1457           CenterVector += (*BTS->endpoints[i]->node->node);
     1447          CenterVector += BTS->getEndpoint(i);
    14581448        CenterVector.Scale(1. / 3.);
    14591449        DoLog(2) && (Log() << Verbose(2) << "CenterVector of base triangle is " << CenterVector << endl);
     
    25692559  // fill the set of neighbours
    25702560  TesselPointSet SetOfNeighbours;
     2561
    25712562  SetOfNeighbours.insert(CandidateLine.BaseLine->endpoints[1]->node);
    25722563  for (TesselPointList::iterator Runner = CandidateLine.pointlist.begin(); Runner != CandidateLine.pointlist.end(); Runner++)
     
    48024793  if (LastTriangle != NULL) {
    48034794    stringstream sstr;
    4804     sstr << "-"<< TrianglesOnBoundary.size() << "-" << LastTriangle->endpoints[0]->node->getName() << "_" << LastTriangle->endpoints[1]->node->getName() << "_" << LastTriangle->endpoints[2]->node->getName();
     4795    sstr << "-"<< TrianglesOnBoundary.size() << "-" << LastTriangle->getEndpointName(0) << "_" << LastTriangle->getEndpointName(1) << "_" << LastTriangle->getEndpointName(2);
    48054796    NumberName = sstr.str();
    48064797    if (DoTecplotOutput) {
Note: See TracChangeset for help on using the changeset viewer.