]> https://gitweb.dealii.org/ - dealii.git/commitdiff
New test
authorAndrew McBride <mcbride.andrew@gmail.com>
Wed, 1 Sep 2010 17:26:13 +0000 (17:26 +0000)
committerAndrew McBride <mcbride.andrew@gmail.com>
Wed, 1 Sep 2010 17:26:13 +0000 (17:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@21826 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/Makefile
tests/base/my_test/cmp/generic [new file with mode: 0644]
tests/base/polynomial_minus_equals.cc [new file with mode: 0644]

index fec220202dbaebe3697ad160611dcd8de76238b0..c06f6cd19f80d85df6cbd771647106068bd707da 100644 (file)
@@ -99,7 +99,8 @@ tests_x =  geometry_info_* \
           mutex_* \
           scalar_* \
           conditional_ostream \
-          convergence_table_*
+          convergence_table_* \
+          polynomial_minus_equals
 
 # add threading tests. note that we have
 # to list them individually, without wildcards, because the .cc files are
diff --git a/tests/base/my_test/cmp/generic b/tests/base/my_test/cmp/generic
new file mode 100644 (file)
index 0000000..e4f1a12
--- /dev/null
@@ -0,0 +1,33 @@
+
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
+DEAL::0
diff --git a/tests/base/polynomial_minus_equals.cc b/tests/base/polynomial_minus_equals.cc
new file mode 100644 (file)
index 0000000..cad0d18
--- /dev/null
@@ -0,0 +1,55 @@
+/* $Id: polynomial.cc  $ */
+/* Author: Andrew McBride, 2010 */
+/*                                                                */
+/*    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors */
+/*                                                                */
+/*    This file is subject to QPL and may not be  distributed     */
+/*    without copyright and license information. Please refer     */
+/*    to the file deal.II/doc/license.html for the  text  and     */
+/*    further information on this license.                        */
+
+// check on the Polynomial -= operator
+
+#include <base/logstream.h>
+#include <base/polynomial.h>
+
+#include <iostream>
+#include <vector>
+#include <fstream>
+#include <iomanip>
+#include <cmath>
+
+using namespace dealii;
+
+
+int main () 
+{
+    std::ofstream logfile("polynomial_minus_equals/output");
+    deallog << std::setprecision(3);
+    deallog.attach(logfile);
+    deallog.depth_console(0);
+    
+    //                 subtract two equal polynomials up to order p_dim
+    //                 the result evaluated at an arbitrary point 
+    //                 should always be zero
+    
+    //                 check polynomials up to order 32
+       const unsigned int p_dim = 32;
+       
+       std::vector<double> coefficients_a;
+       
+       //                      arbitrary point
+       double evalutation_number = 12.123;
+       
+       for (unsigned int pp = 0; pp < p_dim; pp++) 
+       {
+               coefficients_a.push_back(pp);
+               
+               Polynomials::Polynomial<double> test_poly_a(coefficients_a);
+               Polynomials::Polynomial<double> test_poly_b(coefficients_a);
+               
+               test_poly_b -= test_poly_a;
+               
+               deallog << test_poly_b.value(evalutation_number) << std::endl;
+       }
+}

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.