Index: ThirdParty/vmg/src/commands/com_check_consistency.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_check_consistency.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_check_consistency.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,61 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_check_consistency.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:28:58 2011
+ *
+ * @brief  Checks a given grid for nan and inf.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <cstdio>
+
+#include "base/command.hpp"
+#include "grid/grid.hpp"
+#include "grid/multigrid.hpp"
+
+using namespace VMG;
+
+class VMGCommandCheckConsistency : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    Multigrid* grid = MG::GetFactory().Get(arguments[0])->Cast<Multigrid>();
+
+    MPE_EVENT_END()
+
+    if (!(*grid)().IsConsistent())
+      return StopCycleNow;
+
+    return Continue;
+  }
+
+  static const char* Name() {return "CheckConsistency";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandCheckConsistency)
Index: ThirdParty/vmg/src/commands/com_check_iteration_counter.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_check_iteration_counter.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_check_iteration_counter.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,66 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_check_iteration_counter.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:29:39 2011
+ *
+ * @brief  Increases the iteration counter and checks if
+ *         the maximum number of iterations is reached.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/object.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandCheckIterationCounter : public Command
+{
+public:
+  VMGCommandCheckIterationCounter()
+  {
+    new ObjectStorage<int>("ITERATION", 0);
+  }
+
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    const int& max_iteration = MG::GetFactory().GetObjectStorageVal<int>("MAX_ITERATION");
+    int& iteration = MG::GetFactory().GetObjectStorageVal<int>("ITERATION");
+
+    MPE_EVENT_END()
+
+    if (++iteration >= max_iteration)
+      return StopCycleLater;
+    else
+      return Continue;
+  }
+
+  static const char* Name() {return "CheckIterationCounter";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandCheckIterationCounter)
Index: ThirdParty/vmg/src/commands/com_check_relative_residual.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_check_relative_residual.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_check_relative_residual.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,73 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_check_relative_residual.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:30:18 2011
+ *
+ * @brief  Checks if the relative residual is small enough
+ *         to stop execution.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <cmath>
+
+#include "base/command.hpp"
+#include "base/factory.hpp"
+#include "base/object.hpp"
+#include "comm/comm.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandCheckRelativeResidual : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    VMG::Factory& factory = MG::GetFactory();
+
+    const vmg_float& res = factory.GetObjectStorageVal<vmg_float>(arguments[0]);
+    const vmg_float& init_res = factory.GetObjectStorageVal<vmg_float>(arguments[1]);
+    const vmg_float& precision = factory.GetObjectStorageVal<vmg_float>("PRECISION");
+    const vmg_float rel_res = (init_res != 0.) ? std::fabs(res / init_res) : 0.;
+
+    MG::GetComm()->PrintOnce(Info, "Relative residual: %e", rel_res);
+
+    MPE_EVENT_END()
+
+    if (rel_res < precision)
+      return StopCycleLater;
+    else
+      return Continue;
+  }
+
+  static const char* Name() {return "CheckRelativeResidual";}
+  static int Arguments() {return 2;}
+};
+
+CREATE_INITIALIZER(VMGCommandCheckRelativeResidual)
+
Index: ThirdParty/vmg/src/commands/com_check_residual.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_check_residual.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_check_residual.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,67 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_check_residual.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:31:37 2011
+ *
+ * @brief  Checks if the residual is small enough to stop
+ *         execution.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <cmath>
+
+#include "base/command.hpp"
+#include "base/factory.hpp"
+#include "base/object.hpp"
+#include "comm/comm.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandCheckResidual : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    const vmg_float& res = MG::GetFactory().GetObjectStorageVal<vmg_float>(arguments[0]);
+    const vmg_float& precision = MG::GetFactory().Get("PRECISION")->Cast< ObjectStorage<vmg_float> >()->Val();
+
+    MPE_EVENT_END()
+
+    if (std::fabs(res) < precision)
+      return StopCycleLater;
+    else
+      return Continue;
+  }
+
+  static const char* Name() {return "CheckResidual";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandCheckResidual)
+
Index: ThirdParty/vmg/src/commands/com_clear_coarse_levels.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_clear_coarse_levels.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_clear_coarse_levels.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,58 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_clear_coarse_levels.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:32:12 2011
+ *
+ * @brief  Overwrites all grid values of all grids except
+ *         the finest one with zeros.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/factory.hpp"
+#include "grid/multigrid.hpp"
+
+using namespace VMG;
+
+class VMGCommandClearCoarseLevels : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetFactory().Get(arguments[0])->Cast<Multigrid>()->ClearAllCoarseLevels();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ClearCoarseLevels";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandClearCoarseLevels)
+
Index: ThirdParty/vmg/src/commands/com_clear_grid.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_clear_grid.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_clear_grid.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,59 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_clear_grid.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:32:44 2011
+ *
+ * @brief  Overwrites all grid values with zero.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/factory.hpp"
+#include "comm/comm.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandClearGrid : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetFactory().Get(arguments[0])->Cast<Multigrid>()->ClearAll();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ClearGrid";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandClearGrid)
+
Index: ThirdParty/vmg/src/commands/com_compute_residual_norm.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_compute_residual_norm.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_compute_residual_norm.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,60 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_compute_residual_norm.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:40:12 2011
+ *
+ * @brief  Computes the residual in the discrete L2-norm
+ *         and hands the value over to the factory.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/object.hpp"
+#include "comm/comm.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandComputeResidualNorm : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    vmg_float residual = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs());
+    new ObjectStorage<vmg_float>(arguments[0], residual);
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ComputeResidualNorm";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandComputeResidualNorm)
Index: ThirdParty/vmg/src/commands/com_copy_boundary.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_copy_boundary.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_copy_boundary.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,60 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_copy_boundary.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:33:14 2011
+ *
+ * @brief  Copies the boundary values from one grid to another
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/grid.hpp"
+#include "grid/multigrid.hpp"
+
+using namespace VMG;
+
+class VMGCommandCopyBoundary : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    Grid& from = (*MG::GetFactory().Get(arguments[0])->Cast<Multigrid>())();
+    Grid& to = (*MG::GetFactory().Get(arguments[1])->Cast<Multigrid>())();
+
+    to.SetBoundary(from);
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "CopyBoundary";}
+  static int Arguments() {return 2;}
+};
+
+CREATE_INITIALIZER(VMGCommandCopyBoundary)
+
Index: ThirdParty/vmg/src/commands/com_execute_cycle.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_execute_cycle.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_execute_cycle.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,56 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_execute_cycle.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:33:49 2011
+ *
+ * @brief  Executes a given cycle once.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/command_list.hpp"
+#include "base/factory.hpp"
+
+using namespace VMG;
+
+class VMGCommandExecuteCycle : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    Request req = MG::GetFactory().Get(arguments[0])->Cast<CommandList>()->ExecuteList();
+
+    MPE_EVENT_END()
+
+    return req;
+  }
+
+  static const char* Name() {return "ExecuteCycle";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandExecuteCycle)
Index: ThirdParty/vmg/src/commands/com_execute_cycle_loop.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_execute_cycle_loop.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_execute_cycle_loop.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,56 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_execute_cycle_loop.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:34:13 2011
+ *
+ * @brief  Executes a single cycle as long as it returns
+ *         "Continue"
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/command_list.hpp"
+#include "base/factory.hpp"
+
+using namespace VMG;
+
+class VMGCommandExecuteCycleLoop : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    while (MG::GetFactory().Get(arguments[0])->Cast<CommandList>()->ExecuteList() == Continue);
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ExecuteCycleLoop";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandExecuteCycleLoop)
Index: ThirdParty/vmg/src/commands/com_execute_full_cycle.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_execute_full_cycle.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_execute_full_cycle.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,63 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_execute_full_cycle.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:35:13 2011
+ *
+ * @brief  Executes a set of cycles once.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/command_list.hpp"
+
+using namespace VMG;
+
+class VMGCommandExecuteFullCycle : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    std::string str_init = arguments[0] + "_INIT";
+    std::string str_loop = arguments[0] + "_LOOP";
+    std::string str_finalize = arguments[0] + "_FINALIZE";
+
+    VMG::Factory& factory = MG::GetFactory();
+
+    factory.Get(str_init)->Cast<CommandList>()->ExecuteList();
+    factory.Get(str_loop)->Cast<CommandList>()->ExecuteList();
+    factory.Get(str_finalize)->Cast<CommandList>()->ExecuteList();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ExecuteFullCycle";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandExecuteFullCycle)
Index: ThirdParty/vmg/src/commands/com_execute_full_cycle_loop.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_execute_full_cycle_loop.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_execute_full_cycle_loop.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,64 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_execute_full_cycle_loop.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:35:37 2011
+ *
+ * @brief  Executes a set of cycles. foo_INIT and foo_FINALIZE
+ *         get executed once and foo_LOOP in a loop.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/command_list.hpp"
+
+using namespace VMG;
+
+class VMGCommandExecuteFullCycleLoop : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    std::string str_init = arguments[0] + "_INIT";
+    std::string str_loop = arguments[0] + "_LOOP";
+    std::string str_finalize = arguments[0] + "_FINALIZE";
+
+    MG::GetFactory().Get(str_init)->Cast<CommandList>()->ExecuteList();
+
+    while (MG::GetFactory().Get(str_loop)->Cast<CommandList>()->ExecuteList() == Continue);
+
+    MG::GetFactory().Get(str_finalize)->Cast<CommandList>()->ExecuteList();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ExecuteFullCycleLoop";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandExecuteFullCycleLoop)
Index: ThirdParty/vmg/src/commands/com_export_solution.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_export_solution.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_export_solution.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,60 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_export_solution.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:36:40 2011
+ *
+ * @brief  Executes MGInterface::ExportSolution(sol)
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/factory.hpp"
+#include "base/interface.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandExportSolution : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    Multigrid& sol = *MG::GetSol();
+
+    MG::GetInterface()->ExportSolution(sol(sol.MaxLevel()));
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ExportSolution";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandExportSolution)
Index: ThirdParty/vmg/src/commands/com_force_discrete_compatibility.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_force_discrete_compatibility.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_force_discrete_compatibility.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,64 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_force_discrete_compatibility.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:37:11 2011
+ *
+ * @brief  May be used to explicitly force the discrete
+ *         compatibility condition \sum_{i,j,k} f_{i,j,k} = 0.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/grid.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandForceDiscreteCompatibility : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    Grid& rhs = (*MG::GetRhs())(MG::GetRhs()->MaxLevel());
+    Comm& comm = *MG::GetComm();
+
+    if (comm.BoundaryConditions()[0] == Periodic &&
+	comm.BoundaryConditions()[1] == Periodic &&
+	comm.BoundaryConditions()[2] == Periodic)
+      rhs.ForceDiscreteCompatibilityCondition();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ForceDiscreteCompatibility";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandForceDiscreteCompatibility)
Index: ThirdParty/vmg/src/commands/com_import_rhs.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_import_rhs.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_import_rhs.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,64 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_import_rhs.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:39:13 2011
+ *
+ * @brief  Calls MGInterface::ImportRightHandSide(rhs)
+ *
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/discretization.hpp"
+#include "base/interface.hpp"
+#include "comm/comm.hpp"
+#include "discretization/boundary_value_setter.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandImportRightHandSide : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetInterface()->ImportRightHandSide(*MG::GetRhs());
+    MG::GetDiscretization()->ModifyRightHandSide();
+    if (MG::GetFactory().TestObject("BOUNDARY_VALUE_SETTER"))
+      MG::GetBoundaryValueSetter()->ComputeBoundaryValues();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "ImportRightHandSide";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandImportRightHandSide)
Index: ThirdParty/vmg/src/commands/com_initialize_iteration_counter.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_initialize_iteration_counter.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_initialize_iteration_counter.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,57 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_initialize_iteration_counter.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:29:39 2011
+ *
+ * @brief  Increases the iteration counter and checks if
+ *         the maximum number of iterations is reached.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/object.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandInitializeIterationCounter : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    new ObjectStorage<int>("ITERATION", 0);
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "InitializeIterationCounter";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandInitializeIterationCounter)
Index: ThirdParty/vmg/src/commands/com_initialize_residual_norm.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_initialize_residual_norm.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_initialize_residual_norm.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,62 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_initialize_residual_norm.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:40:12 2011
+ *
+ * @brief  Computes the residual in the discrete L2-norm
+ *         and hands the value over to the factory.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/object.hpp"
+#include "comm/comm.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandInitializeResidualNorm : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    vmg_float residual = MG::GetComm()->ComputeResidualNorm(*MG::GetSol(), *MG::GetRhs());
+    new ObjectStorage<vmg_float>(arguments[0], residual);
+
+    MG::GetComm()->PrintOnce(Info, "Initial residual: %e", residual);
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "InitializeResidualNorm";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandInitializeResidualNorm)
Index: ThirdParty/vmg/src/commands/com_interpolate_fmg.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_interpolate_fmg.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_interpolate_fmg.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,60 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_interpolate_fmg.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:41:29 2011
+ *
+ * @brief  Runs the interpolation of the level operator
+ *         "LEVELOPERATOR_FMG".
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/multigrid.hpp"
+#include "level/level_operator.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandInterpolateFMG : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    LevelOperator* lop = MG::GetFactory().Get("LEVELOPERATOR_FMG")->Cast<LevelOperator>();
+
+    lop->Prolongate(*MG::GetSol(), *MG::GetRhs());
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "InterpolateFMG";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandInterpolateFMG)
Index: ThirdParty/vmg/src/commands/com_nop.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_nop.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_nop.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,50 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_nop.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon May 30 12:43:54 2011
+ *
+ * @brief  A command that does nothing.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+
+using namespace VMG;
+
+class VMGCommandNOP : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+    MPE_EVENT_END()
+    return Continue;
+  }
+
+  static const char* Name() {return "NOP";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandNOP)
Index: ThirdParty/vmg/src/commands/com_print_all_settings.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_print_all_settings.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_print_all_settings.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,56 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_print_all_settings.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon May 30 12:43:54 2011
+ *
+ * @brief  Writes all relevant grid settings to standard output.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "comm/comm.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandPrintAllSettings : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetComm()->PrintAllSettings();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "PrintAllSettings";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandPrintAllSettings)
Index: ThirdParty/vmg/src/commands/com_print_defect.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_print_defect.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_print_defect.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,68 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_print_defect.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:42:29 2011
+ *
+ * @brief  Writes the current defect to a VTKStructuredPoints file
+ *         in output/date_time
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <sstream>
+
+#include "base/command.hpp"
+#include "comm/comm.hpp"
+#include "grid/multigrid.hpp"
+
+using namespace VMG;
+
+class VMGCommandPrintDefect : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    std::stringstream buffer;
+
+    Comm* comm = MG::GetComm();
+    Multigrid& rhs = *MG::GetRhs();
+    Multigrid& sol = *MG::GetSol();
+
+    buffer << "Level "<< rhs.Level() << " Defect";
+
+    comm->CommToGhosts(sol());
+    comm->PrintDefect(sol(), rhs(), buffer.str().c_str());
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "PrintDefect";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandPrintDefect)
Index: ThirdParty/vmg/src/commands/com_print_grid.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_print_grid.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_print_grid.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,88 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_print_grid.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:43:54 2011
+ *
+ * @brief  Writes a given grid including boundary and
+ *         halo to a VTKStructuredPoints file in
+ *         output/date_time
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <sstream>
+
+#include "base/command.hpp"
+#include "comm/comm.hpp"
+#include "grid/grid.hpp"
+#include "grid/multigrid.hpp"
+
+using namespace VMG;
+
+class VMGCommandPrintGrid : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+  MPE_EVENT_BEGIN()
+
+        std::ostringstream buffer;
+
+  Multigrid& grid = *MG::GetFactory().Get(arguments[0])->Cast<Multigrid>();
+
+  buffer << "Level " << grid.Level() << " ";
+
+  switch (grid().Global().BoundaryType())
+  {
+  case LocallyRefined:
+    buffer << "Locally Refined ";
+    break;
+  case GlobalMax:
+    buffer << "Global Max ";
+    break;
+  case GlobalCoarsened:
+    buffer << "Global Coarsened ";
+    break;
+  case EmptyGrid:
+    buffer << "Empty grid ";
+    break;
+  case BTUndefined:
+    buffer << "Undefined ";
+    break;
+  }
+
+  buffer << arguments[0];
+
+  MG::GetComm()->PrintGrid(grid(), buffer.str().c_str());
+
+  MPE_EVENT_END()
+
+  return Continue;
+  }
+
+  static const char* Name() {return "PrintGrid";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandPrintGrid)
Index: ThirdParty/vmg/src/commands/com_print_grid_structure.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_print_grid_structure.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_print_grid_structure.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,58 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_print_grid_structure.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:44:47 2011
+ *
+ * @brief  Writes a mesh representation of the multigrid
+ *         to a VTK xml file.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "comm/comm.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandPrintGridStructure : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetComm()->DebugPrintGridStructure((*MG::GetRhs()));
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "PrintGridStructure";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandPrintGridStructure)
Index: ThirdParty/vmg/src/commands/com_print_residual_norm.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_print_residual_norm.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_print_residual_norm.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,72 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_print_residual_norm.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:47:22 2011
+ *
+ * @brief  Writes the current discrete L2-norm of the residual
+ *         to standard output.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <sstream>
+
+#include "base/command.hpp"
+#include "comm/comm.hpp"
+#include "grid/grid.hpp"
+#include "grid/multigrid.hpp"
+#include "level/level_operator.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandPrintResidualNorm : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+
+#ifdef OUTPUT_DEBUG
+    MPE_EVENT_BEGIN()
+
+    Multigrid* sol = MG::GetSol();
+    Multigrid* rhs = MG::GetRhs();
+    Comm* comm = MG::GetComm();
+
+    if ((*sol)(sol->MaxLevel()).IsActive()) {
+      vmg_float residual = comm->ComputeResidualNorm(*sol, *rhs);
+      comm->PrintOnce(Debug, "Residual: %e", residual);
+    }
+
+    MPE_EVENT_END()
+#endif
+
+    return Continue;
+  }
+
+  static const char* Name() {return "PrintResidualNorm";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandPrintResidualNorm)
Index: ThirdParty/vmg/src/commands/com_print_running_time.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_print_running_time.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_print_running_time.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,59 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_print_running_time.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Nov 21 11:01:58 2011
+ *
+ * @brief  Print the running time of various subsystems of vmg.
+ *         Needs vmg to be configured with --enable-debug-output
+ *         and --enable-debug-measure-time
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <cstdio>
+
+#include "base/command.hpp"
+#include "base/timer.hpp"
+
+using namespace VMG;
+
+class VMGCommandPrintRunningTime : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+      Timer::Print();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "PrintRunningTime";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandPrintRunningTime)
Index: ThirdParty/vmg/src/commands/com_prolongate.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_prolongate.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_prolongate.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,57 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_prolongate.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:48:08 2011
+ *
+ * @brief  Runs LevelOperator::Prolongate
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/multigrid.hpp"
+#include "level/level_operator.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandProlongate : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetLevelOperator()->Prolongate(*MG::GetSol(), *MG::GetRhs());
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "Prolongate";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandProlongate)
Index: ThirdParty/vmg/src/commands/com_restrict.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_restrict.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_restrict.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,57 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_restrict.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:48:45 2011
+ *
+ * @brief  Runs LevelOperator::Restrict.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/multigrid.hpp"
+#include "level/level_operator.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandRestrict : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetLevelOperator()->Restrict(*MG::GetSol(), *MG::GetRhs());
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "Restrict";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandRestrict)
Index: ThirdParty/vmg/src/commands/com_set_average_to_zero.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_set_average_to_zero.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_set_average_to_zero.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,58 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_set_average_to_zero.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:49:11 2011
+ *
+ * @brief  May be used to ensure the global constraint
+ *         \sum_{i,j,k} sol_{i,j,k} = 0
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "base/factory.hpp"
+#include "grid/grid.hpp"
+#include "grid/multigrid.hpp"
+
+using namespace VMG;
+
+class VMGCommandSetAverageToZero : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    (*MG::GetFactory().Get(arguments[0])->Cast<Multigrid>())().SetAverageToZero();
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "SetAverageToZero";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandSetAverageToZero)
Index: ThirdParty/vmg/src/commands/com_set_coarser_dirichlet_values.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_set_coarser_dirichlet_values.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_set_coarser_dirichlet_values.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,65 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_set_coarser_dirichlet_values.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:50:00 2011
+ *
+ * @brief  Used for FAS-like multigrid algorithms, to set
+ *         all Dirichlet boundary values on all the coarse
+ *         levels in advance.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/grid.hpp"
+#include "grid/multigrid.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandSetCoarserDirichletValues : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    Multigrid& rhs = *MG::GetRhs();
+    Multigrid& sol = *MG::GetSol();
+
+    rhs.SetCoarserDirichletValues();
+
+    for (int i=rhs.MinLevel(); i<=rhs.GlobalMaxLevel(); ++i)
+      sol(i).SetBoundary(rhs(i));
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "SetCoarserDirichletValues";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandSetCoarserDirichletValues)
Index: ThirdParty/vmg/src/commands/com_set_level.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_set_level.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_set_level.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,62 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_set_level.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:51:22 2011
+ *
+ * @brief  Bring a given multigrid to a given level.
+ *         For the level argument, no numerical value is allowed
+ *         but the name of a variable in the factory.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include <cstdio>
+
+#include "base/command.hpp"
+#include "grid/multigrid.hpp"
+
+using namespace VMG;
+
+class VMGCommandSetLevel : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    Multigrid* grid = MG::GetFactory().Get(arguments[0])->Cast<Multigrid>();
+    ObjectStorage<int>* level = MG::GetFactory().Get(arguments[1])->Cast< ObjectStorage<int> >();
+
+    grid->SetLevel(level->Val());
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "SetLevel";}
+  static int Arguments() {return 2;}
+};
+
+CREATE_INITIALIZER(VMGCommandSetLevel)
Index: ThirdParty/vmg/src/commands/com_smooth.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_smooth.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_smooth.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,59 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_smooth.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:52:29 2011
+ *
+ * @brief  Run the smoother.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/multigrid.hpp"
+#include "smoother/smoother.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandSmooth : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    const int& steps = MG::GetFactory().Get(arguments[0])->Cast< ObjectStorage<int> >()->Val();
+
+    MG::GetSmoother()->Run(*MG::GetSol(), *MG::GetRhs(), steps);
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "Smooth";}
+  static int Arguments() {return 1;}
+};
+
+CREATE_INITIALIZER(VMGCommandSmooth)
Index: ThirdParty/vmg/src/commands/com_solve.cpp
===================================================================
--- ThirdParty/vmg/src/commands/com_solve.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
+++ ThirdParty/vmg/src/commands/com_solve.cpp	(revision 7faa5c793164ff799487bb1193ab2a18a3a7e2fb)
@@ -0,0 +1,57 @@
+/*
+ *    vmg - a versatile multigrid solver
+ *    Copyright (C) 2012 Institute for Numerical Simulation, University of Bonn
+ *
+ *  vmg 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 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  vmg 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * @file   com_solve.cpp
+ * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
+ * @date   Mon Apr 18 12:52:57 2011
+ *
+ * @brief  Run the solver
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <libvmg_config.h>
+#endif
+
+#include "base/command.hpp"
+#include "grid/multigrid.hpp"
+#include "solver/solver.hpp"
+#include "mg.hpp"
+
+using namespace VMG;
+
+class VMGCommandSolve : public Command
+{
+public:
+  Request Run(Command::argument_vector arguments)
+  {
+    MPE_EVENT_BEGIN()
+
+    MG::GetSolver()->Run((*MG::GetSol())(), (*MG::GetRhs())());
+
+    MPE_EVENT_END()
+
+    return Continue;
+  }
+
+  static const char* Name() {return "Solve";}
+  static int Arguments() {return 0;}
+};
+
+CREATE_INITIALIZER(VMGCommandSolve)
