Ignore:
Timestamp:
May 25, 2016, 7:13:59 AM (9 years ago)
Author:
Frederik Heber <heber@…>
Children:
a92c27
Parents:
66700f2
git-author:
Frederik Heber <heber@…> (07/12/14 11:57:54)
git-committer:
Frederik Heber <heber@…> (05/25/16 07:13:59)
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.
File:
1 edited

Legend:

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

    r66700f2 r4492f1  
    1919#include <cmath>
    2020#include <list>
     21#include <map>
     22#include <set>
     23#include <vector>
    2124
    2225#include "LinearAlgebra/Vector.hpp"
     
    4851  //!> typedef for the list of points with integral weights
    4952  typedef std::list<std::pair<Vector, int> > WeightedPolygon_t;
     53  //!> typedef for a sorted list of indices
     54  typedef std::set<unsigned int> IndexSet_t;
     55  //!> typedef for the adjacency list of a polygon
     56  typedef std::map<unsigned int, IndexSet_t > adjacency_t;
    5057
    5158  /** General getter function for the distribution of points on the surface.
     
    5865  {
    5966    ASSERT(0, "SphericalPointDistribution::get() - not specialized for "+toString(N)+".");
     67  }
     68
     69  template <int N> adjacency_t getConnections()
     70  {
     71    ASSERT(0, "SphericalPointDistribution::getConnections() - not specialized for "+toString(N)+".");
    6072  }
    6173
     
    184196template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<14>() const;
    185197
     198template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<0>();
     199template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<1>();
     200template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<2>();
     201template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<3>();
     202template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<4>();
     203template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<5>();
     204template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<6>();
     205template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<7>();
     206template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<8>();
     207template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<9>();
     208template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<10>();
     209template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<11>();
     210template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<12>();
     211template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<14>();
     212
    186213#endif /* SPHERICALPOINTDISTRIBUTION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.