// These might be required when the faces contribution is computed
// Therefore they will be initialized at this point.
- std::vector<AnisotropicPolynomials<dim> *> polynomials_abf(dim);
+ std::array<std::unique_ptr<AnisotropicPolynomials<dim>>, dim> polynomials_abf;
// Generate x_1^{i} x_2^{r+1} ...
for (unsigned int dd = 0; dd < dim; ++dd)
poly[d].push_back(Polynomials::Monomial<double>(deg + 1));
poly[dd] = Polynomials::Monomial<double>::generate_complete_basis(deg);
- polynomials_abf[dd] = new AnisotropicPolynomials<dim>(poly);
+ polynomials_abf[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
}
// Number of the point being entered
// space D_xi Q_k
if (deg > 0)
{
- std::vector<AnisotropicPolynomials<dim> *> polynomials(dim);
+ std::array<std::unique_ptr<AnisotropicPolynomials<dim>>, dim> polynomials;
for (unsigned int dd = 0; dd < dim; ++dd)
{
poly[d] = Polynomials::Legendre::generate_complete_basis(deg);
poly[dd] = Polynomials::Legendre::generate_complete_basis(deg - 1);
- polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
+ polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
}
interior_weights.reinit(
cell_quadrature.weight(k) *
polynomials[d]->compute_value(i, cell_quadrature.point(k));
}
-
- for (unsigned int d = 0; d < dim; ++d)
- delete polynomials[d];
}
}
}
- for (unsigned int d = 0; d < dim; ++d)
- delete polynomials_abf[d];
-
Assert(current == this->generalized_support_points.size(),
ExcInternalError());
}
// Create Legendre basis for the
// space D_xi Q_k. Here, we cannot
// use the shape functions
- std::vector<AnisotropicPolynomials<dim> *> polynomials(dim);
+ std::array<std::unique_ptr<AnisotropicPolynomials<dim>>, dim> polynomials;
for (unsigned int dd = 0; dd < dim; ++dd)
{
std::vector<std::vector<Polynomials::Polynomial<double>>> poly(dim);
poly[d] = Polynomials::Legendre::generate_complete_basis(rt_order);
poly[dd] = Polynomials::Legendre::generate_complete_basis(rt_order - 1);
- polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
+ polynomials[dd] = std::make_unique<AnisotropicPolynomials<dim>>(poly);
}
// TODO: the implementation makes the assumption that all faces have the
polynomials[d]->compute_value(i_weight, q_sub.point(k));
}
}
-
- for (unsigned int d = 0; d < dim; ++d)
- delete polynomials[d];
}
// If we need to plot curved lines then generate a quadrature formula to
// place points via the mapping
- Quadrature<dim> * q_projector = nullptr;
- std::vector<Point<1>> boundary_points;
+ std::unique_ptr<Quadrature<dim>> q_projector;
+ std::vector<Point<1>> boundary_points;
if (mapping != nullptr)
{
boundary_points.resize(n_points);
// tensor product of points, only one copy
QIterated<dim - 1> quadrature(quadrature1d, 1);
- q_projector = new Quadrature<dim>(
+ q_projector = std::make_unique<Quadrature<dim>>(
QProjector<dim>::project_to_all_faces(quadrature));
}
}
}
- if (q_projector != nullptr)
- delete q_projector;
-
-
// make sure everything now gets to disk
out.flush();