Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tesselation.cpp

    rbdc91e r36166d  
    99
    1010#include <fstream>
     11#include <iomanip>
    1112
    1213#include "helpers.hpp"
     
    16481649  bool AddFlag = false;
    16491650  LinkedCell *BoundaryPoints = NULL;
    1650   bool SuccessFlag = true;
    16511651
    16521652  cloud->GoToFirst();
     
    16621662    // get the next triangle
    16631663    triangles = FindClosestTrianglesToVector(Walker->node, BoundaryPoints);
    1664     if (triangles != NULL)
    1665       BTS = triangles->front();
    1666     else
    1667       BTS = NULL;
    1668     delete triangles;
    1669     if ((BTS == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
     1664    BTS = triangles->front();
     1665    if ((triangles == NULL) || (BTS->ContainsBoundaryPoint(Walker))) {
    16701666      DoLog(0) && (Log() << Verbose(0) << "No triangles found, probably a tesselation point itself." << endl);
    16711667      cloud->GoToNext();
     
    17371733    } else { // something is wrong with FindClosestTriangleToPoint!
    17381734      DoeLog(1) && (eLog() << Verbose(1) << "The closest triangle did not produce an intersection!" << endl);
    1739       SuccessFlag = false;
    1740       break;
     1735      return false;
    17411736    }
    17421737    cloud->GoToNext();
     
    17451740  // exit
    17461741  delete (Center);
    1747   delete (BoundaryPoints);
    1748   return SuccessFlag;
     1742  return true;
    17491743}
    17501744;
     
    22492243  for (int i = 0; i < NDIM; i++) { // each axis
    22502244    LC->n[i] = LC->N[i] - 1; // current axis is topmost cell
    2251     const int map[NDIM] = {i, (i + 1) % NDIM, (i + 2) % NDIM};
    2252     for (LC->n[map[1]] = 0; LC->n[map[1]] < LC->N[map[1]]; LC->n[map[1]]++)
    2253       for (LC->n[map[2]] = 0; LC->n[map[2]] < LC->N[map[2]]; LC->n[map[2]]++) {
     2245    for (LC->n[(i + 1) % NDIM] = 0; LC->n[(i + 1) % NDIM] < LC->N[(i + 1) % NDIM]; LC->n[(i + 1) % NDIM]++)
     2246      for (LC->n[(i + 2) % NDIM] = 0; LC->n[(i + 2) % NDIM] < LC->N[(i + 2) % NDIM]; LC->n[(i + 2) % NDIM]++) {
    22542247        const LinkedCell::LinkedNodes *List = LC->GetCurrentCell();
    22552248        //Log() << Verbose(1) << "Current cell is " << LC->n[0] << ", " << LC->n[1] << ", " << LC->n[2] << " with No. " << LC->index << "." << endl;
    22562249        if (List != NULL) {
    22572250          for (LinkedCell::LinkedNodes::const_iterator Runner = List->begin(); Runner != List->end(); Runner++) {
    2258             if ((*Runner)->node->at(map[0]) > maxCoordinate[map[0]]) {
    2259               DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << map[0] << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl);
    2260               maxCoordinate[map[0]] = (*Runner)->node->at(map[0]);
    2261               MaxPoint[map[0]] = (*Runner);
     2251            if ((*Runner)->node->at(i) > maxCoordinate[i]) {
     2252              DoLog(1) && (Log() << Verbose(1) << "New maximal for axis " << i << " node is " << *(*Runner) << " at " << *(*Runner)->node << "." << endl);
     2253              maxCoordinate[i] = (*Runner)->node->at(i);
     2254              MaxPoint[i] = (*Runner);
    22622255            }
    22632256          }
Note: See TracChangeset for help on using the changeset viewer.