From: Wolfgang Bangerth Date: Thu, 5 Feb 2015 02:38:22 +0000 (-0600) Subject: Use Tensor<1,dim> instead of Point to denote directions. X-Git-Tag: v8.3.0-rc1~494^2~17 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=134985a1908fdf9d34f0bb82ae614fee57f8ff64;p=dealii.git Use Tensor<1,dim> instead of Point to denote directions. --- diff --git a/include/deal.II/base/function_lib.h b/include/deal.II/base/function_lib.h index d1a5c856ed..4b77435317 100644 --- a/include/deal.II/base/function_lib.h +++ b/include/deal.II/base/function_lib.h @@ -635,7 +635,7 @@ namespace Functions * Constructor. Take the Fourier coefficients in each space direction as * argument. */ - FourierCosineFunction (const Point &fourier_coefficients); + FourierCosineFunction (const Tensor<1,dim> &fourier_coefficients); /** * Return the value of the function at the given point. Unless there is @@ -662,7 +662,7 @@ namespace Functions /** * Stored Fourier coefficients. */ - const Point fourier_coefficients; + const Tensor<1,dim> fourier_coefficients; }; @@ -687,7 +687,7 @@ namespace Functions * Constructor. Take the Fourier coefficients in each space direction as * argument. */ - FourierSineFunction (const Point &fourier_coefficients); + FourierSineFunction (const Tensor<1,dim> &fourier_coefficients); /** * Return the value of the function at the given point. Unless there is @@ -714,7 +714,7 @@ namespace Functions /** * Stored Fourier coefficients. */ - const Point fourier_coefficients; + const Tensor<1,dim> fourier_coefficients; }; diff --git a/source/base/function_lib.cc b/source/base/function_lib.cc index ad798b65bd..f9ff174ab8 100644 --- a/source/base/function_lib.cc +++ b/source/base/function_lib.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 1999 - 2014 by the deal.II authors +// Copyright (C) 1999 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -131,7 +131,7 @@ namespace Functions ExcDimensionMismatch(gradients.size(), points.size())); for (unsigned int i=0; i >(points[i])*2; } @@ -1839,7 +1839,7 @@ namespace Functions template FourierCosineFunction:: - FourierCosineFunction (const Point &fourier_coefficients) + FourierCosineFunction (const Tensor<1,dim> &fourier_coefficients) : Function (1), fourier_coefficients (fourier_coefficients) @@ -1875,7 +1875,7 @@ namespace Functions const unsigned int component) const { Assert (component==0, ExcIndexRange(component,0,1)); - return fourier_coefficients.square() * (-std::cos(fourier_coefficients * p)); + return (fourier_coefficients * fourier_coefficients) * (-std::cos(fourier_coefficients * p)); } @@ -1887,7 +1887,7 @@ namespace Functions template FourierSineFunction:: - FourierSineFunction (const Point &fourier_coefficients) + FourierSineFunction (const Tensor<1,dim> &fourier_coefficients) : Function (1), fourier_coefficients (fourier_coefficients) @@ -1923,7 +1923,7 @@ namespace Functions const unsigned int component) const { Assert (component==0, ExcIndexRange(component,0,1)); - return fourier_coefficients.square() * (-std::sin(fourier_coefficients * p)); + return (fourier_coefficients * fourier_coefficients) * (-std::sin(fourier_coefficients * p)); } @@ -1994,7 +1994,7 @@ namespace Functions const unsigned int n = weights.size(); double sum = 0; for (unsigned int s=0; s