--- /dev/null
+/* ---------------------------------------------------------------------\r
+ *\r
+ * Copyright (C) 2013 - 2015 by the deal.II authors\r
+ *\r
+ * This file is part of the deal.II library.\r
+ *\r
+ * The deal.II library is free software; you can use it, redistribute\r
+ * it, and/or modify it under the terms of the GNU Lesser General\r
+ * Public License as published by the Free Software Foundation; either\r
+ * version 2.1 of the License, or (at your option) any later version.\r
+ * The full text of the license can be found in the file LICENSE at\r
+ * the top level of the deal.II distribution.\r
+ *\r
+ * ---------------------------------------------------------------------\r
+ */\r
+\r
+#include <deal.II/base/logstream.h>\r
+#include <deal.II/distributed/shared_tria.h>\r
+#include <deal.II/grid/tria.h>\r
+#include <deal.II/grid/grid_generator.h>\r
+#include <deal.II/grid/tria_accessor.h>\r
+#include <deal.II/grid/tria_iterator.h>\r
+#include <deal.II/dofs/dof_handler.h>\r
+#include <deal.II/dofs/dof_accessor.h>\r
+#include <deal.II/dofs/dof_tools.h>\r
+#include <deal.II/fe/fe_q.h>\r
+\r
+#include <fstream>\r
+#include <iostream>\r
+\r
+using namespace dealii;\r
+\r
+static const unsigned int dim = 2;\r
+\r
+int main (int argc, char **argv)\r
+{\r
+ try\r
+ {\r
+ Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1);\r
+ {\r
+ parallel::shared::Triangulation<dim> triangulation(MPI_COMM_WORLD);\r
+ FE_Q<dim> fe(1);\r
+ DoFHandler<dim> dof_handler (triangulation);\r
+\r
+ GridGenerator::hyper_cube (triangulation, -1, 1);\r
+ triangulation.refine_global (2);\r
+ dof_handler.distribute_dofs (fe);\r
+ IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs();\r
+ deallog << locally_owned_dofs.n_elements() << std::endl;\r
+ dof_handler.clear ();\r
+ deallog << "OK" << std::endl;\r
+ }\r
+ }\r
+\r
+ catch (std::exception &exc)\r
+ {\r
+ std::cerr << std::endl << std::endl\r
+ << "----------------------------------------------------"\r
+ << std::endl;\r
+ std::cerr << "Exception on processing: " << std::endl\r
+ << exc.what() << std::endl\r
+ << "Aborting!" << std::endl\r
+ << "----------------------------------------------------"\r
+ << std::endl;\r
+\r
+ return 1;\r
+ }\r
+ catch (...)\r
+ {\r
+ std::cerr << std::endl << std::endl\r
+ << "----------------------------------------------------"\r
+ << std::endl;\r
+ std::cerr << "Unknown exception!" << std::endl\r
+ << "Aborting!" << std::endl\r
+ << "----------------------------------------------------"\r
+ << std::endl;\r
+ return 1;\r
+ }\r
+\r
+ return 0;\r
+}\r