#include <deal.II/base/geometry_info.h>
#include <deal.II/base/iterator_range.h>
#include <deal.II/base/std_cxx11/function.h>
+#include <deal.II/base/std_cxx11/unique_ptr.h>
#include <deal.II/grid/tria_iterator_selector.h>
// Ignore deprecation warnings for auto_ptr.
#include <boost/signals2.hpp>
#include <boost/serialization/vector.hpp>
#include <boost/serialization/map.hpp>
+#ifdef DEAL_II_WITH_CXX11
+# include <boost/serialization/unique_ptr.hpp>
+#else
+# include <boost/serialization/scoped_ptr.hpp>
+#endif
#include <boost/serialization/split_member.hpp>
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
* in 2D it contains data concerning lines and in 3D quads and lines. All
* of these have no level and are therefore treated separately.
*/
- dealii::internal::Triangulation::TriaFaces<dim> *faces;
+ std_cxx11::unique_ptr<dealii::internal::Triangulation::TriaFaces<dim> > faces;
/**
// ---------------------------------------------------------------------
//
-// Copyright (C) 1999 - 2015 by the deal.II authors
+// Copyright (C) 1999 - 2016 by the deal.II authors
//
// This file is part of the deal.II library.
//
// get sub-objects. note that the
// current class is only used for
// objects that are *not* cells
- return *dealii::internal::TriaAccessorBase::get_objects (this->tria->faces,
+ return *dealii::internal::TriaAccessorBase::get_objects (this->tria->faces.get(),
dealii::internal::int2type<structdim> ());
else
return *dealii::internal::TriaAccessorBase::get_objects (&this->tria->levels[this->present_level]->cells,
// reserve enough space
triangulation.levels.push_back (new internal::Triangulation::TriaLevel<dim>);
- triangulation.faces = new internal::Triangulation::TriaFaces<dim>;
+ triangulation.faces.reset (new internal::Triangulation::TriaFaces<dim>);
triangulation.levels[0]->reserve_space (cells.size(), dim, spacedim);
triangulation.faces->lines.reserve_space (0,needed_lines.size());
triangulation.levels[0]->cells.reserve_space (0,cells.size());
// for the lines
// reserve enough space
triangulation.levels.push_back (new internal::Triangulation::TriaLevel<dim>);
- triangulation.faces = new internal::Triangulation::TriaFaces<dim>;
+ triangulation.faces.reset (new internal::Triangulation::TriaFaces<dim>);
triangulation.levels[0]->reserve_space (cells.size(), dim, spacedim);
triangulation.faces->lines.reserve_space (0,needed_lines.size());
const bool check_for_distorted_cells)
:
smooth_grid(smooth_grid),
- faces(NULL),
anisotropic_refinement(false),
check_for_distorted_cells(check_for_distorted_cells),
vertex_to_boundary_id_map_1d (0),
for (unsigned int i=0; i<tria.levels.size(); ++i)
tria.levels[i] = nullptr;
- tria.faces = nullptr;
-
tria.number_cache = internal::Triangulation::NumberCache<dim>();
tria.vertex_to_boundary_id_map_1d = nullptr;
}
levels.clear ();
- if (faces)
- {
- delete faces;
- faces = 0;
- }
-
// the vertex_to_boundary_id_map_1d field
// should be unused except in 1d
Assert ((dim == 1)
anisotropic_refinement = old_tria.anisotropic_refinement;
smooth_grid = old_tria.smooth_grid;
- faces = new internal::Triangulation::TriaFaces<dim>(*old_tria.faces);
+ if (dim > 1)
+ faces.reset (new internal::Triangulation::TriaFaces<dim>(*old_tria.faces));
typename std::map<types::manifold_id,
SmartPointer<const Manifold<dim,spacedim> , Triangulation<dim, spacedim> > >::const_iterator
{
// let functions in anonymous namespace do their work
dealii::clear_user_data (levels);
- dealii::clear_user_data (faces);
+ dealii::clear_user_data (faces.get());
}
template <int dim, int spacedim>
void Triangulation<dim,spacedim>::clear_user_flags_line ()
{
- dealii::clear_user_flags_line (levels, faces);
+ dealii::clear_user_flags_line (levels, faces.get());
}
template <int dim, int spacedim>
void Triangulation<dim,spacedim>::clear_user_flags_quad ()
{
- dealii::clear_user_flags_quad (levels, faces);
+ dealii::clear_user_flags_quad (levels, faces.get());
}
template <int dim, int spacedim>
void Triangulation<dim,spacedim>::clear_user_flags_hex ()
{
- dealii::clear_user_flags_hex (levels, faces);
+ dealii::clear_user_flags_hex (levels, faces.get());
}
delete levels[i];
levels.clear ();
- delete faces;
- faces = NULL;
+ faces.reset ();
vertices.clear ();
vertices_used.clear ();