]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
new tet for mg::SparseMatrixCollection
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 23 Aug 2013 20:22:06 +0000 (20:22 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 23 Aug 2013 20:22:06 +0000 (20:22 +0000)
git-svn-id: https://svn.dealii.org/trunk@30458 0785d39b-7218-0410-832d-ea1e28bc413d

tests/multigrid/sparse_matrix_collection_01.cc [new file with mode: 0644]
tests/multigrid/sparse_matrix_collection_01/cmp/generic [new file with mode: 0644]
tests/multigrid/step-16-02.cc

diff --git a/tests/multigrid/sparse_matrix_collection_01.cc b/tests/multigrid/sparse_matrix_collection_01.cc
new file mode 100644 (file)
index 0000000..8acdd24
--- /dev/null
@@ -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 <deal.II/base/logstream.h>
+#include <deal.II/multigrid/sparse_matrix_collection.h>
+
+#include <fstream>
+#include <iomanip>
+#include <iomanip>
+#include <algorithm>
+
+using namespace std;
+
+
+
+int main()
+{
+  initlog(__FILE__);
+
+  mg::SparseMatrixCollection<float> 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 (file)
index 0000000..ff05a07
--- /dev/null
@@ -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
index 6c1b72b426ea49d8dc605fe12c5e47b3f4af103e..e5a8c5a821f9d560594208e0873c9b0a592cb4ee 100644 (file)
@@ -462,40 +462,6 @@ void LaplaceProblem<dim>::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 <int dim>
 void LaplaceProblem<dim>::solve ()
 {
@@ -545,25 +511,6 @@ void LaplaceProblem<dim>::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 <int dim>
 void LaplaceProblem<dim>::refine_grid (const std::string& reftype)
 {
@@ -619,16 +566,6 @@ void LaplaceProblem<dim>::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
-// <code>assemble_multigrid</code> that takes
-// care of forming the matrices on every
-// level that we need in the multigrid
-// method.
 template <int dim>
 void LaplaceProblem<dim>::run ()
 {
@@ -673,10 +610,6 @@ void LaplaceProblem<dim>::run ()
 }
 
 
-// @sect3{The main() function}
-//
-// This is again the same function as
-// in step-6:
 int main ()
 {
   initlog(__FILE__, true);

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.