1 // ---------------------------------------------------------------------
3 // Copyright (C) 2000 - 2017 by the deal.II authors
5 // This file is part of the deal.II library.
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
14 // ---------------------------------------------------------------------
17 // Output function values and derivatives for vector valued
18 // polynomials returning Tensor<1,dim> for their values.
20 // classes: PolynomialsBDM, PolynomialsRaviartThomas
23 #include <deal.II/base/polynomials_bdm.h>
24 #include <deal.II/base/polynomials_raviart_thomas.h>
30 template <int dim, class PolynomialType>
31 void check_point (const Point<dim> &x,
32 const PolynomialType &p)
34 const unsigned int n = p.n();
35 std::vector<Tensor<1,dim> > values(n);
36 std::vector<Tensor<2,dim> > gradients(n);
37 std::vector<Tensor<3,dim> > seconds(0);
38 std::vector<Tensor<4,dim> > thirds(0);
39 std::vector<Tensor<5,dim> > fourths(0);
41 p.compute(x, values, gradients, seconds, thirds, fourths);
43 deallog << "Point " << x << std::endl;
44 for (unsigned int i=0; i<n; ++i)
46 deallog << "p[" << i << "] value ";
47 for (unsigned int d=0; d<dim; ++d)
48 deallog << (int) (values[i][d]+.5) << ' ';
50 for (unsigned int d1=0; d1<dim; ++d1)
51 for (unsigned int d2=0; d2<dim; ++d2)
52 deallog << (int) (gradients[i][d1][d2]+.5) << ' ';
63 PolynomialsBDM<dim> p1(1);
64 PolynomialsBDM<dim> p2(2);
65 PolynomialsBDM<dim> p3(3);
66 PolynomialsBDM<dim> p4(4);
84 PolynomialsRaviartThomas<dim> p0(0);
85 PolynomialsRaviartThomas<dim> p1(1);
86 PolynomialsRaviartThomas<dim> p2(2);
87 PolynomialsRaviartThomas<dim> p3(3);
102 std::ofstream logfile("output");
103 deallog << std::setprecision(0);
104 deallog.attach(logfile);
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