]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add a quick test for metis
authorDenis Davydov <davydden@gmail.com>
Thu, 13 Oct 2016 08:25:21 +0000 (10:25 +0200)
committerDenis Davydov <davydden@gmail.com>
Thu, 13 Oct 2016 08:25:21 +0000 (10:25 +0200)
tests/quick_tests/CMakeLists.txt
tests/quick_tests/step-metis.cc [new file with mode: 0644]

index 07b30b05cfeae4d4d30430b6d46c3b729a8d8941..5cd10638a2dbeca12506345bcc84dcd2ba99ffc7 100644 (file)
@@ -116,6 +116,12 @@ IF (DEAL_II_WITH_TRILINOS)
   make_quicktest("step-trilinos" ${_mybuild} "")
 ENDIF()
 
+# Test metis
+IF (DEAL_II_WITH_METIS AND DEAL_II_WITH_MPI)
+  make_quicktest("step-metis" ${_mybuild} 2)
+ENDIF()
+
+
 
 # A custom test target:
 ADD_CUSTOM_TARGET(test
diff --git a/tests/quick_tests/step-metis.cc b/tests/quick_tests/step-metis.cc
new file mode 100644 (file)
index 0000000..a951c4f
--- /dev/null
@@ -0,0 +1,81 @@
+/* ---------------------------------------------------------------------\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

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.