TensorProductPolynomials<dim, PolynomialType>::output_indices(
std::ostream &out) const
{
- unsigned int ix[dim];
+ unsigned int ix[(dim > 0) ? dim : 1];
for (unsigned int i = 0; i < this->n(); ++i)
{
compute_index(i, ix);
const unsigned int i,
const Point<dim> & p) const
{
- unsigned int indices[dim];
+ unsigned int indices[(dim > 0) ? dim : 1];
compute_index(i, indices);
// compute values and
const unsigned int i,
const Point<dim> & p) const
{
- unsigned int indices[dim];
+ unsigned int indices[(dim > 0) ? dim : 1];
compute_index(i, indices);
double v[dim][3];
template <int dim>
void
-AnisotropicPolynomials<dim>::compute_index(const unsigned int i,
- unsigned int (&indices)[dim]) const
+AnisotropicPolynomials<dim>::compute_index(
+ const unsigned int i,
+ unsigned int (&indices)[(dim > 0 ? dim : 1)]) const
{
#ifdef DEBUG
unsigned int n_poly = 1;
Assert(i < n_poly, ExcInternalError());
#endif
- if (dim == 1)
+ if (dim == 0)
+ {
+ }
+ else if (dim == 1)
internal::compute_tensor_index(i,
polynomials[0].size(),
0 /*not used*/,
AnisotropicPolynomials<dim>::compute_value(const unsigned int i,
const Point<dim> & p) const
{
- unsigned int indices[dim];
+ unsigned int indices[(dim > 0) ? dim : 1];
compute_index(i, indices);
double value = 1.;
AnisotropicPolynomials<dim>::compute_grad(const unsigned int i,
const Point<dim> & p) const
{
- unsigned int indices[dim];
+ unsigned int indices[(dim > 0) ? dim : 1];
compute_index(i, indices);
// compute values and
AnisotropicPolynomials<dim>::compute_grad_grad(const unsigned int i,
const Point<dim> & p) const
{
- unsigned int indices[dim];
+ unsigned int indices[(dim > 0) ? dim : 1];
compute_index(i, indices);
std::vector<std::vector<double>> v(dim, std::vector<double>(3));
// one-dimensional indices of
// this particular tensor
// product polynomial
- unsigned int indices[dim];
+ unsigned int indices[(dim > 0) ? dim : 1];
compute_index(i, indices);
if (update_values)
/* ------------------- explicit instantiations -------------- */
+template class TensorProductPolynomials<0, Polynomials::Polynomial<double>>;
template class TensorProductPolynomials<1, Polynomials::Polynomial<double>>;
template class TensorProductPolynomials<2, Polynomials::Polynomial<double>>;
template class TensorProductPolynomials<3, Polynomials::Polynomial<double>>;
3,
Polynomials::PiecewisePolynomial<double>>;
+template class AnisotropicPolynomials<0>;
template class AnisotropicPolynomials<1>;
template class AnisotropicPolynomials<2>;
template class AnisotropicPolynomials<3>;