Ignore:
Timestamp:
Aug 20, 2014, 1:06:16 PM (11 years ago)
Author:
Frederik Heber <heber@…>
Children:
0b517b
Parents:
ef3885
git-author:
Frederik Heber <heber@…> (07/12/14 11:57:54)
git-committer:
Frederik Heber <heber@…> (08/20/14 13:06:16)
Message:

Added getConnections() to SphericalPointDistribution.

  • we use tesselation in order to extract the connection information between nearest neighboring points from the BoundaryLines of the tesselation. The triangles are ideal as they assure that no point lies within a triangle, hence all these points may be safely combined.
  • functions reside in extra module as with get().
  • added extensive unit tests.
  • TESTS: Removed XFAIL from SphericalPointDistributionUnitTest.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Fragmentation/Exporters/SphericalPointDistribution.hpp

    ref3885 r42c742  
    1919#include <cmath>
    2020#include <list>
     21#include <map>
     22#include <set>
     23#include <vector>
    2124
    2225#include "LinearAlgebra/Vector.hpp"
     
    4952  //!> typedef for the list of points with integral weights
    5053  typedef std::list<std::pair<Vector, int> > WeightedPolygon_t;
     54  //!> typedef for a sorted list of indices
     55  typedef std::set<unsigned int> IndexSet_t;
     56  //!> typedef for the adjacency list of a polygon
     57  typedef std::map<unsigned int, IndexSet_t > adjacency_t;
    5158
    5259  /** General getter function for the distribution of points on the surface.
     
    6168  }
    6269
     70  template <int N> adjacency_t getConnections()
     71  {
     72    ASSERT(0, "SphericalPointDistribution::getConnections() - not specialized for "+toString(N)+".");
     73  }
    6374
    6475  /** Matches a given spherical distribution with another containing more
     
    193204template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<14>();
    194205
     206template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<0>();
     207template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<1>();
     208template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<2>();
     209template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<3>();
     210template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<4>();
     211template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<5>();
     212template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<6>();
     213template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<7>();
     214template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<8>();
     215template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<9>();
     216template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<10>();
     217template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<11>();
     218template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<12>();
     219template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<14>();
     220
    195221#endif /* SPHERICALPOINTDISTRIBUTION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.