Index: src/Tesselation/boundary.cpp
===================================================================
--- src/Tesselation/boundary.cpp	(revision 833b155e089160225200039831a7742be7bb1a16)
+++ src/Tesselation/boundary.cpp	(revision aa55d00dbcc8c34ecf6c22c2d29232d84d0cc262)
@@ -767,674 +767,4 @@
 };
 
-
-/** Fills the empty space around other molecules' surface of the simulation box with a filler.
- * \param *out output stream for debugging
- * \param *List list of molecules already present in box
- * \param *TesselStruct contains tesselated surface
- * \param *filler molecule which the box is to be filled with
- * \param configuration contains box dimensions
- * \param MaxDistance fills in molecules only up to this distance (set to -1 if whole of the domain)
- * \param distance[NDIM] distance between filling molecules in each direction
- * \param boundary length of boundary zone between molecule and filling mollecules
- * \param epsilon distance to surface which is not filled
- * \param RandAtomDisplacement maximum distance for random displacement per atom
- * \param RandMolDisplacement maximum distance for random displacement per filler molecule
- * \param DoRandomRotation true - do random rotiations, false - don't
- */
-void FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, const double MaxDistance, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const bool DoRandomRotation)
-{
-	//Info FunctionInfo(__func__);
-  molecule *Filling = World::getInstance().createMolecule();
-  Vector CurrentPosition;
-  int N[NDIM];
-  int n[NDIM];
-  const RealSpaceMatrix &M = World::getInstance().getDomain().getM();
-  RealSpaceMatrix Rotations;
-  const RealSpaceMatrix &MInverse = World::getInstance().getDomain().getMinv();
-  Vector AtomTranslations;
-  Vector FillerTranslations;
-  Vector FillerDistance;
-  Vector Inserter;
-  double FillIt = false;
-  bond::ptr Binder;
-  double phi[NDIM];
-  map<molecule *, Tesselation *> TesselStruct;
-  map<molecule *, LinkedCell_deprecated *> LCList;
-
-  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++)
-    if ((*ListRunner)->getAtomCount() > 0) {
-      LOG(1, "Pre-creating linked cell lists for molecule " << *ListRunner << ".");
-      PointCloudAdaptor< molecule > cloud(*ListRunner, (*ListRunner)->name);
-      LCList[(*ListRunner)] = new LinkedCell_deprecated(cloud, 10.); // get linked cell list
-      LOG(1, "Pre-creating tesselation for molecule " << *ListRunner << ".");
-      TesselStruct[(*ListRunner)] = NULL;
-      FindNonConvexBorder((*ListRunner), TesselStruct[(*ListRunner)], (const LinkedCell_deprecated *&)LCList[(*ListRunner)], 5., NULL);
-    }
-
-  // Center filler at origin
-  filler->CenterEdge();
-  const int FillerCount = filler->getAtomCount();
-  LOG(2, "INFO: Filler molecule has the following bonds:");
-  for(molecule::iterator AtomRunner = filler->begin(); AtomRunner != filler->end(); ++AtomRunner) {
-    const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
-    for(BondList::const_iterator BondRunner = ListOfBonds.begin();
-        BondRunner != ListOfBonds.end();
-        ++BondRunner) {
-      if ((*BondRunner)->leftatom == *AtomRunner)
-        LOG(2, "  " << *(*BondRunner));
-    }
-  }
-
-  atom * CopyAtoms[FillerCount];
-
-  // calculate filler grid in [0,1]^3
-  FillerDistance = MInverse * Vector(distance[0], distance[1], distance[2]);
-  for(int i=0;i<NDIM;i++)
-    N[i] = (int) ceil(1./FillerDistance[i]);
-  LOG(1, "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << ".");
-
-  // initialize seed of random number generator to current time
-  RandomNumberGenerator &random = RandomNumberGeneratorFactory::getInstance().makeRandomNumberGenerator();
-  const double rng_min = random.min();
-  const double rng_max = random.max();
-  //srand ( time(NULL) );
-
-  // go over [0,1]^3 filler grid
-  for (n[0] = 0; n[0] < N[0]; n[0]++)
-    for (n[1] = 0; n[1] < N[1]; n[1]++)
-      for (n[2] = 0; n[2] < N[2]; n[2]++) {
-        // calculate position of current grid vector in untransformed box
-        CurrentPosition = M * Vector((double)n[0]/(double)N[0], (double)n[1]/(double)N[1], (double)n[2]/(double)N[2]);
-        // create molecule random translation vector ...
-        for (int i=0;i<NDIM;i++)
-          FillerTranslations[i] = RandomMolDisplacement*(random()/((rng_max-rng_min)/2.) - 1.);
-        LOG(2, "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << ".");
-
-        // go through all atoms
-        for (int i=0;i<FillerCount;i++)
-          CopyAtoms[i] = NULL;
-
-        // have same rotation angles for all molecule's atoms
-        if (DoRandomRotation)
-          for (int i=0;i<NDIM;i++)
-            phi[i] = (random()/(rng_max-rng_min))*(2.*M_PI);
-
-        // atom::clone is not const member function, hence we need iterator here
-        for(molecule::iterator iter = filler->begin(); iter !=filler->end();++iter){
-
-          // create atomic random translation vector ...
-          for (int i=0;i<NDIM;i++)
-            AtomTranslations[i] = RandomAtomDisplacement*(random()/((rng_max-rng_min)/2.) - 1.);
-
-          // ... and rotation matrix
-          if (DoRandomRotation) {
-            Rotations.set(0,0,  cos(phi[0])            *cos(phi[2]) + (sin(phi[0])*sin(phi[1])*sin(phi[2])));
-            Rotations.set(0,1,  sin(phi[0])            *cos(phi[2]) - (cos(phi[0])*sin(phi[1])*sin(phi[2])));
-            Rotations.set(0,2,              cos(phi[1])*sin(phi[2])                                        );
-            Rotations.set(1,0, -sin(phi[0])*cos(phi[1])                                                    );
-            Rotations.set(1,1,  cos(phi[0])*cos(phi[1])                                                    );
-            Rotations.set(1,2,              sin(phi[1])                                                    );
-            Rotations.set(2,0, -cos(phi[0])            *sin(phi[2]) + (sin(phi[0])*sin(phi[1])*cos(phi[2])));
-            Rotations.set(2,1, -sin(phi[0])            *sin(phi[2]) - (cos(phi[0])*sin(phi[1])*cos(phi[2])));
-            Rotations.set(2,2,              cos(phi[1])*cos(phi[2])                                        );
-          }
-
-          // ... and put at new position
-          Inserter = (*iter)->getPosition();
-          if (DoRandomRotation)
-            Inserter *= Rotations;
-          Inserter += AtomTranslations + FillerTranslations + CurrentPosition;
-
-          // check whether inserter is inside box
-          Inserter *= MInverse;
-          FillIt = true;
-          for (int i=0;i<NDIM;i++)
-            FillIt = FillIt && (Inserter[i] >= -MYEPSILON) && ((Inserter[i]-1.) <= MYEPSILON);
-          Inserter *= M;
-
-          // Check whether point is in- or outside
-          for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) {
-            // get linked cell list
-            if (TesselStruct[(*ListRunner)] != NULL) {
-              const double distance = (TesselStruct[(*ListRunner)]->GetDistanceToSurface(Inserter, LCList[(*ListRunner)]));
-              FillIt = FillIt && (distance > boundary) && ((MaxDistance < 0) || (MaxDistance > distance));
-            }
-          }
-          // insert into Filling
-          if (FillIt) {
-            LOG(1, "INFO: Position at " << Inserter << " is outer point.");
-            // copy atom ...
-            CopyAtoms[(*iter)->getNr()] = (*iter)->clone();
-            (*CopyAtoms[(*iter)->getNr()]).setPosition(Inserter);
-            Filling->AddAtom(CopyAtoms[(*iter)->getNr()]);
-            LOG(1, "Filling atom " << **iter << ", translated to " << AtomTranslations << ", at final position is " << (CopyAtoms[(*iter)->getNr()]->getPosition()) << ".");
-          } else {
-            LOG(1, "INFO: Position at " << Inserter << " is inner point, within boundary or outside of MaxDistance.");
-            CopyAtoms[(*iter)->getNr()] = NULL;
-            continue;
-          }
-        }
-        // go through all bonds and add as well
-        for(molecule::iterator AtomRunner = filler->begin(); AtomRunner != filler->end(); ++AtomRunner) {
-          const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
-          for(BondList::const_iterator BondRunner = ListOfBonds.begin();
-              BondRunner != ListOfBonds.end();
-              ++BondRunner)
-            if ((*BondRunner)->leftatom == *AtomRunner) {
-              Binder = (*BondRunner);
-              if ((CopyAtoms[Binder->leftatom->getNr()] != NULL) && (CopyAtoms[Binder->rightatom->getNr()] != NULL)) {
-                LOG(3, "Adding Bond between " << *CopyAtoms[Binder->leftatom->getNr()] << " and " << *CopyAtoms[Binder->rightatom->getNr()]<< ".");
-                Filling->AddBond(CopyAtoms[Binder->leftatom->getNr()], CopyAtoms[Binder->rightatom->getNr()], Binder->getDegree());
-              }
-            }
-        }
-      }
-  for (MoleculeList::iterator ListRunner = List->ListOfMolecules.begin(); ListRunner != List->ListOfMolecules.end(); ListRunner++) {
-    delete LCList[*ListRunner];
-    delete TesselStruct[(*ListRunner)];
-  }
-};
-
-/** Rotates given molecule \a Filling and moves its atoms according to given
- *  \a RandomAtomDisplacement.
- *
- *  Note that for rotation to be sensible, the molecule should be centered at
- *  the origin. This is not done here!
- *
- *  \param &Filling molecule whose atoms to displace
- *  \param RandomAtomDisplacement magnitude of random displacement
- *  \param &Rotations 3D rotation matrix (or unity if no rotation desired)
- */
-void RandomizeMoleculePositions(
-    molecule *&Filling,
-    double RandomAtomDisplacement,
-    RealSpaceMatrix &Rotations,
-    RandomNumberGenerator &random
-    )
-{
-  const double rng_min = random.min();
-  const double rng_max = random.max();
-
-  Vector AtomTranslations;
-  for(molecule::iterator miter = Filling->begin(); miter != Filling->end(); ++miter) {
-    Vector temp = (*miter)->getPosition();
-    temp *= Rotations;
-    (*miter)->setPosition(temp);
-    // create atomic random translation vector ...
-    for (int i=0;i<NDIM;i++)
-      AtomTranslations[i] = RandomAtomDisplacement*(random()/((rng_max-rng_min)/2.) - 1.);
-    (*miter)->setPosition((*miter)->getPosition() + AtomTranslations);
-  }
-}
-
-/** Removes all atoms of a molecule outside.
- *
- * If the molecule is empty, it is removed as well.
- *
- * @param Filling molecule whose atoms to check, removed if eventually left
- *        empty.
- * @return true - atoms had to be removed, false - no atoms have been removed
- */
-bool RemoveAtomsOutsideDomain(molecule *&Filling)
-{
-  bool status = false;
-  Box &Domain = World::getInstance().getDomain();
-  // check if all is still inside domain
-  for(molecule::iterator miter = Filling->begin(); miter != Filling->end(); ) {
-    // check whether each atom is inside box
-    if (!Domain.isInside((*miter)->getPosition())) {
-      status = true;
-      atom *Walker = *miter;
-      ++miter;
-      World::getInstance().destroyAtom(Walker);
-    } else {
-      ++miter;
-    }
-  }
-  if (Filling->empty()) {
-    LOG(0, "Removing molecule " << Filling->getName() << ", all atoms have been removed.");
-    World::getInstance().destroyMolecule(Filling);
-    Filling = NULL;
-  }
-  return status;
-}
-
-/** Checks whether there are no atoms inside a sphere around \a CurrentPosition
- *  except those atoms present in \a *filler.
- *  If filler is NULL, then we just call LinkedCell_deprecated::GetPointsInsideSphere() and
- *  check whether the return list is empty.
- * @param *filler
- * @param boundary
- * @param CurrentPosition
- */
-bool isSpaceAroundPointVoid(
-    LinkedCell_deprecated *LC,
-    molecule *filler,
-    const double boundary,
-    Vector &CurrentPosition)
-{
-  size_t compareTo = 0;
-  TesselPointSTLList* liste = LC->GetPointsInsideSphere(boundary == 0. ? MYEPSILON : boundary, &CurrentPosition);
-  if (filler != NULL) {
-    for (TesselPointSTLList::const_iterator iter = liste->begin();
-        iter != liste->end();
-        ++iter) {
-      for (molecule::iterator miter = filler->begin();
-          miter != filler->end();
-          ++miter) {
-        if (*iter == *miter)
-          ++compareTo;
-      }
-    }
-  }
-  const bool result = (liste->size() == compareTo);
-  if (!result) {
-    LOG(0, "Skipping because of the following atoms:");
-    for (TesselPointSTLList::const_iterator iter = liste->begin();
-        iter != liste->end();
-        ++iter) {
-      LOG(0, **iter);
-    }
-  }
-  delete(liste);
-  return result;
-}
-
-/** Sets given 3x3 matrix to a random rotation matrix.
- *
- * @param a matrix to set
- */
-inline void setRandomRotation(RealSpaceMatrix &a)
-{
-  double phi[NDIM];
-  RandomNumberGenerator &random = RandomNumberGeneratorFactory::getInstance().makeRandomNumberGenerator();
-  const double rng_min = random.min();
-  const double rng_max = random.max();
-
-  for (int i=0;i<NDIM;i++) {
-    phi[i] = (random()/(rng_max-rng_min))*(2.*M_PI);
-    LOG(4, "DEBUG: Random angle is " << phi[i] << ".");
-  }
-
-  a.setRotation(phi);
-}
-
-/** Fills the empty space of the simulation box with water.
- * \param *filler molecule which the box is to be filled with
- * \param configuration contains box dimensions
- * \param distance[NDIM] distance between filling molecules in each direction
- * \param boundary length of boundary zone between molecule and filling molecules
- * \param RandAtomDisplacement maximum distance for random displacement per atom
- * \param RandMolDisplacement maximum distance for random displacement per filler molecule
- * \param MinDistance minimum distance to boundary of domain and present molecules
- * \param DoRandomRotation true - do random rotations, false - don't
- */
-void FillVoidWithMolecule(
-    molecule *&filler,
-    config &configuration,
-    const double distance[NDIM],
-    const double boundary,
-    const double RandomAtomDisplacement,
-    const double RandomMolDisplacement,
-    const double MinDistance,
-    const bool DoRandomRotation
-    )
-{
-  //Info FunctionInfo(__func__);
-  molecule *Filling = NULL;
-  Vector CurrentPosition;
-  int N[NDIM];
-  int n[NDIM];
-  const RealSpaceMatrix &M = World::getInstance().getDomain().getM();
-  RealSpaceMatrix Rotations;
-  const RealSpaceMatrix &MInverse = World::getInstance().getDomain().getMinv();
-  Vector FillerTranslations;
-  Vector FillerDistance;
-  Vector Inserter;
-  double FillIt = false;
-  Vector firstInserter;
-  bool firstInsertion = true;
-  const Box &Domain = World::getInstance().getDomain();
-  map<molecule *, LinkedCell_deprecated *> LCList;
-  std::vector<molecule *> List = World::getInstance().getAllMolecules();
-  MoleculeListClass *MolList = World::getInstance().getMolecules();
-
-  for (std::vector<molecule *>::iterator ListRunner = List.begin(); ListRunner != List.end(); ListRunner++)
-    if ((*ListRunner)->getAtomCount() > 0) {
-      LOG(1, "Pre-creating linked cell lists for molecule " << *ListRunner << ".");
-      PointCloudAdaptor< molecule > cloud(*ListRunner, (*ListRunner)->name);
-      LCList[(*ListRunner)] = new LinkedCell_deprecated(cloud, 10.); // get linked cell list
-    }
-
-  // Center filler at its center of gravity
-  const Vector gravity = filler->DetermineCenterOfGravity();
-  filler->CenterAtVector(gravity);
-  //const int FillerCount = filler->getAtomCount();
-  LOG(2, "INFO: Filler molecule has the following bonds:");
-  for(molecule::iterator AtomRunner = filler->begin(); AtomRunner != filler->end(); ++AtomRunner) {
-    const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
-    for(BondList::const_iterator BondRunner = ListOfBonds.begin();
-        BondRunner != ListOfBonds.end();
-        ++BondRunner)
-      if ((*BondRunner)->leftatom == *AtomRunner)
-        LOG(2, "  " << *(*BondRunner));
-  }
-
-  // calculate filler grid in [0,1]^3
-  FillerDistance = MInverse * Vector(distance[0], distance[1], distance[2]);
-  for(int i=0;i<NDIM;i++)
-    N[i] = (int) ceil(1./FillerDistance[i]);
-  LOG(1, "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << ".");
-
-  // initialize seed of random number generator to current time
-  RandomNumberGenerator &random = RandomNumberGeneratorFactory::getInstance().makeRandomNumberGenerator();
-  const double rng_min = random.min();
-  const double rng_max = random.max();
-  //srand ( time(NULL) );
-
-  // go over [0,1]^3 filler grid
-  for (n[0] = 0; n[0] < N[0]; n[0]++)
-    for (n[1] = 0; n[1] < N[1]; n[1]++)
-      for (n[2] = 0; n[2] < N[2]; n[2]++) {
-        // calculate position of current grid vector in untransformed box
-        CurrentPosition = M * Vector((double)n[0]/(double)N[0], (double)n[1]/(double)N[1], (double)n[2]/(double)N[2]);
-        // create molecule random translation vector ...
-        for (int i=0;i<NDIM;i++) // have the random values [-1,1]*RandomMolDisplacement
-          FillerTranslations[i] = RandomMolDisplacement*(random()/((rng_max-rng_min)/2.) - 1.);
-        LOG(2, "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << ".");
-
-        // ... and rotation matrix
-        if (DoRandomRotation)
-          setRandomRotation(Rotations);
-        else
-          Rotations.setIdentity();
-
-
-        // Check whether there is anything too close by and whether atom is outside of domain
-        FillIt = true;
-        for (std::map<molecule *, LinkedCell_deprecated *>::iterator ListRunner = LCList.begin(); ListRunner != LCList.end(); ++ListRunner) {
-          FillIt = FillIt && isSpaceAroundPointVoid(
-              ListRunner->second,
-              (firstInsertion ? filler : NULL),
-              boundary,
-              CurrentPosition);
-          FillIt = FillIt && (Domain.isValid(CurrentPosition))
-              && ((Domain.DistanceToBoundary(CurrentPosition) - MinDistance) > -MYEPSILON);
-          if (!FillIt)
-            break;
-        }
-
-        // insert into Filling
-        if (FillIt) {
-          Inserter = CurrentPosition + FillerTranslations;
-          LOG(1, "INFO: Position at " << Inserter << " is void point.");
-          // fill!
-          Filling = filler->CopyMolecule();
-          RandomizeMoleculePositions(Filling, RandomAtomDisplacement, Rotations, random);
-          // translation
-          Filling->Translate(Inserter);
-          // remove out-of-bounds atoms
-          const bool status = RemoveAtomsOutsideDomain(Filling);
-          if ((firstInsertion) && (!status)) { // no atom has been removed
-            // remove copied atoms and molecule again
-            Filling->removeAtomsinMolecule();
-            World::getInstance().destroyMolecule(Filling);
-            // and mark is final filler position
-            Filling = filler;
-            firstInsertion = false;
-            firstInserter = Inserter;
-          } else {
-            // TODO: Remove when World has no MoleculeListClass anymore
-            if (Filling)
-              MolList->insert(Filling);
-          }
-        } else {
-         LOG(1, "INFO: Position at " << Inserter << " is non-void point, within boundary or outside of MaxDistance.");
-          continue;
-        }
-      }
-
-  // have we inserted any molecules?
-  if (firstInsertion) {
-    // If not remove filler
-    for(molecule::iterator miter = filler->begin(); !filler->empty(); miter = filler->begin()) {
-      atom *Walker = *miter;
-      World::getInstance().destroyAtom(Walker);
-    }
-    World::getInstance().destroyMolecule(filler);
-  } else {
-    // otherwise translate and randomize to final position
-    if (DoRandomRotation)
-      setRandomRotation(Rotations);
-    else
-      Rotations.setIdentity();
-    RandomizeMoleculePositions(filler, RandomAtomDisplacement, Rotations, random);
-    // translation
-    filler->Translate(firstInserter);
-    // remove out-of-bounds atoms
-    RemoveAtomsOutsideDomain(filler);
-  }
-
-  LOG(0, MolList->ListOfMolecules.size() << " molecules have been inserted.");
-
-  for (std::map<molecule *, LinkedCell_deprecated *>::iterator ListRunner = LCList.begin(); !LCList.empty(); ListRunner = LCList.begin()) {
-    delete ListRunner->second;
-    LCList.erase(ListRunner);
-  }
-};
-
-
-/** Fills the empty space around other molecules' surface of the simulation box with a filler.
- *
- * Note that we use \a FindNonConvexBorder to determine the surface of the found molecules.
- * There, we use a radius of twice the given \a boundary.
- *
- * \param *out output stream for debugging
- * \param *List list of molecules already present in box
- * \param *TesselStruct contains tesselated surface
- * \param *filler molecule which the box is to be filled with
- * \param configuration contains box dimensions
- * \param MaxSurfaceDistance fills in molecules only up to this distance (set to -1 if whole of the domain)
- * \param distance[NDIM] distance between filling molecules in each direction
- * \param boundary length of boundary zone between molecule and filling molecules
- * \param MinDistance distance to boundary of domain which is not filled
- * \param RandAtomDisplacement maximum distance for random displacement per atom
- * \param RandMolDisplacement maximum distance for random displacement per filler molecule
- * \param DoRandomRotation true - do random rotations, false - don't
- */
-void FillBoxWithMolecule(
-    MoleculeListClass *MolList,
-    molecule *filler,
-    config &configuration,
-    const double MaxSurfaceDistance,
-    const double distance[NDIM],
-    const double boundary,
-    const double MinDistance,
-    const double RandomAtomDisplacement,
-    const double RandomMolDisplacement,
-    const bool DoRandomRotation)
-{
-  //Info FunctionInfo(__func__);
-  molecule *Filling = NULL;
-  Vector CurrentPosition;
-  int N[NDIM];
-  int n[NDIM];
-  const RealSpaceMatrix &M = World::getInstance().getDomain().getM();
-  RealSpaceMatrix Rotations;
-  const RealSpaceMatrix &MInverse = World::getInstance().getDomain().getMinv();
-  Vector FillerTranslations;
-  Vector FillerDistance;
-  Vector Inserter;
-  double FillIt = false;
-  Vector firstInserter;
-  bool firstInsertion = true;
-  const Box &Domain = World::getInstance().getDomain();
-  map<molecule *, LinkedCell_deprecated *> LCList;
-  std::vector<molecule *> List = World::getInstance().getAllMolecules();
-  map<molecule *, Tesselation *> TesselStruct;
-
-  for (MoleculeList::iterator ListRunner = MolList->ListOfMolecules.begin(); ListRunner != MolList->ListOfMolecules.end(); ListRunner++)
-    if ((*ListRunner)->getAtomCount() > 0) {
-      LOG(1, "Pre-creating linked cell lists for molecule " << *ListRunner << ".");
-      PointCloudAdaptor< molecule > cloud(*ListRunner, (*ListRunner)->name);
-      LCList[(*ListRunner)] = new LinkedCell_deprecated(cloud, 4.*boundary); // get linked cell list
-      LOG(1, "Pre-creating tesselation for molecule " << *ListRunner << ".");
-      TesselStruct[(*ListRunner)] = NULL;
-      FindNonConvexBorder((*ListRunner), TesselStruct[(*ListRunner)], (const LinkedCell_deprecated *&)LCList[(*ListRunner)], 2.*boundary, NULL);
-    }
-
-  // Center filler at origin
-  filler->CenterEdge();
-//  const int FillerCount = filler->getAtomCount();
-  LOG(2, "INFO: Filler molecule has the following bonds:");
-  for(molecule::iterator AtomRunner = filler->begin(); AtomRunner != filler->end(); ++AtomRunner) {
-    const BondList& ListOfBonds = (*AtomRunner)->getListOfBonds();
-    for(BondList::const_iterator BondRunner = ListOfBonds.begin();
-        BondRunner != ListOfBonds.end();
-        ++BondRunner) {
-      if ((*BondRunner)->leftatom == *AtomRunner)
-        LOG(2, "  " << *(*BondRunner));
-    }
-  }
-
-//  atom * CopyAtoms[FillerCount];
-
-  setVerbosity(4);
-
-  // calculate filler grid in [0,1]^3
-  FillerDistance = MInverse * Vector(distance[0], distance[1], distance[2]);
-  for(int i=0;i<NDIM;i++)
-    N[i] = (int) ceil(1./FillerDistance[i]);
-  LOG(1, "INFO: Grid steps are " << N[0] << ", " << N[1] << ", " << N[2] << ".");
-
-  // initialize seed of random number generator to current time
-  RandomNumberGenerator &random = RandomNumberGeneratorFactory::getInstance().makeRandomNumberGenerator();
-  const double rng_min = random.min();
-  const double rng_max = random.max();
-  //srand ( time(NULL) );
-
-  // go over [0,1]^3 filler grid
-  for (n[0] = 0; n[0] < N[0]; n[0]++)
-    for (n[1] = 0; n[1] < N[1]; n[1]++)
-      for (n[2] = 0; n[2] < N[2]; n[2]++) {
-        // calculate position of current grid vector in untransformed box
-        CurrentPosition = M * Vector((double)n[0]/(double)N[0], (double)n[1]/(double)N[1], (double)n[2]/(double)N[2]);
-        // create molecule random translation vector ...
-        for (int i=0;i<NDIM;i++)
-          FillerTranslations[i] = RandomMolDisplacement*(random()/((rng_max-rng_min)/2.) - 1.);
-        LOG(1, "INFO: Current Position is " << CurrentPosition << "+" << FillerTranslations << ".");
-
-        // ... and rotation matrix
-        if (DoRandomRotation)
-          setRandomRotation(Rotations);
-        else
-          Rotations.setIdentity();
-
-
-        // Check whether there is anything too close by and whether atom is outside of domain
-        FillIt = true;
-        for (std::map<molecule *, LinkedCell_deprecated *>::iterator ListRunner = LCList.begin(); ListRunner != LCList.end(); ++ListRunner) {
-          // check whether its void
-          FillIt = FillIt && isSpaceAroundPointVoid(
-              ListRunner->second,
-              (firstInsertion ? filler : NULL),
-              boundary,
-              CurrentPosition);
-          if (!FillIt) {
-            LOG(2, "REJECT: Position at " << Inserter << " is non-void.");
-            break;
-          }
-          // check whether inside domain
-          FillIt = FillIt && (Domain.isValid(CurrentPosition));
-          if (!FillIt) {
-            LOG(2, "REJECT: Position at " << CurrentPosition << " is "
-                << distance << ", hence outside of domain.");
-            break;
-          }
-          // check minimum distance to boundary
-          const double distance = (Domain.DistanceToBoundary(CurrentPosition) - MinDistance);
-          FillIt = FillIt && (distance > -MYEPSILON);
-          if (!FillIt) {
-            LOG(2, "REJECT: Position at " << CurrentPosition << " is " << distance << ", less than "
-                << MinDistance << " hence, too close to boundary.");
-            break;
-          }
-        }
-        // Check whether point is in- or outside of tesselations
-        if (FillIt) {
-          for (MoleculeList::iterator ListRunner = MolList->ListOfMolecules.begin(); ListRunner != MolList->ListOfMolecules.end(); ListRunner++) {
-            // get linked cell list
-            if (TesselStruct[(*ListRunner)] != NULL) {
-              const double distance = (TesselStruct[(*ListRunner)]->GetDistanceToSurface(Inserter, LCList[(*ListRunner)]));
-              LOG(2, "INFO: Distance to surface is " << distance << ".");
-              FillIt = FillIt && ((distance == -1.) || (distance > boundary)) && ((MaxSurfaceDistance < 0) || (MaxSurfaceDistance > distance));
-              if (!FillIt) {
-                LOG(2, "REJECT: Position at " << CurrentPosition << " is in distance of " << distance
-                    << " to a surface, less than " << MaxSurfaceDistance  << " hence, too close.");
-                break;
-              }
-            }
-          }
-        }
-
-        // insert into Filling
-        if (FillIt) {
-          Inserter = CurrentPosition + FillerTranslations;
-          LOG(2, "ACCEPT: Position at " << CurrentPosition << " is void point.");
-          // fill!
-          Filling = filler->CopyMolecule();
-          RandomizeMoleculePositions(Filling, RandomAtomDisplacement, Rotations, random);
-          // translation
-          Filling->Translate(Inserter);
-          // remove out-of-bounds atoms
-          const bool status = RemoveAtomsOutsideDomain(Filling);
-          if ((firstInsertion) && (!status)) { // no atom has been removed
-            // remove copied atoms and molecule again
-            Filling->removeAtomsinMolecule();
-            World::getInstance().destroyMolecule(Filling);
-            // and mark is final filler position
-            Filling = filler;
-            firstInsertion = false;
-            firstInserter = Inserter;
-          } else {
-            // TODO: Remove when World has no MoleculeListClass anymore
-            if (Filling)
-              MolList->insert(Filling);
-          }
-        } else {
-          LOG(2, "REJECT: Position at " << CurrentPosition << " is non-void point, within boundary or outside of MaxSurfaceDistance.");
-          continue;
-        }
-      }
-
-  // have we inserted any molecules?
-  if (firstInsertion) {
-    // If not remove filler
-    for(molecule::iterator miter = filler->begin(); !filler->empty(); miter = filler->begin()) {
-      atom *Walker = *miter;
-      World::getInstance().destroyAtom(Walker);
-    }
-    World::getInstance().destroyMolecule(filler);
-  } else {
-    // otherwise translate and randomize to final position
-    if (DoRandomRotation)
-      setRandomRotation(Rotations);
-    else
-      Rotations.setIdentity();
-    RandomizeMoleculePositions(filler, RandomAtomDisplacement, Rotations, random);
-    // translation
-    filler->Translate(firstInserter);
-    // remove out-of-bounds atoms
-    RemoveAtomsOutsideDomain(filler);
-  }
-
-  LOG(0, MolList->ListOfMolecules.size() << " molecules have been inserted.");
-
-  for (std::map<molecule *, LinkedCell_deprecated *>::iterator ListRunner = LCList.begin(); !LCList.empty(); ListRunner = LCList.begin()) {
-    delete ListRunner->second;
-    LCList.erase(ListRunner);
-  }
-};
-
 /** Tesselates the non convex boundary by rolling a virtual sphere along the surface of the molecule.
  * \param *out output stream for debugging
Index: src/Tesselation/boundary.hpp
===================================================================
--- src/Tesselation/boundary.hpp	(revision 833b155e089160225200039831a7742be7bb1a16)
+++ src/Tesselation/boundary.hpp	(revision aa55d00dbcc8c34ecf6c22c2d29232d84d0cc262)
@@ -40,6 +40,4 @@
 
 double ConvexizeNonconvexEnvelope(class Tesselation *&TesselStruct, const molecule * const mol, const char * const filename);
-void FillBoxWithMolecule(MoleculeListClass *List, molecule *filler, config &configuration, const double MaxDistance, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const bool DoRandomRotation);
-void FillVoidWithMolecule(molecule *&filler, config &configuration, const double distance[NDIM], const double boundary, const double RandomAtomDisplacement, const double RandomMolDisplacement, const double MinDistance, const bool DoRandomRotation);
 void FindConvexBorder(const molecule* const mol, Boundaries *BoundaryPts, Tesselation *&TesselStruct, const LinkedCell_deprecated *LCList, const char *filename);
 Vector* FindEmbeddingHole(MoleculeListClass *mols, molecule *srcmol);
