From c6deb46fc2b5aa39a894355113af80dca8d4919c Mon Sep 17 00:00:00 2001 From: heltai Date: Wed, 20 Nov 2013 20:02:35 +0000 Subject: [PATCH] Merged from trunk to branch manifold id git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@31737 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/CMakeLists.txt | 3 + tests/a-framework/CMakeLists.txt | 2 +- tests/aniso/CMakeLists.txt | 2 +- tests/base/CMakeLists.txt | 2 +- tests/bits/CMakeLists.txt | 2 +- tests/codim_one/CMakeLists.txt | 2 +- tests/deal.II/CMakeLists.txt | 2 +- tests/distributed_grids/CMakeLists.txt | 2 +- tests/fe/CMakeLists.txt | 2 +- tests/gla/CMakeLists.txt | 2 +- tests/grid/CMakeLists.txt | 2 +- tests/hp/CMakeLists.txt | 2 +- tests/integrators/CMakeLists.txt | 2 +- tests/lac/CMakeLists.txt | 2 +- ...with_trilinos=true.with_petsc=true.output} | 0 tests/lac/iteration_number_control.cc | 85 +++++++++++++++++++ tests/lac/iteration_number_control.output | 6 ++ tests/lapack/CMakeLists.txt | 2 +- tests/manifold/CMakeLists.txt | 2 +- tests/matrix_free/CMakeLists.txt | 2 +- tests/metis/CMakeLists.txt | 2 +- tests/mpi/CMakeLists.txt | 2 +- tests/multigrid/CMakeLists.txt | 2 +- tests/petsc/CMakeLists.txt | 2 +- tests/run_testsuite.cmake | 6 +- tests/serialization/CMakeLists.txt | 2 +- tests/slepc/CMakeLists.txt | 2 +- tests/trilinos/CMakeLists.txt | 2 +- tests/umfpack/CMakeLists.txt | 2 +- 29 files changed, 121 insertions(+), 27 deletions(-) rename tests/lac/{ala_01.output => ala_01.with_trilinos=true.with_petsc=true.output} (100%) create mode 100644 tests/lac/iteration_number_control.cc create mode 100644 tests/lac/iteration_number_control.output diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 15b4d9ad0c..b1ad22bf63 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,6 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) +PROJECT(TESTSUITE NONE) + MESSAGE(FATAL_ERROR "\n The testsuite cannot be set up as an independent project. Please configure \"deal.II\" directly instead.\n\n" diff --git a/tests/a-framework/CMakeLists.txt b/tests/a-framework/CMakeLists.txt index 2077b01d03..c2ca3dd75d 100644 --- a/tests/a-framework/CMakeLists.txt +++ b/tests/a-framework/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/aniso/CMakeLists.txt b/tests/aniso/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/aniso/CMakeLists.txt +++ b/tests/aniso/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/base/CMakeLists.txt b/tests/base/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/base/CMakeLists.txt +++ b/tests/base/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/bits/CMakeLists.txt b/tests/bits/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/bits/CMakeLists.txt +++ b/tests/bits/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/codim_one/CMakeLists.txt b/tests/codim_one/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/codim_one/CMakeLists.txt +++ b/tests/codim_one/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/deal.II/CMakeLists.txt b/tests/deal.II/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/deal.II/CMakeLists.txt +++ b/tests/deal.II/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/distributed_grids/CMakeLists.txt b/tests/distributed_grids/CMakeLists.txt index e1ba866f7e..baeb270640 100644 --- a/tests/distributed_grids/CMakeLists.txt +++ b/tests/distributed_grids/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_P4EST) diff --git a/tests/fe/CMakeLists.txt b/tests/fe/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/fe/CMakeLists.txt +++ b/tests/fe/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/gla/CMakeLists.txt b/tests/gla/CMakeLists.txt index ef84a0b386..e8f4a01f4a 100644 --- a/tests/gla/CMakeLists.txt +++ b/tests/gla/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST) diff --git a/tests/grid/CMakeLists.txt b/tests/grid/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/grid/CMakeLists.txt +++ b/tests/grid/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/hp/CMakeLists.txt b/tests/hp/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/hp/CMakeLists.txt +++ b/tests/hp/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/integrators/CMakeLists.txt b/tests/integrators/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/integrators/CMakeLists.txt +++ b/tests/integrators/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/lac/CMakeLists.txt b/tests/lac/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/lac/CMakeLists.txt +++ b/tests/lac/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/lac/ala_01.output b/tests/lac/ala_01.with_trilinos=true.with_petsc=true.output similarity index 100% rename from tests/lac/ala_01.output rename to tests/lac/ala_01.with_trilinos=true.with_petsc=true.output diff --git a/tests/lac/iteration_number_control.cc b/tests/lac/iteration_number_control.cc new file mode 100644 index 0000000000..26ff41d21a --- /dev/null +++ b/tests/lac/iteration_number_control.cc @@ -0,0 +1,85 @@ +// --------------------------------------------------------------------- +// $Id$ +// +// Copyright (C) 1998 - 2013 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. +// +// --------------------------------------------------------------------- + +// check that IterationNumber control works as expected, i.e., it terminates +// with success when reaching the maximum number of iterations + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +void check() +{ + // Check 1: should still terminate after one iteration when using a matrix + // with only one eigenvalue + const unsigned int size = 20; + FullMatrix A(size, size); + for (unsigned int i=0; i in(size), out(size); + in = 1.; + + { + IterationNumberControl control(5); + SolverCG<> solver(control); + solver.solve(A, out, in, PreconditionIdentity()); + Assert (control.last_step() == 1, ExcInternalError()); + } + for (unsigned int i=0; i solver(control); + solver.solve(A, out, in, PreconditionIdentity()); + Assert (control.last_step() == 5, ExcInternalError()); + } + bool solved_exactly = true; + for (unsigned int i=0; i 1e-8) + solved_exactly = false; + Assert(solved_exactly == false, ExcInternalError()); + + deallog << "OK" << std::endl; +} + +int main() +{ + std::ofstream logfile("output"); +// logfile.setf(std::ios::fixed); + deallog << std::setprecision(4); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + check(); +} + diff --git a/tests/lac/iteration_number_control.output b/tests/lac/iteration_number_control.output new file mode 100644 index 0000000000..e2c05a877e --- /dev/null +++ b/tests/lac/iteration_number_control.output @@ -0,0 +1,6 @@ + +DEAL:cg::Starting value 4.472 +DEAL:cg::Convergence step 1 value 0 +DEAL:cg::Starting value 4.472 +DEAL:cg::Convergence step 5 value 0.6308 +DEAL::OK diff --git a/tests/lapack/CMakeLists.txt b/tests/lapack/CMakeLists.txt index 13d07cf2c3..8887f4f830 100644 --- a/tests/lapack/CMakeLists.txt +++ b/tests/lapack/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_LAPACK) diff --git a/tests/manifold/CMakeLists.txt b/tests/manifold/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/manifold/CMakeLists.txt +++ b/tests/manifold/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/matrix_free/CMakeLists.txt b/tests/matrix_free/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/matrix_free/CMakeLists.txt +++ b/tests/matrix_free/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/metis/CMakeLists.txt b/tests/metis/CMakeLists.txt index 3219ef35aa..e45e9f2adb 100644 --- a/tests/metis/CMakeLists.txt +++ b/tests/metis/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_METIS) diff --git a/tests/mpi/CMakeLists.txt b/tests/mpi/CMakeLists.txt index ef84a0b386..e8f4a01f4a 100644 --- a/tests/mpi/CMakeLists.txt +++ b/tests/mpi/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_MPI AND DEAL_II_WITH_P4EST) diff --git a/tests/multigrid/CMakeLists.txt b/tests/multigrid/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/multigrid/CMakeLists.txt +++ b/tests/multigrid/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/petsc/CMakeLists.txt b/tests/petsc/CMakeLists.txt index 5afa661fa1..840a460b10 100644 --- a/tests/petsc/CMakeLists.txt +++ b/tests/petsc/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_PETSC) diff --git a/tests/run_testsuite.cmake b/tests/run_testsuite.cmake index 00e7a1e294..5efc0979e3 100644 --- a/tests/run_testsuite.cmake +++ b/tests/run_testsuite.cmake @@ -21,9 +21,9 @@ IF( "${CTEST_BINARY_DIRECTORY}" STREQUAL "" AND "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}" ) MESSAGE(FATAL_ERROR " -ctest was invoked in the source directory (or test source directory) and -CTEST_BINARY_DIRECTORY is not set. Please either call ctest from within a -designated build directory, or set CTEST_BINARY_DIRECTORY accordingly. +ctest was invoked in the test directory and CTEST_BINARY_DIRECTORY is not +set. Please either call ctest from within a designated build directory, or +set CTEST_BINARY_DIRECTORY accordingly. " ) ENDIF() diff --git a/tests/serialization/CMakeLists.txt b/tests/serialization/CMakeLists.txt index e39c51b85d..ffa6bb54a1 100644 --- a/tests/serialization/CMakeLists.txt +++ b/tests/serialization/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) DEAL_II_PICKUP_TESTS() diff --git a/tests/slepc/CMakeLists.txt b/tests/slepc/CMakeLists.txt index 27b6959af2..93e938146c 100644 --- a/tests/slepc/CMakeLists.txt +++ b/tests/slepc/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF((DEAL_II_WITH_PETSC) AND (DEAL_II_WITH_SLEPC)) diff --git a/tests/trilinos/CMakeLists.txt b/tests/trilinos/CMakeLists.txt index 862d6a1f5e..9bd93d7f13 100644 --- a/tests/trilinos/CMakeLists.txt +++ b/tests/trilinos/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_TRILINOS) diff --git a/tests/umfpack/CMakeLists.txt b/tests/umfpack/CMakeLists.txt index 70aca765ff..994c98b39b 100644 --- a/tests/umfpack/CMakeLists.txt +++ b/tests/umfpack/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8) -INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsuite.cmake) +INCLUDE(${DEAL_II_SOURCE_DIR}/cmake/setup_testsubproject.cmake) PROJECT(testsuite CXX) INCLUDE(${DEAL_II_TARGET_CONFIG}) IF(DEAL_II_WITH_UMFPACK) -- 2.39.5