#include <deal.II/base/exceptions.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/std_cxx11/shared_ptr.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <boost/property_tree/ptree_fwd.hpp>
#include <boost/serialization/split_member.hpp>
#include <map>
#include <vector>
#include <string>
-#include <memory>
DEAL_II_NAMESPACE_OPEN
* than having to include all of the property_tree stuff from boost. This
* works around a problem with gcc 4.5.
*/
- std::auto_ptr<boost::property_tree::ptree> entries;
+ std_cxx11::unique_ptr<boost::property_tree::ptree> entries;
/**
* A list of patterns that are used to describe the parameters of this
#include <deal.II/base/vector_slice.h>
#include <deal.II/base/quadrature.h>
#include <deal.II/base/table.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/mapping.h>
#include <algorithm>
-#include <memory>
// dummy include in order to have the
// definition of PetscScalar available
* is necessary for the <tt>get_function_*</tt> functions as well as the
* functions of same name in the extractor classes.
*/
- std::auto_ptr<const CellIteratorBase> present_cell;
+ std_cxx11::unique_ptr<const CellIteratorBase> present_cell;
/**
* A signal connection we use to ensure we get informed whenever the
//TODO[WB]: do not use a plain pointer for DoFHandler::faces, but rather an
-//auto_ptr or some such thing. alternatively, why not use the DoFFaces object
+//unique_ptr or some such thing. alternatively, why not use the DoFFaces object
//right away?
template<int dim, int spacedim>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/base/multithread_info.h>
#include <deal.II/base/quadrature.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/parallel_vector.h>
namespace
{
- // Reset a std::auto_ptr. If we can, do not de-allocate the previously
+ // Reset a unique_ptr. If we can, do not de-allocate the previously
// held memory but re-use it for the next item to avoid the repeated
// memory allocation. We do this because FEValues objects are heavily
// used in multithreaded contexts where memory allocations are evil.
template <typename Type, typename Pointer, typename Iterator>
void
reset_pointer_in_place_if_possible
- (std::auto_ptr<Pointer> &present_cell,
+ (std_cxx11::unique_ptr<Pointer> &present_cell,
const Iterator &new_cell)
{
// see if the existing pointer is non-null and if the type of
#include <deal.II/base/qprojector.h>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/base/tensor_product_polynomials.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/tria_boundary.h>
#include <deal.II/numerics/vector_tools.h>
#include <numeric>
-#include <memory>
#include <fstream>
update_internal_dofs(cell);
const Quadrature<dim> point_quadrature(p);
- std::auto_ptr<InternalData>
+ std_cxx11::unique_ptr<InternalData>
mdata (dynamic_cast<InternalData *> (
get_data(update_transformation_values, point_quadrature)));
UpdateFlags update_flags = update_transformation_values|update_transformation_gradients;
if (spacedim>dim)
update_flags |= update_jacobian_grads;
- std::auto_ptr<InternalData>
+ std_cxx11::unique_ptr<InternalData>
mdata (dynamic_cast<InternalData *> (
get_data(update_flags,point_quadrature)));
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/base/tensor_product_polynomials.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/tria_boundary.h>
#include <deal.II/fe/fe_q.h>
#include <numeric>
-#include <memory>
DEAL_II_NAMESPACE_OPEN
// the right size and transformation shape values already computed at point
// p.
const Quadrature<dim> point_quadrature(p);
- std::auto_ptr<InternalData>
+ std_cxx11::unique_ptr<InternalData>
mdata (dynamic_cast<InternalData *> (
get_data(update_transformation_values, point_quadrature)));
UpdateFlags update_flags = update_transformation_values|update_transformation_gradients;
if (spacedim>dim)
update_flags |= update_jacobian_grads;
- std::auto_ptr<InternalData>
+ std_cxx11::unique_ptr<InternalData>
mdata (dynamic_cast<InternalData *> (
get_data(update_flags,point_quadrature)));
#include <deal.II/base/quadrature.h>
#include <deal.II/base/qprojector.h>
#include <deal.II/base/memory_consumption.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_iterator.h>
#include <cmath>
#include <algorithm>
-#include <memory>
DEAL_II_NAMESPACE_OPEN
// already computed at point p.
const Quadrature<dim> point_quadrature(p);
- std::auto_ptr<InternalData>
+ std_cxx11::unique_ptr<InternalData>
mdata (dynamic_cast<InternalData *> (
get_data(update_transformation_values, point_quadrature)));
if (spacedim>dim)
update_flags |= update_jacobian_grads;
- std::auto_ptr<InternalData>
+ std_cxx11::unique_ptr<InternalData>
mdata(dynamic_cast<InternalData *> (
MappingQ1<dim,spacedim>::get_data(update_flags, point_quadrature)));
if (!fe2.constraints_are_implemented())
return;
- std::auto_ptr<Triangulation<dim> > tria(make_tria<dim>());
- std::auto_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
- std::auto_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
+ std_cxx11::unique_ptr<Triangulation<dim> > tria(make_tria<dim>());
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
ConstraintMatrix cm;
DoFTools::make_hanging_node_constraints (*dof2, cm);
cm.close ();
!fe2.constraints_are_implemented())
return;
- std::auto_ptr<Triangulation<dim> > tria(make_tria<dim>());
- std::auto_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
- std::auto_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
+ std_cxx11::unique_ptr<Triangulation<dim> > tria(make_tria<dim>());
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
ConstraintMatrix cm1, cm2;
DoFTools::make_hanging_node_constraints (*dof1, cm1);
DoFTools::make_hanging_node_constraints (*dof2, cm2);
!fe2.constraints_are_implemented())
return;
- std::auto_ptr<Triangulation<dim> > tria(make_tria<dim>());
- std::auto_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
- std::auto_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
+ std_cxx11::unique_ptr<Triangulation<dim> > tria(make_tria<dim>());
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
ConstraintMatrix cm1, cm2;
DoFTools::make_hanging_node_constraints (*dof1, cm1);
DoFTools::make_hanging_node_constraints (*dof2, cm2);
!fe2.constraints_are_implemented())
return;
- std::auto_ptr<Triangulation<dim> > tria(make_tria<dim>());
- std::auto_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
- std::auto_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
+ std_cxx11::unique_ptr<Triangulation<dim> > tria(make_tria<dim>());
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
ConstraintMatrix cm1, cm2;
DoFTools::make_hanging_node_constraints (*dof1, cm1);
DoFTools::make_hanging_node_constraints (*dof2, cm2);
if (!fe2.isotropic_restriction_is_implemented())
return;
- std::auto_ptr<Triangulation<dim> > tria(make_tria<dim>());
- std::auto_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
- std::auto_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
+ std_cxx11::unique_ptr<Triangulation<dim> > tria(make_tria<dim>());
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof1(make_dof_handler (*tria, fe1));
+ std_cxx11::unique_ptr<DoFHandler<dim> > dof2(make_dof_handler (*tria, fe2));
ConstraintMatrix cm;
DoFTools::make_hanging_node_constraints (*dof2, cm);
cm.close ();
#include "../tests.h"
#include <deal.II/base/logstream.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/grid_generator.h>
#include <iomanip>
#include <iomanip>
#include <string>
-#include <memory>
// forward declaration of the function that must be provided in the