Index: src/Fragmentation/Exporters/SphericalPointDistribution.hpp
===================================================================
--- src/Fragmentation/Exporters/SphericalPointDistribution.hpp	(revision 3678ebc57e18808f8b12560be8edf24e11074a7c)
+++ src/Fragmentation/Exporters/SphericalPointDistribution.hpp	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
@@ -19,4 +19,7 @@
 #include <cmath>
 #include <list>
+#include <map>
+#include <set>
+#include <vector>
 
 #include "LinearAlgebra/Vector.hpp"
@@ -48,4 +51,8 @@
   //!> typedef for the list of points with integral weights
   typedef std::list<std::pair<Vector, int> > WeightedPolygon_t;
+  //!> typedef for a sorted list of indices
+  typedef std::set<unsigned int> IndexSet_t;
+  //!> typedef for the adjacency list of a polygon
+  typedef std::map<unsigned int, IndexSet_t > adjacency_t;
 
   /** General getter function for the distribution of points on the surface.
@@ -58,4 +65,10 @@
   {
     ASSERT(0, "SphericalPointDistribution::get() - not specialized for "+toString(N)+".");
+    return Polygon_t();
+  }
+
+  template <int N> adjacency_t getConnections()
+  {
+    ASSERT(0, "SphericalPointDistribution::getConnections() - not specialized for "+toString(N)+".");
     return Polygon_t();
   }
@@ -185,3 +198,18 @@
 template <> SphericalPointDistribution::Polygon_t SphericalPointDistribution::get<14>() const;
 
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<0>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<1>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<2>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<3>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<4>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<5>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<6>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<7>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<8>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<9>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<10>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<11>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<12>();
+template <> SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<14>();
+
 #endif /* SPHERICALPOINTDISTRIBUTION_HPP_ */
Index: src/Fragmentation/Exporters/SphericalPointDistribution_getConnections.cpp
===================================================================
--- src/Fragmentation/Exporters/SphericalPointDistribution_getConnections.cpp	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
+++ src/Fragmentation/Exporters/SphericalPointDistribution_getConnections.cpp	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
@@ -0,0 +1,263 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ *
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * SphericalPointDistribution_getConnections.cpp
+ *
+ *  Created on: Jul 12, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "SphericalPointDistribution.hpp"
+
+#include "CodePatterns/Assert.hpp"
+
+#include <boost/assign.hpp>
+
+using namespace std;
+using namespace boost::assign;
+
+typedef SphericalPointDistribution::IndexSet_t IndexSet_t;
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<0>()
+{
+  adjacency_t adjacency;
+  ASSERT( adjacency.size() == 0,
+      "SphericalPointDistribution::getConnections<0>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<1>()
+{
+  adjacency_t adjacency;
+  ASSERT( adjacency.size() == 0,
+      "SphericalPointDistribution::getConnections<1>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<2>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(1) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(0) );
+  ASSERT( adjacency.size() == 2,
+      "SphericalPointDistribution::getConnections<2>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<3>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(1)(2) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(0)(2) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(1) );
+  ASSERT( adjacency.size() == 3,
+      "SphericalPointDistribution::getConnections<3>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<4>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(1)(2)(3) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(0)(2)(3) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(1)(3) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(1)(2) );
+  ASSERT( adjacency.size() == 4,
+      "SphericalPointDistribution::getConnections<4>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<5>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(2)(3)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(2)(3)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(1)(3)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(1)(2)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(1)(2)(3) );
+  ASSERT( adjacency.size() == 5,
+      "SphericalPointDistribution::getConnections<5>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<6>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(2)(3)(4)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(2)(3)(4)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(1)(4)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(1)(4)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(1)(2)(3) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(0)(1)(2)(3) );
+  ASSERT( adjacency.size() == 6,
+      "SphericalPointDistribution::getConnections<6>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<7>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(2)(3)(4)(5)(6) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(2)(3)(4)(5)(6) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(1)(3)(6) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(1)(2)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(1)(3)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(0)(1)(4)(6) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 6, list_of<unsigned int>(0)(1)(2)(5) );
+  ASSERT( adjacency.size() == 7,
+      "SphericalPointDistribution::getConnections<7>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<8>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(2)(3)(4)(5)(6)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(2)(3)(4)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(1)(3)(4)(6)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(1)(2)(5)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(1)(2)(5)(6) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(0)(1)(3)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 6, list_of<unsigned int>(0)(2)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 7, list_of<unsigned int>(0)(2)(3) );
+  ASSERT( adjacency.size() == 8,
+      "SphericalPointDistribution::getConnections<8>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<9>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(1)(2)(3)(4) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(0)(3)(4)(5)(6) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(3)(4)(7)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(1)(2)(5)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(1)(2)(6)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(1)(3)(6)(7)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 6, list_of<unsigned int>(1)(4)(5)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 7, list_of<unsigned int>(2)(4)(5)(6)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 8, list_of<unsigned int>(2)(3)(5)(7) );
+  ASSERT( adjacency.size() == 9,
+      "SphericalPointDistribution::getConnections<9>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<10>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(2)(3)(4)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(6)(7)(8)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(4)(5)(6)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(4)(5)(8)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(2)(3)(6)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(0)(2)(3)(7)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 6, list_of<unsigned int>(1)(2)(4)(7)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 7, list_of<unsigned int>(1)(2)(5)(6)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 8, list_of<unsigned int>(1)(3)(5)(7)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 9, list_of<unsigned int>(1)(3)(4)(6)(8) );
+  ASSERT( adjacency.size() == 10,
+      "SphericalPointDistribution::getConnections<10>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<11>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(1)(2)(3)(4)(5) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(0)(2)(5)(6)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(1)(3)(6)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(2)(4)(7)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(3)(5)(8)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(0)(1)(4)(9)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 6, list_of<unsigned int>(1)(2)(7)(8)(9)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 7, list_of<unsigned int>(2)(3)(6)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 8, list_of<unsigned int>(3)(4)(6)(7)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 9, list_of<unsigned int>(4)(5)(6)(8)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 10, list_of<unsigned int>(1)(5)(6)(9) );
+  ASSERT( adjacency.size() == 11,
+      "SphericalPointDistribution::getConnections<11>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<12>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(2)(3)(4)(5)(6) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(7)(8)(9)(10)(11) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(3)(6)(9)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(2)(4)(10)(11) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(3)(5)(7)(11) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(0)(4)(6)(7)(8) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 6, list_of<unsigned int>(0)(2)(5)(8)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 7, list_of<unsigned int>(1)(4)(5)(8)(11) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 8, list_of<unsigned int>(1)(5)(6)(7)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 9, list_of<unsigned int>(1)(2)(6)(8)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 10, list_of<unsigned int>(1)(2)(3)(9)(11) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 11, list_of<unsigned int>(1)(3)(4)(7)(10) );
+  ASSERT( adjacency.size() == 12,
+      "SphericalPointDistribution::getConnections<12>() - adjacency has wrong size.");
+  return adjacency;
+}
+
+template <>
+SphericalPointDistribution::adjacency_t SphericalPointDistribution::getConnections<14>()
+{
+  adjacency_t adjacency;
+  adjacency += make_pair<unsigned int, IndexSet_t >( 0, list_of<unsigned int>(2)(3)(4)(5)(6)(7) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 1, list_of<unsigned int>(8)(9)(10)(11)(12)(13) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 2, list_of<unsigned int>(0)(3)(7)(8)(13) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 3, list_of<unsigned int>(0)(2)(4)(8)(9) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 4, list_of<unsigned int>(0)(3)(5)(9)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 5, list_of<unsigned int>(0)(4)(6)(10)(11) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 6, list_of<unsigned int>(0)(5)(7)(11)(12) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 7, list_of<unsigned int>(0)(2)(6)(12)(13) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 8, list_of<unsigned int>(1)(2)(3)(9)(13) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 9, list_of<unsigned int>(1)(3)(4)(8)(10) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 10, list_of<unsigned int>(1)(4)(5)(9)(11) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 11, list_of<unsigned int>(1)(5)(6)(10)(12) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 12, list_of<unsigned int>(1)(6)(7)(11)(13) );
+  adjacency += make_pair<unsigned int, IndexSet_t >( 13, list_of<unsigned int>(1)(2)(7)(8)(12) );
+  ASSERT( adjacency.size() == 14,
+      "SphericalPointDistribution::getConnections<14>() - adjacency has wrong size.");
+  return adjacency;
+}
Index: src/Fragmentation/Exporters/unittests/Makefile.am
===================================================================
--- src/Fragmentation/Exporters/unittests/Makefile.am	(revision 3678ebc57e18808f8b12560be8edf24e11074a7c)
+++ src/Fragmentation/Exporters/unittests/Makefile.am	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
@@ -12,5 +12,6 @@
 	../Fragmentation/Exporters/unittests/SaturatedFragmentUnitTest.hpp \
 	../Fragmentation/Exporters/unittests/SaturationDistanceMaximizerUnitTest.hpp \
-	../Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp
+	../Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp \
+	../Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest_assistant.hpp
 
 FRAGMENTATIONEXPORTERSTESTS = \
Index: src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp
===================================================================
--- src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp	(revision 3678ebc57e18808f8b12560be8edf24e11074a7c)
+++ src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.cpp	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
@@ -45,4 +45,5 @@
 #include "SphericalPointDistributionUnitTest.hpp"
 
+#include <algorithm>
 #include <boost/assign.hpp>
 #include <boost/math/quaternion.hpp>
@@ -53,7 +54,10 @@
 #include "LinearAlgebra/Line.hpp"
 
+#include "Atom/TesselPoint.hpp"
 #include "Fragmentation/Exporters/SphericalPointDistribution.hpp"
-
-#include "LinearAlgebra/Line.hpp"
+#include "LinkedCell/linkedcell.hpp"
+#include "LinkedCell/PointCloudAdaptor.hpp"
+#include "Tesselation/BoundaryLineSet.hpp"
+#include "Tesselation/tesselation.hpp"
 
 #ifdef HAVE_TESTRUNNER
@@ -78,5 +82,5 @@
   ASSERT_DO(Assert::Throw);
 
-  setVerbosity(6);
+  setVerbosity(2);
 }
 
@@ -270,73 +274,69 @@
 }
 
-/** UnitTest for matchSphericalPointDistributions() with two points
- */
-void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_2()
-{
+/** UnitTest for getConnections()
+ */
+template <>
+void SphericalPointDistributionTest_assistant::getConnectionTest<0>()
+{
+  const int N=0;
   SphericalPointDistribution SPD(1.);
-  // test with one point, matching trivially
-  {
-    SphericalPointDistribution::WeightedPolygon_t polygon;
-    polygon += std::make_pair(Vector(1.,0.,0.), 1);
-    SphericalPointDistribution::Polygon_t newpolygon =
-        SPD.get<2>();
-    SphericalPointDistribution::Polygon_t expected;
-    expected += Vector(-1.,0.,0.);
-    SphericalPointDistribution::Polygon_t remaining =
-        SphericalPointDistribution::matchSphericalPointDistributions(
-            polygon,
-            newpolygon);
-//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
-    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
-  }
-
-  // test with one point, just a flip of axis
-  {
-    SphericalPointDistribution::WeightedPolygon_t polygon;
-    polygon += std::make_pair( Vector(0.,1.,0.), 1);
-    SphericalPointDistribution::Polygon_t newpolygon =
-        SPD.get<2>();
-    SphericalPointDistribution::Polygon_t expected;
-    expected += Vector(0.,-1.,0.);
-    SphericalPointDistribution::Polygon_t remaining =
-        SphericalPointDistribution::matchSphericalPointDistributions(
-            polygon,
-            newpolygon);
-//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
-    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
-  }
-
-  // test with one point, just a flip to another axis
-  {
-    SphericalPointDistribution::WeightedPolygon_t polygon;
-    polygon += std::make_pair( Vector(0.,0.,-1.), 1);
-    SphericalPointDistribution::Polygon_t newpolygon =
-        SPD.get<2>();
-    SphericalPointDistribution::Polygon_t expected;
-    expected += Vector(0.,0.,1.);
-    SphericalPointDistribution::Polygon_t remaining =
-        SphericalPointDistribution::matchSphericalPointDistributions(
-            polygon,
-            newpolygon);
-//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
-    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
-  }
-
-  // test with one point, full rotation
-  {
-    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
-    SphericalPointDistribution::WeightedPolygon_t polygon;
-    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
-    SphericalPointDistribution::Polygon_t newpolygon =
-        SPD.get<2>();
-    SphericalPointDistribution::Polygon_t expected;
-    expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
-    SphericalPointDistribution::Polygon_t remaining =
-        SphericalPointDistribution::matchSphericalPointDistributions(
-            polygon,
-            newpolygon);
-//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
-    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
-  }
+
+  // create empty adjacency
+  SphericalPointDistribution::adjacency_t adjacency;
+
+  // get the implemented connections
+  SphericalPointDistribution::adjacency_t expected =
+      SPD.getConnections<N>();
+
+  // and compare the two
+  CPPUNIT_ASSERT_EQUAL( expected, adjacency );
+}
+
+/** UnitTest for getConnections()
+ */
+template <>
+void SphericalPointDistributionTest_assistant::getConnectionTest<1>()
+{
+  const int N=1;
+  SphericalPointDistribution SPD(1.);
+
+  // create empty adjacency
+  SphericalPointDistribution::adjacency_t adjacency;
+
+  // get the implemented connections
+  SphericalPointDistribution::adjacency_t expected =
+      SPD.getConnections<N>();
+
+  // and compare the two
+  CPPUNIT_ASSERT_EQUAL( expected, adjacency );
+}
+
+/** UnitTest for getConnections()
+ */
+template <>
+void SphericalPointDistributionTest_assistant::getConnectionTest<2>()
+{
+  const int N=2;
+  SphericalPointDistribution SPD(1.);
+
+  // create empty adjacency
+  SphericalPointDistribution::adjacency_t adjacency;
+  adjacency +=
+      make_pair<
+      unsigned int,
+      SphericalPointDistribution::IndexSet_t >
+        (0, list_of<unsigned int>(1));
+  adjacency +=
+      make_pair<
+      unsigned int,
+      SphericalPointDistribution::IndexSet_t >
+        (1, list_of<unsigned int>(0));
+
+  // get the implemented connections
+  SphericalPointDistribution::adjacency_t expected =
+      SPD.getConnections<N>();
+
+  // and compare the two
+  CPPUNIT_ASSERT_EQUAL( expected, adjacency );
 }
 
@@ -460,4 +460,75 @@
 }
 
+/** UnitTest for matchSphericalPointDistributions() with two points
+ */
+void SphericalPointDistributionTest::matchSphericalPointDistributionsTest_2()
+{
+  SphericalPointDistribution SPD(1.);
+  // test with one point, matching trivially
+  {
+    SphericalPointDistribution::WeightedPolygon_t polygon;
+    polygon += std::make_pair(Vector(1.,0.,0.), 1);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<2>();
+    SphericalPointDistribution::Polygon_t expected;
+    expected += Vector(-1.,0.,0.);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
+  }
+
+  // test with one point, just a flip of axis
+  {
+    SphericalPointDistribution::WeightedPolygon_t polygon;
+    polygon += std::make_pair( Vector(0.,1.,0.), 1);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<2>();
+    SphericalPointDistribution::Polygon_t expected;
+    expected += Vector(0.,-1.,0.);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
+  }
+
+  // test with one point, just a flip to another axis
+  {
+    SphericalPointDistribution::WeightedPolygon_t polygon;
+    polygon += std::make_pair( Vector(0.,0.,-1.), 1);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<2>();
+    SphericalPointDistribution::Polygon_t expected;
+    expected += Vector(0.,0.,1.);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
+  }
+
+  // test with one point, full rotation
+  {
+    Line RotationAxis(zeroVec, Vector(0.2, 0.43, 0.6893248));
+    SphericalPointDistribution::WeightedPolygon_t polygon;
+    polygon += std::make_pair(RotationAxis.rotateVector(Vector(1.,0.,0.), 47.6/180*M_PI), 1);
+    SphericalPointDistribution::Polygon_t newpolygon =
+        SPD.get<2>();
+    SphericalPointDistribution::Polygon_t expected;
+    expected += RotationAxis.rotateVector(Vector(-1.,0.,0.), 47.6/180*M_PI);
+    SphericalPointDistribution::Polygon_t remaining =
+        SphericalPointDistribution::matchSphericalPointDistributions(
+            polygon,
+            newpolygon);
+//    CPPUNIT_ASSERT_EQUAL( expected, remaining );
+    CPPUNIT_ASSERT( areEqualToWithinBounds(expected, remaining, CenterAccuracy) );
+  }
+}
+
 /** UnitTest for matchSphericalPointDistributions() with three points
  */
Index: src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp
===================================================================
--- src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp	(revision 3678ebc57e18808f8b12560be8edf24e11074a7c)
+++ src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest.hpp	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
@@ -19,10 +19,44 @@
 /********************************************** Test classes **************************************/
 
-class SphericalPointDistributionTest : public CppUnit::TestFixture
+/** Template specialization needs to be in front of adding the test via CPPUNIT_TEST
+ * Hence,we put it in an extra class and inherit the functions.
+ */
+struct SphericalPointDistributionTest_assistant
 {
+public:
+  template <int N>
+  void getConnectionTest();
+};
+
+template <> void SphericalPointDistributionTest_assistant::getConnectionTest<0>();
+template <> void SphericalPointDistributionTest_assistant::getConnectionTest<1>();
+template <> void SphericalPointDistributionTest_assistant::getConnectionTest<2>();
+
+#include "SphericalPointDistributionUnitTest_assistant.hpp"
+
+class SphericalPointDistributionTest :
+  public CppUnit::TestFixture,
+  public SphericalPointDistributionTest_assistant
+{
+
+private:
     CPPUNIT_TEST_SUITE( SphericalPointDistributionTest) ;
     CPPUNIT_TEST( calculateCenterOfMinimumDistanceTest );
     CPPUNIT_TEST ( areEqualToWithinBoundsTest );
     CPPUNIT_TEST ( joinPointsTest );
+    CPPUNIT_TEST ( getConnectionTest<0> );
+    CPPUNIT_TEST ( getConnectionTest<1> );
+    CPPUNIT_TEST ( getConnectionTest<2> );
+    CPPUNIT_TEST ( getConnectionTest<3> );
+    CPPUNIT_TEST ( getConnectionTest<4> );
+    CPPUNIT_TEST ( getConnectionTest<5> );
+    CPPUNIT_TEST ( getConnectionTest<6> );
+    CPPUNIT_TEST ( getConnectionTest<7> );
+    CPPUNIT_TEST ( getConnectionTest<8> );
+    CPPUNIT_TEST ( getConnectionTest<9> );
+    CPPUNIT_TEST ( getConnectionTest<10> );
+    CPPUNIT_TEST ( getConnectionTest<11> );
+    CPPUNIT_TEST ( getConnectionTest<12> );
+    CPPUNIT_TEST ( getConnectionTest<14> );
     CPPUNIT_TEST ( matchSphericalPointDistributionsTest_2 );
     CPPUNIT_TEST ( matchSphericalPointDistributionsTest_3 );
@@ -32,5 +66,5 @@
     CPPUNIT_TEST ( matchSphericalPointDistributionsTest_7 );
     CPPUNIT_TEST ( matchSphericalPointDistributionsTest_8 );
-    CPPUNIT_TEST ( matchSphericalPointDistributionsTest_multiple );
+//    CPPUNIT_TEST ( matchSphericalPointDistributionsTest_multiple );
     CPPUNIT_TEST_SUITE_END();
 
Index: src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest_assistant.hpp
===================================================================
--- src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest_assistant.hpp	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
+++ src/Fragmentation/Exporters/unittests/SphericalPointDistributionUnitTest_assistant.hpp	(revision 6393ff1ff061bf36c0e20f302fe2046f0f07cf64)
@@ -0,0 +1,114 @@
+/*
+ * SphericalPointDistribution_assistant.hpp
+ *
+ *  Created on: Jul 12, 2014
+ *      Author: heber
+ */
+
+#ifndef SPHERICALPOINTDISTRIBUTION_ASSISTANT_HPP_
+#define SPHERICALPOINTDISTRIBUTION_ASSISTANT_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "SphericalPointDistributionUnitTest.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include "Atom/TesselPoint.hpp"
+#include "Fragmentation/Exporters/SphericalPointDistribution.hpp"
+#include "LinkedCell/linkedcell.hpp"
+#include "LinkedCell/PointCloudAdaptor.hpp"
+#include "Tesselation/BoundaryLineSet.hpp"
+#include "Tesselation/tesselation.hpp"
+
+
+// class generator: taken from www.cplusplus.com example std::generate
+struct c_unique {
+  unsigned int current;
+  c_unique() {current=0;}
+  unsigned int operator()() {return current++;}
+} UniqueNumber;
+
+struct VectorToTesselPoint
+{
+  TesselPoint * operator()(const Vector &_v, const unsigned int _index) {
+    TesselPoint *t = new TesselPoint();
+    t->setPosition(_v);
+    t->setNr(_index);
+    return t;
+  }
+};
+
+/** UnitTest for getConnections()
+ */
+template <int N>
+void SphericalPointDistributionTest_assistant::getConnectionTest()
+{
+  SphericalPointDistribution SPD(1.);
+  // get the points and convert into TesselPoint list
+  SphericalPointDistribution::Polygon_t newpolygon = SPD.get<N>();
+  TesselPointSTLList Corners;
+  SphericalPointDistribution::IndexList_t indices(N);
+  std::generate(indices.begin(), indices.end(), UniqueNumber);
+  std::transform(
+      newpolygon.begin(), newpolygon.end(),
+      indices.begin(),
+      std::back_inserter(Corners),
+      VectorToTesselPoint());
+
+  // create the tesselation
+  const double SPHERERADIUS = 1.5;
+  Tesselation TesselStruct;
+  PointCloudAdaptor<TesselPointSTLList> cloud(&Corners, "TesselPointSTLList");
+  TesselStruct(cloud, SPHERERADIUS);
+
+  // create a adjacency list from a tesselation of the (convex set of) points
+  SphericalPointDistribution::adjacency_t adjacency;
+  for (LineMap::const_iterator iter = TesselStruct.LinesOnBoundary.begin();
+      iter != TesselStruct.LinesOnBoundary.end(); ++iter) {
+    const BoundaryLineSet * const line = iter->second;
+    {
+      std::pair< SphericalPointDistribution::adjacency_t::iterator, bool > inserter =
+          adjacency.insert(
+                std::make_pair(
+                    line->endpoints[0]->Nr,
+                    SphericalPointDistribution::IndexSet_t() ));
+      inserter.first->second.insert(line->endpoints[1]->Nr);
+      LOG(6, "DEBUG: Inserting " << line->endpoints[0]->Nr << "," << line->endpoints[1]->Nr);
+    }
+    {
+      std::pair< SphericalPointDistribution::adjacency_t::iterator, bool > inserter =
+          adjacency.insert(
+                std::make_pair(
+                    line->endpoints[1]->Nr,
+                    SphericalPointDistribution::IndexSet_t() ));
+      inserter.first->second.insert(line->endpoints[0]->Nr);
+      LOG(6, "DEBUG: Inserting " << line->endpoints[1]->Nr << "," << line->endpoints[0]->Nr);
+    }
+  }
+
+  // get the implemented connections
+  SphericalPointDistribution::adjacency_t expected =
+      SPD.getConnections<N>();
+
+//  // print the map: for debugging and extracting the edges for getConnections()
+//  std::cout << "\tadjacency_t adjacency;" << std::endl;
+//  for (SphericalPointDistribution::adjacency_t::const_iterator iter = adjacency.begin();
+//      iter != adjacency.end(); ++iter) {
+//    std::cout << "\tadjacency += make_pair<unsigned int, IndexSet_t >( "
+//        << iter->first << ", list_of<unsigned int>";
+//    for (SphericalPointDistribution::IndexSet_t::const_iterator indexiter = iter->second.begin();
+//        indexiter != iter->second.end(); ++indexiter)
+//      std::cout << "(" << *indexiter << ")";
+//    std::cout << " );" << std::endl;
+//  }
+
+  // and compare the two
+  CPPUNIT_ASSERT_EQUAL( expected, adjacency );
+}
+
+
+#endif /* SPHERICALPOINTDISTRIBUTION_ASSISTANT_HPP_ */
