Index: src/LinkedCell/LinkedCell.hpp
===================================================================
--- src/LinkedCell/LinkedCell.hpp	(revision d8296152e374a74c483120eb411121989ba27a98)
+++ src/LinkedCell/LinkedCell.hpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
@@ -16,9 +16,7 @@
 #include "LinkedCell/types.hpp"
 
+class TesselPoint;
+
 namespace LinkedCell {
-
-  //!> linked list of tesselpoints
-  typedef std::list<TesselPoint *> LinkedList;
-
 
   /** This class contains a specific cell of a three-dimensional linked cell
Index: src/LinkedCell/LinkedCell_View.cpp
===================================================================
--- src/LinkedCell/LinkedCell_View.cpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
+++ src/LinkedCell/LinkedCell_View.cpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
@@ -0,0 +1,85 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2011 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * LinkedCell_View.cpp
+ *
+ *  Created on: Nov 15, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "LinkedCell_View.hpp"
+
+#include "Atom/TesselPoint.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "LinkedCell.hpp"
+#include "LinkedCell_Model.hpp"
+
+using namespace LinkedCell;
+
+LinkedCell_View::LinkedCell_View(const LinkedCell_Model &_LC) :
+    LC(_LC)
+{}
+
+LinkedCell_View::~LinkedCell_View()
+{
+}
+
+/** Return at least as many points as are inside a sphere of \a radius around \a center.
+ *
+ * \sa LinkedCell_View::getPointsInsideSphere()
+ *
+ * @param radius radius of sphere
+ * @param center center of sphere
+ * @return a list containing at least all points inside described sphere
+ */
+LinkedList LinkedCell_View::getAllNeighbors(const double radius, const Vector &center) const
+{
+  LinkedList TesselList;  // we do not need a set, as nodes are uniquely associated to a cell.
+
+  // get relative bounds
+  const tripleIndex step = LC.getStep(radius);
+  const tripleIndex index = LC.getIndexToVector(center);
+  LinkedCell_Model::LinkedCellNeighborhoodBounds neighbors =
+      LC.getNeighborhoodBounds(index, step);
+
+  tripleIndex n;
+  for (n[0] = neighbors.first[0]; n[0] <= neighbors.second[0]; n[0]++)
+    for (n[1] = neighbors.first[1]; n[1] <= neighbors.second[1]; n[1]++)
+      for (n[2] = neighbors.first[2]; n[2] <= neighbors.second[2]; n[2]++) {
+        if (!LC.checkArrayBounds(n))
+          LC.applyBoundaryConditions(n);
+        const LinkedCell &List = LC.getCell(n);
+        //LOG(1, "Current cell is " << n[0] << ", " << n[1] << ", " << n[2] << " with No. " << index << ".");
+        for (LinkedCell::const_iterator Runner = List.begin(); Runner != List.end(); Runner++)
+          TesselList.push_back(*Runner);
+      }
+  return TesselList;
+}
+
+LinkedList LinkedCell_View::getPointsInsideSphere(const double radius, const Vector &center) const
+{
+  // get overly much points
+  const LinkedList TesselList = getAllNeighbors(radius, center);
+  LinkedList ReturnList;
+
+  // remove all unnecessary ones
+  for (LinkedList::const_iterator iter = TesselList.begin(); iter != TesselList.end(); ++iter) {
+    if (center.DistanceSquared((*iter)->getPosition()) <= radius*radius)
+      ReturnList.push_back(*iter);
+  }
+
+  return ReturnList;
+}
+
Index: src/LinkedCell/LinkedCell_View.hpp
===================================================================
--- src/LinkedCell/LinkedCell_View.hpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
+++ src/LinkedCell/LinkedCell_View.hpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
@@ -0,0 +1,47 @@
+/*
+ * LinkedCell_View.hpp
+ *
+ *  Created on: Nov 15, 2011
+ *      Author: heber
+ */
+
+#ifndef LINKEDCELL_VIEW_HPP_
+#define LINKEDCELL_VIEW_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "LinkedCell/types.hpp"
+
+class TesselPoint;
+class Vector;
+
+namespace LinkedCell {
+
+  class LinkedCell_Model;
+
+  /** This is the view of the MVC ansatz for the LinkedCell structure.
+   *
+   * \sa linkedcell
+   *
+   * The view contains high-level functions for the user to use. He does not
+   * need to know anything about the inner workings.
+   *
+   */
+  class LinkedCell_View
+  {
+  public:
+    LinkedCell_View(const LinkedCell_Model &_LC);
+    ~LinkedCell_View();
+
+    LinkedList getAllNeighbors(const double radius, const Vector &center) const;
+    LinkedList getPointsInsideSphere(const double radius, const Vector &center) const;
+  private:
+    const LinkedCell_Model &LC;
+  };
+
+}
+
+#endif /* LINKEDCELL_VIEW_HPP_ */
Index: src/LinkedCell/types.hpp
===================================================================
--- src/LinkedCell/types.hpp	(revision d8296152e374a74c483120eb411121989ba27a98)
+++ src/LinkedCell/types.hpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
@@ -31,4 +31,7 @@
   class LinkedCell;
 
+  //!> linked list of tesselpoints
+  typedef std::list<TesselPoint *> LinkedList;
+
   //!> three-dimensional array of LinkedCell instances
   typedef boost::multi_array<LinkedCell *, NDIM> LinkedCellArray;
Index: src/LinkedCell/unittests/LinkedCell_ViewUnitTest.cpp
===================================================================
--- src/LinkedCell/unittests/LinkedCell_ViewUnitTest.cpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
+++ src/LinkedCell/unittests/LinkedCell_ViewUnitTest.cpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
@@ -0,0 +1,180 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2011 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * LinkedCell_ViewUnitTest.cpp
+ *
+ *  Created on: Nov 18, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+using namespace std;
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include <algorithm>
+#include <list>
+
+#include "Box.hpp"
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+#include "LinearAlgebra/defs.hpp"
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
+#include "LinkedCell/LinkedCell.hpp"
+#include "LinkedCell/LinkedCell_Model.hpp"
+#include "LinkedCell/LinkedCell_View.hpp"
+#include "LinkedCell/PointCloudAdaptor.hpp"
+
+#include "LinkedCell_ViewUnitTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+#define DOMAINLENGTH 20.
+#define EDGELENGTH 2.
+#define NUMBERCELLS DOMAINLENGTH/EDGELENGTH
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( LinkedCell_ViewTest );
+
+
+void LinkedCell_ViewTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  //setVerbosity(3);
+
+  // create diag(20.) matrix
+  RealSpaceMatrix BoxM;
+  BoxM.setIdentity();
+  BoxM *= 20.;
+
+  // create Box with this matrix
+  domain = new Box(BoxM);
+
+  // create LinkedCell structure with this Box
+  LCImpl = new LinkedCell::LinkedCell_Model(EDGELENGTH, *domain);
+
+  // create a list of nodes and add to LCImpl
+  std::vector< Vector > VectorList;
+  for (size_t i=0;i<((size_t)floor(NUMBERCELLS));++i)
+    VectorList.push_back(Vector((double)i*EDGELENGTH,(double)i*EDGELENGTH,(double)i*EDGELENGTH));
+  for (size_t i=0;i<VectorList.size();++i) {
+    TesselPoint * Walker = new TesselPoint();
+    Walker->setName(std::string("Walker")+toString(i));
+    Walker->setPosition(VectorList[i]);
+    NodeList.insert(Walker);
+    LCImpl->addNode(Walker);
+  }
+
+  // create LinkedCell_View from that
+  LC = new LinkedCell::LinkedCell_View(*LCImpl);
+}
+
+
+void LinkedCell_ViewTest::tearDown()
+{
+  delete LC;
+  delete LCImpl;
+  delete domain;
+
+  // remove all nodes again
+  for (PointSet::iterator iter = NodeList.begin();
+      !NodeList.empty();
+      iter = NodeList.begin()) {
+    delete *iter;
+    NodeList.erase(iter);
+  }
+}
+
+
+/** UnitTest for getAllNeighbors()
+ */
+void LinkedCell_ViewTest::getAllNeighborsTest()
+{
+  // define some center vector
+  Vector center(DOMAINLENGTH/2.,DOMAINLENGTH/2.,DOMAINLENGTH/2.);
+
+  // get LinkedList from LC
+  const double distance = 2.;
+  LinkedCell::LinkedList NeighborList = LC->getAllNeighbors(distance, center);
+//  for (LinkedCell::LinkedList::const_iterator iter = NeighborList.begin();
+//      iter != NeighborList.end(); ++iter)
+//    std::cout << **iter << " is in returned neighbor list." << std::endl;
+
+  // gather points from NodeList
+  LinkedCell::LinkedList ComparisonList;
+  for (PointSet::const_iterator iter = NodeList.begin(); iter != NodeList.end(); ++iter)
+    if (center.DistanceSquared((*iter)->getPosition()) <= distance*distance) {
+      ComparisonList.push_back(*iter);
+      //std::cout << **iter << " is inside of " << center << " plus " << distance << "." << std::endl;
+    }
+  // check that we get at least as many as needed
+  CPPUNIT_ASSERT(ComparisonList.size() <= NeighborList.size());
+
+  // sort lists to ease comparison
+  ComparisonList.sort();
+  NeighborList.sort();
+
+  // check element-wise and skip unrequired ones
+  LinkedCell::LinkedList::iterator iter1 = ComparisonList.begin();
+  LinkedCell::LinkedList::iterator iter2 = NeighborList.begin();
+  for(;(iter1 != ComparisonList.end()) && (iter2 != NeighborList.end()); ++iter1, ++iter2) {
+    while (*iter1 != *iter2)
+      ++iter2;
+    //std::cout << **iter1 << " == " << **iter2 << std::endl;
+    CPPUNIT_ASSERT( iter2 != NeighborList.end() );
+  }
+}
+
+/** UnitTest for getPointsInsideSphere()
+ */
+void LinkedCell_ViewTest::getPointsInsideSphereTest()
+{
+  // define some center vector
+  Vector center(DOMAINLENGTH/2.,DOMAINLENGTH/2.,DOMAINLENGTH/2.);
+
+  // get LinkedList from LC
+  const double distance = 2.;
+  LinkedCell::LinkedList NeighborList = LC->getPointsInsideSphere(distance, center);
+//  for (LinkedCell::LinkedList::const_iterator iter = NeighborList.begin();
+//      iter != NeighborList.end(); ++iter)
+//    std::cout << **iter << " is in returned restricted neighbor list." << std::endl;
+
+  // gather points from NodeList
+  LinkedCell::LinkedList ComparisonList;
+  for (PointSet::const_iterator iter = NodeList.begin(); iter != NodeList.end(); ++iter)
+    if (center.DistanceSquared((*iter)->getPosition()) <= distance*distance) {
+      ComparisonList.push_back(*iter);
+      //std::cout << **iter << " is inside of " << center << " plus " << distance << "." << std::endl;
+    }
+  // check that we get at least as many as needed
+  CPPUNIT_ASSERT(ComparisonList.size() == NeighborList.size());
+
+  // sort lists to ease comparison
+  ComparisonList.sort();
+  NeighborList.sort();
+
+  // check element-wise and skip unrequired ones
+  LinkedCell::LinkedList::iterator iter1 = ComparisonList.begin();
+  LinkedCell::LinkedList::iterator iter2 = NeighborList.begin();
+  for(;(iter1 != ComparisonList.end()) && (iter2 != NeighborList.end()); ++iter1, ++iter2) {
+    //std::cout << **iter1 << " == " << **iter2 << std::endl;
+    CPPUNIT_ASSERT( *iter1 == *iter2 );
+  }
+}
Index: src/LinkedCell/unittests/LinkedCell_ViewUnitTest.hpp
===================================================================
--- src/LinkedCell/unittests/LinkedCell_ViewUnitTest.hpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
+++ src/LinkedCell/unittests/LinkedCell_ViewUnitTest.hpp	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
@@ -0,0 +1,50 @@
+/*
+ * LinkedCell_ViewUnitTest.hpp
+ *
+ *  Created on: Nov 18, 2011
+ *      Author: heber
+ */
+
+#ifndef LINKEDCELL_VIEWUNITTEST_HPP_
+#define LINKEDCELL_VIEWUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+class Box;
+
+namespace LinkedCell {
+  class LinkedCell_View;
+}
+
+#include <cppunit/extensions/HelperMacros.h>
+
+/********************************************** Test classes **************************************/
+
+class LinkedCell_ViewTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( LinkedCell_ViewTest) ;
+    CPPUNIT_TEST ( getAllNeighborsTest );
+    CPPUNIT_TEST ( getPointsInsideSphereTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+
+      void getAllNeighborsTest();
+      void getPointsInsideSphereTest();
+
+private:
+      typedef std::set<TesselPoint *> PointSet;
+      PointSet NodeList;
+
+      Box *domain;
+      LinkedCell::LinkedCell_Model *LCImpl;
+      LinkedCell::LinkedCell_View *LC;
+};
+
+
+#endif /* LINKEDCELL_VIEWUNITTEST_HPP_ */
Index: src/LinkedCell/unittests/Makefile.am
===================================================================
--- src/LinkedCell/unittests/Makefile.am	(revision d8296152e374a74c483120eb411121989ba27a98)
+++ src/LinkedCell/unittests/Makefile.am	(revision 5344e4935985c68c502a7e1e2e936a0ac622ef57)
@@ -5,6 +5,8 @@
 	../LinkedCell/LinkedCell.cpp \
 	../LinkedCell/LinkedCell_Model.cpp \
+	../LinkedCell/LinkedCell_View.cpp \
 	../LinkedCell/unittests/LinkedCellUnitTest.cpp \
 	../LinkedCell/unittests/LinkedCell_ModelUnitTest.cpp \
+	../LinkedCell/unittests/LinkedCell_ViewUnitTest.cpp \
 	../LinkedCell/unittests/linkedcellUnitTest.cpp
 
@@ -12,7 +14,9 @@
 	../LinkedCell/LinkedCell.hpp \
 	../LinkedCell/LinkedCell_Model.hpp \
+	../LinkedCell/LinkedCell_View.hpp \
 	../LinkedCell/PointCloudAdaptor.hpp \
 	../LinkedCell/unittests/LinkedCellUnitTest.hpp \
 	../LinkedCell/unittests/LinkedCell_ModelUnitTest.hpp \
+	../LinkedCell/unittests/LinkedCell_ViewUnitTest.hpp \
 	../LinkedCell/unittests/linkedcellUnitTest.hpp
 
@@ -20,4 +24,5 @@
   LinkedCellUnitTest \
   LinkedCell_ModelUnitTest \
+  LinkedCell_ViewUnitTest \
   linkedcellUnitTest
 
@@ -59,4 +64,15 @@
 LinkedCell_ModelUnitTest_LDADD = $(LINKEDCELLLIBS)
 
+LinkedCell_ViewUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../LinkedCell/unittests/LinkedCell_ViewUnitTest.cpp \
+	../LinkedCell/unittests/LinkedCell_ViewUnitTest.hpp \
+	../LinkedCell/LinkedCell.cpp \
+	../LinkedCell/LinkedCell_Model.cpp \
+	../LinkedCell/LinkedCell_View.cpp \
+	../LinkedCell/LinkedCell.hpp \
+	../LinkedCell/LinkedCell_Model.hpp \
+	../LinkedCell/LinkedCell_View.hpp \
+	../LinkedCell/PointCloudAdaptor.hpp
+LinkedCell_ViewUnitTest_LDADD = $(LINKEDCELLLIBS)
 
 #AUTOMAKE_OPTIONS = parallel-tests
