From 9f34ce6e2b0854c010a2d00e75896a16f32920c8 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 6 Apr 2017 15:42:34 -0500 Subject: [PATCH] Remove tests for ShiftedMatrix(|Generalized) --- tests/lac/shifted_matrix_01.cc | 71 -------------- tests/lac/shifted_matrix_01.output | 5 - tests/lac/shifted_matrix_02.cc | 69 -------------- tests/lac/shifted_matrix_02.output | 4 - tests/lac/shifted_matrix_03.cc | 79 --------------- tests/lac/shifted_matrix_03.output | 7 -- tests/lac/shifted_matrix_04.cc | 86 ----------------- tests/lac/shifted_matrix_04.output | 10 -- tests/lac/shifted_matrix_05.cc | 95 ------------------- tests/lac/shifted_matrix_05.output | 14 --- tests/lac/shifted_matrix_generalized_01.cc | 43 --------- .../lac/shifted_matrix_generalized_01.output | 2 - 12 files changed, 485 deletions(-) delete mode 100644 tests/lac/shifted_matrix_01.cc delete mode 100644 tests/lac/shifted_matrix_01.output delete mode 100644 tests/lac/shifted_matrix_02.cc delete mode 100644 tests/lac/shifted_matrix_02.output delete mode 100644 tests/lac/shifted_matrix_03.cc delete mode 100644 tests/lac/shifted_matrix_03.output delete mode 100644 tests/lac/shifted_matrix_04.cc delete mode 100644 tests/lac/shifted_matrix_04.output delete mode 100644 tests/lac/shifted_matrix_05.cc delete mode 100644 tests/lac/shifted_matrix_05.output delete mode 100644 tests/lac/shifted_matrix_generalized_01.cc delete mode 100644 tests/lac/shifted_matrix_generalized_01.output diff --git a/tests/lac/shifted_matrix_01.cc b/tests/lac/shifted_matrix_01.cc deleted file mode 100644 index 5b5d95eb31..0000000000 --- a/tests/lac/shifted_matrix_01.cc +++ /dev/null @@ -1,71 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2014 - 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. -// -// --------------------------------------------------------------------- - -// check ShiftedMatrix::checkConstructor - -#include "../tests.h" -#include -#include -#include -#include - -#include -#include -#include - -template -void -checkConstructor(FullMatrix &A, double sigma) -{ - deallog << "constructor" << std::endl; - - ShiftedMatrix < FullMatrix > S(A, sigma); - - deallog << "Multiplying with all ones vector" << std::endl; - Vector V(A.n()); - for (unsigned int i = 0; i < V.size(); ++i) - V(i) = 1; - - Vector O(A.m()); - - S.vmult(O, V); - - // Check the dimensions of the result matrix - Assert(A.m() == O.size(), ExcInternalError()); - deallog << "Dimensions of result vector verified" << std::endl; - - for (unsigned int i = 0; i < O.size(); ++i) - deallog << O(i) << '\t'; - deallog << std::endl; -} - -int -main() -{ - std::ofstream logfile("output"); - deallog << std::fixed; - deallog << std::setprecision(4); - deallog.attach(logfile); - deallog.threshold_double(1.e-10); - - const double Adata[] = - { 2, 3, 4, 5 }; - - FullMatrix A(2, 2); - - A.fill(Adata); - - checkConstructor(A, 2); -} diff --git a/tests/lac/shifted_matrix_01.output b/tests/lac/shifted_matrix_01.output deleted file mode 100644 index b90077284d..0000000000 --- a/tests/lac/shifted_matrix_01.output +++ /dev/null @@ -1,5 +0,0 @@ - -DEAL::constructor -DEAL::Multiplying with all ones vector -DEAL::Dimensions of result vector verified -DEAL::7.0000 11.0000 diff --git a/tests/lac/shifted_matrix_02.cc b/tests/lac/shifted_matrix_02.cc deleted file mode 100644 index c7e33e8c37..0000000000 --- a/tests/lac/shifted_matrix_02.cc +++ /dev/null @@ -1,69 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2014 - 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. -// -// --------------------------------------------------------------------- - -// check ShiftedMatrix::checkVmult - -#include "../tests.h" -#include -#include -#include -#include - -#include -#include -#include - -template -void -checkVmult(FullMatrix &A, double sigma, Vector &V) -{ - deallog << "vmult" << std::endl; - - ShiftedMatrix < FullMatrix > S(A, sigma); - Vector O(A.m()); - - S.vmult(O, V); - - // Check the dimensions of the result matrix - Assert(A.m() == O.size(), ExcInternalError()); - deallog << "Dimensions of result vector verified" << std::endl; - - for (unsigned int i = 0; i < O.size(); ++i) - deallog << O(i) << '\t'; - deallog << std::endl; -} - -int -main() -{ - std::ofstream logfile("output"); - deallog << std::fixed; - deallog << std::setprecision(4); - deallog.attach(logfile); - deallog.threshold_double(1.e-10); - - const double Adata[] = - { 2, 3, 4, 5 }; - - FullMatrix A(2, 2); - - A.fill(Adata); - - Vector V(2); - V(0) = 1; - V(1) = 2; - - checkVmult(A, 2, V); -} diff --git a/tests/lac/shifted_matrix_02.output b/tests/lac/shifted_matrix_02.output deleted file mode 100644 index 5c9d5fcf3b..0000000000 --- a/tests/lac/shifted_matrix_02.output +++ /dev/null @@ -1,4 +0,0 @@ - -DEAL::vmult -DEAL::Dimensions of result vector verified -DEAL::10.0000 18.0000 diff --git a/tests/lac/shifted_matrix_03.cc b/tests/lac/shifted_matrix_03.cc deleted file mode 100644 index b139c476fb..0000000000 --- a/tests/lac/shifted_matrix_03.cc +++ /dev/null @@ -1,79 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2014 - 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. -// -// --------------------------------------------------------------------- - -// check ShiftedMatrix::checkResidual - -#include "../tests.h" -#include -#include -#include -#include - -#include -#include -#include - -template -void -checkResidual(FullMatrix &A, double sigma, Vector &V, - Vector &R) -{ - deallog << "residual" << std::endl; - - ShiftedMatrix < FullMatrix > S(A, sigma); - Vector O(A.m()); - double residual; - - residual = S.residual(O, V, R); - - // Check the dimensions of the result matrix - Assert(A.m() == O.size(), ExcInternalError()); - deallog << "Dimensions of result vector verified" << std::endl; - - deallog << "Residual vector" << std::endl; - for (unsigned int i = 0; i < O.size(); ++i) - deallog << O(i) << '\t'; - deallog << std::endl; - - deallog << "Residual value" << std::endl; - deallog << residual << std::endl; -} - -int -main() -{ - std::ofstream logfile("output"); - deallog << std::fixed; - deallog << std::setprecision(4); - deallog.attach(logfile); - deallog.threshold_double(1.e-10); - - const double Adata[] = - { 2, 3, 4, 5 }; - - FullMatrix A(2, 2); - - A.fill(Adata); - - Vector V(2); - V(0) = 1; - V(1) = 2; - - Vector R(2); - R(0) = 1; - R(1) = 1; - - checkResidual(A, 2, V, R); -} diff --git a/tests/lac/shifted_matrix_03.output b/tests/lac/shifted_matrix_03.output deleted file mode 100644 index 64cf220694..0000000000 --- a/tests/lac/shifted_matrix_03.output +++ /dev/null @@ -1,7 +0,0 @@ - -DEAL::residual -DEAL::Dimensions of result vector verified -DEAL::Residual vector -DEAL::-9.0000 -17.0000 -DEAL::Residual value -DEAL::19.2354 diff --git a/tests/lac/shifted_matrix_04.cc b/tests/lac/shifted_matrix_04.cc deleted file mode 100644 index 887cc79f4d..0000000000 --- a/tests/lac/shifted_matrix_04.cc +++ /dev/null @@ -1,86 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2014 - 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. -// -// --------------------------------------------------------------------- - -// check ShiftedMatrix::checkSetSigma - -#include "../tests.h" -#include -#include -#include -#include - -#include -#include -#include - -template -void -checkSetSigma(FullMatrix &A, double sigma) -{ - deallog << "shift(sigma)" << std::endl; - - deallog << "Init ShiftedMatrix with sigma=0" << std::endl; - ShiftedMatrix < FullMatrix > S(A, 0); - - deallog << "Multiplying with all ones vector" << std::endl; - Vector V(A.n()); - for (unsigned int i = 0; i < V.size(); ++i) - V(i) = 1; - - Vector O(A.m()); - - S.vmult(O, V); - - // Check the dimensions of the result matrix - Assert(A.m() == O.size(), ExcInternalError()); - deallog << "Dimensions of result vector verified" << std::endl; - - for (unsigned int i = 0; i < O.size(); ++i) - deallog << O(i) << '\t'; - deallog << std::endl; - - deallog << "Setting new sigma value" << std::endl; - S.shift(sigma); - - deallog << "Multiplying with all ones vector" << std::endl; - S.vmult(O, V); - - // Check the dimensions of the result matrix - Assert(A.m() == O.size(), ExcInternalError()); - deallog << "Dimensions of result vector verified" << std::endl; - - for (unsigned int i = 0; i < O.size(); ++i) - deallog << O(i) << '\t'; - deallog << std::endl; -} - -int -main() -{ - std::ofstream logfile("output"); - deallog << std::fixed; - deallog << std::setprecision(4); - deallog.attach(logfile); - deallog.threshold_double(1.e-10); - - const double Adata[] = - { 2, 3, 4, 5 }; - - FullMatrix A(2, 2); - - A.fill(Adata); - - checkSetSigma(A, 2); -} diff --git a/tests/lac/shifted_matrix_04.output b/tests/lac/shifted_matrix_04.output deleted file mode 100644 index 822d2ddc4e..0000000000 --- a/tests/lac/shifted_matrix_04.output +++ /dev/null @@ -1,10 +0,0 @@ - -DEAL::shift(sigma) -DEAL::Init ShiftedMatrix with sigma=0 -DEAL::Multiplying with all ones vector -DEAL::Dimensions of result vector verified -DEAL::5.0000 9.0000 -DEAL::Setting new sigma value -DEAL::Multiplying with all ones vector -DEAL::Dimensions of result vector verified -DEAL::7.0000 11.0000 diff --git a/tests/lac/shifted_matrix_05.cc b/tests/lac/shifted_matrix_05.cc deleted file mode 100644 index a7a616fa3f..0000000000 --- a/tests/lac/shifted_matrix_05.cc +++ /dev/null @@ -1,95 +0,0 @@ -// --------------------------------------------------------------------- -// -// Copyright (C) 2014 - 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. -// -// --------------------------------------------------------------------- - -// check ShiftedMatrix::checkGetSigma - -#include "../tests.h" -#include -#include -#include -#include - -#include -#include -#include - -template -void -checkGetSigma(FullMatrix &A) -{ - deallog << "shift()" << std::endl; - - deallog << "Init ShiftedMatrix with sigma=0" << std::endl; - ShiftedMatrix < FullMatrix > S(A, 0); - - deallog << "Multiplying with all ones vector" << std::endl; - Vector V(A.n()); - for (unsigned int i = 0; i < V.size(); ++i) - V(i) = 1; - - Vector O(A.m()); - - S.vmult(O, V); - - // Check the dimensions of the result matrix - Assert(A.m() == O.size(), ExcInternalError()); - deallog << "Dimensions of result vector verified" << std::endl; - - for (unsigned int i = 0; i < O.size(); ++i) - deallog << O(i) << '\t'; - deallog << std::endl; - - deallog << "Setting new sigma value by incrementing old value by 1" - << std::endl; - - deallog << "Old sigma value" << std::endl; - double sigma = S.shift(); - deallog << sigma << std::endl; - sigma = sigma + 1; - deallog << "New sigma value" << std::endl; - deallog << sigma << std::endl; - - S.shift(sigma); - - deallog << "Multiplying with all ones vector" << std::endl; - S.vmult(O, V); - - // Check the dimensions of the result matrix - Assert(A.m() == O.size(), ExcInternalError()); - deallog << "Dimensions of result vector verified" << std::endl; - - for (unsigned int i = 0; i < O.size(); ++i) - deallog << O(i) << '\t'; - deallog << std::endl; -} - -int -main() -{ - std::ofstream logfile("output"); - deallog << std::fixed; - deallog << std::setprecision(4); - deallog.attach(logfile); - deallog.threshold_double(1.e-10); - - const double Adata[] = - { 2, 3, 4, 5 }; - - FullMatrix A(2, 2); - - A.fill(Adata); - - checkGetSigma(A); -} diff --git a/tests/lac/shifted_matrix_05.output b/tests/lac/shifted_matrix_05.output deleted file mode 100644 index 27f92db5f1..0000000000 --- a/tests/lac/shifted_matrix_05.output +++ /dev/null @@ -1,14 +0,0 @@ - -DEAL::shift() -DEAL::Init ShiftedMatrix with sigma=0 -DEAL::Multiplying with all ones vector -DEAL::Dimensions of result vector verified -DEAL::5.0000 9.0000 -DEAL::Setting new sigma value by incrementing old value by 1 -DEAL::Old sigma value -DEAL::0 -DEAL::New sigma value -DEAL::1.0000 -DEAL::Multiplying with all ones vector -DEAL::Dimensions of result vector verified -DEAL::6.0000 10.0000 diff --git a/tests/lac/shifted_matrix_generalized_01.cc b/tests/lac/shifted_matrix_generalized_01.cc deleted file mode 100644 index 47aa057a3d..0000000000 --- a/tests/lac/shifted_matrix_generalized_01.cc +++ /dev/null @@ -1,43 +0,0 @@ -#include - -#include -#include -#include - -#include - -int main() -{ - using namespace dealii; - - std::ofstream logfile("output"); - deallog << std::fixed; - deallog << std::setprecision(4); - deallog.attach(logfile); - deallog.threshold_double(1.e-10); - - FullMatrix m1(2, 2); - FullMatrix m2(2, 2); - - m1(0, 0) = 2.0; - m1(0, 1) = 1.0; - m1(1, 0) = 1.0; - m1(1, 1) = 2.0; - - m2(0, 0) = 1.0; - m2(0, 1) = 1.0; - m2(1, 0) = 1.0; - m2(1, 1) = 1.0; - - ShiftedMatrixGeneralized, FullMatrix, Vector > - shifted_matrix(m1, m2, 2.0); - - Vector src(2); - src[0] = 3.0; - src[1] = 7.0; - Vector dst(2); - shifted_matrix.vmult(dst, src); - - deallog << dst[0] << ", "; - deallog << dst[1] << std::endl; -} diff --git a/tests/lac/shifted_matrix_generalized_01.output b/tests/lac/shifted_matrix_generalized_01.output deleted file mode 100644 index e40ef7690c..0000000000 --- a/tests/lac/shifted_matrix_generalized_01.output +++ /dev/null @@ -1,2 +0,0 @@ - -DEAL::33.0000, 37.0000 -- 2.39.5