From 70f339f39e290aa2b9a0af8e61613246323e53e6 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Mon, 28 May 2001 11:26:07 +0000 Subject: [PATCH] test for Legendre polynomials git-svn-id: https://svn.dealii.org/trunk@4732 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/Makefile.in | 7 +- tests/base/polynomial1d.cc | 55 +++++++++++++++ tests/base/polynomial1d.checked | 121 ++++++++++++++++++++++++++++++++ 3 files changed, 180 insertions(+), 3 deletions(-) create mode 100644 tests/base/polynomial1d.cc create mode 100644 tests/base/polynomial1d.checked diff --git a/tests/base/Makefile.in b/tests/base/Makefile.in index f60060d754..869df74278 100644 --- a/tests/base/Makefile.in +++ b/tests/base/Makefile.in @@ -19,8 +19,9 @@ default: run-tests ############################################################ -logtest.exe : logtest.go $(libraries) -polynomial_test.exe: polynomial_test.go $(libraries) +logtest.exe : logtest.go $(lib-base.g) +polynomial_test.exe: polynomial_test.go $(lib-base.g) +polynomial1d.exe : polynomial1d.go $(lib-base.g) quadrature_test.exe: quadrature_test.go $(libraries) reference.exe : reference.go abort.go $(libraries) tensor.exe : tensor.go $(libraries) @@ -28,7 +29,7 @@ timer.exe : timer.go $(libraries) auto_derivative_function.exe : auto_derivative_function.go $(libraries) -tests = logtest quadrature_test reference tensor timer polynomial_test auto_derivative_function +tests = logtest reference quadrature_test tensor timer polynomial1d polynomial_test auto_derivative_function ############################################################ diff --git a/tests/base/polynomial1d.cc b/tests/base/polynomial1d.cc new file mode 100644 index 0000000000..98f7a5eb3f --- /dev/null +++ b/tests/base/polynomial1d.cc @@ -0,0 +1,55 @@ +//----------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2000, 2001 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. +// +//----------------------------------------------------------------------------- + +#include +#include +#include + +#include +#include +#include + + +double scalar_product (const Polynomial& p1, + const Polynomial& p2) +{ + unsigned int degree = (p1.degree() + p2.degree())/2 + 1; + QGauss<1> gauss(degree); + + double sum = 0.; + for (unsigned int i=0;i > p (15); + for (unsigned int i=0;i(i); + + for (unsigned int i=0;i