#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/function.h>
#include <deal.II/base/logstream.h>
+#include <deal.II/base/std_cxx14/memory.h>
#include <deal.II/base/thread_management.h>
#include <deal.II/base/work_stream.h>
#include <deal.II/lac/vector.h>
#include <algorithm>
#include <numeric>
#include <sstream>
-#include <memory>
// The last step is as in all previous programs:
namespace Step14
{
case ProblemDescription::dual_weighted_error_estimator:
{
- solver.reset
- (new LaplaceSolver::WeightedResidual<dim> (triangulation,
- primal_fe,
- dual_fe,
- quadrature,
- face_quadrature,
- descriptor.data->get_right_hand_side(),
- descriptor.data->get_boundary_values(),
- *descriptor.dual_functional));
+ solver = std_cxx14::make_unique<LaplaceSolver::WeightedResidual<dim>>
+ (triangulation,
+ primal_fe,
+ dual_fe,
+ quadrature,
+ face_quadrature,
+ descriptor.data->get_right_hand_side(),
+ descriptor.data->get_boundary_values(),
+ *descriptor.dual_functional);
break;
}
case ProblemDescription::global_refinement:
{
- solver.reset
- (new LaplaceSolver::RefinementGlobal<dim> (triangulation,
- primal_fe,
- quadrature,
- face_quadrature,
- descriptor.data->get_right_hand_side(),
- descriptor.data->get_boundary_values()));
+ solver = std_cxx14::make_unique<LaplaceSolver::RefinementGlobal<dim>>
+ (triangulation,
+ primal_fe,
+ quadrature,
+ face_quadrature,
+ descriptor.data->get_right_hand_side(),
+ descriptor.data->get_boundary_values());
break;
}
case ProblemDescription::kelly_indicator:
{
- solver.reset
- (new LaplaceSolver::RefinementKelly<dim> (triangulation,
- primal_fe,
- quadrature,
- face_quadrature,
- descriptor.data->get_right_hand_side(),
- descriptor.data->get_boundary_values()));
+ solver = std_cxx14::make_unique<LaplaceSolver::RefinementKelly<dim>>
+ (triangulation,
+ primal_fe,
+ quadrature,
+ face_quadrature,
+ descriptor.data->get_right_hand_side(),
+ descriptor.data->get_boundary_values());
break;
}
case ProblemDescription::weighted_kelly_indicator:
{
- solver.reset
- (new LaplaceSolver::RefinementWeightedKelly<dim> (triangulation,
- primal_fe,
- quadrature,
- face_quadrature,
- descriptor.data->get_right_hand_side(),
- descriptor.data->get_boundary_values(),
- *descriptor.kelly_weight));
+ solver = std_cxx14::make_unique<LaplaceSolver::RefinementWeightedKelly<dim>>
+ (triangulation,
+ primal_fe,
+ quadrature,
+ face_quadrature,
+ descriptor.data->get_right_hand_side(),
+ descriptor.data->get_boundary_values(),
+ *descriptor.kelly_weight);
break;
}
// values, and right hand side. These are prepackaged in classes. We
// take here the description of <code>Exercise_2_3</code>, but you can
// also use <code>CurvedRidges@<dim@></code>:
- descriptor.data.reset(new Data::SetUp<Data::Exercise_2_3<dim>,dim> ());
+ descriptor.data = std_cxx14::make_unique<Data::SetUp<Data::Exercise_2_3<dim>,dim>>();
// Next set first a dual functional, then a list of evaluation
// objects. We choose as default the evaluation of the value at an
// each step. One such additional evaluation is to output the grid in
// each step.
const Point<dim> evaluation_point (0.75, 0.75);
- descriptor.dual_functional.reset
- (new DualFunctional::PointValueEvaluation<dim> (evaluation_point));
+ descriptor.dual_functional = std_cxx14::make_unique<DualFunctional::PointValueEvaluation<dim>>
+ (evaluation_point);
Evaluation::PointValueEvaluation<dim>
postprocessor1 (evaluation_point);
// the aforelisted header files:
#include <iostream>
#include <fstream>
+#include <memory>
#include <sstream>
#include <limits>
assemble_stokes_preconditioner ();
- Amg_preconditioner = std::shared_ptr<TrilinosWrappers::PreconditionAMG>
- (new TrilinosWrappers::PreconditionAMG());
+ Amg_preconditioner = std::make_shared<TrilinosWrappers::PreconditionAMG>
+ ();
std::vector<std::vector<bool> > constant_modes;
FEValuesExtractors::Vector velocity_components(0);
Amg_preconditioner->initialize(stokes_preconditioner_matrix.block(0,0),
amg_data);
- Mp_preconditioner = std::shared_ptr<TrilinosWrappers::PreconditionIC>
- (new TrilinosWrappers::PreconditionIC());
+ Mp_preconditioner = std::make_shared<TrilinosWrappers::PreconditionIC>
+ ();
Mp_preconditioner->initialize(stokes_preconditioner_matrix.block(1,1));
std::cout << std::endl;
stokes_fe.component_mask(velocity_components),
constant_modes);
- Mp_preconditioner.reset (new TrilinosWrappers::PreconditionJacobi());
- Amg_preconditioner.reset (new TrilinosWrappers::PreconditionAMG());
+ Mp_preconditioner = std::make_shared<TrilinosWrappers::PreconditionJacobi>();
+ Amg_preconditioner = std::make_shared<TrilinosWrappers::PreconditionAMG>();
TrilinosWrappers::PreconditionAMG::AdditionalData Amg_data;
Amg_data.constant_modes = constant_modes;
if (rebuild_temperature_preconditioner == true)
{
- T_preconditioner.reset (new TrilinosWrappers::PreconditionJacobi());
+ T_preconditioner = std::make_shared<TrilinosWrappers::PreconditionJacobi>();
T_preconditioner->initialize (temperature_matrix);
rebuild_temperature_preconditioner = false;
}