From: Guido Kanschat Date: Sun, 22 May 2005 11:56:41 +0000 (+0000) Subject: start testing vector valued polynomials X-Git-Tag: v8.0.0~13859 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9af1747801c87854ceaeb33843b22cea23ef0500;p=dealii.git start testing vector valued polynomials git-svn-id: https://svn.dealii.org/trunk@10696 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/polynomials_tensor.cc b/tests/base/polynomials_tensor.cc new file mode 100644 index 0000000000..70b562a51f --- /dev/null +++ b/tests/base/polynomials_tensor.cc @@ -0,0 +1,95 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 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. +// +//---------------------------------------------------------------------- + +// Output function values and derivatives for vector valued +// polynomials returning Tensor<1,dim> for their values. + +// classes: PolynomialsBDM, PolynomialsRaviartThomas + +#include +#include +#include + +#include +#include + +using namespace std; + +template +void check_point (const Point& x, + const POLY& p) +{ + const unsigned int n = p.n(); + std::vector > values(n); + std::vector > gradients(n); + std::vector > seconds(0); + + p.compute(x, values, gradients, seconds); + + deallog << "Point " << x << std::endl; + for (unsigned int i=0;i x; + + PolynomialsBDM<2> p21(1); + + x(0) = 1.; + check_point(x, p21); +} + +template +void check_rt () +{ + Point x; + + PolynomialsRaviartThomas p0(0); + PolynomialsRaviartThomas p1(1); + PolynomialsRaviartThomas p2(2); + PolynomialsRaviartThomas p3(3); + + x(0) = 2.; + x(1) = 3.; + if (dim>2) + x(2) = 4; + + check_point(x, p0); + check_point(x, p1); + check_point(x, p2); + check_point(x, p3); +} + +int main() +{ + std::ofstream logfile("polynomials_tensor.output"); + logfile.precision(0); + deallog.attach(logfile); + deallog.depth_console(2); + deallog.threshold_double(1.e-10); + + deallog.push("BDM"); + check_bdm2(); + deallog.pop(); + deallog.push("RT"); + check_rt<2>(); + check_rt<3>(); + deallog.pop(); +}