// The program starts with including a bunch of include files that we will use
// in the various parts of the program. Most of them have been discussed in
// previous tutorials already:
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/convergence_table.h>
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/quadrature_selector.h>
// Then we will show a little trick how we can make sure that objects are not
// deleted while they are still in use. For this purpose, deal.II has the
// ObserverPointer helper class, which is declared in this file:
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
// Next, we will want to use the function VectorTools::integrate_difference()
// mentioned in the introduction, and we are going to use a ConvergenceTable
// that collects all important data during a run and prints it at the end as a
#include <deal.II/algorithms/any_data.h>
#include <deal.II/algorithms/operator.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/algorithms/operator.h>
#include <deal.II/algorithms/timestep_control.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/vector_memory.h>
#include <deal.II/base/config.h>
#include <deal.II/base/function.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/point.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/table.h>
#include <array>
#define dealii_function_restriction_h
#include <deal.II/base/function.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/point.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/tensor.h>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/thread_local_storage.h>
//
// ------------------------------------------------------------------------
-#ifndef dealii_smartpointer_h
-#define dealii_smartpointer_h
+#ifndef dealii_observer_pointer_h
+#define dealii_observer_pointer_h
#include <deal.II/base/config.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/parameter_handler.h>
-#include <deal.II/base/smartpointer.h>
#include <boost/signals2/signal.hpp>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/ndarray.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/point.h>
#include <deal.II/base/polynomial.h>
#include <deal.II/base/scalar_polynomials_base.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/tensor.h>
#include <vector>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/function.h>
#include <deal.II/base/function_time.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/point.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/subscriptor.h>
#include <vector>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/distributed/tria.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mpi_stub.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mpi_stub.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mpi_stub.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/partitioner.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/function.h>
#include <deal.II/base/index_set.h>
#include <deal.II/base/iterator_range.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/types.h>
#include <deal.II/dofs/block_info.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/lazy.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/symmetric_tensor.h>
#include <deal.II/base/tensor.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mutex.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/point.h>
-#include <deal.II/base/smartpointer.h>
#include <iostream>
#include <string>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/grid/tria.h>
#include <deal.II/base/geometry_info.h>
#include <deal.II/base/iterator_range.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/partitioner.h>
#include <deal.II/base/point.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/grid/cell_id.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/base/mutex.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/table.h>
#include <deal.II/base/utilities.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/table.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/table.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/chunk_sparsity_pattern.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mutex.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/table.h>
#include <deal.II/lac/lapack_support.h>
#include <deal.II/base/memory_consumption.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/block_indices.h>
#include <deal.II/lac/block_sparsity_pattern.h>
#include <deal.II/base/index_set.h>
#include <deal.II/base/memory_consumption.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/solver_control.h>
#include <deal.II/lac/vector_operation.h>
#ifdef DEAL_II_WITH_PETSC
# include <deal.II/base/mpi.h>
+# include <deal.II/base/observer_pointer.h>
# include <deal.II/base/parameter_handler.h>
-# include <deal.II/base/smartpointer.h>
# include <deal.II/lac/petsc_matrix_base.h>
# include <deal.II/lac/petsc_precondition.h>
#ifdef DEAL_II_WITH_PETSC
-# include <deal.II/base/smartpointer.h>
+# include <deal.II/base/observer_pointer.h>
# include <deal.II/lac/exceptions.h>
# include <deal.II/lac/solver_control.h>
#ifdef DEAL_II_WITH_PETSC
# include <deal.II/base/mpi.h>
+# include <deal.II/base/observer_pointer.h>
# include <deal.II/base/parameter_handler.h>
-# include <deal.II/base/smartpointer.h>
# include <deal.II/lac/petsc_matrix_base.h>
# include <deal.II/lac/petsc_precondition.h>
#include <deal.II/base/memory_space.h>
#include <deal.II/base/mutex.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/parallel.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/lac/affine_constraints.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/precondition_block_base.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/logstream.h>
#include <deal.II/base/memory_consumption.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/householder.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <string>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/precondition_block_base.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/lac/precondition.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mpi_stub.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/exceptions.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/exceptions.h>
#include <deal.II/base/config.h>
#include <deal.II/base/multithread_info.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <vector>
#include <deal.II/base/config.h>
#include <deal.II/base/mutex.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/vector.h>
#include <deal.II/base/array_view.h>
#include <deal.II/base/exceptions.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/symmetric_tensor.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/vectorization.h>
#include <deal.II/base/array_view.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/geometry_info.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/signaling_nan.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/base/std_cxx20/iota_view.h>
#include <deal.II/base/symmetric_tensor.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/algorithms/any_data.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/algorithms/any_data.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/utilities.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/algorithms/any_data.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/algorithms/named_selection.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/tensor.h>
DEAL_II_NAMESPACE_OPEN
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/lac/vector.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/linear_operator.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/linear_operator.h>
#include <deal.II/lac/vector_memory.h>
#include <deal.II/base/config.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/distributed/tria.h>
#define dealii_non_matching_fe_values
#include <deal.II/base/bounding_box.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/config.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/grid/tria.h>
#include <deal.II/base/data_out_base.h>
#include <deal.II/base/mg_level_object.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/config.h>
#include <deal.II/base/data_out_base.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/vector.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/point.h>
#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/array_view.h>
#include <deal.II/base/bounding_box.h>
#include <deal.II/base/function.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <deal.II/distributed/tria.h>
// ------------------------------------------------------------------------
#include <deal.II/base/memory_consumption.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/distributed/fully_distributed_tria.h>
#include <deal.II/distributed/shared_tria.h>
// for copy and move semantics.
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <iostream>
// other tests.
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <iostream>
// std::any object.
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <any>
// check that unsubscribing with a wrong id is handled correctly
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <iostream>
// works as well
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/subscriptor.h>
#include <iostream>
// it was fixed around 2003-05-22
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/lac/sparse_ilu.h>
#include <deal.II/base/convergence_table.h>
#include <deal.II/base/function.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/convergence_table.h>
#include <deal.II/base/function.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/fe/fe_dgp.h>
// #include <deal.II/fe/fe_q.h>
-#include <deal.II/base/smartpointer.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/fe/fe_tools.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/base/convergence_table.h>
#include <deal.II/base/function.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/base/convergence_table.h>
#include <deal.II/base/function.h>
#include <deal.II/base/logstream.h>
+#include <deal.II/base/observer_pointer.h>
#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/base/smartpointer.h>
#include <deal.II/dofs/dof_accessor.h>
#include <deal.II/dofs/dof_handler.h>