From ae0f513a9dc29ea4bc46b78ca462d0c21718defe Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 17 Nov 2010 19:02:10 +0000 Subject: [PATCH] Add a couple specializations for TensorProductPolynomials that are apparently needed for the Intel compilers. git-svn-id: https://svn.dealii.org/trunk@22795 0785d39b-7218-0410-832d-ea1e28bc413d --- .../source/base/tensor_product_polynomials.cc | 72 ++++++++++++------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/deal.II/source/base/tensor_product_polynomials.cc b/deal.II/source/base/tensor_product_polynomials.cc index 0d9155fbc5..1d3d964eab 100644 --- a/deal.II/source/base/tensor_product_polynomials.cc +++ b/deal.II/source/base/tensor_product_polynomials.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -108,15 +108,26 @@ TensorProductPolynomials::compute_value (const unsigned int i, { unsigned int indices[dim]; compute_index (i, indices); - + double value=1.; for (unsigned int d=0; d +double +TensorProductPolynomials<0>::compute_value (const unsigned int , + const Point<0> &) const +{ + return 1./0.; +} + + + template Tensor<1,dim> TensorProductPolynomials::compute_grad (const unsigned int i, @@ -132,7 +143,7 @@ TensorProductPolynomials::compute_grad (const unsigned int i, std::vector > v(dim, std::vector (2)); for (unsigned int d=0; d grad; for (unsigned int d=0; d::compute_grad (const unsigned int i, for (unsigned int x=0; x::compute_grad_grad (const unsigned int i, std::vector > v(dim, std::vector (3)); for (unsigned int d=0; d grad_grad; for (unsigned int d1=0; d1::compute_grad_grad (const unsigned int i, derivative=2; else derivative=1; - } + } grad_grad[d1][d2] *= v[x][derivative]; } } @@ -224,7 +235,7 @@ compute (const Point &p, v(d,i).resize (n_values_and_derivatives, 0.); polynomials[i].value(p(d), v(d,i)); }; - + for (unsigned int i=0; i &p, // product polynomial unsigned int indices[dim]; compute_index (i, indices); - + if (update_values) { values[i] = 1; for (unsigned int x=0; x &p, derivative=2; else derivative=1; - } + } grad_grads[i][d1][d2] *= v(x,indices[x])[derivative]; } @@ -273,7 +284,7 @@ compute (const Point &p, -template +template unsigned int TensorProductPolynomials::n() const { @@ -282,6 +293,15 @@ TensorProductPolynomials::n() const +template <> +unsigned int +TensorProductPolynomials<0>::n() const +{ + return numbers::invalid_unsigned_int; +} + + + /* ------------------- AnisotropicPolynomials -------------- */ @@ -353,15 +373,15 @@ AnisotropicPolynomials::compute_value (const unsigned int i, { unsigned int indices[dim]; compute_index (i, indices); - + double value=1.; for (unsigned int d=0; d Tensor<1,dim> AnisotropicPolynomials::compute_grad (const unsigned int i, @@ -377,7 +397,7 @@ AnisotropicPolynomials::compute_grad (const unsigned int i, std::vector > v(dim, std::vector (2)); for (unsigned int d=0; d grad; for (unsigned int d=0; d::compute_grad (const unsigned int i, for (unsigned int x=0; x::compute_grad_grad (const unsigned int i, std::vector > v(dim, std::vector (3)); for (unsigned int d=0; d grad_grad; for (unsigned int d1=0; d1::compute_grad_grad (const unsigned int i, derivative=2; else derivative=1; - } + } grad_grad[d1][d2] *= v[x][derivative]; } } @@ -472,7 +492,7 @@ compute (const Point &p, polynomials[d][i].value(p(d), v[d][i]); }; } - + for (unsigned int i=0; i &p, // product polynomial unsigned int indices[dim]; compute_index (i, indices); - + if (update_values) { values[i] = 1; for (unsigned int x=0; x &p, derivative=2; else derivative=1; - } + } grad_grads[i][d1][d2] *= v[x][indices[x]][derivative]; } -- 2.39.5