From: oliver Date: Tue, 25 Apr 2006 19:03:12 +0000 (+0000) Subject: Added an implementation of the polynomials for the Arnold Boffi Falk X-Git-Tag: v8.0.0~11876 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c96809e007a5fffe42877a313803fcc14c474219;p=dealii.git Added an implementation of the polynomials for the Arnold Boffi Falk spaces. git-svn-id: https://svn.dealii.org/trunk@12890 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/polynomials_abf.cc b/deal.II/base/source/polynomials_abf.cc new file mode 100644 index 0000000000..e09516305c --- /dev/null +++ b/deal.II/base/source/polynomials_abf.cc @@ -0,0 +1,118 @@ +//--------------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 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. +// +//--------------------------------------------------------------------------- + +#include +#include +#include +#include +using namespace std; +using namespace Polynomials; + + +template +PolynomialsABF::PolynomialsABF (const unsigned int k) + : + my_degree(k), + n_pols(compute_n_pols(k)) +{ + std::vector > > pols(dim); + pols[0] = Polynomials::LagrangeEquidistant::generate_complete_basis(k+2); + if (k == 0) + for (unsigned int d=1;d(pols); +} + + +template +PolynomialsABF::~PolynomialsABF () +{ + delete polynomial_space; +} + + +template +void +PolynomialsABF::compute (const Point &unit_point, + std::vector > &values, + std::vector > &grads, + std::vector > &grad_grads) const +{ + Assert(values.size()==n_pols || values.size()==0, + ExcDimensionMismatch(values.size(), n_pols)); + Assert(grads.size()==n_pols|| grads.size()==0, + ExcDimensionMismatch(grads.size(), n_pols)); + Assert(grad_grads.size()==n_pols|| grad_grads.size()==0, + ExcDimensionMismatch(grad_grads.size(), n_pols)); + + const unsigned int n_sub = polynomial_space->n(); + p_values.resize((values.size() == 0) ? 0 : n_sub); + p_grads.resize((grads.size() == 0) ? 0 : n_sub); + p_grad_grads.resize((grad_grads.size() == 0) ? 0 : n_sub); + + for (unsigned int d=0;d p; + for (unsigned int c=0;ccompute (p, p_values, p_grads, p_grad_grads); + + for (unsigned int i=0;i +unsigned int +PolynomialsABF::compute_n_pols(unsigned int k) +{ + if (dim == 1) return k+1; + if (dim == 2) return 2*(k+1)*(k+3); + //TODO:Check what are the correct numbers ... + if (dim == 3) return 3*(k+1)*(k+1)*(k+2); + + Assert(false, ExcNotImplemented()); + return 0; +} + + +template class PolynomialsABF<1>; +template class PolynomialsABF<2>; +template class PolynomialsABF<3>; +