From cfc2585fcb271a3eb4751d4a443c97db53b5b77b Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Thu, 13 Oct 2016 10:25:21 +0200 Subject: [PATCH] add a quick test for metis --- tests/quick_tests/CMakeLists.txt | 6 +++ tests/quick_tests/step-metis.cc | 81 ++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 tests/quick_tests/step-metis.cc diff --git a/tests/quick_tests/CMakeLists.txt b/tests/quick_tests/CMakeLists.txt index 07b30b05cf..5cd10638a2 100644 --- a/tests/quick_tests/CMakeLists.txt +++ b/tests/quick_tests/CMakeLists.txt @@ -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 index 0000000000..a951c4f60e --- /dev/null +++ b/tests/quick_tests/step-metis.cc @@ -0,0 +1,81 @@ +/* --------------------------------------------------------------------- + * + * Copyright (C) 2013 - 2015 by the deal.II authors + * + * This file is part of the deal.II library. + * + * The deal.II library is free software; you can use it, redistribute + * it, and/or modify it under the terms of the GNU Lesser General + * Public License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * The full text of the license can be found in the file LICENSE at + * the top level of the deal.II distribution. + * + * --------------------------------------------------------------------- + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace dealii; + +static const unsigned int dim = 2; + +int main (int argc, char **argv) +{ + try + { + Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); + { + parallel::shared::Triangulation triangulation(MPI_COMM_WORLD); + FE_Q fe(1); + DoFHandler dof_handler (triangulation); + + GridGenerator::hyper_cube (triangulation, -1, 1); + triangulation.refine_global (2); + dof_handler.distribute_dofs (fe); + IndexSet locally_owned_dofs = dof_handler.locally_owned_dofs(); + deallog << locally_owned_dofs.n_elements() << std::endl; + dof_handler.clear (); + deallog << "OK" << std::endl; + } + } + + catch (std::exception &exc) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Exception on processing: " << std::endl + << exc.what() << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + + return 1; + } + catch (...) + { + std::cerr << std::endl << std::endl + << "----------------------------------------------------" + << std::endl; + std::cerr << "Unknown exception!" << std::endl + << "Aborting!" << std::endl + << "----------------------------------------------------" + << std::endl; + return 1; + } + + return 0; +} -- 2.39.5