Index: src/LinkedCell/LinkedCell.cpp
===================================================================
--- src/LinkedCell/LinkedCell.cpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
+++ src/LinkedCell/LinkedCell.cpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
@@ -0,0 +1,76 @@
+/*
+ * 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.cpp
+ *
+ *  Created on: Nov 15, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "LinkedCell/types.hpp"
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <algorithm>
+
+#include "CodePatterns/Assert.hpp"
+#include "LinkedCell/LinkedCell.hpp"
+#include "Atom/TesselPoint.hpp"
+
+
+LinkedCell::LinkedCell::LinkedCell(const tripleIndex &_indices) :
+    indices(_indices)
+{}
+
+LinkedCell::LinkedCell::~LinkedCell()
+{
+  // prevent us from deleting any contained points
+  clear();
+}
+
+const LinkedCell::tripleIndex& LinkedCell::LinkedCell::getIndices() const
+{
+  return indices;
+}
+
+const LinkedCell::LinkedCellArray::index& LinkedCell::LinkedCell::getIndex(const size_t index) const
+{
+  ASSERT((index >=0) && (index <=2),
+      "LinkedCell::getIndex() - given index "+toString(index)+" is out of bounds [0,2].");
+  return indices[index];
+}
+
+/** Add \a *point to this LinkedCell.
+ *
+ * @param point point to add
+ */
+void LinkedCell::LinkedCell::addPoint(TesselPoint *point)
+{
+  push_back(point);
+}
+
+
+/** Remove \a *point from this LinkedCell.
+ *
+ * We do nothing if point is not found.
+ *
+ * @param point point to remove
+ */
+void LinkedCell::LinkedCell::deletePoint(const TesselPoint *point)
+{
+  LinkedList::iterator iter = find(begin(), end(), point);
+  ASSERT( iter != end(),
+      "LinkedCell::LinkedCell::deletePoint() - "+toString(*point)+" not present in this cell.");
+  if (iter != end())
+    erase(iter);
+}
Index: src/LinkedCell/LinkedCell.hpp
===================================================================
--- src/LinkedCell/LinkedCell.hpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
+++ src/LinkedCell/LinkedCell.hpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
@@ -0,0 +1,53 @@
+/*
+ * LinkedCell.hpp
+ *
+ *  Created on: Nov 15, 2011
+ *      Author: heber
+ */
+
+#ifndef LINKEDCELL_HPP_
+#define LINKEDCELL_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "LinkedCell/types.hpp"
+
+namespace LinkedCell {
+
+  //!> linked list of tesselpoints
+  typedef std::list<TesselPoint *> LinkedList;
+
+
+  /** This class contains a specific cell of a three-dimensional linked cell
+   * mesh.
+   *
+   * Basically, we extend LinkedList by the triplet of indices.
+   */
+  class LinkedCell : public LinkedList
+  {
+  public:
+    explicit LinkedCell(const tripleIndex &_indices);
+    ~LinkedCell();
+
+    const tripleIndex& getIndices() const;
+    const LinkedCellArray::index& getIndex(const size_t index) const;
+
+    void addPoint(TesselPoint *point);
+    void deletePoint(const TesselPoint *point);
+
+  private:
+    /** We do not allow a default constructor.
+     *
+     */
+    LinkedCell();
+
+    tripleIndex indices;
+  };
+
+}
+
+
+#endif /* LINKEDCELL_HPP_ */
Index: src/LinkedCell/types.hpp
===================================================================
--- src/LinkedCell/types.hpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
+++ src/LinkedCell/types.hpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
@@ -0,0 +1,35 @@
+/*
+ * types.hpp
+ *
+ *  Created on: Nov 15, 2011
+ *      Author: heber
+ */
+
+#ifndef LINKEDCELL_TYPES_HPP_
+#define LINKEDCELL_TYPES_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <list>
+#include <vector>
+
+#include <boost/array.hpp>
+#include <boost/multi_array.hpp>
+
+class TesselPoint;
+
+namespace LinkedCell {
+
+  class LinkedCell;
+
+  //!> three-dimensional array of LinkedCell instances
+  typedef boost::multi_array<LinkedCell *, 3> LinkedCellArray;
+
+  //!> vector of 3 indices
+  typedef boost::array<LinkedCellArray::index, 3> tripleIndex;
+}
+
+#endif /* LINKEDCELL_TYPES_HPP_ */
Index: src/LinkedCell/unittests/LinkedCellUnitTest.cpp
===================================================================
--- src/LinkedCell/unittests/LinkedCellUnitTest.cpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
+++ src/LinkedCell/unittests/LinkedCellUnitTest.cpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+/*
+ * LinkedCellUnitTest.cpp
+ *
+ *  Created on: Nov 14, 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 "Atom/TesselPoint.hpp"
+#include "CodePatterns/Assert.hpp"
+#include "LinkedCell/LinkedCell.hpp"
+
+#include "LinkedCellUnitTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( LinkedCelltest );
+
+
+void LinkedCelltest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  // this must not compile as default cstor is private
+  //cell = new LinkedCell();
+
+  indices[0] = indices[1] = indices[2] = 0;
+  cell = new LinkedCell::LinkedCell(indices);
+  CPPUNIT_ASSERT(cell != NULL);
+}
+
+
+void LinkedCelltest::tearDown()
+{
+  delete cell;
+}
+
+/** UnitTest for list capabilities.
+ */
+void LinkedCelltest::ListTest()
+{
+  TesselPoint *Walker = new TesselPoint;
+
+  // add a point
+  cell->push_back(Walker);
+  CPPUNIT_ASSERT_EQUAL((size_t)1, cell->size());
+
+  // remove point
+  LinkedCell::LinkedCell::iterator iter = cell->begin();
+  TesselPoint *OtherWalker = *iter;
+  CPPUNIT_ASSERT(Walker == OtherWalker);
+  cell->erase(iter);
+  CPPUNIT_ASSERT_EQUAL((size_t)0, cell->size());
+
+  delete Walker;
+}
+
+std::ostream & operator<<(std::ostream &ost, const LinkedCell::tripleIndex& indices)
+{
+  ost << indices[0] << "," << indices[1] << "," << indices[2];
+  return ost;
+}
+
+/** UnitTest for LinkedCell::addPoint() and LinkedCell::deletePoint()
+ */
+void LinkedCelltest::adddeletePointTest()
+{
+  TesselPoint *Walker = new TesselPoint;
+
+  // add a point
+  cell->addPoint(Walker);
+  CPPUNIT_ASSERT_EQUAL((size_t)1, cell->size());
+  CPPUNIT_ASSERT(Walker == *(cell->begin()));
+
+  // remove point
+  cell->deletePoint(Walker);
+  CPPUNIT_ASSERT_EQUAL((size_t)0, cell->size());
+
+  delete Walker;
+
+}
+
+/** UnitTest for LinkedCell::getIndices().
+ */
+void LinkedCelltest::IndexTest()
+{
+  // check reference returned
+  const LinkedCell::tripleIndex &returnedindices = cell->getIndices();
+  CPPUNIT_ASSERT_EQUAL(indices, returnedindices);
+
+  // check each index
+  for(size_t i=0;i<3;++i)
+    CPPUNIT_ASSERT_EQUAL( indices[i], cell->getIndex(i) );
+}
Index: src/LinkedCell/unittests/LinkedCellUnitTest.hpp
===================================================================
--- src/LinkedCell/unittests/LinkedCellUnitTest.hpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
+++ src/LinkedCell/unittests/LinkedCellUnitTest.hpp	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
@@ -0,0 +1,47 @@
+/*
+ * LinkedCellUnitTest.hpp
+ *
+ *  Created on: Nov 14, 2011
+ *      Author: heber
+ */
+
+#ifndef LINKEDCELLUNITTEST_HPP_
+#define LINKEDCELLUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+namespace LinkedCell {
+  class LinkedCell;
+}
+
+/********************************************** Test classes **************************************/
+
+class LinkedCelltest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( LinkedCelltest) ;
+    CPPUNIT_TEST ( adddeletePointTest );
+    CPPUNIT_TEST ( ListTest );
+    CPPUNIT_TEST ( IndexTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+
+      void adddeletePointTest();
+      void ListTest();
+      void IndexTest();
+
+private:
+      LinkedCell::tripleIndex indices;
+      LinkedCell::LinkedCell *cell;
+};
+
+
+#endif /* LINKEDCELLUNITTEST_HPP_ */
Index: src/LinkedCell/unittests/Makefile.am
===================================================================
--- src/LinkedCell/unittests/Makefile.am	(revision 6f0841afb57916ffe2e660310f1ff1062d59144a)
+++ src/LinkedCell/unittests/Makefile.am	(revision 794bc8a63dc9704a2721bae96fbed047481b255a)
@@ -3,10 +3,15 @@
 
 LINKEDCELLTESTSSOURCES = \
+	../LinkedCell/LinkedCell.cpp \
+	../LinkedCell/unittests/LinkedCellUnitTest.cpp \
 	../LinkedCell/unittests/linkedcellUnitTest.cpp
 
 LINKEDCELLTESTSHEADERS = \
+	../LinkedCell/LinkedCell.hpp \
+	../LinkedCell/unittests/LinkedCellUnitTest.hpp \
 	../LinkedCell/unittests/linkedcellUnitTest.hpp
 
 LINKEDCELLTESTS = \
+  LinkedCellUnitTest \
   linkedcellUnitTest
 
@@ -28,4 +33,15 @@
 linkedcellUnitTest_LDADD = $(LINKEDCELLLIBS)
 
+LinkedCellUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../LinkedCell/unittests/LinkedCellUnitTest.cpp \
+	../LinkedCell/unittests/LinkedCellUnitTest.hpp \
+	../LinkedCell/LinkedCell.cpp \
+	../LinkedCell/LinkedCell.hpp
+LinkedCellUnitTest_LDADD = $(LINKEDCELLLIBS)
+#	../libMolecuilderLinkedCell.la \
+	../libMolecuilderAtom.la \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la
+
+
 
 #AUTOMAKE_OPTIONS = parallel-tests
