Index: src/Actions/FragmentationAction/FragmentationAutomationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Actions/FragmentationAction/FragmentationAutomationAction.cpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -48,4 +48,5 @@
 
 #include "Atom/atom.hpp"
+#include "Box.hpp"
 #include "Fragmentation/EnergyMatrix.hpp"
 #include "Fragmentation/ForceMatrix.hpp"
@@ -61,4 +62,5 @@
 #include "Jobs/MPQCData.hpp"
 #include "Jobs/MPQCData_printKeyNames.hpp"
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
 #ifdef HAVE_VMG
 #include "Jobs/VMGJob.hpp"
@@ -91,4 +93,6 @@
   return NULL;
 }
+
+const int LEVEL = 5;
 
 /** Creates a MPQCCommandJob with argument \a filename.
@@ -110,5 +114,11 @@
   std::string output((std::istreambuf_iterator<char>(file)),
       std::istreambuf_iterator<char>());
-  FragmentJob::ptr testJob( new MPQCJob(nextid, output) );
+  double begin[NDIM] = { 0., 0., 0. };
+  const RealSpaceMatrix& M = World::getInstance().getDomain().getM();
+  const double size = M.at(0,0);
+  ASSERT( M.determinant() == size*size*size,
+      "parsejob() - current domain matrix "+toString(M)+" is not cubic.");
+  const int level = LEVEL;
+  FragmentJob::ptr testJob( new MPQCJob(nextid, output, begin, size, level) );
   jobs.push_back(testJob);
   file.close();
@@ -207,5 +217,5 @@
       IdResultMap.insert( make_pair((*iter)->getId(), *iter) );
       ASSERT( inserter.second,
-          "printReceivedMPQCResults() - two results have same id "
+          "ExtractMPQCDataFromResults() - two results have same id "
           +toString((*iter)->getId())+".");
     }
@@ -475,15 +485,36 @@
     FragmentController &controller,
     const FragmentationFragmentationAutomationAction::FragmentationFragmentationAutomationParameters &params,
-    const size_t NoJobs)
-{
-  const int GRID = pow(2,5);
+    const std::vector<MPQCData> &fragmentData)
+{
   std::vector<FragmentJob::ptr> jobs;
-  std::vector< double > sampled_input (GRID*GRID*GRID, 0.);
-  for (size_t i=0; i< NoJobs; ++i) {
+  // add one job for each fragment as the short-range correction which we need
+  // to subtract from the obtained full potential to get the long-range part only
+  for (std::vector<MPQCData>::const_iterator iter = fragmentData.begin();
+      iter != fragmentData.end(); ++iter) {
     const JobId_t next_id = controller.getAvailableId();
     LOG(1, "INFO: Creating VMGJob.");
-    FragmentJob::ptr testJob( new VMGJob(next_id, sampled_input) );
+    FragmentJob::ptr testJob(
+        new VMGJob(next_id, iter->density.begin, iter->density.size, iter->density.level, iter->density.sampled_grid) );
     jobs.push_back(testJob);
   }
+
+  // add one more job for the full calculation
+  // TODO: Here, we actually have to combine all the other sampled_grids
+  {
+    const int level = LEVEL;
+    const int GRID = pow(2, level);
+    std::vector<double> full_sampled_grid(GRID*GRID*GRID, 0.);
+    double begin[NDIM] = { 0., 0., 0. };
+    const RealSpaceMatrix& M = World::getInstance().getDomain().getM();
+    const double size = M.at(0,0);
+    ASSERT( M.determinant() == size*size*size,
+        "createLongRangeJobs() - current domain matrix "+toString(M)+" is not cubic.");
+    const JobId_t next_id = controller.getAvailableId();
+    FragmentJob::ptr testJob(
+        new VMGJob(next_id, begin, size, level, full_sampled_grid) );
+    jobs.push_back(testJob);
+  }
+
+  // then send jobs to controller
   controller.addJobs(jobs);
   controller.sendJobs(params.host.get(), params.port.get());
@@ -557,5 +588,5 @@
 
   // Phase Five: create VMGJobs
-  if (!createLongRangeJobs(controller, params, jobfiles.size()+1))
+  if (!createLongRangeJobs(controller, params, fragmentData))
     return Action::failure;
   RunService(io_service, "Adding VMGJobs");
Index: src/Jobs/InterfaceVMGJob.cpp
===================================================================
--- src/Jobs/InterfaceVMGJob.cpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Jobs/InterfaceVMGJob.cpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -61,8 +61,15 @@
 
   LOG(1, "INFO: Mesh has extent " << grid.Extent().MeshWidth() << ".");
+  const int gridpoints = pow(2, level);
+  LOG(1, "INFO: gridpoints on finest level are " << gridpoints << ".");
+  assert( (grid.Extent().MeshWidth().X() * gridpoints) == 1 );
+  assert( (grid.Extent().MeshWidth().Y() * gridpoints) == 1 );
+  assert( (grid.Extent().MeshWidth().Z() * gridpoints) == 1 );
   LOG(1, "INFO: "
       << "X in [" << grid.Local().Begin().X() << "," << grid.Local().End().X() << "],"
       << "Y in [" << grid.Local().Begin().Y() << "," << grid.Local().End().Y() << "],"
       << "Z in [" << grid.Local().Begin().Z() << "," << grid.Local().End().Z() << "].");
+
+  std::vector<double>::const_iterator sample_iter = sampled_input.begin();
   for (i.X()=grid.Local().Begin().X(); i.X()<grid.Local().End().X(); ++i.X())
     for (i.Y()=grid.Local().Begin().Y(); i.Y()<grid.Local().End().Y(); ++i.Y())
@@ -72,6 +79,8 @@
 //        R.y() = pos.Y();
 //        R.z() = pos.Z();
-        grid(i) = 0.; //temp_grid(i);
+        grid(i) = *sample_iter; //temp_grid(i);
+        ++sample_iter;
       }
+  assert( sample_iter == sampled_input.end() );
 
   Grid::iterator grid_iter;
Index: src/Jobs/InterfaceVMGJob.hpp
===================================================================
--- src/Jobs/InterfaceVMGJob.hpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Jobs/InterfaceVMGJob.hpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -36,5 +36,6 @@
     VMG::Interface(boundary, levelMin, levelMax,
 		   box_begin, box_end, coarseningSteps, alpha),
-		   sampled_input(_sampled_input)
+		   sampled_input(_sampled_input),
+		   level(levelMax)
   {}
 
@@ -46,4 +47,5 @@
 private:
   const std::vector< double > sampled_input;
+  const int level;
 };
 
Index: src/Jobs/MPQCData.hpp
===================================================================
--- src/Jobs/MPQCData.hpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Jobs/MPQCData.hpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -67,6 +67,17 @@
 
   /// Density
-  typedef std::vector<double> grid_type;
-  grid_type density;
+  struct density_t {
+    //!> Begin (min coordinates) of grid in real space
+    double begin[3];
+    //!> edge length of cubic(!) domain
+    double size;
+    //!> level of the grid, hence \f$2^\text{level}\f$
+    int level;
+
+    //!> typedef for vector of samples grids
+    typedef std::vector<double> grid_type;
+    //!> vector of sample points in order x, y, z
+    grid_type sampled_grid;
+  } density;
 
   /// Timing structure
@@ -98,5 +109,10 @@
     ar & energies.eigenvalues;
     ar & forces;
-    ar & density;
+    int i;
+    for (int i=0; i<3; ++i)
+      ar & density.begin[i];
+    ar & density.size;
+    ar & density.level;
+    ar & density.sampled_grid;
     ar & times.walltime;
     ar & times.cputime;
Index: src/Jobs/MPQCJob.cpp
===================================================================
--- src/Jobs/MPQCJob.cpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Jobs/MPQCJob.cpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -46,11 +46,23 @@
 #include <sstream>
 
-MPQCJob::MPQCJob(const JobId_t _JobId, const std::string &_inputfile) :
+MPQCJob::MPQCJob(
+    const JobId_t _JobId,
+    const std::string &_inputfile,
+    const double _begin[3],
+    const double _size,
+    const int _level) :
   FragmentJob(_JobId),
-  inputfile(_inputfile)
-{}
+  inputfile(_inputfile),
+  size(_size),
+  level(_level)
+{
+  for (int i=0; i<3; ++i)
+    begin[i] = _begin[i];
+}
 
 MPQCJob::MPQCJob() :
-  FragmentJob(JobId::IllegalJob)
+  FragmentJob(JobId::IllegalJob),
+  size(0.),
+  level(0)
 {}
 
Index: src/Jobs/MPQCJob.hpp
===================================================================
--- src/Jobs/MPQCJob.hpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Jobs/MPQCJob.hpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -27,5 +27,10 @@
 {
 public:
-  MPQCJob(const JobId_t _JobId, const std::string &_inputfile);
+  MPQCJob(
+      const JobId_t _JobId,
+      const std::string &_inputfile,
+      const double _begin[3],
+      const double _size,
+      const int _level);
   virtual ~MPQCJob();
 
@@ -35,4 +40,10 @@
   //!> contents of the input file
   const std::string inputfile;
+  //!> offset of grid
+  double begin[3];
+  //!> size of grid, i.e. edge length of cubic(!) domain
+  const double size;
+  //!> level, i.e. \f$2^{\text{level}}\f$ grid points per axis
+  const int level;
 
 private:
@@ -48,4 +59,9 @@
     ar & boost::serialization::base_object<FragmentJob>(*this);
     ar & const_cast<std::string &>(inputfile);
+    int i;
+    for (i=0; i<3; ++i)
+      ar & begin[i];
+    ar & const_cast<double &>(size);
+    ar & const_cast<int &>(level);
   }
 };
Index: src/Jobs/VMGJob.cpp
===================================================================
--- src/Jobs/VMGJob.cpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Jobs/VMGJob.cpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -74,11 +74,23 @@
 using namespace VMG;
 
-VMGJob::VMGJob(const JobId_t _JobId, const std::vector< double > &_sampled_input) :
+VMGJob::VMGJob(
+    const JobId_t _JobId,
+    const double _begin[3],
+    const double _size,
+    const int _level,
+    const std::vector< double > &_sampled_input) :
   FragmentJob(_JobId),
+  size(_size),
+  level(_level),
   sampled_input(_sampled_input)
-{}
+{
+  for (size_t i=0; i<3; ++i)
+    begin[i] = _begin[i];
+}
 
 VMGJob::VMGJob() :
-  FragmentJob(JobId::IllegalJob)
+  FragmentJob(JobId::IllegalJob),
+  size(0.),
+  level(0)
 {}
 
@@ -117,7 +129,4 @@
   // TODO: As a matter of fact should use open boundary conditions
   const Boundary boundary(Periodic, Periodic, Periodic);
-  int level = 7;
-  double box_offset[NDIM] = { 0., 0., 0. };
-  double box_size = 1;
 //  int near_field_cells = 10;
 
@@ -136,6 +145,6 @@
       2,
       level,
-      Vector(box_offset),
-      box_size);
+      Vector(begin),
+      size);
   new LevelOperatorCS(Stencils::RestrictionFullWeight, Stencils::InterpolationTrilinear);
   new Givens<SolverSingular>();
Index: src/Jobs/VMGJob.hpp
===================================================================
--- src/Jobs/VMGJob.hpp	(revision 2764e08a4c838a97a1a5416a338b1c476a1e6dcd)
+++ src/Jobs/VMGJob.hpp	(revision d12d62174ff6d2796691d3074a5db03af886ecb4)
@@ -34,7 +34,14 @@
    *
    * @param _JobId id of the job
+   * @param _begin offset of the domain
+   * @param _size edge length of the cubic(!) domain
+   * @param _level level is \f$2^{\text{level}}\f$ grid points
    * @param _sampled_input vector of sampled points of the grid as right-hand side
    */
-  VMGJob(const JobId_t _JobId, const std::vector< double > &_sampled_input);
+  VMGJob(const JobId_t _JobId,
+      const double _begin[3],
+      const double _size,
+      const int _level,
+      const std::vector< double > &_sampled_input);
   virtual ~VMGJob();
 
@@ -45,4 +52,7 @@
 
 private:
+  double begin[3];
+  const double size;
+  const int level;
   //!> contents of the input file
   const std::vector< double > sampled_input;
@@ -59,4 +69,9 @@
   {
     ar & boost::serialization::base_object<FragmentJob>(*this);
+    int i;
+    for (i=0; i< 3; ++i)
+      ar & begin[i];
+    ar & const_cast< double &>(size);
+    ar & const_cast< int &>(level);
     ar & const_cast< std::vector< double > &>(sampled_input);
   }
