* Constructor. Take the Fourier coefficients in each space direction as
* argument.
*/
- FourierCosineFunction (const Point<dim> &fourier_coefficients);
+ FourierCosineFunction (const Tensor<1,dim> &fourier_coefficients);
/**
* Return the value of the function at the given point. Unless there is
/**
* Stored Fourier coefficients.
*/
- const Point<dim> fourier_coefficients;
+ const Tensor<1,dim> fourier_coefficients;
};
* Constructor. Take the Fourier coefficients in each space direction as
* argument.
*/
- FourierSineFunction (const Point<dim> &fourier_coefficients);
+ FourierSineFunction (const Tensor<1,dim> &fourier_coefficients);
/**
* Return the value of the function at the given point. Unless there is
/**
* Stored Fourier coefficients.
*/
- const Point<dim> fourier_coefficients;
+ const Tensor<1,dim> fourier_coefficients;
};
// ---------------------------------------------------------------------
//
-// 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.
//
ExcDimensionMismatch(gradients.size(), points.size()));
for (unsigned int i=0; i<points.size(); ++i)
- gradients[i] = points[i]*2;
+ gradients[i] = static_cast<Tensor<1,dim> >(points[i])*2;
}
template <int dim>
FourierCosineFunction<dim>::
- FourierCosineFunction (const Point<dim> &fourier_coefficients)
+ FourierCosineFunction (const Tensor<1,dim> &fourier_coefficients)
:
Function<dim> (1),
fourier_coefficients (fourier_coefficients)
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));
}
template <int dim>
FourierSineFunction<dim>::
- FourierSineFunction (const Point<dim> &fourier_coefficients)
+ FourierSineFunction (const Tensor<1,dim> &fourier_coefficients)
:
Function<dim> (1),
fourier_coefficients (fourier_coefficients)
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));
}
const unsigned int n = weights.size();
double sum = 0;
for (unsigned int s=0; s<n; ++s)
- sum -= fourier_coefficients[s].square() * std::sin(fourier_coefficients[s] * p);
+ sum -= (fourier_coefficients[s] * fourier_coefficients[s]) * std::sin(fourier_coefficients[s] * p);
return sum;
}
const unsigned int n = weights.size();
double sum = 0;
for (unsigned int s=0; s<n; ++s)
- sum -= fourier_coefficients[s].square() * std::cos(fourier_coefficients[s] * p);
+ sum -= (fourier_coefficients[s] * fourier_coefficients[s]) * std::cos(fourier_coefficients[s] * p);
return sum;
}