]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add test.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 19 Nov 2017 14:54:59 +0000 (15:54 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sun, 19 Nov 2017 14:54:59 +0000 (15:54 +0100)
tests/base/convergence_table_05.cc [new file with mode: 0644]
tests/base/convergence_table_05.output [new file with mode: 0644]

diff --git a/tests/base/convergence_table_05.cc b/tests/base/convergence_table_05.cc
new file mode 100644 (file)
index 0000000..49cfe53
--- /dev/null
@@ -0,0 +1,42 @@
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2010 - 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 "../tests.h"
+#include <deal.II/base/data_out_base.h>
+#include <deal.II/base/table_handler.h>
+#include <deal.II/base/convergence_table.h>
+
+#include <vector>
+#include <string>
+
+// test the method evaluate_convergence_rates with key column given by
+// unsigned long long int
+
+int main ()
+{
+  initlog();
+
+  ConvergenceTable t;
+
+  const unsigned long long int t1 = 100;
+  const unsigned long long int t2 = 400;
+  t.add_value("cells", t1);
+  t.add_value("error", 0.1);
+  t.add_value("cells", t2);
+  t.add_value("error", 0.025);
+  t.evaluate_convergence_rates("error", "cells", ConvergenceTable::reduction_rate_log2, 2);
+  t.write_text(deallog.get_file_stream());
+}
diff --git a/tests/base/convergence_table_05.output b/tests/base/convergence_table_05.output
new file mode 100644 (file)
index 0000000..686e1e9
--- /dev/null
@@ -0,0 +1,4 @@
+
+cells    error    
+100   0.1000 -    
+400   0.0250 2.00 

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.