From 34e6f805d284c4cd02755e1992901c00cc71e069 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Fri, 23 Aug 2013 20:22:06 +0000 Subject: [PATCH] new tet for mg::SparseMatrixCollection git-svn-id: https://svn.dealii.org/trunk@30458 0785d39b-7218-0410-832d-ea1e28bc413d --- .../multigrid/sparse_matrix_collection_01.cc | 42 ++++++++++++ .../sparse_matrix_collection_01/cmp/generic | 6 ++ tests/multigrid/step-16-02.cc | 67 ------------------- 3 files changed, 48 insertions(+), 67 deletions(-) create mode 100644 tests/multigrid/sparse_matrix_collection_01.cc create mode 100644 tests/multigrid/sparse_matrix_collection_01/cmp/generic diff --git a/tests/multigrid/sparse_matrix_collection_01.cc b/tests/multigrid/sparse_matrix_collection_01.cc new file mode 100644 index 0000000000..8acdd24022 --- /dev/null +++ b/tests/multigrid/sparse_matrix_collection_01.cc @@ -0,0 +1,42 @@ +// --------------------------------------------------------------------- +// $Id$ +// +// Copyright (C) 2000 - 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. +// +// --------------------------------------------------------------------- + +#include "../tests.h" +#include +#include + +#include +#include +#include +#include + +using namespace std; + + + +int main() +{ + initlog(__FILE__); + + mg::SparseMatrixCollection smc; + smc.resize(0, 5); + + deallog << "matrix " << smc.matrix.min_level() << '-' << smc.matrix.max_level() << std::endl; + deallog << "matrix_in " << smc.matrix_in.min_level() << '-' << smc.matrix_in.max_level() << std::endl; + deallog << "matrix_out " << smc.matrix_out.min_level() << '-' << smc.matrix_out.max_level() << std::endl; + deallog << "matrix_up " << smc.matrix_up.min_level() << '-' << smc.matrix_up.max_level() << std::endl; + deallog << "matrix_down " << smc.matrix_down.min_level() << '-' << smc.matrix_down.max_level() << std::endl; +} diff --git a/tests/multigrid/sparse_matrix_collection_01/cmp/generic b/tests/multigrid/sparse_matrix_collection_01/cmp/generic new file mode 100644 index 0000000000..ff05a075c6 --- /dev/null +++ b/tests/multigrid/sparse_matrix_collection_01/cmp/generic @@ -0,0 +1,6 @@ + +DEAL::matrix 0-5 +DEAL::matrix_in 0-5 +DEAL::matrix_out 0-5 +DEAL::matrix_up 1-5 +DEAL::matrix_down 1-5 diff --git a/tests/multigrid/step-16-02.cc b/tests/multigrid/step-16-02.cc index 6c1b72b426..e5a8c5a821 100644 --- a/tests/multigrid/step-16-02.cc +++ b/tests/multigrid/step-16-02.cc @@ -462,40 +462,6 @@ void LaplaceProblem::assemble_multigrid (const bool& use_mw) } - -// @sect4{LaplaceProblem::solve} - -// This is the other function that is -// significantly different in support of the -// multigrid solver (or, in fact, the -// preconditioner for which we use the -// multigrid method). -// -// Let us start out by setting up two of the -// components of multilevel methods: transfer -// operators between levels, and a solver on -// the coarsest level. In finite element -// methods, the transfer operators are -// derived from the finite element function -// spaces involved and can often be computed -// in a generic way independent of the -// problem under consideration. In that case, -// we can use the MGTransferPrebuilt class -// that, given the constraints on the global -// level and an MGDoFHandler object computes -// the matrices corresponding to these -// transfer operators. -// -// The second part of the following lines -// deals with the coarse grid solver. Since -// our coarse grid is very coarse indeed, we -// decide for a direct solver (a Householder -// decomposition of the coarsest level -// matrix), even if its implementation is not -// particularly sophisticated. If our coarse -// mesh had many more cells than the five we -// have here, something better suited would -// obviously be necessary here. template void LaplaceProblem::solve () { @@ -545,25 +511,6 @@ void LaplaceProblem::solve () } - -// @sect4{Postprocessing} - -// The following two functions postprocess a -// solution once it is computed. In -// particular, the first one refines the mesh -// at the beginning of each cycle while the -// second one outputs results at the end of -// each such cycle. The functions are almost -// unchanged from those in step-6, with the -// exception of two minor differences: The -// KellyErrorEstimator::estimate function -// wants an argument of type DoFHandler, not -// MGDoFHandler, and so we have to cast from -// derived to base class; and we generate -// output in VTK format, to use the more -// modern visualization programs available -// today compared to those that were -// available when step-6 was written. template void LaplaceProblem::refine_grid (const std::string& reftype) { @@ -619,16 +566,6 @@ void LaplaceProblem::output_results (const unsigned int cycle) const } -// @sect4{LaplaceProblem::run} - -// Like several of the functions above, this -// is almost exactly a copy of of the -// corresponding function in step-6. The only -// difference is the call to -// assemble_multigrid that takes -// care of forming the matrices on every -// level that we need in the multigrid -// method. template void LaplaceProblem::run () { @@ -673,10 +610,6 @@ void LaplaceProblem::run () } -// @sect3{The main() function} -// -// This is again the same function as -// in step-6: int main () { initlog(__FILE__, true); -- 2.39.5