From: Andrew McBride Date: Wed, 1 Sep 2010 17:26:13 +0000 (+0000) Subject: New test X-Git-Tag: v8.0.0~5600 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc08f08a4c4846d7477b901b031b3fa9ea222418;p=dealii.git New test git-svn-id: https://svn.dealii.org/trunk@21826 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/Makefile b/tests/base/Makefile index fec220202d..c06f6cd19f 100644 --- a/tests/base/Makefile +++ b/tests/base/Makefile @@ -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 index 0000000000..e4f1a12e71 --- /dev/null +++ b/tests/base/my_test/cmp/generic @@ -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 index 0000000000..cad0d18250 --- /dev/null +++ b/tests/base/polynomial_minus_equals.cc @@ -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 +#include + +#include +#include +#include +#include +#include + +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 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 test_poly_a(coefficients_a); + Polynomials::Polynomial test_poly_b(coefficients_a); + + test_poly_b -= test_poly_a; + + deallog << test_poly_b.value(evalutation_number) << std::endl; + } +}