Changeset 734816


Ignore:
Timestamp:
Apr 9, 2010, 9:55:39 AM (15 years ago)
Author:
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:
dcea0f
Parents:
fe238c
Message:

LinkedNodes is now declared inside LinkedCell and some new functions.

  • as prepraratory measure we placed LinkedNodes as typedef into LinkedCell class. This caused same namespace changes elsewhere where LinkedNodes is used.
  • new function GetallNeighbours() which performs going through linked cells.
  • new function GetPointsInsideaSphere() which performs going through linked cells and returns all neighbours up to a given distance to a given center.

Note: New functions are not yet used elsewhere. Unit test has to be written beforehand.

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

Location:
src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/boundary.cpp

    • Property mode changed from 100755 to 100644
    rfe238c r734816  
    986986  // 2. expand from there
    987987  while ((!TesselStruct->OpenLines.empty()) && (OneLoopWithoutSuccessFlag)) {
    988     // 2a. fill all new OpenLines
     988    // 2a. print OpenLines
    989989    Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for candidates:" << endl;
    990990    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    991       Log() << Verbose(2) << *(Runner->second) << endl;
    992 
     991      Log() << Verbose(1) << " " << *(Runner->second) << endl;
     992
     993    // 2b. find best candidate for each OpenLine
    993994    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
    994995      baseline = Runner->second;
     
    10001001    }
    10011002
    1002     // 2b. search for smallest ShortestAngle among all candidates
    1003     double ShortestAngle = 4.*M_PI;
     1003    // 2c. print OpenLines with candidates again
    10041004    Log() << Verbose(1) << "There are " << TesselStruct->OpenLines.size() << " open lines to scan for the best candidates:" << endl;
    10051005    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++)
    1006       Log() << Verbose(2) << *(Runner->second) << endl;
    1007 
     1006      Log() << Verbose(1) << " " << *(Runner->second) << endl;
     1007
     1008    // 2d. search for smallest ShortestAngle among all candidates
     1009    double ShortestAngle = 4.*M_PI;
    10081010    for (CandidateMap::iterator Runner = TesselStruct->OpenLines.begin(); Runner != TesselStruct->OpenLines.end(); Runner++) {
    10091011      if (Runner->second->ShortestAngle < ShortestAngle) {
     
    10131015      }
    10141016    }
     1017    // 2e. if we found one, add candidate
    10151018    if ((ShortestAngle == 4.*M_PI) || (baseline->pointlist.empty()))
    10161019      OneLoopWithoutSuccessFlag = false;
     
    10191022    }
    10201023
    1021     // write temporary envelope
     1024    // 2f. write temporary envelope
    10221025    if (filename != NULL) {
    10231026      if ((DoSingleStepOutput && ((TesselStruct->TrianglesOnBoundary.size() % SingleStepWidth == 0)))) { // if we have a new triangle and want to output each new triangle configuration
  • src/ellipsoid.cpp

    rfe238c r734816  
    249249    Log() << Verbose(2) << "INFO: Center cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " ... ";
    250250    // get random cell
    251     const LinkedNodes *List = LC->GetCurrentCell();
     251    const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    252252    if (List == NULL) {  // set index to it
    253253      continue;
     
    268268      for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    269269        for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    270           const LinkedNodes *List = LC->GetCurrentCell();
     270          const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    271271          PointsLeft += List->size();
    272272        }
     
    293293      for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    294294        for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    295           const LinkedNodes *List = LC->GetCurrentCell();
     295          const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    296296//          Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    297297          if (List != NULL) {
     
    300300//            else
    301301//              Log() << Verbose(2) << "Cell is empty ... " << endl;
    302             for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     302            for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    303303              if ((current != PickedAtomNrs.end()) && (*current == index)) {
    304304                Candidate = (*Runner);
  • src/linkedcell.cpp

    rfe238c r734816  
    220220 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[] are out of bounds.
    221221 */
    222 const LinkedNodes* LinkedCell::GetCurrentCell() const
     222const LinkedCell::LinkedNodes* LinkedCell::GetCurrentCell() const
    223223{
    224224  if (CheckBounds()) {
     
    234234 * \return LinkedAtoms pointer to current cell, NULL if LinkedCell::n[]+relative[] are out of bounds.
    235235 */
    236 const LinkedNodes* LinkedCell::GetRelativeToCurrentCell(const int relative[NDIM]) const
     236const LinkedCell::LinkedNodes* LinkedCell::GetRelativeToCurrentCell(const int relative[NDIM]) const
    237237{
    238238  if (CheckBounds(relative)) {
     
    302302};
    303303
     304/** Returns a list with all neighbours from the current LinkedCell::index.
     305 * \param distance (if no distance, then adjacent cells are taken)
     306 * \return list of tesselpoints
     307 */
     308LinkedCell::LinkedNodes* LinkedCell::GetallNeighbours(const double distance = 0) const
     309{
     310  int N[NDIM], Nlower[NDIM], Nupper[NDIM];
     311  TesselPoint *Walker = NULL;
     312  LinkedNodes *TesselList = new LinkedNodes;
     313
     314  // then go through the current and all neighbouring cells and check the contained points for possible candidates
     315  //Log() << Verbose(1) << "LC Intervals:";
     316  const int step = (distance == 0) ? 1 : (int)floor(distance/RADIUS)+1;
     317  for (int i=0;i<NDIM;i++) {
     318    Nlower[i] = ((N[i]-step) >= 0) ? N[i]-step : 0;
     319    Nupper[i] = ((N[i]+step) < N[i]) ? N[i]+step : N[i]-step;
     320    //Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] ";
     321  }
     322  //Log() << Verbose(0) << endl;
     323  for (n[0] = Nlower[0]; n[0] <= Nupper[0]; n[0]++)
     324    for (n[1] = Nlower[1]; n[1] <= Nupper[1]; n[1]++)
     325      for (n[2] = Nlower[2]; n[2] <= Nupper[2]; n[2]++) {
     326        const LinkedNodes *List = GetCurrentCell();
     327        //Log() << Verbose(1) << "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;
     328        if (List != NULL) {
     329          for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     330            Walker = *Runner;
     331            TesselList->push_back(Walker);
     332          }
     333        }
     334      }
     335  return TesselList;
     336};
     337
     338
     339/** Returns a list of all TesselPoint with distance less than \a radius to \a *Center.
     340 * \param radius radius of sphere
     341 * \param *center center of sphere
     342 * \return list of all points inside sphere
     343 */
     344LinkedCell::LinkedNodes* LinkedCell::GetPointsInsideSphere(const double radius, const Vector * const center) const
     345{
     346  int N[NDIM], Nlower[NDIM], Nupper[NDIM];
     347  const double radiusSquared = radius*radius;
     348  TesselPoint *Walker = NULL;
     349  LinkedNodes *TesselList = new LinkedNodes;
     350
     351  if (SetIndexToVector(center)) {
     352    for(int i=0;i<NDIM;i++) // store indices of this cell
     353    N[i] = n[i];
     354    //Log() << Verbose(1) << "INFO: Center cell is " << N[0] << ", " << N[1] << ", " << N[2] << " with No. " << index << "." << endl;
     355  } else {
     356    DoeLog(1) && (eLog()<< Verbose(1) << "Vector " << *center << " is outside of LinkedCell's bounding box." << endl);
     357    return TesselList;
     358  }
     359  // then go through the current and all neighbouring cells and check the contained points for possible candidates
     360  //Log() << Verbose(1) << "LC Intervals:";
     361  for (int i=0;i<NDIM;i++) {
     362    Nlower[i] = ((N[i]-1) >= 0) ? N[i]-1 : 0;
     363    Nupper[i] = ((N[i]+1) < N[i]) ? N[i]+1 : N[i]-1;
     364    //Log() << Verbose(0) << " [" << Nlower[i] << "," << Nupper[i] << "] ";
     365  }
     366  //Log() << Verbose(0) << endl;
     367  for (n[0] = Nlower[0]; n[0] <= Nupper[0]; n[0]++)
     368    for (n[1] = Nlower[1]; n[1] <= Nupper[1]; n[1]++)
     369      for (n[2] = Nlower[2]; n[2] <= Nupper[2]; n[2]++) {
     370        const LinkedNodes *List = GetCurrentCell();
     371        //Log() << Verbose(1) << "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << "." << endl;
     372        if (List != NULL) {
     373          for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     374            Walker = *Runner;
     375            if ((center->DistanceSquared(Walker->node) - radiusSquared) > MYEPSILON) {
     376              TesselList->push_back(Walker);
     377            }
     378          }
     379        }
     380      }
     381  return TesselList;
     382};
  • src/linkedcell.hpp

    rfe238c r734816  
    3333/********************************************** definitions *********************************/
    3434
    35 #define LinkedNodes list<TesselPoint *>
    3635
    3736/********************************************** declarations *******************************/
     
    4039 */
    4140class LinkedCell {
    42   public:
     41private:
     42
     43public:
     44  typedef list<TesselPoint *> LinkedNodes;
     45
     46
    4347    Vector max;       // upper boundary
    4448    Vector min;       // lower boundary
     
    5357    LinkedCell(LinkedNodes *set, const double radius);
    5458    ~LinkedCell();
    55     const LinkedNodes* GetCurrentCell()const ;
    56     const LinkedNodes* GetRelativeToCurrentCell(const int relative[NDIM])const ;
     59    const LinkedCell::LinkedNodes* GetCurrentCell()const ;
     60    const LinkedCell::LinkedNodes* GetRelativeToCurrentCell(const int relative[NDIM])const ;
    5761    bool SetIndexToNode(const TesselPoint * const Walker)const ;
    5862    bool SetIndexToVector(const Vector * const x)const ;
     
    6064    bool CheckBounds(const int relative[NDIM])const ;
    6165    void GetNeighbourBounds(int lower[NDIM], int upper[NDIM])const ;
     66
     67    LinkedCell::LinkedNodes* GetallNeighbours(const double distance) const;
     68    LinkedCell::LinkedNodes* GetPointsInsideSphere(const double radius, const Vector * const center) const;
    6269
    6370    // not implemented yet
  • src/molecule_graph.cpp

    rfe238c r734816  
    148148      for (LC->n[1] = 0; LC->n[1] < LC->N[1]; LC->n[1]++)
    149149        for (LC->n[2] = 0; LC->n[2] < LC->N[2]; LC->n[2]++) {
    150           const LinkedNodes *List = LC->GetCurrentCell();
     150          const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    151151          //Log() << Verbose(2) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    152152          if (List != NULL) {
    153             for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     153            for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    154154              Walker = AtomMap[(*Runner)->nr];
    155155              //Log() << Verbose(0) << "Current Atom is " << *Walker << "." << endl;
     
    158158                for (n[1] = -1; n[1] <= 1; n[1]++)
    159159                  for (n[2] = -1; n[2] <= 1; n[2]++) {
    160                     const LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);
     160                    const LinkedCell::LinkedNodes *OtherList = LC->GetRelativeToCurrentCell(n);
    161161                    //Log() << Verbose(2) << "Current relative cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << " containing " << List->size() << " points." << endl;
    162162                    if (OtherList != NULL) {
    163                       for (LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
     163                      for (LinkedCell::LinkedNodes::const_iterator OtherRunner = OtherList->begin(); OtherRunner != OtherList->end(); OtherRunner++) {
    164164                        if ((*OtherRunner)->nr > Walker->nr) {
    165165                          OtherWalker = AtomMap[(*OtherRunner)->nr];
  • src/tesselation.cpp

    rfe238c r734816  
    10191019  BaseLine = NULL;
    10201020};
     1021
     1022/** Checks validity of a given sphere of a candidate line.
     1023 * Sphere must touch all candidates and the baseline endpoints and there must be no other atoms inside.
     1024 * \param RADIUS radius of sphere
     1025 * \param *LC LinkedCell structure with other atoms
     1026 * \return true - sphere is valid, false - sphere contains other points
     1027 */
     1028bool CandidateForTesselation::CheckValidity(const double RADIUS, const LinkedCell *LC) const
     1029{
     1030  const double radiusSquared = RADIUS;
     1031  list<const Vector *> VectorList;
     1032  VectorList.push_back(&OptCenter);
     1033  VectorList.push_back(&OtherOptCenter);
     1034
     1035  // check baseline for OptCenter and OtherOptCenter being on sphere's surface
     1036  for (list<const Vector *>::const_iterator VRunner = VectorList.begin(); VRunner != VectorList.end(); ++VRunner) {
     1037    for (int i=0;i<2;i++)
     1038      if (fabs((*VRunner)->DistanceSquared(BaseLine->endpoints[i]->node->node) - radiusSquared) < MYEPSILON) {
     1039        DoeLog(1) && (eLog() << Verbose(1) << "Endpoint " << BaseLine->endpoints[i] << " is out of sphere at " << (*VRunner) << "." << endl);
     1040        return false;
     1041      }
     1042  }
     1043
     1044  // check Candidates for OptCenter and OtherOptCenter being on sphere's surface
     1045  for (TesselPointList::const_iterator Runner = pointlist.begin(); Runner != pointlist.begin(); ++Runner) {
     1046    const TesselPoint *Walker = *Runner;
     1047    for (list<const Vector *>::const_iterator VRunner = VectorList.begin(); VRunner != VectorList.end(); ++VRunner) {
     1048      if (fabs((*VRunner)->DistanceSquared(Walker->node) - radiusSquared) < MYEPSILON) {
     1049        DoeLog(1) && (eLog() << Verbose(1) << "Candidate " << Walker << " is out of sphere at " << (*VRunner) << "." << endl);
     1050        return false;
     1051      }
     1052    }
     1053  }
     1054
     1055  // check for no other points being inside the sphere
     1056  bool flag = true;
     1057  for (list<const Vector *>::const_iterator VRunner = VectorList.begin(); VRunner != VectorList.end(); ++VRunner) {
     1058    // get all points inside the sphere
     1059    TesselPointList *ListofPoints = LC->GetPointsInsideSphere(RADIUS, (*VRunner));
     1060    cout << Verbose(1) << "CheckValidity: There are " << ListofPoints->size() << " points inside the sphere at " << (*VRunner) << "." << endl;
     1061    // remove baseline's endpoints and candidates
     1062    for (int i=0;i<2;i++)
     1063      ListofPoints->remove(BaseLine->endpoints[i]->node);
     1064    for (TesselPointList::const_iterator Runner = pointlist.begin(); Runner != pointlist.begin(); ++Runner)
     1065      ListofPoints->remove(*Runner);
     1066    if (!ListofPoints->empty()) {
     1067      flag = false;
     1068      DoeLog(1) && (eLog() << Verbose(1) << "External atoms inside of sphere at " << (*VRunner) << ":" << endl);
     1069      for (TesselPointList::const_iterator Runner = ListofPoints->begin(); Runner != ListofPoints->begin(); ++Runner)
     1070        DoeLog(1) && (eLog() << Verbose(1) << "  " << *Runner << endl);
     1071    }
     1072    delete(ListofPoints);
     1073  }
     1074  return flag;
     1075};
     1076
     1077
    10211078
    10221079/** output operator for CandidateForTesselation.
     
    20622119    for (LC->n[(i+1)%NDIM]=0;LC->n[(i+1)%NDIM]<LC->N[(i+1)%NDIM];LC->n[(i+1)%NDIM]++)
    20632120      for (LC->n[(i+2)%NDIM]=0;LC->n[(i+2)%NDIM]<LC->N[(i+2)%NDIM];LC->n[(i+2)%NDIM]++) {
    2064         const LinkedNodes *List = LC->GetCurrentCell();
     2121        const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    20652122        //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    20662123        if (List != NULL) {
    2067           for (LinkedNodes::const_iterator Runner = List->begin();Runner != List->end();Runner++) {
     2124          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin();Runner != List->end();Runner++) {
    20682125            if ((*Runner)->node->x[i] > maxCoordinate[i]) {
    20692126              Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl;
     
    24712528
    24722529  // go through all angle-sorted candidates (in degenerate n-nodes case we may have to add multiple triangles)
    2473   Log() << Verbose(0) << "List of Candidates for Turning Point: " << *TurningPoint << "." << endl;
     2530  Log() << Verbose(0) << "List of Candidates for Turning Point " << *TurningPoint << ":" << endl;
    24742531  for (TesselPointList::iterator TesselRunner = connectedClosestPoints->begin(); TesselRunner != connectedClosestPoints->end(); ++TesselRunner)
    2475     Log() << Verbose(0) << **TesselRunner << endl;
     2532    Log() << Verbose(0) << " " << **TesselRunner << endl;
    24762533  TesselPointList::iterator Runner = connectedClosestPoints->begin();
    24772534  TesselPointList::iterator Sprinter = Runner;
     
    28092866    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    28102867      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    2811         const LinkedNodes *List = LC->GetCurrentCell();
     2868        const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    28122869        //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    28132870        if (List != NULL) {
    2814           for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     2871          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    28152872            Candidate = (*Runner);
    28162873            // check if we only have one unique point yet ...
     
    29683025        for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    29693026          for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    2970             const LinkedNodes *List = LC->GetCurrentCell();
     3027            const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    29713028            //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    29723029            if (List != NULL) {
    2973               for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     3030              for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    29743031                Candidate = (*Runner);
    29753032
     
    30383095                      } else {
    30393096                        if ((Candidate != NULL) && (CandidateLine.pointlist.begin() != CandidateLine.pointlist.end())) {
    3040                           Log() << Verbose(1) << "REJECT: Old candidate " << *(Candidate) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl;
     3097                          Log() << Verbose(1) << "REJECT: Old candidate " << *(CandidateLine.pointlist.begin()) << " with " << CandidateLine.ShortestAngle << " is better than new one " << *Candidate << " with " << alpha << " ." << endl;
    30413098                        } else {
    30423099                          Log() << Verbose(1) << "REJECT: Candidate " << *Candidate << " with " << alpha << " was rejected." << endl;
     
    30693126  }
    30703127
    3071   Log() << Verbose(1) << "INFO: Sorting candidate list ..." << endl;
     3128  DoLog(1) && (Log() << Verbose(1) << "INFO: Checking whether sphere contains candidate list and baseline only ..." << endl);
     3129  if (!CandidateLine.CheckValidity(RADIUS, LC)) {
     3130    DoeLog(0) && (eLog() << Verbose(0) << "There were other points contained in the rolling sphere as well!" << endl);
     3131    performCriticalExit();
     3132  }
     3133
     3134  DoLog(1) && (Log() << Verbose(1) << "INFO: Sorting candidate list ..." << endl);
    30723135  if (CandidateLine.pointlist.size() > 1) {
    30733136    CandidateLine.pointlist.unique();
     
    31353198    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    31363199      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    3137         const LinkedNodes *List = LC->GetCurrentCell();
     3200        const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    31383201        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    31393202        if (List != NULL) {
    3140           for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     3203          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    31413204            FindPoint = PointsOnBoundary.find((*Runner)->nr);
    31423205            if (FindPoint != PointsOnBoundary.end()) {
  • src/tesselation.hpp

    rfe238c r734816  
    4242
    4343#define DoTecplotOutput 1
    44 #define DoRaster3DOutput 1
    45 #define DoVRMLOutput 1
     44#define DoRaster3DOutput 0
     45#define DoVRMLOutput 0
    4646#define TecplotSuffix ".dat"
    4747#define Raster3DSuffix ".r3d"
     
    251251  CandidateForTesselation(TesselPoint* candidate, BoundaryLineSet* currentBaseLine, Vector OptCandidateCenter, Vector OtherOptCandidateCenter);
    252252  ~CandidateForTesselation();
     253
     254  bool CheckValidity(const double RADIUS, const LinkedCell *LC) const;
    253255
    254256  TesselPointList pointlist;
  • src/tesselationhelpers.cpp

    rfe238c r734816  
    578578    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    579579      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    580         const LinkedNodes *List = LC->GetCurrentCell();
     580        const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    581581        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    582582        if (List != NULL) {
    583           for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     583          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    584584            helper.CopyVector(Point);
    585585            helper.SubtractVector((*Runner)->node);
     
    633633    for (LC->n[1] = Nlower[1]; LC->n[1] <= Nupper[1]; LC->n[1]++)
    634634      for (LC->n[2] = Nlower[2]; LC->n[2] <= Nupper[2]; LC->n[2]++) {
    635         const LinkedNodes *List = LC->GetCurrentCell();
     635        const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    636636        //Log() << Verbose(1) << "The current cell " << LC->n[0] << "," << LC->n[1] << "," << LC->n[2] << endl;
    637637        if (List != NULL) {
    638           for (LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
     638          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    639639            helper.CopyVector(Point);
    640640            helper.SubtractVector((*Runner)->node);
  • src/unittests/tesselation_boundarytriangleunittest.hpp

    rfe238c r734816  
    3535      class BoundaryLineSet *lines[3];
    3636      class BoundaryPointSet *points[3];
    37       LinkedNodes Corners;
     37      LinkedCell::LinkedNodes Corners;
    3838};
    3939
  • src/unittests/tesselation_insideoutsideunittest.cpp

    rfe238c r734816  
    133133  delete(LinkedList);
    134134  delete(TesselStruct);
    135   for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
     135  for (LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
    136136    delete((*Runner)->node);
    137137    delete(*Runner);
  • src/unittests/tesselation_insideoutsideunittest.hpp

    rfe238c r734816  
    3131private:
    3232      class Tesselation *TesselStruct;
    33       LinkedNodes Corners;
     33      LinkedCell::LinkedNodes Corners;
    3434      class LinkedCell *LinkedList;
    3535};
  • src/unittests/tesselationunittest.cpp

    rfe238c r734816  
    101101  delete(LinkedList);
    102102  delete(TesselStruct);
    103   for (LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
     103  for (LinkedCell::LinkedNodes::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++) {
    104104    delete((*Runner)->node);
    105105    delete(*Runner);
  • src/unittests/tesselationunittest.hpp

    rfe238c r734816  
    3434private:
    3535      class Tesselation *TesselStruct;
    36       LinkedNodes Corners;
     36      LinkedCell::LinkedNodes Corners;
    3737      class LinkedCell *LinkedList;
    3838};
Note: See TracChangeset for help on using the changeset viewer.