From 6c05bc6f79cfc32b76b26abc0b5443822ec61a6f Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Mon, 9 Sep 2024 11:46:48 -0600 Subject: [PATCH] Rename SmartPointer -> ObserverPointer. --- doc/doxygen/headers/instantiations.h | 2 +- doc/doxygen/headers/memory.h | 4 +- doc/news/3.4.0-vs-4.0.0.h | 2 +- doc/news/5.1.0-vs-5.2.0.h | 2 +- doc/news/5.2.0-vs-6.0.0.h | 2 +- doc/news/9.0.1-vs-9.1.0.h | 6 +- doc/news/changes/minor/20240725Bangerth | 6 +- examples/step-13/step-13.cc | 18 +-- examples/step-14/step-14.cc | 26 ++-- examples/step-21/step-21.cc | 8 +- examples/step-22/doc/results.dox | 4 +- examples/step-22/step-22.cc | 10 +- examples/step-31/step-31.cc | 10 +- examples/step-32/step-32.cc | 4 +- examples/step-39/step-39.cc | 2 +- examples/step-43/step-43.cc | 10 +- examples/step-45/step-45.cc | 9 +- examples/step-55/step-55.cc | 4 +- examples/step-59/step-59.cc | 2 +- examples/step-69/step-69.cc | 8 +- examples/step-7/step-7.cc | 14 +- include/deal.II/algorithms/newton.h | 6 +- .../deal.II/algorithms/theta_timestepping.h | 12 +- include/deal.II/base/function_restriction.h | 4 +- include/deal.II/base/logstream.h | 2 +- .../base/mpi_remote_point_evaluation.h | 4 +- include/deal.II/base/quadrature_point_data.h | 6 +- include/deal.II/base/smartpointer.h | 140 +++++++++--------- include/deal.II/base/subscriptor.h | 13 +- .../deal.II/distributed/cell_data_transfer.h | 4 +- .../distributed/fully_distributed_tria.h | 2 +- include/deal.II/distributed/shared_tria.h | 2 +- include/deal.II/distributed/tria.h | 2 +- include/deal.II/dofs/dof_handler.h | 2 +- include/deal.II/dofs/dof_handler_policy.h | 6 +- include/deal.II/fe/fe_coupling_values.h | 4 +- include/deal.II/fe/fe_series.h | 4 +- include/deal.II/fe/fe_values_base.h | 7 +- include/deal.II/fe/fe_values_views.h | 8 +- include/deal.II/fe/mapping_fe_field.h | 10 +- include/deal.II/fe/mapping_manifold.h | 2 +- include/deal.II/fe/mapping_q1_eulerian.h | 7 +- include/deal.II/fe/mapping_q_eulerian.h | 6 +- include/deal.II/grid/composition_manifold.h | 4 +- include/deal.II/grid/grid_in.h | 2 +- include/deal.II/grid/grid_tools_cache.h | 5 +- include/deal.II/grid/intergrid_map.h | 7 +- include/deal.II/grid/manifold_lib.h | 8 +- include/deal.II/grid/persistent_tria.h | 4 +- include/deal.II/hp/fe_values.h | 7 +- include/deal.II/lac/block_matrix_base.h | 2 +- include/deal.II/lac/block_sparse_matrix.h | 4 +- include/deal.II/lac/chunk_sparse_matrix.h | 4 +- include/deal.II/lac/lapack_full_matrix.h | 5 +- include/deal.II/lac/petsc_snes.h | 4 +- include/deal.II/lac/petsc_solver.h | 2 +- include/deal.II/lac/petsc_ts.h | 4 +- include/deal.II/lac/precondition.h | 24 +-- include/deal.II/lac/precondition_block.h | 3 +- include/deal.II/lac/precondition_selector.h | 3 +- include/deal.II/lac/relaxation_block.h | 8 +- include/deal.II/lac/solver_selector.h | 2 +- include/deal.II/lac/sparse_matrix.h | 4 +- include/deal.II/lac/sparse_vanka.h | 4 +- include/deal.II/lac/sparse_vanka.templates.h | 2 +- .../deal.II/matrix_free/fe_point_evaluation.h | 6 +- .../matrix_free/fe_remote_evaluation.h | 6 +- include/deal.II/matrix_free/mapping_info.h | 2 +- include/deal.II/matrix_free/matrix_free.h | 5 +- .../matrix_free/matrix_free.templates.h | 14 +- include/deal.II/matrix_free/operators.h | 2 +- include/deal.II/matrix_free/tools.h | 2 +- include/deal.II/meshworker/assembler.h | 32 ++-- include/deal.II/meshworker/dof_info.h | 2 +- include/deal.II/meshworker/integration_info.h | 4 +- include/deal.II/meshworker/scratch_data.h | 18 ++- include/deal.II/meshworker/simple.h | 22 +-- .../meshworker/vector_selector.templates.h | 7 +- include/deal.II/multigrid/mg_block_smoother.h | 4 +- include/deal.II/multigrid/mg_coarse.h | 41 +++-- include/deal.II/multigrid/mg_matrix.h | 4 +- include/deal.II/multigrid/mg_transfer.h | 4 +- include/deal.II/multigrid/mg_transfer_block.h | 4 +- .../deal.II/multigrid/mg_transfer_component.h | 2 +- .../multigrid/mg_transfer_global_coarsening.h | 17 ++- .../mg_transfer_global_coarsening.templates.h | 4 +- include/deal.II/multigrid/multigrid.h | 34 +++-- include/deal.II/non_matching/fe_values.h | 12 +- include/deal.II/non_matching/mapping_info.h | 20 +-- .../deal.II/non_matching/mesh_classifier.h | 2 +- .../non_matching/quadrature_generator.h | 4 +- include/deal.II/numerics/cell_data_transfer.h | 4 +- include/deal.II/numerics/data_out_dof_data.h | 8 +- .../numerics/data_out_dof_data.templates.h | 16 +- include/deal.II/numerics/data_out_resample.h | 4 +- include/deal.II/numerics/data_out_stack.h | 2 +- .../deal.II/numerics/dof_output_operator.h | 4 +- include/deal.II/numerics/fe_field_function.h | 4 +- .../deal.II/numerics/point_value_history.h | 2 +- include/deal.II/numerics/solution_transfer.h | 8 +- include/deal.II/numerics/time_dependent.h | 6 +- include/deal.II/particles/particle_handler.h | 7 +- source/base/subscriptor.cc | 2 +- source/multigrid/mg_level_global_transfer.cc | 2 +- source/non_matching/mesh_classifier.cc | 6 +- source/non_matching/quadrature_generator.cc | 6 +- source/numerics/time_dependent.cc | 11 +- tests/algorithms/newton_01.cc | 4 +- tests/algorithms/newton_02.cc | 3 +- tests/algorithms/theta_01.cc | 8 +- tests/base/assign_subscriptor.cc | 26 ++-- tests/base/reference.cc | 14 +- tests/base/smart_pointer_01.cc | 8 +- tests/bits/joa_1.cc | 2 +- tests/bits/sparse_lu_decomposition_1.cc | 4 +- tests/bits/step-13.cc | 14 +- tests/bits/step-14.cc | 31 ++-- tests/bits/step-7.cc | 2 +- tests/codim_one/bem_integration.cc | 2 +- .../dofs/dof_handler_redistributed_dofs_01.cc | 2 +- .../dofs/dof_handler_redistributed_dofs_02.cc | 2 +- tests/fe/fe_conformity_test.h | 8 +- tests/fe/fe_q_dg0.cc | 8 +- tests/hp/step-13.cc | 14 +- tests/hp/step-7.cc | 2 +- .../parallel_multigrid_adaptive_01.cc | 2 +- .../parallel_multigrid_adaptive_03.cc | 2 +- .../parallel_multigrid_adaptive_05.cc | 2 +- tests/mpi/muelu_periodicity.cc | 9 +- tests/mpi/periodicity_02.cc | 9 +- tests/mpi/periodicity_03.cc | 9 +- .../parallel_multigrid_adaptive_01.cc | 2 +- .../parallel_multigrid_adaptive_03.cc | 2 +- .../parallel_multigrid_adaptive_05.cc | 2 +- .../fe_immersed_surface_values.cc | 2 +- tests/performance/instrumentation_step_22.cc | 8 +- tests/performance/timing_mg_glob_coarsen.cc | 4 +- tests/performance/timing_step_22.cc | 8 +- tests/simplex/step-07.cc | 2 +- tests/simplex/step-31.cc | 10 +- tests/simplex/step-55.cc | 4 +- 141 files changed, 572 insertions(+), 543 deletions(-) diff --git a/doc/doxygen/headers/instantiations.h b/doc/doxygen/headers/instantiations.h index ebf752bf82..d3597a9887 100644 --- a/doc/doxygen/headers/instantiations.h +++ b/doc/doxygen/headers/instantiations.h @@ -120,6 +120,6 @@ * * These are the classes, where no reasonable predetermined set of instances * exists. Therefore, all member definitions are included in the header file - * and are instantiated wherever needed. An example would be the SmartPointer + * and are instantiated wherever needed. An example would be the ObserverPointer * class template that can be used with virtually any template argument. */ diff --git a/doc/doxygen/headers/memory.h b/doc/doxygen/headers/memory.h index a15d117a5c..af44b75f58 100644 --- a/doc/doxygen/headers/memory.h +++ b/doc/doxygen/headers/memory.h @@ -17,8 +17,8 @@ * @defgroup memory Memory handling * * This group has some basic classes and namespaces for memory - * handling. The Subscriptor and SmartPointer classes are used for - * counted memory handling, i.e. whenever a SmartPointer is set to + * handling. The Subscriptor and ObserverPointer classes are used for + * counted memory handling, i.e. whenever a ObserverPointer is set to * point to an object, it increases a counter in that object; when the * pointer is set to point elsewhere, it decreases it again. This way, * one always knows how many users of an object there still are. While diff --git a/doc/news/3.4.0-vs-4.0.0.h b/doc/news/3.4.0-vs-4.0.0.h index a1913df9fd..ae7ddd18e6 100644 --- a/doc/news/3.4.0-vs-4.0.0.h +++ b/doc/news/3.4.0-vs-4.0.0.h @@ -385,7 +385,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
  • Fixed: The Subscriptor uses a counter to - count how many SmartPointer objects subscribe + count how many ObserverPointer objects subscribe to the pointed-to object. This counter needs to be a volatile variable in multithreaded mode, to avoid false compiler optimizations based on the assumption that the variable cannot change between two subsequent diff --git a/doc/news/5.1.0-vs-5.2.0.h b/doc/news/5.1.0-vs-5.2.0.h index dffcaa9eef..c690a9e4e4 100644 --- a/doc/news/5.1.0-vs-5.2.0.h +++ b/doc/news/5.1.0-vs-5.2.0.h @@ -494,7 +494,7 @@ inconvenience this causes. New: Class Subscriptor receives a text argument allowing to identify the violating pointer more easily. The additional feature is being incorporated into SmartPointer constructors throughout the + class="class">ObserverPointer constructors throughout the library.
    (GK, 2005/03/16) diff --git a/doc/news/5.2.0-vs-6.0.0.h b/doc/news/5.2.0-vs-6.0.0.h index 46ee07061c..1faa2fe8a1 100644 --- a/doc/news/5.2.0-vs-6.0.0.h +++ b/doc/news/5.2.0-vs-6.0.0.h @@ -552,7 +552,7 @@ inconvenience this causes. (WB 2006/08/02)

    -
  • Changed: When there is still a SmartPointer object +

  • Changed: When there is still a ObserverPointer object pointing to another object at the time it is destroyed, this would cause the program to be aborted. However, there are cases where this is not desirable, for example here: diff --git a/doc/news/9.0.1-vs-9.1.0.h b/doc/news/9.0.1-vs-9.1.0.h index f46900ce49..25ee0ee089 100644 --- a/doc/news/9.0.1-vs-9.1.0.h +++ b/doc/news/9.0.1-vs-9.1.0.h @@ -684,7 +684,7 @@ inconvenience this causes.

  • - Changed: SmartPointer and Subscriptor use a `std::string` + Changed: ObserverPointer and Subscriptor use a `std::string` instead of a `const char *` for subscriber identification. As a result, subscriber strings are no longer compared by their memory address but instead by their content. @@ -1287,10 +1287,10 @@ inconvenience this causes.
  • - Changed: The class Subscriptor and SmartPointer check for dangling pointers and + Changed: The class Subscriptor and ObserverPointer check for dangling pointers and use-after-move. The destructor of Subscriptor doesn't signal an error when there is still an object subscribed to it. Instead, validity is checked when - dereferencing the SmartPointer object. + dereferencing the ObserverPointer object.
    (Daniel Arndt, 2018/11/02)
  • diff --git a/doc/news/changes/minor/20240725Bangerth b/doc/news/changes/minor/20240725Bangerth index bb22192d5d..2d46cb94a1 100644 --- a/doc/news/changes/minor/20240725Bangerth +++ b/doc/news/changes/minor/20240725Bangerth @@ -1,6 +1,6 @@ -Deprecated: SmartPointer is clearly documented as not owning the -object it points to. Yet, SmartPointer::clear() deletes the object -pointed to, thereby assuming that the SmartPointer object actually +Deprecated: ObserverPointer is clearly documented as not owning the +object it points to. Yet, ObserverPointer::clear() deletes the object +pointed to, thereby assuming that the ObserverPointer object actually owns the object. This must surely be confusing. As a consequence the function is now deprecated.
    diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index b20b827c6a..a57da8fd55 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -469,7 +469,7 @@ namespace Step13 // a triangulation in the constructor and storing it henceforth. Since // this triangulation will be used throughout all computations, we have to // make sure that the triangulation is valid until it is last used. We - // do this by keeping a SmartPointer to this triangulation, + // do this by keeping a ObserverPointer to this triangulation, // as explained in step-7. // // Note that while the pointer itself is declared constant @@ -496,7 +496,7 @@ namespace Step13 virtual unsigned int n_dofs() const = 0; protected: - const SmartPointer> triangulation; + const ObserverPointer> triangulation; }; @@ -568,11 +568,11 @@ namespace Step13 // member variables, of which the use should be clear from the previous // examples: protected: - const SmartPointer> fe; - const SmartPointer> quadrature; - DoFHandler dof_handler; - Vector solution; - const SmartPointer> boundary_values; + const ObserverPointer> fe; + const ObserverPointer> quadrature; + DoFHandler dof_handler; + Vector solution; + const ObserverPointer> boundary_values; // Then we declare an abstract function that will be used to assemble // the right hand side. As explained above, there are various cases for @@ -996,7 +996,7 @@ namespace Step13 // constructor takes the same data as does that of the underlying class // (to which it passes all information) except for one function object // that denotes the right hand side of the problem. A pointer to this - // object is stored (again as a SmartPointer, in order to + // object is stored (again as a ObserverPointer, in order to // make sure that the function object is not deleted as long as it is // still used by this class). // @@ -1013,7 +1013,7 @@ namespace Step13 const Function &boundary_values); protected: - const SmartPointer> rhs_function; + const ObserverPointer> rhs_function; virtual void assemble_rhs(Vector &rhs) const override; }; diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index e4aba7f6c4..bf57bc6b01 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -355,7 +355,7 @@ namespace Step14 virtual void output_solution() const = 0; protected: - const SmartPointer> triangulation; + const ObserverPointer> triangulation; unsigned int refinement_cycle; }; @@ -399,12 +399,12 @@ namespace Step14 virtual unsigned int n_dofs() const override; protected: - const SmartPointer> fe; - const SmartPointer> quadrature; - const SmartPointer> face_quadrature; - DoFHandler dof_handler; - Vector solution; - const SmartPointer> boundary_values; + const ObserverPointer> fe; + const ObserverPointer> quadrature; + const ObserverPointer> face_quadrature; + DoFHandler dof_handler; + Vector solution; + const ObserverPointer> boundary_values; virtual void assemble_rhs(Vector &rhs) const = 0; @@ -709,7 +709,7 @@ namespace Step14 virtual void output_solution() const override; protected: - const SmartPointer> rhs_function; + const ObserverPointer> rhs_function; virtual void assemble_rhs(Vector &rhs) const override; }; @@ -913,7 +913,7 @@ namespace Step14 virtual void refine_grid() override; private: - const SmartPointer> weighting_function; + const ObserverPointer> weighting_function; }; @@ -1051,7 +1051,7 @@ namespace Step14 // @sect4{The SetUpBase and SetUp classes} // Based on the above description, the SetUpBase class then - // looks as follows. To allow using the SmartPointer class + // looks as follows. To allow using the ObserverPointer class // with this class, we derived from the Subscriptor class. template struct SetUpBase : public Subscriptor @@ -1624,7 +1624,7 @@ namespace Step14 const DualFunctional::DualFunctionalBase &dual_functional); protected: - const SmartPointer> + const ObserverPointer> dual_functional; virtual void assemble_rhs(Vector &rhs) const override; @@ -1757,8 +1757,8 @@ namespace Step14 // that will serve as the "scratch data" class of the WorkStream concept: struct CellData { - FEValues fe_values; - const SmartPointer> right_hand_side; + FEValues fe_values; + const ObserverPointer> right_hand_side; std::vector cell_residual; std::vector rhs_values; diff --git a/examples/step-21/step-21.cc b/examples/step-21/step-21.cc index cea9403e91..589fd2f20e 100644 --- a/examples/step-21/step-21.cc +++ b/examples/step-21/step-21.cc @@ -428,7 +428,7 @@ namespace Step21 } private: - const SmartPointer matrix; + const ObserverPointer matrix; }; @@ -452,8 +452,8 @@ namespace Step21 } private: - const SmartPointer> system_matrix; - const SmartPointer>> m_inverse; + const ObserverPointer> system_matrix; + const ObserverPointer>> m_inverse; mutable Vector tmp1, tmp2; }; @@ -477,7 +477,7 @@ namespace Step21 } private: - const SmartPointer> system_matrix; + const ObserverPointer> system_matrix; mutable Vector tmp1, tmp2; }; diff --git a/examples/step-22/doc/results.dox b/examples/step-22/doc/results.dox index 30473dc225..0aba8a21ad 100644 --- a/examples/step-22/doc/results.dox +++ b/examples/step-22/doc/results.dox @@ -418,8 +418,8 @@ class BlockSchurPreconditioner : public Subscriptor const BlockVector &src) const; private: - const SmartPointer > system_matrix; - const SmartPointer, + const ObserverPointer > system_matrix; + const ObserverPointer, PreconditionerMp > > m_inverse; const PreconditionerA &a_preconditioner; diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index 9fcfc2a36b..22634bd4cb 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -288,8 +288,8 @@ namespace Step22 void vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; }; @@ -335,7 +335,7 @@ namespace Step22 // consequence of the definition above, the declaration // InverseMatrix now contains the second template parameter for // a preconditioner class as above, which affects the - // SmartPointer object m_inverse as well. + // ObserverPointer object m_inverse as well. template class SchurComplement : public Subscriptor { @@ -347,8 +347,8 @@ namespace Step22 void vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer> system_matrix; - const SmartPointer< + const ObserverPointer> system_matrix; + const ObserverPointer< const InverseMatrix, PreconditionerType>> A_inverse; diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 3812ddb9a6..4181ce8650 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -253,8 +253,8 @@ namespace Step31 void vmult(VectorType &dst, const VectorType &src) const; private: - const SmartPointer matrix; - const PreconditionerType &preconditioner; + const ObserverPointer matrix; + const PreconditionerType &preconditioner; }; @@ -355,10 +355,10 @@ namespace Step31 const TrilinosWrappers::MPI::BlockVector &src) const; private: - const SmartPointer + const ObserverPointer stokes_matrix; - const SmartPointer> + const ObserverPointer> m_inverse; const PreconditionerTypeA &a_preconditioner; diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index e0db852efb..0b78838c35 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -277,9 +277,9 @@ namespace Step32 } private: - const SmartPointer + const ObserverPointer stokes_matrix; - const SmartPointer + const ObserverPointer stokes_preconditioner_matrix; const PreconditionerTypeMp &mp_preconditioner; const PreconditionerTypeA &a_preconditioner; diff --git a/examples/step-39/step-39.cc b/examples/step-39/step-39.cc index d7f2b54eef..47e4d05e56 100644 --- a/examples/step-39/step-39.cc +++ b/examples/step-39/step-39.cc @@ -620,7 +620,7 @@ namespace Step39 mg_matrix_dg_down.clear_elements(); // It is important to update the sparsity patterns after clear() // was called for the level matrices, since the matrices lock the sparsity - // pattern through the SmartPointer and Subscriptor mechanism. + // pattern through the ObserverPointer and Subscriptor mechanism. mg_sparsity.resize(0, n_levels - 1); mg_sparsity_dg_interface.resize(0, n_levels - 1); diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index 2b82b6f765..036e32f792 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -329,8 +329,8 @@ namespace Step43 void vmult(VectorType &dst, const VectorType &src) const; private: - const SmartPointer matrix; - const PreconditionerType &preconditioner; + const ObserverPointer matrix; + const PreconditionerType &preconditioner; }; @@ -379,10 +379,10 @@ namespace Step43 const TrilinosWrappers::MPI::BlockVector &src) const; private: - const SmartPointer + const ObserverPointer darcy_matrix; - const SmartPointer> + const ObserverPointer> m_inverse; const PreconditionerTypeA &a_preconditioner; diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index 52b599eaa5..9cd59e495a 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -197,8 +197,8 @@ namespace Step45 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; mutable TrilinosWrappers::MPI::Vector tmp; }; @@ -248,8 +248,9 @@ namespace Step45 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer system_matrix; - const SmartPointer< + const ObserverPointer + system_matrix; + const ObserverPointer< const InverseMatrix> A_inverse; mutable TrilinosWrappers::MPI::Vector tmp1, tmp2; diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index 444d06be16..ec65240c80 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -106,8 +106,8 @@ namespace Step55 void vmult(VectorType &dst, const VectorType &src) const; private: - const SmartPointer matrix; - const Preconditioner &preconditioner; + const ObserverPointer matrix; + const Preconditioner &preconditioner; }; diff --git a/examples/step-59/step-59.cc b/examples/step-59/step-59.cc index 570b76642b..e6b128af1c 100644 --- a/examples/step-59/step-59.cc +++ b/examples/step-59/step-59.cc @@ -149,7 +149,7 @@ namespace Step59 // general-purpose class MatrixFreeOperators::Base. We derive the class from // the Subscriptor class to be able to use the operator within the Chebyshev // preconditioner because that preconditioner stores the underlying matrix - // via a SmartPointer. + // via a ObserverPointer. // // Given that we implement a complete matrix interface by hand, we need to // add an `initialize()` function, an `m()` function, a `vmult()` function, diff --git a/examples/step-69/step-69.cc b/examples/step-69/step-69.cc index 40a31a377a..bae77776fb 100644 --- a/examples/step-69/step-69.cc +++ b/examples/step-69/step-69.cc @@ -239,7 +239,7 @@ namespace Step69 const MPI_Comm mpi_communicator; TimerOutput &computing_timer; - SmartPointer> discretization; + ObserverPointer> discretization; }; // @sect4{The ProblemDescription class} @@ -401,8 +401,8 @@ namespace Step69 const MPI_Comm mpi_communicator; TimerOutput &computing_timer; - SmartPointer> offline_data; - SmartPointer> initial_values; + ObserverPointer> offline_data; + ObserverPointer> initial_values; SparseMatrix dij_matrix; @@ -454,7 +454,7 @@ namespace Step69 const MPI_Comm mpi_communicator; TimerOutput &computing_timer; - SmartPointer> offline_data; + ObserverPointer> offline_data; Vector r; diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index 12bf1e4518..84fea14faa 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -44,7 +44,7 @@ #include // 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 -// SmartPointer helper class, which is declared in this file: +// ObserverPointer helper class, which is declared in this file: #include // Next, we will want to use the function VectorTools::integrate_difference() // mentioned in the introduction, and we are going to use a ConvergenceTable @@ -379,9 +379,9 @@ namespace Step7 // subscribing class is expected to check the value stored in its // corresponding pointer before trying to access the object subscribed to. // - // This is exactly what the SmartPointer class is doing. It basically acts - // just like a pointer, i.e. it can be dereferenced, can be assigned to and - // from other pointers, and so on. On top of that it uses the mechanism + // This is exactly what the ObserverPointer class is doing. It basically + // acts just like a pointer, i.e. it can be dereferenced, can be assigned to + // and from other pointers, and so on. On top of that it uses the mechanism // described above to find out if the pointer this class is representing is // dangling when we try to dereference it. In that case an exception is // thrown. @@ -389,9 +389,9 @@ namespace Step7 // In the present example program, we want to protect the finite element // object from the situation that for some reason the finite element // pointed to is destroyed while still in use. We therefore use a - // SmartPointer to the finite element object; since the finite element + // ObserverPointer to the finite element object; since the finite element // object is actually never changed in our computations, we pass a const - // FiniteElement<dim> as template argument to the SmartPointer + // FiniteElement<dim> as template argument to the ObserverPointer // class. Note that the pointer so declared is assigned at construction // time of the solve object, and destroyed upon destruction, so the lock // on the destruction of the finite element object extends throughout the @@ -399,7 +399,7 @@ namespace Step7 Triangulation triangulation; DoFHandler dof_handler; - SmartPointer> fe; + ObserverPointer> fe; AffineConstraints hanging_node_constraints; diff --git a/include/deal.II/algorithms/newton.h b/include/deal.II/algorithms/newton.h index e6de216bba..bb1bb244b2 100644 --- a/include/deal.II/algorithms/newton.h +++ b/include/deal.II/algorithms/newton.h @@ -123,18 +123,18 @@ namespace Algorithms /** * The operator computing the residual. */ - SmartPointer> residual; + ObserverPointer> residual; /** * The operator applying the inverse derivative to the residual. */ - SmartPointer> inverse_derivative; + ObserverPointer> inverse_derivative; /** * The operator handling the output in case the debug_vectors is true. * Call the initialize function first. */ - SmartPointer, Newton> data_out; + ObserverPointer, Newton> data_out; /** * This flag is set by the function assemble(), indicating that the matrix diff --git a/include/deal.II/algorithms/theta_timestepping.h b/include/deal.II/algorithms/theta_timestepping.h index 69a7dd2e59..104f6968a4 100644 --- a/include/deal.II/algorithms/theta_timestepping.h +++ b/include/deal.II/algorithms/theta_timestepping.h @@ -129,7 +129,7 @@ namespace Algorithms * them Implicit and Explicit. They both share the * public interface of Operator, and additionally provide storage for the * matrices to be used and a pointer to TimestepData. Note that we do not - * use a SmartPointer here, since the TimestepData will be destroyed before + * use a ObserverPointer here, since the TimestepData will be destroyed before * the operator. * * @code @@ -140,7 +140,7 @@ namespace Algorithms * void operator()(AnyData &out, const AnyData &in); * * private: - * SmartPointer, Explicit> matrix; + * ObserverPointer, Explicit> matrix; * FullMatrix m; * }; * @@ -151,7 +151,7 @@ namespace Algorithms * void operator()(AnyData &out, const AnyData &in); * * private: - * SmartPointer, Implicit> matrix; + * ObserverPointer, Implicit> matrix; * FullMatrix m; * }; * @endcode @@ -412,7 +412,7 @@ namespace Algorithms * vector, $M$ the @ref GlossMassMatrix "mass matrix", $F$ the operator in space and $c$ is the * adjusted time step size $(1-\theta) \Delta t$. */ - SmartPointer> op_explicit; + ObserverPointer> op_explicit; /** * The operator solving the implicit part of the scheme. It will receive @@ -424,12 +424,12 @@ namespace Algorithms * the input data, M the @ref GlossMassMatrix "mass matrix", F the operator in * space and c is the adjusted time step size $ \theta \Delta t$ */ - SmartPointer> op_implicit; + ObserverPointer> op_implicit; /** * The operator writing the output in each time step */ - SmartPointer, ThetaTimestepping> + ObserverPointer, ThetaTimestepping> output; }; diff --git a/include/deal.II/base/function_restriction.h b/include/deal.II/base/function_restriction.h index b724944b51..3af56b723b 100644 --- a/include/deal.II/base/function_restriction.h +++ b/include/deal.II/base/function_restriction.h @@ -74,7 +74,7 @@ namespace Functions private: // The higher-dimensional function that has been restricted. - const SmartPointer> function; + const ObserverPointer> function; // The (`dim + 1`)-coordinate direction that has been restricted. const unsigned int restricted_direction; @@ -133,7 +133,7 @@ namespace Functions private: // The higher-dimensional function that has been restricted. - const SmartPointer> function; + const ObserverPointer> function; // The (`dim + 1`)-coordinate direction that is kept "open" const unsigned int open_direction; diff --git a/include/deal.II/base/logstream.h b/include/deal.II/base/logstream.h index 762a5141d2..c74deb3bf8 100644 --- a/include/deal.II/base/logstream.h +++ b/include/deal.II/base/logstream.h @@ -122,7 +122,7 @@ public: * A pointer to the LogStream object to which the prefix is * applied. */ - SmartPointer stream; + ObserverPointer stream; }; diff --git a/include/deal.II/base/mpi_remote_point_evaluation.h b/include/deal.II/base/mpi_remote_point_evaluation.h index d1f844d3fc..de557a0b20 100644 --- a/include/deal.II/base/mpi_remote_point_evaluation.h +++ b/include/deal.II/base/mpi_remote_point_evaluation.h @@ -438,12 +438,12 @@ namespace Utilities /** * Reference to the Triangulation object used during reinit(). */ - SmartPointer> tria; + ObserverPointer> tria; /** * Reference to the Mapping object used during reinit(). */ - SmartPointer> mapping; + ObserverPointer> mapping; /** * (One-to-one) relation of points and cells. diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index 92ccf49adc..a1fa0a48f5 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -91,7 +91,7 @@ public: * may reflect, for example, different constitutive models of continuum * mechanics in different parts of the domain. * - * @note The first time this method is called, it stores a SmartPointer to the + * @note The first time this method is called, it stores a ObserverPointer to the * Triangulation object that owns the cell. The future invocations of this * method expects the cell to be from the same stored triangulation. * @@ -227,8 +227,8 @@ private: * Triangulation, we need to store a reference to that Triangulation within * the class. */ - SmartPointer, - CellDataStorage> + ObserverPointer, + CellDataStorage> tria; /** diff --git a/include/deal.II/base/smartpointer.h b/include/deal.II/base/smartpointer.h index 98ce656660..647d185efb 100644 --- a/include/deal.II/base/smartpointer.h +++ b/include/deal.II/base/smartpointer.h @@ -48,9 +48,9 @@ DEAL_II_NAMESPACE_OPEN * object (which for this purpose needs to be derived from the Subscriptor * class), and ensuring that the pointed-to object's destructor triggers an * error if that use-count is larger than zero -- i.e., if there are still - * observing SmartPointer objects pointing to it. + * observing ObserverPointer objects pointing to it. * - * Conceptually, SmartPointer fills a gap between `std::unique_ptr` and + * Conceptually, ObserverPointer fills a gap between `std::unique_ptr` and * `std::shared_ptr`. While the former makes it clear that there is a unique * owner of an object (namely the scope in which the `std::unique_ptr` resides), * it does not allow other places in a code base to point to the object. In @@ -58,74 +58,75 @@ DEAL_II_NAMESPACE_OPEN * but none of them is the "owner" of the object: They all are, and the last * one to stop pointing to the object is responsible for deleting it. * - * SmartPointer utilizes semantics in which one place owns an object and others - * can point to it. The owning place is responsible for destroying the object - * when it is no longer needed, and as mentioned above, this will trigger an - * error if other places are still pointing to it via SmartPointer pointers. + * ObserverPointer utilizes semantics in which one place owns an object and + * others can point to it. The owning place is responsible for destroying the + * object when it is no longer needed, and as mentioned above, this will trigger + * an error if other places are still pointing to it via ObserverPointer + * pointers. * * In practice, using this scheme, if you try to destroy an object to which - * observers still point via SmartPointer objects, you will get an error that + * observers still point via ObserverPointer objects, you will get an error that * says that there are still observers of the object and that the object can * consequently not be destroyed without creating "dangling" pointers. This * is often not very helpful in *finding* where these pointers are. As a * consequence, this class also provides two ways to annotate the observer * count with information about what other places still observe an object. - * First, when initializing a SmartPointer object with the address of the + * First, when initializing a ObserverPointer object with the address of the * object pointed to, you can also attach a string that describes the * observing location, and this string will then be shown in error messages * listing all remaining observers. Second, if no such string is provided, * the name second template argument `P` is used as the debug string. This - * allows to encode the observer information in the type of the SmartPointer. + * allows to encode the observer information in the type of the ObserverPointer. * - * @note Unlike `std::unique_ptr` and `std::shared_ptr`, SmartPointer does + * @note Unlike `std::unique_ptr` and `std::shared_ptr`, ObserverPointer does * NOT implement any memory handling. In particular, deleting a - * SmartPointer does not delete the object because the semantics + * ObserverPointer does not delete the object because the semantics * of this class are that it only *observes* an object, but does not * take over ownership. As a consequence, this is a sure way of creating * a memory leak: * @code - * SmartPointer dont_do_this = new T; + * ObserverPointer dont_do_this = new T; * @endcode * This is because here, no variable "owns" the object pointed to, and * the destruction of the `dont_do_this` pointer does not trigger the * release of the memory pointed to. * * @note This class correctly handles `const`-ness of an object, i.e., - * a `SmartPointer` really behaves as if it were a pointer + * a `ObserverPointer` really behaves as if it were a pointer * to a constant object (disallowing write access when dereferenced), while - * `SmartPointer` is a mutable pointer. + * `ObserverPointer` is a mutable pointer. * * @dealiiConceptRequires{std::is_base_of_v} * * @ingroup memory */ template -class SmartPointer +class ObserverPointer { public: /** * Standard constructor for null pointer. The id of this pointer is set to * the name of the class P. */ - SmartPointer(); + ObserverPointer(); /** - * Copy constructor for SmartPointer. We do not copy the object subscribed + * Copy constructor for ObserverPointer. We do not copy the object subscribed * to from tt, but subscribe ourselves to it again. */ template - SmartPointer(const SmartPointer &other); + ObserverPointer(const ObserverPointer &other); /** - * Copy constructor for SmartPointer. We do not copy the object subscribed + * Copy constructor for ObserverPointer. We do not copy the object subscribed * to from tt, but subscribe ourselves to it again. */ - SmartPointer(const SmartPointer &other); + ObserverPointer(const ObserverPointer &other); /** - * Move constructor for SmartPointer. + * Move constructor for ObserverPointer. */ - SmartPointer(SmartPointer &&other) noexcept; + ObserverPointer(ObserverPointer &&other) noexcept; /** * Constructor taking a normal pointer. If possible, i.e. if the pointer is @@ -133,9 +134,9 @@ public: * lock it, i.e. to prevent its destruction before the end of its use. * * The id is used in the call to Subscriptor::subscribe(id) and by - * ~SmartPointer() in the call to Subscriptor::unsubscribe(). + * ~ObserverPointer() in the call to Subscriptor::unsubscribe(). */ - SmartPointer(T *t, const std::string &id); + ObserverPointer(T *t, const std::string &id); /** * Constructor taking a normal pointer. If possible, i.e. if the pointer is @@ -143,12 +144,12 @@ public: * lock it, i.e. to prevent its destruction before the end of its use. The * id of this pointer is set to the name of the class P. */ - SmartPointer(T *t); + ObserverPointer(T *t); /** * Destructor, removing the subscription. */ - ~SmartPointer(); + ~ObserverPointer(); /** * Assignment operator for normal pointers. The pointer subscribes to the @@ -156,35 +157,35 @@ public: * will not try to subscribe to a null-pointer, but still delete the old * subscription. */ - SmartPointer & + ObserverPointer & operator=(T *tt); /** - * Assignment operator for SmartPointer. The pointer subscribes to the new + * Assignment operator for ObserverPointer. The pointer subscribes to the new * object automatically and unsubscribes to an old one if it exists. */ template - SmartPointer & - operator=(const SmartPointer &other); + ObserverPointer & + operator=(const ObserverPointer &other); /** - * Assignment operator for SmartPointer. The pointer subscribes to the new + * Assignment operator for ObserverPointer. The pointer subscribes to the new * object automatically and unsubscribes to an old one if it exists. */ - SmartPointer & - operator=(const SmartPointer &other); + ObserverPointer & + operator=(const ObserverPointer &other); /** - * Move assignment operator for SmartPointer. + * Move assignment operator for ObserverPointer. */ - SmartPointer & - operator=(SmartPointer &&other) noexcept; + ObserverPointer & + operator=(ObserverPointer &&other) noexcept; /** * Delete the object pointed to and set the pointer to nullptr. Note * that unlike what the documentation of the class describes, *this * function actually deletes the object pointed to*. That is, this - * function assumes a SmartPointer's ownership of the object pointed to. + * function assumes a ObserverPointer's ownership of the object pointed to. * * @deprecated This function is deprecated. It does not use the * semantics we usually use for this class, and its use is surely @@ -231,7 +232,7 @@ public: */ template void - swap(SmartPointer &tt); + swap(ObserverPointer &tt); /** * Swap pointers between this object and the pointer given. As this releases @@ -275,7 +276,7 @@ private: template -inline SmartPointer::SmartPointer() +inline ObserverPointer::ObserverPointer() : pointer(nullptr) , id(typeid(P).name()) , pointed_to_object_is_alive(false) @@ -288,7 +289,7 @@ inline SmartPointer::SmartPointer() template -inline SmartPointer::SmartPointer(T *t) +inline ObserverPointer::ObserverPointer(T *t) : pointer(t) , id(typeid(P).name()) , pointed_to_object_is_alive(false) @@ -304,7 +305,7 @@ inline SmartPointer::SmartPointer(T *t) template -inline SmartPointer::SmartPointer(T *t, const std::string &id) +inline ObserverPointer::ObserverPointer(T *t, const std::string &id) : pointer(t) , id(id) , pointed_to_object_is_alive(false) @@ -321,7 +322,8 @@ inline SmartPointer::SmartPointer(T *t, const std::string &id) template template -inline SmartPointer::SmartPointer(const SmartPointer &other) +inline ObserverPointer::ObserverPointer( + const ObserverPointer &other) : pointer(other.pointer) , id(other.id) , pointed_to_object_is_alive(false) @@ -342,7 +344,8 @@ inline SmartPointer::SmartPointer(const SmartPointer &other) template -inline SmartPointer::SmartPointer(const SmartPointer &other) +inline ObserverPointer::ObserverPointer( + const ObserverPointer &other) : pointer(other.pointer) , id(other.id) , pointed_to_object_is_alive(false) @@ -363,7 +366,8 @@ inline SmartPointer::SmartPointer(const SmartPointer &other) template -inline SmartPointer::SmartPointer(SmartPointer &&other) noexcept +inline ObserverPointer::ObserverPointer( + ObserverPointer &&other) noexcept : pointer(other.pointer) , id(other.id) , pointed_to_object_is_alive(false) @@ -400,7 +404,7 @@ inline SmartPointer::SmartPointer(SmartPointer &&other) noexcept template -inline SmartPointer::~SmartPointer() +inline ObserverPointer::~ObserverPointer() { static_assert(std::is_base_of_v, "This class can only be used if the first template argument " @@ -414,7 +418,7 @@ inline SmartPointer::~SmartPointer() template inline void -SmartPointer::clear() +ObserverPointer::clear() { if (pointed_to_object_is_alive && pointer != nullptr) { @@ -428,8 +432,8 @@ SmartPointer::clear() template -inline SmartPointer & -SmartPointer::operator=(T *tt) +inline ObserverPointer & +ObserverPointer::operator=(T *tt) { // optimize if no real action is requested if (pointer == tt) @@ -451,8 +455,8 @@ SmartPointer::operator=(T *tt) template template -inline SmartPointer & -SmartPointer::operator=(const SmartPointer &other) +inline ObserverPointer & +ObserverPointer::operator=(const ObserverPointer &other) { // if objects on the left and right // hand side of the operator= are @@ -479,8 +483,8 @@ SmartPointer::operator=(const SmartPointer &other) template -inline SmartPointer & -SmartPointer::operator=(const SmartPointer &other) +inline ObserverPointer & +ObserverPointer::operator=(const ObserverPointer &other) { // if objects on the left and right // hand side of the operator= are @@ -507,8 +511,8 @@ SmartPointer::operator=(const SmartPointer &other) template -inline SmartPointer & -SmartPointer::operator=(SmartPointer &&other) noexcept +inline ObserverPointer & +ObserverPointer::operator=(ObserverPointer &&other) noexcept { if (other == nullptr) { @@ -549,7 +553,7 @@ SmartPointer::operator=(SmartPointer &&other) noexcept template -inline SmartPointer::operator T *() const +inline ObserverPointer::operator T *() const { return pointer; } @@ -558,7 +562,7 @@ inline SmartPointer::operator T *() const template inline T & -SmartPointer::operator*() const +ObserverPointer::operator*() const { Assert(pointer != nullptr, ExcNotInitialized()); Assert(pointed_to_object_is_alive, @@ -570,7 +574,7 @@ SmartPointer::operator*() const template inline T * -SmartPointer::get() const +ObserverPointer::get() const { Assert(pointer != nullptr, ExcNotInitialized()); Assert(pointed_to_object_is_alive, @@ -582,7 +586,7 @@ SmartPointer::get() const template inline T * -SmartPointer::operator->() const +ObserverPointer::operator->() const { return this->get(); } @@ -592,10 +596,10 @@ SmartPointer::operator->() const template template inline void -SmartPointer::swap(SmartPointer &other) +ObserverPointer::swap(ObserverPointer &other) { #ifdef DEBUG - SmartPointer aux(pointer, id); + ObserverPointer aux(pointer, id); *this = other; other = aux; #else @@ -607,7 +611,7 @@ SmartPointer::swap(SmartPointer &other) template inline void -SmartPointer::swap(T *&ptr) +ObserverPointer::swap(T *&ptr) { if (pointed_to_object_is_alive && pointer != nullptr) pointer->unsubscribe(pointed_to_object_is_alive, id); @@ -622,18 +626,18 @@ SmartPointer::swap(T *&ptr) template inline std::size_t -SmartPointer::memory_consumption() const +ObserverPointer::memory_consumption() const { - return sizeof(SmartPointer); + return sizeof(ObserverPointer); } // The following function is not strictly necessary but is an optimization -// for places where you call swap(p1,p2) with SmartPointer objects p1, p2. +// for places where you call swap(p1,p2) with ObserverPointer objects p1, p2. // Unfortunately, MS Visual Studio (at least up to the 2013 edition) trips // over it when calling std::swap(v1,v2) where v1,v2 are std::vectors of -// SmartPointer objects: it can't determine whether it should call std::swap +// ObserverPointer objects: it can't determine whether it should call std::swap // or dealii::swap on the individual elements (see bug #184 on our Google Code // site. Consequently, just take this function out of the competition for this // compiler. @@ -645,7 +649,7 @@ SmartPointer::memory_consumption() const */ template inline void -swap(SmartPointer &t1, SmartPointer &t2) +swap(ObserverPointer &t1, ObserverPointer &t2) { t1.swap(t2); } @@ -661,7 +665,7 @@ swap(SmartPointer &t1, SmartPointer &t2) */ template inline void -swap(SmartPointer &t1, T *&t2) +swap(ObserverPointer &t1, T *&t2) { t1.swap(t2); } @@ -677,7 +681,7 @@ swap(SmartPointer &t1, T *&t2) */ template inline void -swap(T *&t1, SmartPointer &t2) +swap(T *&t1, ObserverPointer &t2) { t2.swap(t1); } diff --git a/include/deal.II/base/subscriptor.h b/include/deal.II/base/subscriptor.h index 832b68c03a..6ee22b81bd 100644 --- a/include/deal.II/base/subscriptor.h +++ b/include/deal.II/base/subscriptor.h @@ -39,8 +39,9 @@ DEAL_II_NAMESPACE_OPEN * moved from or destroyed. * The mechanism works as follows: The member function subscribe() accepts a * pointer to a boolean that is modified on invalidation. The object that owns - * this pointer (usually an object of class type SmartPointer) is then expected - * to check the state of the boolean before trying to access this class. + * this pointer (usually an object of class type ObserverPointer) is then + * expected to check the state of the boolean before trying to access this + * class. * * The utility of this class is even enhanced by providing identifying strings * to the functions subscribe() and unsubscribe(). These strings are represented @@ -50,7 +51,7 @@ DEAL_II_NAMESPACE_OPEN * x is some object. Therefore, the pointers provided to * subscribe() and to unsubscribe() must be the same. Strings with equal * contents will not be recognized to be the same. The handling in - * SmartPointer will take care of this. + * ObserverPointer will take care of this. * The current subscribers to this class can be obtained by calling * list_subscribers(). * @@ -104,7 +105,7 @@ public: * @name Subscriptor functionality * * Classes derived from Subscriptor provide a facility to subscribe to this - * object. This is mostly used by the SmartPointer class. + * object. This is mostly used by the ObserverPointer class. * @{ */ @@ -234,8 +235,8 @@ private: using map_iterator = decltype(counter_map)::iterator; /** - * In this vector, we store pointers to the validity bool in the SmartPointer - * objects that subscribe to this class. + * In this vector, we store pointers to the validity bool in the + * ObserverPointer objects that subscribe to this class. */ mutable std::vector *> validity_pointers; diff --git a/include/deal.II/distributed/cell_data_transfer.h b/include/deal.II/distributed/cell_data_transfer.h index 8614979328..ed8aae473a 100644 --- a/include/deal.II/distributed/cell_data_transfer.h +++ b/include/deal.II/distributed/cell_data_transfer.h @@ -235,8 +235,8 @@ namespace parallel /** * Pointer to the triangulation to work with. */ - SmartPointer, - CellDataTransfer> + ObserverPointer, + CellDataTransfer> triangulation; /** diff --git a/include/deal.II/distributed/fully_distributed_tria.h b/include/deal.II/distributed/fully_distributed_tria.h index a5355d5a25..e80f214806 100644 --- a/include/deal.II/distributed/fully_distributed_tria.h +++ b/include/deal.II/distributed/fully_distributed_tria.h @@ -306,7 +306,7 @@ namespace parallel /** * Partitioner used during repartition(). */ - SmartPointer> + ObserverPointer> partitioner_distributed; /** diff --git a/include/deal.II/distributed/shared_tria.h b/include/deal.II/distributed/shared_tria.h index 40b7ea4691..9e62c5d758 100644 --- a/include/deal.II/distributed/shared_tria.h +++ b/include/deal.II/distributed/shared_tria.h @@ -571,7 +571,7 @@ namespace internal /** * The modified parallel::shared::Triangulation. */ - const SmartPointer< + const ObserverPointer< const dealii::parallel::shared::Triangulation> shared_tria; diff --git a/include/deal.II/distributed/tria.h b/include/deal.II/distributed/tria.h index 4992c0639d..8d29176cd6 100644 --- a/include/deal.II/distributed/tria.h +++ b/include/deal.II/distributed/tria.h @@ -1139,7 +1139,7 @@ namespace parallel /** * The modified parallel::distributed::Triangulation. */ - const SmartPointer< + const ObserverPointer< dealii::parallel::distributed::Triangulation> distributed_tria; diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index c8f7299239..88164cfc5d 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -1491,7 +1491,7 @@ private: /** * Address of the triangulation to work on. */ - SmartPointer, DoFHandler> + ObserverPointer, DoFHandler> tria; /** diff --git a/include/deal.II/dofs/dof_handler_policy.h b/include/deal.II/dofs/dof_handler_policy.h index 0d912861d8..00bcb2d291 100644 --- a/include/deal.II/dofs/dof_handler_policy.h +++ b/include/deal.II/dofs/dof_handler_policy.h @@ -145,7 +145,7 @@ namespace internal /** * The DoFHandler object on which this policy object works. */ - SmartPointer> dof_handler; + ObserverPointer> dof_handler; }; @@ -205,7 +205,7 @@ namespace internal /** * The DoFHandler object on which this policy object works. */ - SmartPointer> dof_handler; + ObserverPointer> dof_handler; }; @@ -247,7 +247,7 @@ namespace internal /** * The DoFHandler object on which this policy object works. */ - SmartPointer> dof_handler; + ObserverPointer> dof_handler; }; } // namespace Policy } // namespace DoFHandlerImplementation diff --git a/include/deal.II/fe/fe_coupling_values.h b/include/deal.II/fe/fe_coupling_values.h index 312977d244..6336361d55 100644 --- a/include/deal.II/fe/fe_coupling_values.h +++ b/include/deal.II/fe/fe_coupling_values.h @@ -1034,12 +1034,12 @@ private: /** * Pointer to first FEValuesBase object. */ - SmartPointer> first_fe_values; + ObserverPointer> first_fe_values; /** * Pointer to second FEValuesBase object. */ - SmartPointer> second_fe_values; + ObserverPointer> second_fe_values; /** * Renumbering data for the first FEValuesBase object. diff --git a/include/deal.II/fe/fe_series.h b/include/deal.II/fe/fe_series.h index 3f381449dc..0c0874f991 100644 --- a/include/deal.II/fe/fe_series.h +++ b/include/deal.II/fe/fe_series.h @@ -182,7 +182,7 @@ namespace FESeries /** * hp::FECollection for which transformation matrices will be calculated. */ - SmartPointer> fe_collection; + ObserverPointer> fe_collection; /** * hp::QCollection used in calculation of transformation matrices. @@ -352,7 +352,7 @@ namespace FESeries /** * hp::FECollection for which transformation matrices will be calculated. */ - SmartPointer> fe_collection; + ObserverPointer> fe_collection; /** * hp::QCollection used in calculation of transformation matrices. diff --git a/include/deal.II/fe/fe_values_base.h b/include/deal.II/fe/fe_values_base.h index f9d6a7d16e..9d9175f8b0 100644 --- a/include/deal.II/fe/fe_values_base.h +++ b/include/deal.II/fe/fe_values_base.h @@ -1698,7 +1698,8 @@ protected: /** * A pointer to the mapping object associated with this FEValues object. */ - const SmartPointer, FEValuesBase> + const ObserverPointer, + FEValuesBase> mapping; /** @@ -1720,8 +1721,8 @@ protected: * A pointer to the finite element object associated with this FEValues * object. */ - const SmartPointer, - FEValuesBase> + const ObserverPointer, + FEValuesBase> fe; /** diff --git a/include/deal.II/fe/fe_values_views.h b/include/deal.II/fe/fe_values_views.h index 6a84365e5f..4311fe7b30 100644 --- a/include/deal.II/fe/fe_values_views.h +++ b/include/deal.II/fe/fe_values_views.h @@ -548,7 +548,7 @@ namespace FEValuesViews /** * A pointer to the FEValuesBase object we operate on. */ - SmartPointer> fe_values; + ObserverPointer> fe_values; /** * The single scalar component this view represents of the FEValuesBase @@ -1271,7 +1271,7 @@ namespace FEValuesViews /** * A pointer to the FEValuesBase object we operate on. */ - SmartPointer> fe_values; + ObserverPointer> fe_values; /** * The first component of the vector this view represents of the @@ -1584,7 +1584,7 @@ namespace FEValuesViews /** * A pointer to the FEValuesBase object we operate on. */ - SmartPointer> fe_values; + ObserverPointer> fe_values; /** * The first component of the vector this view represents of the @@ -1958,7 +1958,7 @@ namespace FEValuesViews /** * A pointer to the FEValuesBase object we operate on. */ - SmartPointer> fe_values; + ObserverPointer> fe_values; /** * The first component of the vector this view represents of the diff --git a/include/deal.II/fe/mapping_fe_field.h b/include/deal.II/fe/mapping_fe_field.h index 8286b2e838..574999ee65 100644 --- a/include/deal.II/fe/mapping_fe_field.h +++ b/include/deal.II/fe/mapping_fe_field.h @@ -367,7 +367,7 @@ public: /** * A pointer to the underlying finite element. */ - SmartPointer> fe; + ObserverPointer> fe; /** * Values of shape functions. Access by function @p shape. @@ -570,15 +570,15 @@ protected: /** * Reference to the vector of shifts. */ - std::vector< - SmartPointer>> + std::vector>> euler_vector; /** * Pointer to the DoFHandler to which the mapping vector is associated. */ - SmartPointer, - MappingFEField> + ObserverPointer, + MappingFEField> euler_dof_handler; private: diff --git a/include/deal.II/fe/mapping_manifold.h b/include/deal.II/fe/mapping_manifold.h index bfcf9ca78d..3253309b5a 100644 --- a/include/deal.II/fe/mapping_manifold.h +++ b/include/deal.II/fe/mapping_manifold.h @@ -313,7 +313,7 @@ public: * * Updated each. */ - mutable SmartPointer> manifold; + mutable ObserverPointer> manifold; }; private: diff --git a/include/deal.II/fe/mapping_q1_eulerian.h b/include/deal.II/fe/mapping_q1_eulerian.h index 9897d34754..28b8f9779f 100644 --- a/include/deal.II/fe/mapping_q1_eulerian.h +++ b/include/deal.II/fe/mapping_q1_eulerian.h @@ -176,14 +176,15 @@ protected: /** * Reference to the vector of shifts. */ - SmartPointer> + ObserverPointer> euler_transform_vectors; /** * Pointer to the DoFHandler to which the mapping vector is associated. */ - SmartPointer, - MappingQ1Eulerian> + ObserverPointer, + MappingQ1Eulerian> shiftmap_dof_handler; }; diff --git a/include/deal.II/fe/mapping_q_eulerian.h b/include/deal.II/fe/mapping_q_eulerian.h index 79801901c6..ea0f0649ad 100644 --- a/include/deal.II/fe/mapping_q_eulerian.h +++ b/include/deal.II/fe/mapping_q_eulerian.h @@ -174,14 +174,14 @@ protected: /** * Reference to the vector of shifts. */ - SmartPointer> + ObserverPointer> euler_vector; /** * Pointer to the DoFHandler to which the mapping vector is associated. */ - SmartPointer, - MappingQEulerian> + ObserverPointer, + MappingQEulerian> euler_dof_handler; private: diff --git a/include/deal.II/grid/composition_manifold.h b/include/deal.II/grid/composition_manifold.h index 6a826cce7a..e32943e07d 100644 --- a/include/deal.II/grid/composition_manifold.h +++ b/include/deal.II/grid/composition_manifold.h @@ -112,7 +112,7 @@ private: /** * The first ChartManifold. */ - SmartPointer< + ObserverPointer< const ChartManifold, CompositionManifold> F; @@ -121,7 +121,7 @@ private: /** * The second ChartManifold. */ - SmartPointer< + ObserverPointer< const ChartManifold, CompositionManifold> G; diff --git a/include/deal.II/grid/grid_in.h b/include/deal.II/grid/grid_in.h index 4b5c5e67c8..ab6d744bf3 100644 --- a/include/deal.II/grid/grid_in.h +++ b/include/deal.II/grid/grid_in.h @@ -882,7 +882,7 @@ protected: /** * Store address of the triangulation to be fed with the data read in. */ - SmartPointer, GridIn> tria; + ObserverPointer, GridIn> tria; /** * This function can write the raw cell data objects created by the diff --git a/include/deal.II/grid/grid_tools_cache.h b/include/deal.II/grid/grid_tools_cache.h index f48710d010..98ccfc25a9 100644 --- a/include/deal.II/grid/grid_tools_cache.h +++ b/include/deal.II/grid/grid_tools_cache.h @@ -241,12 +241,13 @@ namespace GridTools /** * A pointer to the Triangulation. */ - SmartPointer, Cache> tria; + ObserverPointer, Cache> + tria; /** * Mapping to use when computing on the Triangulation. */ - SmartPointer, Cache> mapping; + ObserverPointer, Cache> mapping; /** diff --git a/include/deal.II/grid/intergrid_map.h b/include/deal.II/grid/intergrid_map.h index fc9650020a..4c57d9ac34 100644 --- a/include/deal.II/grid/intergrid_map.h +++ b/include/deal.II/grid/intergrid_map.h @@ -122,7 +122,8 @@ public: using cell_iterator = typename MeshType::cell_iterator; /** - * Constructor setting the class name arguments in the SmartPointer members. + * Constructor setting the class name arguments in the ObserverPointer + * members. */ InterGridMap(); @@ -187,12 +188,12 @@ private: /** * Store a pointer to the source grid. */ - SmartPointer> source_grid; + ObserverPointer> source_grid; /** * Likewise for the destination grid. */ - SmartPointer> destination_grid; + ObserverPointer> destination_grid; /** * Set the mapping for the pair of cells given. These shall match in level diff --git a/include/deal.II/grid/manifold_lib.h b/include/deal.II/grid/manifold_lib.h index e6de2053ae..fbe88a26b1 100644 --- a/include/deal.II/grid/manifold_lib.h +++ b/include/deal.II/grid/manifold_lib.h @@ -790,15 +790,15 @@ private: /** * Pointer to the push_forward function. */ - SmartPointer, - FunctionManifold> + ObserverPointer, + FunctionManifold> push_forward_function; /** * Pointer to the pull_back function. */ - SmartPointer, - FunctionManifold> + ObserverPointer, + FunctionManifold> pull_back_function; /** diff --git a/include/deal.II/grid/persistent_tria.h b/include/deal.II/grid/persistent_tria.h index 612b92b757..6a406f4aab 100644 --- a/include/deal.II/grid/persistent_tria.h +++ b/include/deal.II/grid/persistent_tria.h @@ -250,8 +250,8 @@ private: /** * This grid shall be used as coarse grid. */ - SmartPointer, - PersistentTriangulation> + ObserverPointer, + PersistentTriangulation> coarse_grid; /** diff --git a/include/deal.II/hp/fe_values.h b/include/deal.II/hp/fe_values.h index dac0f9ce03..84d8608781 100644 --- a/include/deal.II/hp/fe_values.h +++ b/include/deal.II/hp/fe_values.h @@ -202,14 +202,15 @@ namespace hp /** * A pointer to the collection of finite elements to be used. */ - const SmartPointer, - FEValuesBase> + const ObserverPointer< + const FECollection, + FEValuesBase> fe_collection; /** * A pointer to the collection of mappings to be used. */ - const SmartPointer< + const ObserverPointer< const MappingCollection, FEValuesBase> mapping_collection; diff --git a/include/deal.II/lac/block_matrix_base.h b/include/deal.II/lac/block_matrix_base.h index d0b012a62c..fea46354f7 100644 --- a/include/deal.II/lac/block_matrix_base.h +++ b/include/deal.II/lac/block_matrix_base.h @@ -849,7 +849,7 @@ protected: /** * Array of sub-matrices. */ - Table<2, SmartPointer>> sub_objects; + Table<2, ObserverPointer>> sub_objects; /** * This function collects the sizes of the sub-objects and stores them in diff --git a/include/deal.II/lac/block_sparse_matrix.h b/include/deal.II/lac/block_sparse_matrix.h index f7d90f3adb..9d8ecaa608 100644 --- a/include/deal.II/lac/block_sparse_matrix.h +++ b/include/deal.II/lac/block_sparse_matrix.h @@ -364,9 +364,9 @@ private: /** * Pointer to the block sparsity pattern used for this matrix. In order to * guarantee that it is not deleted while still in use, we subscribe to it - * using the SmartPointer class. + * using the ObserverPointer class. */ - SmartPointer> + ObserverPointer> sparsity_pattern; }; diff --git a/include/deal.II/lac/chunk_sparse_matrix.h b/include/deal.II/lac/chunk_sparse_matrix.h index 72d2cc0aa5..d8c3ff6e4a 100644 --- a/include/deal.II/lac/chunk_sparse_matrix.h +++ b/include/deal.II/lac/chunk_sparse_matrix.h @@ -1405,9 +1405,9 @@ private: /** * Pointer to the sparsity pattern used for this matrix. In order to * guarantee that it is not deleted while still in use, we subscribe to it - * using the SmartPointer class. + * using the ObserverPointer class. */ - SmartPointer> cols; + ObserverPointer> cols; /** * Array of values for all the nonzero entries. The position of an diff --git a/include/deal.II/lac/lapack_full_matrix.h b/include/deal.II/lac/lapack_full_matrix.h index e94f0b384f..16f7e0bbe7 100644 --- a/include/deal.II/lac/lapack_full_matrix.h +++ b/include/deal.II/lac/lapack_full_matrix.h @@ -1024,8 +1024,9 @@ public: Tvmult(BlockVector &, const BlockVector &) const; private: - SmartPointer, PreconditionLU> matrix; - SmartPointer>, PreconditionLU> mem; + ObserverPointer, PreconditionLU> + matrix; + ObserverPointer>, PreconditionLU> mem; }; /*---------------------- Inline functions -----------------------------------*/ diff --git a/include/deal.II/lac/petsc_snes.h b/include/deal.II/lac/petsc_snes.h index e13d7371a6..65498156b7 100644 --- a/include/deal.II/lac/petsc_snes.h +++ b/include/deal.II/lac/petsc_snes.h @@ -472,8 +472,8 @@ namespace PETScWrappers /** * Pointers to the internal PETSc matrix objects. */ - SmartPointer A; - SmartPointer P; + ObserverPointer A; + ObserverPointer P; /** * This flag is used to support versions of PETSc older than 3.13. diff --git a/include/deal.II/lac/petsc_solver.h b/include/deal.II/lac/petsc_solver.h index 383a8ace11..81a8def957 100644 --- a/include/deal.II/lac/petsc_solver.h +++ b/include/deal.II/lac/petsc_solver.h @@ -172,7 +172,7 @@ namespace PETScWrappers * copy the data from this object before starting the solution process, * and copy the data back into it afterwards. */ - SmartPointer solver_control; + ObserverPointer solver_control; /** * Utility to create the KSP object and attach convergence test. diff --git a/include/deal.II/lac/petsc_ts.h b/include/deal.II/lac/petsc_ts.h index f6f53d0408..d8837f277f 100644 --- a/include/deal.II/lac/petsc_ts.h +++ b/include/deal.II/lac/petsc_ts.h @@ -716,8 +716,8 @@ namespace PETScWrappers /** * Pointers to the internal PETSc matrix objects. */ - SmartPointer A; - SmartPointer P; + ObserverPointer A; + ObserverPointer P; /** * Object to apply solve_with_jacobian. diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index c4d167e524..a75ac00bb8 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -682,7 +682,7 @@ protected: /** * Pointer to the matrix object. */ - SmartPointer> A; + ObserverPointer> A; /** * Stores the additional data passed to the initialize function, obtained @@ -867,8 +867,8 @@ namespace internal } private: - const SmartPointer A; - const double relaxation; + const ObserverPointer A; + const double relaxation; }; template @@ -935,8 +935,8 @@ namespace internal } private: - const SmartPointer A; - const double relaxation; + const ObserverPointer A; + const double relaxation; }; template @@ -1026,8 +1026,8 @@ namespace internal } private: - const SmartPointer A; - const double relaxation; + const ObserverPointer A; + const double relaxation; /** * An array that stores for each matrix row where the first position after @@ -1069,8 +1069,8 @@ namespace internal } private: - const SmartPointer A; - const double relaxation; + const ObserverPointer A; + const double relaxation; const std::vector &permutation; const std::vector &inverse_permutation; @@ -2026,8 +2026,8 @@ public: *

    Requirements on the templated classes

    * * The class `MatrixType` must be derived from Subscriptor because a - * SmartPointer to `MatrixType` is held in the class. In particular, this means - * that the matrix object needs to persist during the lifetime of + * ObserverPointer to `MatrixType` is held in the class. In particular, this + * means that the matrix object needs to persist during the lifetime of * PreconditionChebyshev. The preconditioner is held in a shared_ptr that is * copied into the AdditionalData member variable of the class, so the * variable used for initialization can safely be discarded after calling @@ -2254,7 +2254,7 @@ private: /** * A pointer to the underlying matrix. */ - SmartPointer< + ObserverPointer< const MatrixType, PreconditionChebyshev> matrix_ptr; diff --git a/include/deal.II/lac/precondition_block.h b/include/deal.II/lac/precondition_block.h index ef9048753c..58f751d4a2 100644 --- a/include/deal.II/lac/precondition_block.h +++ b/include/deal.II/lac/precondition_block.h @@ -343,7 +343,8 @@ protected: * inverse matrices should not be stored) until the last call of the * preconditoining @p vmult function of the derived classes. */ - SmartPointer> A; + ObserverPointer> + A; /** * Relaxation parameter to be used by derived classes. */ diff --git a/include/deal.II/lac/precondition_selector.h b/include/deal.II/lac/precondition_selector.h index 43c3ae60b5..1964dbded1 100644 --- a/include/deal.II/lac/precondition_selector.h +++ b/include/deal.II/lac/precondition_selector.h @@ -188,7 +188,8 @@ private: * Matrix that is used for the matrix-builtin preconditioning function. cf. * also @p PreconditionUseMatrix. */ - SmartPointer> + ObserverPointer> A; /** diff --git a/include/deal.II/lac/relaxation_block.h b/include/deal.II/lac/relaxation_block.h index 3e00d0e6d9..54d11c481b 100644 --- a/include/deal.II/lac/relaxation_block.h +++ b/include/deal.II/lac/relaxation_block.h @@ -246,15 +246,15 @@ protected: * inverse matrices should not be stored) until the last call of the * preconditioning @p vmult function of the derived classes. */ - SmartPointer> + ObserverPointer> A; /** * Control information. */ - SmartPointer> + ObserverPointer> additional_data; private: diff --git a/include/deal.II/lac/solver_selector.h b/include/deal.II/lac/solver_selector.h index c703d7f88c..4815b25f5a 100644 --- a/include/deal.II/lac/solver_selector.h +++ b/include/deal.II/lac/solver_selector.h @@ -206,7 +206,7 @@ protected: * Stores the @p SolverControl that is needed in the constructor of each @p * Solver class. This can be changed with @p set_control(). */ - SmartPointer> control; + ObserverPointer> control; /** * Stores the name of the solver. diff --git a/include/deal.II/lac/sparse_matrix.h b/include/deal.II/lac/sparse_matrix.h index 61b961144f..37359243cf 100644 --- a/include/deal.II/lac/sparse_matrix.h +++ b/include/deal.II/lac/sparse_matrix.h @@ -1742,9 +1742,9 @@ private: /** * Pointer to the sparsity pattern used for this matrix. In order to * guarantee that it is not deleted while still in use, we subscribe to it - * using the SmartPointer class. + * using the ObserverPointer class. */ - SmartPointer> cols; + ObserverPointer> cols; /** * Array of values for all the nonzero entries. The position of an diff --git a/include/deal.II/lac/sparse_vanka.h b/include/deal.II/lac/sparse_vanka.h index 63ede4c36f..e84362f97b 100644 --- a/include/deal.II/lac/sparse_vanka.h +++ b/include/deal.II/lac/sparse_vanka.h @@ -283,7 +283,7 @@ private: /** * Pointer to the matrix. */ - SmartPointer, SparseVanka> matrix; + ObserverPointer, SparseVanka> matrix; /** * Indices of those degrees of freedom that we shall work on. @@ -294,7 +294,7 @@ private: * Array of inverse matrices, one for each degree of freedom. Only those * elements will be used that are tagged in @p selected. */ - mutable std::vector, SparseVanka>> + mutable std::vector, SparseVanka>> inverses; /** diff --git a/include/deal.II/lac/sparse_vanka.templates.h b/include/deal.II/lac/sparse_vanka.templates.h index 34fda24b17..a710307a6c 100644 --- a/include/deal.II/lac/sparse_vanka.templates.h +++ b/include/deal.II/lac/sparse_vanka.templates.h @@ -61,7 +61,7 @@ template SparseVanka::~SparseVanka() { typename std::vector< - SmartPointer, SparseVanka>>::iterator i; + ObserverPointer, SparseVanka>>::iterator i; for (i = inverses.begin(); i != inverses.end(); ++i) { FullMatrix *p = *i; diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index ecb8528df1..cb80eb478d 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -891,12 +891,12 @@ protected: /** * Pointer to the Mapping object passed to the constructor. */ - SmartPointer> mapping; + ObserverPointer> mapping; /** * Pointer to the FiniteElement object passed to the constructor. */ - SmartPointer> fe; + ObserverPointer> fe; /** * Description of the 1d polynomial basis for tensor product elements used @@ -1045,7 +1045,7 @@ protected: * Pointer to currently used mapping info (either on the fly or external * precomputed). */ - SmartPointer> mapping_info; + ObserverPointer> mapping_info; /** * The current cell index to access mapping data from mapping info. diff --git a/include/deal.II/matrix_free/fe_remote_evaluation.h b/include/deal.II/matrix_free/fe_remote_evaluation.h index 1b276c7230..c9ef3821cb 100644 --- a/include/deal.II/matrix_free/fe_remote_evaluation.h +++ b/include/deal.II/matrix_free/fe_remote_evaluation.h @@ -609,17 +609,17 @@ private: /** * Underlying communicator which handles update of the ghost values. */ - SmartPointer> comm; + ObserverPointer> comm; /** * Pointer to MeshType if used with Triangulation. */ - SmartPointer> tria; + ObserverPointer> tria; /** * Pointer to MeshType if used with DoFHandler. */ - SmartPointer> dof_handler; + ObserverPointer> dof_handler; /** * First selected component. diff --git a/include/deal.II/matrix_free/mapping_info.h b/include/deal.II/matrix_free/mapping_info.h index d09e1594a7..081b5f066c 100644 --- a/include/deal.II/matrix_free/mapping_info.h +++ b/include/deal.II/matrix_free/mapping_info.h @@ -192,7 +192,7 @@ namespace internal /** * The pointer to the first entry of mapping_collection. */ - SmartPointer> mapping; + ObserverPointer> mapping; /** * Reference-cell type related to each quadrature and active quadrature diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index 6a7dfa02ca..21248b1287 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -2252,7 +2252,7 @@ private: /** * Pointers to the DoFHandlers underlying the current problem. */ - std::vector>> dof_handlers; + std::vector>> dof_handlers; /** * Pointers to the AffineConstraints underlying the current problem. Only @@ -2260,7 +2260,8 @@ private: * template parameter as the `Number` template of MatrixFree is passed to * reinit(). Filled with nullptr otherwise. */ - std::vector>> affine_constraints; + std::vector>> + affine_constraints; /** * Contains the information about degrees of freedom on the individual cells diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index f7c6d6ff61..51cd4c0f04 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -366,7 +366,8 @@ namespace internal void store_affine_constraints( const dealii::AffineConstraints *, - SmartPointer> &stored_constraints) + ObserverPointer> + &stored_constraints) { stored_constraints = nullptr; } @@ -374,8 +375,9 @@ namespace internal template void store_affine_constraints( - const dealii::AffineConstraints *affine_constraints, - SmartPointer> &stored_constraints) + const dealii::AffineConstraints *affine_constraints, + ObserverPointer> + &stored_constraints) { stored_constraints = affine_constraints; } @@ -1118,9 +1120,9 @@ namespace internal std::vector compute_dof_info( const std::vector *> &constraint, - const std::vector &locally_owned_dofs, - const std::vector>> &dof_handlers, - const Table<2, MatrixFreeFunctions::ShapeInfo> &shape_infos, + const std::vector &locally_owned_dofs, + const std::vector>> &dof_handlers, + const Table<2, MatrixFreeFunctions::ShapeInfo> &shape_infos, const unsigned int cell_level_index_end_local, const unsigned int mg_level, const bool hold_all_faces_to_owned_cells, diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index 585baa1ac7..8f36705993 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -590,7 +590,7 @@ namespace MatrixFreeOperators /** * Const pointer to the operator class. */ - SmartPointer mf_base_operator; + ObserverPointer mf_base_operator; }; diff --git a/include/deal.II/matrix_free/tools.h b/include/deal.II/matrix_free/tools.h index e78510062d..16a9ef30ca 100644 --- a/include/deal.II/matrix_free/tools.h +++ b/include/deal.II/matrix_free/tools.h @@ -622,7 +622,7 @@ namespace MatrixFreeTools /** * Reference to the underlying MatrixFree object. */ - SmartPointer> + ObserverPointer> matrix_free; /** diff --git a/include/deal.II/meshworker/assembler.h b/include/deal.II/meshworker/assembler.h index 9adf6d3afa..3b54ca260f 100644 --- a/include/deal.II/meshworker/assembler.h +++ b/include/deal.II/meshworker/assembler.h @@ -166,15 +166,15 @@ namespace MeshWorker /** * A pointer to the object containing the block structure. */ - SmartPointer> + ObserverPointer> block_info; /** * A pointer to the object containing constraints. */ - SmartPointer, - ResidualLocalBlocksToGlobalBlocks> + ObserverPointer, + ResidualLocalBlocksToGlobalBlocks> constraints; }; @@ -271,22 +271,22 @@ namespace MeshWorker /** * The global matrices, stored as a vector of pointers. */ - SmartPointer, - MatrixLocalBlocksToGlobalBlocks> + ObserverPointer, + MatrixLocalBlocksToGlobalBlocks> matrices; /** * A pointer to the object containing the block structure. */ - SmartPointer> + ObserverPointer> block_info; /** * A pointer to the object containing constraints. */ - SmartPointer, - MatrixLocalBlocksToGlobalBlocks> + ObserverPointer, + MatrixLocalBlocksToGlobalBlocks> constraints; /** @@ -326,8 +326,8 @@ namespace MeshWorker public: using MatrixPtrVector = MGMatrixBlockVector; using MatrixPtrVectorPtr = - SmartPointer>; + ObserverPointer>; /** * Constructor, initializing the #threshold, which limits how small @@ -502,15 +502,15 @@ namespace MeshWorker /** * A pointer to the object containing the block structure. */ - SmartPointer> + ObserverPointer> block_info; /** * A pointer to the object containing constraints. */ - SmartPointer> + ObserverPointer> mg_constrained_dofs; diff --git a/include/deal.II/meshworker/dof_info.h b/include/deal.II/meshworker/dof_info.h index 4dfcf8d262..25db2e32bc 100644 --- a/include/deal.II/meshworker/dof_info.h +++ b/include/deal.II/meshworker/dof_info.h @@ -168,7 +168,7 @@ namespace MeshWorker /// The block structure of the system - SmartPointer> block_info; + ObserverPointer> block_info; /** * The structure refers to a cell with level data instead of active data. diff --git a/include/deal.II/meshworker/integration_info.h b/include/deal.II/meshworker/integration_info.h index ca717062b8..c1d56aed98 100644 --- a/include/deal.II/meshworker/integration_info.h +++ b/include/deal.II/meshworker/integration_info.h @@ -219,8 +219,8 @@ namespace MeshWorker /** * The pointer to the (system) element used for initialization. */ - SmartPointer, - IntegrationInfo> + ObserverPointer, + IntegrationInfo> fe_pointer; /** diff --git a/include/deal.II/meshworker/scratch_data.h b/include/deal.II/meshworker/scratch_data.h index cb1f3a8d3e..d424d0de96 100644 --- a/include/deal.II/meshworker/scratch_data.h +++ b/include/deal.II/meshworker/scratch_data.h @@ -210,7 +210,7 @@ namespace MeshWorker { public: /** - * Create an empty ScratchData object. A SmartPointer pointing to + * Create an empty ScratchData object. A ObserverPointer pointing to * @p mapping and @p fe is stored internally. Make sure they live longer * than this class instance. * @@ -305,7 +305,7 @@ namespace MeshWorker const UpdateFlags &neighbor_face_update_flags = update_default); /** - * Create an empty ScratchData object. A SmartPointer pointing to + * Create an empty ScratchData object. A ObserverPointer pointing to * @p mapping_collection and @p fe_collection is stored internally. Make sure they live longer * than this class instance. * @@ -1360,13 +1360,13 @@ namespace MeshWorker * The mapping used by the internal FEValues. Make sure it lives * longer than this class. */ - SmartPointer> mapping; + ObserverPointer> mapping; /** * The finite element used by the internal FEValues. Make sure it lives * longer than this class. */ - SmartPointer> fe; + ObserverPointer> fe; /** * Quadrature formula used to integrate on the current cell, and on its @@ -1428,13 +1428,14 @@ namespace MeshWorker * The mapping collection used by the internal hp::FEValues. Make sure it * lives longer than this class. */ - SmartPointer> mapping_collection; + ObserverPointer> + mapping_collection; /** * The finite element used by the internal FEValues. Make sure it lives * longer than this class. */ - SmartPointer> fe_collection; + ObserverPointer> fe_collection; /** * Quadrature formula used to integrate on the current cell, and on its @@ -1553,13 +1554,14 @@ namespace MeshWorker * A pointer to the last used FEValues/FEFaceValues, or FESubfaceValues * object on this cell. */ - SmartPointer> current_fe_values; + ObserverPointer> current_fe_values; /** * A pointer to the last used FEValues/FEFaceValues, or FESubfaceValues * object on the neighbor cell. */ - SmartPointer> current_neighbor_fe_values; + ObserverPointer> + current_neighbor_fe_values; }; #ifndef DOXYGEN diff --git a/include/deal.II/meshworker/simple.h b/include/deal.II/meshworker/simple.h index 8ecdd7c8ef..c9b07c3e8e 100644 --- a/include/deal.II/meshworker/simple.h +++ b/include/deal.II/meshworker/simple.h @@ -111,8 +111,8 @@ namespace MeshWorker /** * A pointer to the object containing constraints. */ - SmartPointer, - ResidualSimple> + ObserverPointer, + ResidualSimple> constraints; }; @@ -211,7 +211,7 @@ namespace MeshWorker /** * The vector of global matrices being assembled. */ - std::vector>> matrix; + std::vector>> matrix; /** * The smallest positive number that will be entered into the global @@ -234,8 +234,8 @@ namespace MeshWorker /** * A pointer to the object containing constraints. */ - SmartPointer, - MatrixSimple> + ObserverPointer, + MatrixSimple> constraints; }; @@ -378,40 +378,40 @@ namespace MeshWorker /** * The global matrix being assembled. */ - SmartPointer, MGMatrixSimple> + ObserverPointer, MGMatrixSimple> matrix; /** * The matrix used for face flux terms across the refinement edge, * coupling coarse to fine. */ - SmartPointer, MGMatrixSimple> + ObserverPointer, MGMatrixSimple> flux_up; /** * The matrix used for face flux terms across the refinement edge, * coupling fine to coarse. */ - SmartPointer, MGMatrixSimple> + ObserverPointer, MGMatrixSimple> flux_down; /** * The matrix used for face contributions for continuous elements across * the refinement edge, coupling coarse to fine. */ - SmartPointer, MGMatrixSimple> + ObserverPointer, MGMatrixSimple> interface_in; /** * The matrix used for face contributions for continuous elements across * the refinement edge, coupling fine to coarse. */ - SmartPointer, MGMatrixSimple> + ObserverPointer, MGMatrixSimple> interface_out; /** * A pointer to the object containing constraints. */ - SmartPointer> + ObserverPointer> mg_constrained_dofs; /** diff --git a/include/deal.II/meshworker/vector_selector.templates.h b/include/deal.II/meshworker/vector_selector.templates.h index 1b6eec1c00..814f52f7b4 100644 --- a/include/deal.II/meshworker/vector_selector.templates.h +++ b/include/deal.II/meshworker/vector_selector.templates.h @@ -99,7 +99,8 @@ namespace MeshWorker VectorData::initialize(const VectorType *v, const std::string &name) { - SmartPointer> p = v; + ObserverPointer> p = + v; this->data.add(p, name); VectorSelector::initialize(this->data); } @@ -195,8 +196,8 @@ namespace MeshWorker const MGLevelObject *v, const std::string &name) { - SmartPointer, - MGVectorData> + ObserverPointer, + MGVectorData> p = v; this->data.add(p, name); VectorSelector::initialize(this->data); diff --git a/include/deal.II/multigrid/mg_block_smoother.h b/include/deal.II/multigrid/mg_block_smoother.h index a3275938d7..deffa9e5e1 100644 --- a/include/deal.II/multigrid/mg_block_smoother.h +++ b/include/deal.II/multigrid/mg_block_smoother.h @@ -123,8 +123,8 @@ private: /** * Memory for auxiliary vectors. */ - SmartPointer>, - MGSmootherBlock> + ObserverPointer>, + MGSmootherBlock> mem; }; diff --git a/include/deal.II/multigrid/mg_coarse.h b/include/deal.II/multigrid/mg_coarse.h index 0ab59b8f3b..b9d98289ba 100644 --- a/include/deal.II/multigrid/mg_coarse.h +++ b/include/deal.II/multigrid/mg_coarse.h @@ -73,8 +73,8 @@ private: /** * Reference to the smoother. */ - SmartPointer, - MGCoarseGridApplySmoother> + ObserverPointer, + MGCoarseGridApplySmoother> coarse_smooth; }; @@ -134,31 +134,31 @@ private: /** * Reference to the solver. */ - SmartPointer> + ObserverPointer> solver; /** * Reference to the matrix. */ - SmartPointer> + ObserverPointer> matrix; /** * Reference to the preconditioner. */ - SmartPointer> + ObserverPointer> preconditioner; }; @@ -261,10 +261,9 @@ void MGCoarseGridApplySmoother::initialize( const MGSmootherBase &coarse_smooth_) { - coarse_smooth = - SmartPointer, - MGCoarseGridApplySmoother>(&coarse_smooth_, - typeid(*this).name()); + coarse_smooth = ObserverPointer, + MGCoarseGridApplySmoother>( + &coarse_smooth_, typeid(*this).name()); } diff --git a/include/deal.II/multigrid/mg_matrix.h b/include/deal.II/multigrid/mg_matrix.h index d54eee0f23..5db3406a2f 100644 --- a/include/deal.II/multigrid/mg_matrix.h +++ b/include/deal.II/multigrid/mg_matrix.h @@ -125,7 +125,7 @@ class MGMatrixSelect : public MGMatrixBase> public: /** * Constructor. @p row and @p col are the coordinate of the selected block. - * The other argument is handed over to the @p SmartPointer constructor. + * The other argument is handed over to the @p ObserverPointer constructor. */ MGMatrixSelect(const unsigned int row = 0, const unsigned int col = 0, @@ -180,7 +180,7 @@ private: /** * Pointer to the matrix objects on each level. */ - SmartPointer, MGMatrixSelect> + ObserverPointer, MGMatrixSelect> matrix; /** * Row coordinate of selected block. diff --git a/include/deal.II/multigrid/mg_transfer.h b/include/deal.II/multigrid/mg_transfer.h index 7117c97371..3c11c93c78 100644 --- a/include/deal.II/multigrid/mg_transfer.h +++ b/include/deal.II/multigrid/mg_transfer.h @@ -386,7 +386,7 @@ protected: /** * The mg_constrained_dofs of the level systems. */ - SmartPointer mg_constrained_dofs; + ObserverPointer mg_constrained_dofs; private: /** @@ -574,7 +574,7 @@ protected: /** * The mg_constrained_dofs of the level systems. */ - SmartPointer mg_constrained_dofs; + ObserverPointer mg_constrained_dofs; /** * In the function copy_to_mg, we need to access ghosted entries of the diff --git a/include/deal.II/multigrid/mg_transfer_block.h b/include/deal.II/multigrid/mg_transfer_block.h index 2e1c080fa9..d26acc6edc 100644 --- a/include/deal.II/multigrid/mg_transfer_block.h +++ b/include/deal.II/multigrid/mg_transfer_block.h @@ -159,7 +159,7 @@ protected: * The mg_constrained_dofs of the level systems. */ - SmartPointer + ObserverPointer mg_constrained_dofs; }; @@ -277,7 +277,7 @@ private: * Memory pool required if additional multiplication using #factors is * desired. */ - SmartPointer>, MGTransferBlock> memory; + ObserverPointer>, MGTransferBlock> memory; }; diff --git a/include/deal.II/multigrid/mg_transfer_component.h b/include/deal.II/multigrid/mg_transfer_component.h index c46ea4c14f..8fc68059c0 100644 --- a/include/deal.II/multigrid/mg_transfer_component.h +++ b/include/deal.II/multigrid/mg_transfer_component.h @@ -369,7 +369,7 @@ private: * The constraints of the global system. */ public: - SmartPointer> constraints; + ObserverPointer> constraints; }; /** @} */ diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.h index b03fc8c28f..b12a18b58c 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.h @@ -650,7 +650,7 @@ private: /** * Matrix-free object on the fine side. */ - SmartPointer> matrix_free_fine; + ObserverPointer> matrix_free_fine; /** * Index within the list of DoFHandler objects in the matrix_free_fine @@ -661,7 +661,7 @@ private: /** * Matrix-free object on the coarse side. */ - SmartPointer> matrix_free_coarse; + ObserverPointer> matrix_free_coarse; /** * Index within the list of DoFHandler objects in the matrix_free_coarse @@ -711,7 +711,7 @@ private: /** * Pointer to the DoFHandler object used during initialization. */ - SmartPointer> dof_handler_fine; + ObserverPointer> dof_handler_fine; /** * Multigrid level used during initialization. @@ -897,7 +897,7 @@ private: /** * Pointer to the DoFHandler object used during initialization. */ - SmartPointer> dof_handler_fine; + ObserverPointer> dof_handler_fine; /** * Multigrid level used during initialization. @@ -1248,8 +1248,8 @@ private: */ void initialize_internal_transfer( - const DoFHandler &dof_handler, - const SmartPointer &mg_constrained_dofs); + const DoFHandler &dof_handler, + const ObserverPointer &mg_constrained_dofs); /** * Retrieve finest DoFHandler from two-level transfer objects. @@ -1302,7 +1302,7 @@ private: /** * Collection of the two-level transfer operators. */ - MGLevelObject>> transfer; + MGLevelObject>> transfer; /** * External partitioners used during initialize_dof_vector(). @@ -1395,7 +1395,8 @@ private: /** * Non-block version of transfer operation. */ - std::vector>> transfer_operators; + std::vector>> + transfer_operators; }; diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index 7db8a1b7f1..e4e91efd2f 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -4309,8 +4309,8 @@ MGTransferMF::initialize_constraints( template void MGTransferMF::initialize_internal_transfer( - const DoFHandler &dof_handler, - const SmartPointer &mg_constrained_dofs) + const DoFHandler &dof_handler, + const ObserverPointer &mg_constrained_dofs) { const unsigned int min_level = 0; const unsigned int max_level = diff --git a/include/deal.II/multigrid/multigrid.h b/include/deal.II/multigrid/multigrid.h index 2d75879019..a2c86c3faa 100644 --- a/include/deal.II/multigrid/multigrid.h +++ b/include/deal.II/multigrid/multigrid.h @@ -422,30 +422,30 @@ private: /** * The matrix for each level. */ - SmartPointer, Multigrid> matrix; + ObserverPointer, Multigrid> matrix; /** * The matrix for each level. */ - SmartPointer, Multigrid> + ObserverPointer, Multigrid> coarse; /** * Object for grid transfer. */ - SmartPointer, Multigrid> + ObserverPointer, Multigrid> transfer; /** * The pre-smoothing object. */ - SmartPointer, Multigrid> + ObserverPointer, Multigrid> pre_smooth; /** * The post-smoothing object. */ - SmartPointer, Multigrid> + ObserverPointer, Multigrid> post_smooth; /** @@ -453,7 +453,7 @@ private: * * @note Only vmult is used for these matrices. */ - SmartPointer> edge_out; + ObserverPointer> edge_out; /** * Transpose edge matrix from the refinement edge to the interior of the @@ -461,21 +461,23 @@ private: * * @note Only Tvmult is used for these matrices. */ - SmartPointer> edge_in; + ObserverPointer> edge_in; /** * Edge matrix from fine to coarse. * * @note Only vmult is used for these matrices. */ - SmartPointer, Multigrid> edge_down; + ObserverPointer, Multigrid> + edge_down; /** * Transpose edge matrix from coarse to fine. * * @note Only Tvmult is used for these matrices. */ - SmartPointer, Multigrid> edge_up; + ObserverPointer, Multigrid> + edge_up; template friend class PreconditionMG; @@ -610,28 +612,28 @@ private: /** * Associated @p DoFHandler. */ - std::vector, - PreconditionMG>> + std::vector, + PreconditionMG>> dof_handler_vector; /** * Storage for the pointers to the DoFHandler objects - * without SmartPointer wrapper. + * without ObserverPointer wrapper. */ std::vector *> dof_handler_vector_raw; /** * The multigrid object. */ - SmartPointer, - PreconditionMG> + ObserverPointer, + PreconditionMG> multigrid; /** * Object for grid transfer. */ - SmartPointer> + ObserverPointer> transfer; /** diff --git a/include/deal.II/non_matching/fe_values.h b/include/deal.II/non_matching/fe_values.h index c3639b3624..cba5b15e97 100644 --- a/include/deal.II/non_matching/fe_values.h +++ b/include/deal.II/non_matching/fe_values.h @@ -322,12 +322,12 @@ namespace NonMatching /** * A pointer to the collection of mappings to be used. */ - const SmartPointer> mapping_collection; + const ObserverPointer> mapping_collection; /** * A pointer to the collection of finite elements to be used. */ - const SmartPointer> fe_collection; + const ObserverPointer> fe_collection; /** * Collection of 1-dimensional quadrature rules that are used by @@ -353,7 +353,7 @@ namespace NonMatching /** * Pointer to the MeshClassifier passed to the constructor. */ - const SmartPointer> mesh_classifier; + const ObserverPointer> mesh_classifier; /** * For each element in the FECollection passed to the constructor, @@ -650,12 +650,12 @@ namespace NonMatching /** * A pointer to the collection of mappings to be used. */ - const SmartPointer> mapping_collection; + const ObserverPointer> mapping_collection; /** * A pointer to the collection of finite elements to be used. */ - const SmartPointer> fe_collection; + const ObserverPointer> fe_collection; /** * Collection of 1-dimensional quadrature rules that are used by @@ -676,7 +676,7 @@ namespace NonMatching /** * Pointer to the MeshClassifier passed to the constructor. */ - const SmartPointer> mesh_classifier; + const ObserverPointer> mesh_classifier; /** * FEInterfaceValues corresponding to cells with LocationToLevelSet diff --git a/include/deal.II/non_matching/mapping_info.h b/include/deal.II/non_matching/mapping_info.h index abedfa67d3..2488167788 100644 --- a/include/deal.II/non_matching/mapping_info.h +++ b/include/deal.II/non_matching/mapping_info.h @@ -52,16 +52,16 @@ namespace NonMatching public: static UpdateFlags required_update_flags( - const SmartPointer> &mapping, - const UpdateFlags &update_flags) + const ObserverPointer> &mapping, + const UpdateFlags &update_flags) { return mapping->requires_update_flags(update_flags); } static void compute_mapping_data_for_quadrature( - const SmartPointer> &mapping, - const UpdateFlags &update_flags_mapping, + const ObserverPointer> &mapping, + const UpdateFlags &update_flags_mapping, const typename Triangulation::cell_iterator &cell, CellSimilarity::Similarity &cell_similarity, const Quadrature &quadrature, @@ -83,8 +83,8 @@ namespace NonMatching static void compute_mapping_data_for_immersed_surface_quadrature( - const SmartPointer> &mapping, - const UpdateFlags &update_flags_mapping, + const ObserverPointer> &mapping, + const UpdateFlags &update_flags_mapping, const typename Triangulation::cell_iterator &cell, const ImmersedSurfaceQuadrature &quadrature, std::unique_ptr::InternalDataBase> @@ -105,8 +105,8 @@ namespace NonMatching static void compute_mapping_data_for_face_quadrature( - const SmartPointer> &mapping, - const UpdateFlags &update_flags_mapping, + const ObserverPointer> &mapping, + const UpdateFlags &update_flags_mapping, const typename Triangulation::cell_iterator &cell, const unsigned int face_no, const Quadrature &quadrature, @@ -654,7 +654,7 @@ namespace NonMatching /** * A pointer to the underlying mapping. */ - const SmartPointer> mapping; + const ObserverPointer> mapping; /** * The desired update flags for the evaluation. @@ -757,7 +757,7 @@ namespace NonMatching * reinit functions. This field is only set if * AdditionalData::store_cells is enabled. */ - SmartPointer> triangulation; + ObserverPointer> triangulation; /** * Level and indices of cells passed to the reinit functions. This diff --git a/include/deal.II/non_matching/mesh_classifier.h b/include/deal.II/non_matching/mesh_classifier.h index e4bab67db6..aa631b135b 100644 --- a/include/deal.II/non_matching/mesh_classifier.h +++ b/include/deal.II/non_matching/mesh_classifier.h @@ -172,7 +172,7 @@ namespace NonMatching /** * Pointer to the triangulation that should be classified. */ - const SmartPointer> triangulation; + const ObserverPointer> triangulation; /** * Pointer to an object that describes what we need to know about the diff --git a/include/deal.II/non_matching/quadrature_generator.h b/include/deal.II/non_matching/quadrature_generator.h index 88191cc890..58ad9d7efa 100644 --- a/include/deal.II/non_matching/quadrature_generator.h +++ b/include/deal.II/non_matching/quadrature_generator.h @@ -946,7 +946,7 @@ namespace NonMatching * One dimensional quadrature rules used to create the immersed * quadratures. */ - const SmartPointer> q_collection1D; + const ObserverPointer> q_collection1D; /** * Stores options/settings for the algorithm. @@ -1057,7 +1057,7 @@ namespace NonMatching * Index of the quadrature in q_collection1d that should use to * generate the immersed quadrature rules. */ - const SmartPointer> q_collection1D; + const ObserverPointer> q_collection1D; /** * Quadratures that the derived classes create. diff --git a/include/deal.II/numerics/cell_data_transfer.h b/include/deal.II/numerics/cell_data_transfer.h index 1316f647fc..7104ae104d 100644 --- a/include/deal.II/numerics/cell_data_transfer.h +++ b/include/deal.II/numerics/cell_data_transfer.h @@ -159,8 +159,8 @@ private: /** * Pointer to the triangulation to work with. */ - SmartPointer, - CellDataTransfer> + ObserverPointer, + CellDataTransfer> triangulation; /** diff --git a/include/deal.II/numerics/data_out_dof_data.h b/include/deal.II/numerics/data_out_dof_data.h index 6ac9eb0d2a..71f8bcec33 100644 --- a/include/deal.II/numerics/data_out_dof_data.h +++ b/include/deal.II/numerics/data_out_dof_data.h @@ -342,7 +342,7 @@ namespace internal /** * Pointer to the DoFHandler object that the vector is based on. */ - SmartPointer> dof_handler; + ObserverPointer> dof_handler; /** * Names of the components of this data vector. @@ -362,7 +362,7 @@ namespace internal * Pointer to a DataPostprocessing object which shall be applied to this * data vector. */ - SmartPointer> postprocessor; + ObserverPointer> postprocessor; /** * Number of output variables this dataset provides (either number of @@ -952,12 +952,12 @@ protected: /** * Pointer to the triangulation object. */ - SmartPointer> triangulation; + ObserverPointer> triangulation; /** * Pointer to the optional handler object. */ - SmartPointer> dofs; + ObserverPointer> dofs; /** * List of data elements with vectors of values for each degree of freedom. diff --git a/include/deal.II/numerics/data_out_dof_data.templates.h b/include/deal.II/numerics/data_out_dof_data.templates.h index 4265f49d1c..8d37296cd5 100644 --- a/include/deal.II/numerics/data_out_dof_data.templates.h +++ b/include/deal.II/numerics/data_out_dof_data.templates.h @@ -1756,10 +1756,10 @@ DataOut_DoFData::attach_dof_handler( Exceptions::DataOutImplementation::ExcOldDataStillPresent()); triangulation = - SmartPointer>(&d.get_triangulation(), - typeid(*this).name()); + ObserverPointer>(&d.get_triangulation(), + typeid(*this).name()); dofs = - SmartPointer>(&d, typeid(*this).name()); + ObserverPointer>(&d, typeid(*this).name()); } @@ -1775,8 +1775,8 @@ DataOut_DoFData::attach_triangulation( Exceptions::DataOutImplementation::ExcOldDataStillPresent()); triangulation = - SmartPointer>(&tria, - typeid(*this).name()); + ObserverPointer>(&tria, + typeid(*this).name()); } @@ -1801,7 +1801,7 @@ DataOut_DoFData::add_data_vector( } else { - triangulation = SmartPointer>( + triangulation = ObserverPointer>( &dof_handler.get_triangulation(), typeid(*this).name()); } @@ -1841,7 +1841,7 @@ DataOut_DoFData:: if (triangulation == nullptr) { Assert(dof_handler != nullptr, ExcInternalError()); - triangulation = SmartPointer>( + triangulation = ObserverPointer>( &dof_handler->get_triangulation(), typeid(*this).name()); } @@ -1981,7 +1981,7 @@ DataOut_DoFData::add_mg_data_vector( &data_component_interpretation_) { if (triangulation == nullptr) - triangulation = SmartPointer>( + triangulation = ObserverPointer>( &dof_handler.get_triangulation(), typeid(*this).name()); Assert(&dof_handler.get_triangulation() == triangulation, diff --git a/include/deal.II/numerics/data_out_resample.h b/include/deal.II/numerics/data_out_resample.h index d69f72c5d7..6a0c86f127 100644 --- a/include/deal.II/numerics/data_out_resample.h +++ b/include/deal.II/numerics/data_out_resample.h @@ -136,7 +136,7 @@ private: /** * Mapping used in connection with patch_tria. */ - const SmartPointer> patch_mapping; + const ObserverPointer> patch_mapping; /** * DataOut object that does the actual building of the patches. @@ -161,7 +161,7 @@ private: /** * Mapping of the original triangulation provided in update_mapping(). */ - SmartPointer> mapping; + ObserverPointer> mapping; }; DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/numerics/data_out_stack.h b/include/deal.II/numerics/data_out_stack.h index 2fd89013d9..6c872564d7 100644 --- a/include/deal.II/numerics/data_out_stack.h +++ b/include/deal.II/numerics/data_out_stack.h @@ -323,7 +323,7 @@ private: * DoF handler to be used for the data corresponding to the present * parameter value. */ - SmartPointer, DataOutStack> + ObserverPointer, DataOutStack> dof_handler; /** diff --git a/include/deal.II/numerics/dof_output_operator.h b/include/deal.II/numerics/dof_output_operator.h index 33bdae55a4..1ff4be52cf 100644 --- a/include/deal.II/numerics/dof_output_operator.h +++ b/include/deal.II/numerics/dof_output_operator.h @@ -65,8 +65,8 @@ namespace Algorithms operator<<(const AnyData &vectors) override; private: - SmartPointer, - DoFOutputOperator> + ObserverPointer, + DoFOutputOperator> dof; const std::string filename_base; diff --git a/include/deal.II/numerics/fe_field_function.h b/include/deal.II/numerics/fe_field_function.h index 79c64f05c2..7c03f719ac 100644 --- a/include/deal.II/numerics/fe_field_function.h +++ b/include/deal.II/numerics/fe_field_function.h @@ -469,8 +469,8 @@ namespace Functions /** * Pointer to the dof handler. */ - SmartPointer, - FEFieldFunction> + ObserverPointer, + FEFieldFunction> dh; /** diff --git a/include/deal.II/numerics/point_value_history.h b/include/deal.II/numerics/point_value_history.h index 8b25b9ed6d..421b1dd633 100644 --- a/include/deal.II/numerics/point_value_history.h +++ b/include/deal.II/numerics/point_value_history.h @@ -634,7 +634,7 @@ private: * A smart pointer to the dof_handler supplied to the constructor. This can * be released by calling @p clear(). */ - SmartPointer, PointValueHistory> dof_handler; + ObserverPointer, PointValueHistory> dof_handler; /** diff --git a/include/deal.II/numerics/solution_transfer.h b/include/deal.II/numerics/solution_transfer.h index 121b3cf7af..512dd66426 100644 --- a/include/deal.II/numerics/solution_transfer.h +++ b/include/deal.II/numerics/solution_transfer.h @@ -415,8 +415,8 @@ private: /** * Pointer to the degree of freedom handler to work with. */ - SmartPointer, - SolutionTransfer> + ObserverPointer, + SolutionTransfer> dof_handler; /** @@ -915,8 +915,8 @@ namespace Legacy /** * Pointer to the degree of freedom handler to work with. */ - SmartPointer, - SolutionTransfer> + ObserverPointer, + SolutionTransfer> dof_handler; /** diff --git a/include/deal.II/numerics/time_dependent.h b/include/deal.II/numerics/time_dependent.h index 0462500b84..e3a7032f1e 100644 --- a/include/deal.II/numerics/time_dependent.h +++ b/include/deal.II/numerics/time_dependent.h @@ -616,7 +616,7 @@ protected: * this object operates on. Note that this object takes possession of the * objects pointed to by the pointers in this collection. */ - std::vector> timesteps; + std::vector> timesteps; /** * Number of the present sweep. This is reset by the @p start_sweep function @@ -1466,14 +1466,14 @@ protected: * the functions @p sleep and @p wake_up to save memory, if such a behavior * is specified in the @p flags structure. */ - SmartPointer, TimeStepBase_Tria> tria; + ObserverPointer, TimeStepBase_Tria> tria; /** * Pointer to a grid which is to be used as the coarse grid for this time * level. This pointer is set through the constructor; ownership remains * with the owner of this management object. */ - SmartPointer, TimeStepBase_Tria> + ObserverPointer, TimeStepBase_Tria> coarse_grid; /** diff --git a/include/deal.II/particles/particle_handler.h b/include/deal.II/particles/particle_handler.h index 482bbd4929..9fbfa813c2 100644 --- a/include/deal.II/particles/particle_handler.h +++ b/include/deal.II/particles/particle_handler.h @@ -877,14 +877,15 @@ namespace Particles /** * Address of the triangulation to work on. */ - SmartPointer, - ParticleHandler> + ObserverPointer, + ParticleHandler> triangulation; /** * Address of the mapping to work on. */ - SmartPointer, ParticleHandler> + ObserverPointer, + ParticleHandler> mapping; /** diff --git a/source/base/subscriptor.cc b/source/base/subscriptor.cc index 7941103184..ece630d2eb 100644 --- a/source/base/subscriptor.cc +++ b/source/base/subscriptor.cc @@ -96,7 +96,7 @@ Subscriptor::check_no_subscribers() const noexcept std::cerr << "---------------------------------------------------------" << std::endl - << "An object pointed to by a SmartPointer is being destroyed." + << "An object pointed to by a ObserverPointer is being destroyed." << std::endl << "Under normal circumstances, this would abort the program." << std::endl diff --git a/source/multigrid/mg_level_global_transfer.cc b/source/multigrid/mg_level_global_transfer.cc index 429561c9dc..34a7b49a1e 100644 --- a/source/multigrid/mg_level_global_transfer.cc +++ b/source/multigrid/mg_level_global_transfer.cc @@ -161,7 +161,7 @@ namespace void fill_internal( const DoFHandler &mg_dof, - SmartPointer mg_constrained_dofs, + ObserverPointer mg_constrained_dofs, const MPI_Comm mpi_communicator, const bool transfer_solution_vectors, std::vector> ©_indices, diff --git a/source/non_matching/mesh_classifier.cc b/source/non_matching/mesh_classifier.cc index 1c653b6c26..8978857c1e 100644 --- a/source/non_matching/mesh_classifier.cc +++ b/source/non_matching/mesh_classifier.cc @@ -120,13 +120,13 @@ namespace NonMatching /** * Pointer to the DoFHandler associated with the level set function. */ - const SmartPointer> dof_handler; + const ObserverPointer> dof_handler; /** * Pointer to the vector containing the level set function's global dof * values. */ - const SmartPointer level_set; + const ObserverPointer level_set; }; @@ -229,7 +229,7 @@ namespace NonMatching /** * Pointer to the level set function. */ - const SmartPointer> level_set; + const ObserverPointer> level_set; /** * Collection containing the single element which we locally interpolate diff --git a/source/non_matching/quadrature_generator.cc b/source/non_matching/quadrature_generator.cc index 0558999688..d8bd93cde0 100644 --- a/source/non_matching/quadrature_generator.cc +++ b/source/non_matching/quadrature_generator.cc @@ -1414,19 +1414,19 @@ namespace NonMatching /** * Pointer to the DoFHandler passed to the constructor. */ - const SmartPointer> dof_handler; + const ObserverPointer> dof_handler; /** * Pointer to the vector of solution coefficients passed to the * constructor. */ - const SmartPointer global_dof_values; + const ObserverPointer global_dof_values; /** * Pointer to the element associated with the cell in the last call to * set_active_cell(). */ - SmartPointer> element; + ObserverPointer> element; /** * DOF-indices of the cell in the last call to set_active_cell(). diff --git a/source/numerics/time_dependent.cc b/source/numerics/time_dependent.cc index 89b0a8652f..e5f4b8cfbf 100644 --- a/source/numerics/time_dependent.cc +++ b/source/numerics/time_dependent.cc @@ -98,7 +98,7 @@ TimeDependent::insert_timestep(const TimeStepBase *position, else { // inner time step - const std::vector>::iterator + const std::vector>::iterator insert_position = std::find(timesteps.begin(), timesteps.end(), position); // check iterators again to satisfy coverity: both insert_position and @@ -136,7 +136,7 @@ TimeDependent::delete_timestep(const unsigned int position) // Remember time step object for // later deletion and unlock - // SmartPointer + // ObserverPointer TimeStepBase *t = timesteps[position]; timesteps[position] = nullptr; // Now delete unsubscribed object @@ -153,14 +153,15 @@ TimeDependent::delete_timestep(const unsigned int position) timesteps[position - 1]->set_next_timestep( (position < timesteps.size()) ? timesteps[position] : - /*null*/ SmartPointer()); + /*null*/ ObserverPointer()); // same for "previous" pointer of next // time step if (position < timesteps.size()) timesteps[position]->set_previous_timestep( - (position != 0) ? timesteps[position - 1] : - /*null*/ SmartPointer()); + (position != 0) ? + timesteps[position - 1] : + /*null*/ ObserverPointer()); } diff --git a/tests/algorithms/newton_01.cc b/tests/algorithms/newton_01.cc index 69600b9097..f7a1d452b1 100644 --- a/tests/algorithms/newton_01.cc +++ b/tests/algorithms/newton_01.cc @@ -37,7 +37,7 @@ public: class SquareRootResidual : public Algorithms::OperatorBase { - SmartPointer discretization; + ObserverPointer discretization; public: SquareRootResidual(SquareRoot &problem) @@ -53,7 +53,7 @@ public: class SquareRootSolver : public Algorithms::OperatorBase { - SmartPointer solver; + ObserverPointer solver; public: SquareRootSolver(SquareRoot &problem) diff --git a/tests/algorithms/newton_02.cc b/tests/algorithms/newton_02.cc index a6d1429f47..da1a106b7b 100644 --- a/tests/algorithms/newton_02.cc +++ b/tests/algorithms/newton_02.cc @@ -58,7 +58,8 @@ public: } private: - SmartPointer, TestOutputOperator> dof; + ObserverPointer, TestOutputOperator> + dof; }; class ZeroResidual : public Algorithms::OperatorBase diff --git a/tests/algorithms/theta_01.cc b/tests/algorithms/theta_01.cc index 2977b32b60..c33f4fc56c 100644 --- a/tests/algorithms/theta_01.cc +++ b/tests/algorithms/theta_01.cc @@ -36,8 +36,8 @@ public: operator()(AnyData &out, const AnyData &in); private: - SmartPointer, Explicit> matrix; - FullMatrix m; + ObserverPointer, Explicit> matrix; + FullMatrix m; }; @@ -49,8 +49,8 @@ public: operator()(AnyData &out, const AnyData &in); private: - SmartPointer, Implicit> matrix; - FullMatrix m; + ObserverPointer, Implicit> matrix; + FullMatrix m; }; // End of declarations diff --git a/tests/base/assign_subscriptor.cc b/tests/base/assign_subscriptor.cc index f52101597c..f81fe4165c 100644 --- a/tests/base/assign_subscriptor.cc +++ b/tests/base/assign_subscriptor.cc @@ -14,7 +14,7 @@ -// Check the behavior of the SmartPointer-Subscriptor pair +// Check the behavior of the ObserverPointer-Subscriptor pair // for copy and move semantics. @@ -39,10 +39,10 @@ main() { deallog << "Checking copy assignment" << std::endl; - Subscriptor subscriptor_1; - Subscriptor subscriptor_2; - SmartPointer smart_pointer_1(&subscriptor_1); - SmartPointer smart_pointer_2(&subscriptor_2); + Subscriptor subscriptor_1; + Subscriptor subscriptor_2; + ObserverPointer smart_pointer_1(&subscriptor_1); + ObserverPointer smart_pointer_2(&subscriptor_2); subscriptor_2 = subscriptor_1; @@ -73,8 +73,8 @@ main() { deallog << "Checking copy construction" << std::endl; - Subscriptor subscriptor_1; - SmartPointer smart_pointer_1(&subscriptor_1); + Subscriptor subscriptor_1; + ObserverPointer smart_pointer_1(&subscriptor_1); Subscriptor subscriptor_2(subscriptor_1); @@ -94,10 +94,10 @@ main() { deallog << "Checking move assignment" << std::endl; - Subscriptor subscriptor_1; - Subscriptor subscriptor_2; - SmartPointer smart_pointer_1(&subscriptor_1); - SmartPointer smart_pointer_2(&subscriptor_2); + Subscriptor subscriptor_1; + Subscriptor subscriptor_2; + ObserverPointer smart_pointer_1(&subscriptor_1); + ObserverPointer smart_pointer_2(&subscriptor_2); subscriptor_2 = std::move(subscriptor_1); @@ -128,8 +128,8 @@ main() { deallog << "Checking move construction" << std::endl; - Subscriptor subscriptor_1; - SmartPointer smart_pointer_1(&subscriptor_1); + Subscriptor subscriptor_1; + ObserverPointer smart_pointer_1(&subscriptor_1); Subscriptor subscriptor_2(std::move(subscriptor_1)); diff --git a/tests/base/reference.cc b/tests/base/reference.cc index ef6f52c294..c29110f66e 100644 --- a/tests/base/reference.cc +++ b/tests/base/reference.cc @@ -14,8 +14,8 @@ -// check that SmartPointers preserve constness etc of the objects they -// point to, through assignment of SmartPointers to each other and +// check that ObserverPointers preserve constness etc of the objects they +// point to, through assignment of ObserverPointers to each other and // other tests. @@ -70,11 +70,11 @@ main() Test a("A"); const Test &b("B"); - SmartPointer r(&a, "Test R"); - SmartPointer s(&a, "const Test S"); - // SmartPointer t=&b; // this one should not work - SmartPointer t(const_cast(&b), "Test T"); - SmartPointer u(&b, "const Test"); + ObserverPointer r(&a, "Test R"); + ObserverPointer s(&a, "const Test S"); + // ObserverPointer t=&b; // this one should not work + ObserverPointer t(const_cast(&b), "Test T"); + ObserverPointer u(&b, "const Test"); deallog << "a "; diff --git a/tests/base/smart_pointer_01.cc b/tests/base/smart_pointer_01.cc index 7b61efc635..d51956d6e4 100644 --- a/tests/base/smart_pointer_01.cc +++ b/tests/base/smart_pointer_01.cc @@ -14,7 +14,7 @@ -// Check that it is possible to put SmartPointer objects into a +// Check that it is possible to put ObserverPointer objects into a // std::any object. @@ -36,7 +36,7 @@ main() { initlog(); - Test t; - SmartPointer r(&t); - std::any a = r; + Test t; + ObserverPointer r(&t); + std::any a = r; } diff --git a/tests/bits/joa_1.cc b/tests/bits/joa_1.cc index 0d50e6d87b..bf9bab069a 100644 --- a/tests/bits/joa_1.cc +++ b/tests/bits/joa_1.cc @@ -288,7 +288,7 @@ LaplaceProblem::LaplaceProblem() // finite element object which counts // how many objects use that finite // element (this is what the -// Subscriptor/SmartPointer +// Subscriptor/ObserverPointer // class pair is used for, in case // you want something like this for // your own programs; see step-7 for diff --git a/tests/bits/sparse_lu_decomposition_1.cc b/tests/bits/sparse_lu_decomposition_1.cc index 163136c9ca..07bbe7663e 100644 --- a/tests/bits/sparse_lu_decomposition_1.cc +++ b/tests/bits/sparse_lu_decomposition_1.cc @@ -16,7 +16,7 @@ // this file didn't compile at one point in time due to the private // inheritance of SparseMatrix by SparseLUDecomposition, and the // associated lack of accessibility of the Subscriptor functions to -// the SmartPointer +// the ObserverPointer // // it was fixed around 2003-05-22 @@ -34,7 +34,7 @@ main() { initlog(); - SmartPointer> sparse_decomp; + ObserverPointer> sparse_decomp; deallog << "OK" << std::endl; diff --git a/tests/bits/step-13.cc b/tests/bits/step-13.cc index 6ee0dd4f32..32f2fccbb2 100644 --- a/tests/bits/step-13.cc +++ b/tests/bits/step-13.cc @@ -220,7 +220,7 @@ namespace LaplaceSolver n_dofs() const = 0; protected: - const SmartPointer> triangulation; + const ObserverPointer> triangulation; }; @@ -256,11 +256,11 @@ namespace LaplaceSolver n_dofs() const; protected: - const SmartPointer> fe; - const SmartPointer> quadrature; - DoFHandler dof_handler; - Vector solution; - const SmartPointer> boundary_values; + const ObserverPointer> fe; + const ObserverPointer> quadrature; + DoFHandler dof_handler; + Vector solution; + const ObserverPointer> boundary_values; virtual void assemble_rhs(Vector &rhs) const = 0; @@ -490,7 +490,7 @@ namespace LaplaceSolver const Function &boundary_values); protected: - const SmartPointer> rhs_function; + const ObserverPointer> rhs_function; virtual void assemble_rhs(Vector &rhs) const; }; diff --git a/tests/bits/step-14.cc b/tests/bits/step-14.cc index 0d173ed238..7f744fa638 100644 --- a/tests/bits/step-14.cc +++ b/tests/bits/step-14.cc @@ -287,7 +287,7 @@ namespace LaplaceSolver output_solution() const = 0; protected: - const SmartPointer> triangulation; + const ObserverPointer> triangulation; unsigned int refinement_cycle; }; @@ -335,12 +335,12 @@ namespace LaplaceSolver n_dofs() const; protected: - const SmartPointer> fe; - const SmartPointer> quadrature; - const SmartPointer> face_quadrature; - DoFHandler dof_handler; - Vector solution; - const SmartPointer> boundary_values; + const ObserverPointer> fe; + const ObserverPointer> quadrature; + const ObserverPointer> face_quadrature; + DoFHandler dof_handler; + Vector solution; + const ObserverPointer> boundary_values; virtual void assemble_rhs(Vector &rhs) const = 0; @@ -581,7 +581,7 @@ namespace LaplaceSolver output_solution() const; protected: - const SmartPointer> rhs_function; + const ObserverPointer> rhs_function; virtual void assemble_rhs(Vector &rhs) const; @@ -808,7 +808,7 @@ namespace LaplaceSolver refine_grid(); private: - const SmartPointer> weighting_function; + const ObserverPointer> weighting_function; }; @@ -1254,7 +1254,7 @@ namespace LaplaceSolver postprocess(const Evaluation::EvaluationBase &postprocessor) const; protected: - const SmartPointer> + const ObserverPointer> dual_functional; virtual void assemble_rhs(Vector &rhs) const; @@ -1362,8 +1362,8 @@ namespace LaplaceSolver struct CellData { - FEValues fe_values; - const SmartPointer> right_hand_side; + FEValues fe_values; + const ObserverPointer> right_hand_side; std::vector cell_residual; std::vector rhs_values; @@ -1911,7 +1911,7 @@ public: unsigned int primal_fe_degree; unsigned int dual_fe_degree; - SmartPointer> data; + ObserverPointer> data; enum RefinementCriterion { @@ -1923,11 +1923,12 @@ public: RefinementCriterion refinement_criterion; - SmartPointer> dual_functional; + ObserverPointer> + dual_functional; EvaluatorList evaluator_list; - SmartPointer> kelly_weight; + ObserverPointer> kelly_weight; unsigned int max_degrees_of_freedom; diff --git a/tests/bits/step-7.cc b/tests/bits/step-7.cc index 82ce1787d6..07a7a7fdd4 100644 --- a/tests/bits/step-7.cc +++ b/tests/bits/step-7.cc @@ -202,7 +202,7 @@ private: Triangulation triangulation; DoFHandler dof_handler; - SmartPointer> fe; + ObserverPointer> fe; AffineConstraints hanging_node_constraints; diff --git a/tests/codim_one/bem_integration.cc b/tests/codim_one/bem_integration.cc index 884b4d5dbd..e25e5bac03 100644 --- a/tests/codim_one/bem_integration.cc +++ b/tests/codim_one/bem_integration.cc @@ -86,7 +86,7 @@ private: double term_D(const Tensor<1, 3> &r, const Tensor<1, 3> &a1, const Tensor<1, 3> &a2); - SmartPointer> fe_values; + ObserverPointer> fe_values; }; template <> diff --git a/tests/dofs/dof_handler_redistributed_dofs_01.cc b/tests/dofs/dof_handler_redistributed_dofs_01.cc index 65f5e1f841..857173b157 100644 --- a/tests/dofs/dof_handler_redistributed_dofs_01.cc +++ b/tests/dofs/dof_handler_redistributed_dofs_01.cc @@ -39,7 +39,7 @@ main() DoFHandler dh(tria); dh.distribute_dofs(fe); - SmartPointer> fe_p(&dh.get_fe()); + ObserverPointer> fe_p(&dh.get_fe()); dh.distribute_dofs(*fe_p); diff --git a/tests/dofs/dof_handler_redistributed_dofs_02.cc b/tests/dofs/dof_handler_redistributed_dofs_02.cc index 96a23e0cc7..12947df1a5 100644 --- a/tests/dofs/dof_handler_redistributed_dofs_02.cc +++ b/tests/dofs/dof_handler_redistributed_dofs_02.cc @@ -40,7 +40,7 @@ main() DoFHandler dh(tria); dh.distribute_dofs(fe_collection); - SmartPointer> fe_p( + ObserverPointer> fe_p( &dh.get_fe_collection()); dh.distribute_dofs(*fe_p); diff --git a/tests/fe/fe_conformity_test.h b/tests/fe/fe_conformity_test.h index 27326e4958..9859c9027b 100644 --- a/tests/fe/fe_conformity_test.h +++ b/tests/fe/fe_conformity_test.h @@ -86,10 +86,10 @@ namespace FEConforimityTest const Vector &dof_vector, std::vector &jumps); - SmartPointer> fe_ptr; - Triangulation triangulation; - DoFHandler dof_handler; - AffineConstraints constraints; + ObserverPointer> fe_ptr; + Triangulation triangulation; + DoFHandler dof_handler; + AffineConstraints constraints; Vector random_fe_function; diff --git a/tests/fe/fe_q_dg0.cc b/tests/fe/fe_q_dg0.cc index 885b22ad98..634fc10468 100644 --- a/tests/fe/fe_q_dg0.cc +++ b/tests/fe/fe_q_dg0.cc @@ -321,8 +321,8 @@ namespace Step22 vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; }; @@ -364,8 +364,8 @@ namespace Step22 vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer> system_matrix; - const SmartPointer< + const ObserverPointer> system_matrix; + const ObserverPointer< const InverseMatrix, Preconditioner>> A_inverse; diff --git a/tests/hp/step-13.cc b/tests/hp/step-13.cc index dbe212f3c2..4581a8b4c2 100644 --- a/tests/hp/step-13.cc +++ b/tests/hp/step-13.cc @@ -222,7 +222,7 @@ namespace LaplaceSolver n_dofs() const = 0; protected: - const SmartPointer> triangulation; + const ObserverPointer> triangulation; }; @@ -258,11 +258,11 @@ namespace LaplaceSolver n_dofs() const; protected: - const SmartPointer> fe; - const SmartPointer> quadrature; - DoFHandler dof_handler; - Vector solution; - const SmartPointer> boundary_values; + const ObserverPointer> fe; + const ObserverPointer> quadrature; + DoFHandler dof_handler; + Vector solution; + const ObserverPointer> boundary_values; virtual void assemble_rhs(Vector &rhs) const = 0; @@ -493,7 +493,7 @@ namespace LaplaceSolver const Function &boundary_values); protected: - const SmartPointer> rhs_function; + const ObserverPointer> rhs_function; virtual void assemble_rhs(Vector &rhs) const; }; diff --git a/tests/hp/step-7.cc b/tests/hp/step-7.cc index 0650e19571..944f4599d2 100644 --- a/tests/hp/step-7.cc +++ b/tests/hp/step-7.cc @@ -204,7 +204,7 @@ private: Triangulation triangulation; DoFHandler dof_handler; - SmartPointer> fe; + ObserverPointer> fe; AffineConstraints hanging_node_constraints; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_01.cc b/tests/matrix_free/parallel_multigrid_adaptive_01.cc index b2964b5456..3f2385974e 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_01.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_01.cc @@ -424,7 +424,7 @@ public: } private: - SmartPointer laplace; + ObserverPointer laplace; }; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_03.cc b/tests/matrix_free/parallel_multigrid_adaptive_03.cc index f98533a34c..133f3d61f4 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_03.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_03.cc @@ -436,7 +436,7 @@ public: } private: - SmartPointer laplace; + ObserverPointer laplace; }; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_05.cc b/tests/matrix_free/parallel_multigrid_adaptive_05.cc index b6c16cb3a0..d069070542 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_05.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_05.cc @@ -433,7 +433,7 @@ public: } private: - SmartPointer laplace; + ObserverPointer laplace; }; diff --git a/tests/mpi/muelu_periodicity.cc b/tests/mpi/muelu_periodicity.cc index b3322d8ca8..3abb0d92e9 100644 --- a/tests/mpi/muelu_periodicity.cc +++ b/tests/mpi/muelu_periodicity.cc @@ -193,8 +193,8 @@ namespace Step22 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; mutable TrilinosWrappers::MPI::Vector tmp; }; @@ -249,8 +249,9 @@ namespace Step22 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer system_matrix; - const SmartPointer< + const ObserverPointer + system_matrix; + const ObserverPointer< const InverseMatrix> A_inverse; mutable TrilinosWrappers::MPI::Vector tmp1, tmp2; diff --git a/tests/mpi/periodicity_02.cc b/tests/mpi/periodicity_02.cc index c50a6ad665..f2900e1060 100644 --- a/tests/mpi/periodicity_02.cc +++ b/tests/mpi/periodicity_02.cc @@ -196,8 +196,8 @@ namespace Step22 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; mutable TrilinosWrappers::MPI::Vector tmp; }; @@ -252,8 +252,9 @@ namespace Step22 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer system_matrix; - const SmartPointer< + const ObserverPointer + system_matrix; + const ObserverPointer< const InverseMatrix> A_inverse; mutable TrilinosWrappers::MPI::Vector tmp1, tmp2; diff --git a/tests/mpi/periodicity_03.cc b/tests/mpi/periodicity_03.cc index 6a58d91282..97145887fd 100644 --- a/tests/mpi/periodicity_03.cc +++ b/tests/mpi/periodicity_03.cc @@ -118,8 +118,8 @@ namespace Step22 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; mutable TrilinosWrappers::MPI::Vector tmp; }; @@ -172,8 +172,9 @@ namespace Step22 const TrilinosWrappers::MPI::Vector &src) const; private: - const SmartPointer system_matrix; - const SmartPointer< + const ObserverPointer + system_matrix; + const ObserverPointer< const InverseMatrix> A_inverse; mutable TrilinosWrappers::MPI::Vector tmp1, tmp2; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc index a738e047ab..7f36689221 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc @@ -424,7 +424,7 @@ public: } private: - SmartPointer laplace; + ObserverPointer laplace; }; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc index 866000a59b..0cdc6ccecb 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc @@ -436,7 +436,7 @@ public: } private: - SmartPointer laplace; + ObserverPointer laplace; }; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc index 8996fe80ff..8f0d4851c6 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc @@ -433,7 +433,7 @@ public: } private: - SmartPointer laplace; + ObserverPointer laplace; }; diff --git a/tests/non_matching/fe_immersed_surface_values.cc b/tests/non_matching/fe_immersed_surface_values.cc index 74ec9fd973..ba8133b504 100644 --- a/tests/non_matching/fe_immersed_surface_values.cc +++ b/tests/non_matching/fe_immersed_surface_values.cc @@ -93,7 +93,7 @@ private: const FE_Q element; Triangulation triangulation; DoFHandler dof_handler; - const SmartPointer> mapping; + const ObserverPointer> mapping; NonMatching::ImmersedSurfaceQuadrature quadrature; }; diff --git a/tests/performance/instrumentation_step_22.cc b/tests/performance/instrumentation_step_22.cc index a6f70152f7..022cd1cbc2 100644 --- a/tests/performance/instrumentation_step_22.cc +++ b/tests/performance/instrumentation_step_22.cc @@ -213,8 +213,8 @@ public: vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; }; @@ -254,8 +254,8 @@ public: vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer> system_matrix; - const SmartPointer< + const ObserverPointer> system_matrix; + const ObserverPointer< const InverseMatrix, PreconditionerType>> A_inverse; diff --git a/tests/performance/timing_mg_glob_coarsen.cc b/tests/performance/timing_mg_glob_coarsen.cc index 5e900aada6..95c416e3b1 100644 --- a/tests/performance/timing_mg_glob_coarsen.cc +++ b/tests/performance/timing_mg_glob_coarsen.cc @@ -303,8 +303,8 @@ public: } private: - SmartPointer> coarse_smooth; - const std::vector *constrained_dofs; + ObserverPointer> coarse_smooth; + const std::vector *constrained_dofs; mutable VectorType src_copy; }; diff --git a/tests/performance/timing_step_22.cc b/tests/performance/timing_step_22.cc index 4df5021b48..0a0a9f60c6 100644 --- a/tests/performance/timing_step_22.cc +++ b/tests/performance/timing_step_22.cc @@ -211,8 +211,8 @@ public: vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer matrix; - const SmartPointer preconditioner; + const ObserverPointer matrix; + const ObserverPointer preconditioner; }; @@ -252,8 +252,8 @@ public: vmult(Vector &dst, const Vector &src) const; private: - const SmartPointer> system_matrix; - const SmartPointer< + const ObserverPointer> system_matrix; + const ObserverPointer< const InverseMatrix, PreconditionerType>> A_inverse; diff --git a/tests/simplex/step-07.cc b/tests/simplex/step-07.cc index 6925de738e..894a94ced6 100644 --- a/tests/simplex/step-07.cc +++ b/tests/simplex/step-07.cc @@ -209,7 +209,7 @@ namespace Step7 Triangulation triangulation; DoFHandler dof_handler; - SmartPointer> fe; + ObserverPointer> fe; AffineConstraints hanging_node_constraints; diff --git a/tests/simplex/step-31.cc b/tests/simplex/step-31.cc index 465cb37b48..1c609ce6e3 100644 --- a/tests/simplex/step-31.cc +++ b/tests/simplex/step-31.cc @@ -139,8 +139,8 @@ namespace Step31 vmult(VectorType &dst, const VectorType &src) const; private: - const SmartPointer matrix; - const PreconditionerType &preconditioner; + const ObserverPointer matrix; + const PreconditionerType &preconditioner; }; template InverseMatrix::InverseMatrix( @@ -182,10 +182,10 @@ namespace Step31 const TrilinosWrappers::MPI::BlockVector &src) const; private: - const SmartPointer + const ObserverPointer stokes_matrix; - const SmartPointer> + const ObserverPointer> m_inverse; const PreconditionerTypeA &a_preconditioner; mutable TrilinosWrappers::MPI::Vector tmp; diff --git a/tests/simplex/step-55.cc b/tests/simplex/step-55.cc index 26cc9c9c32..3535122595 100644 --- a/tests/simplex/step-55.cc +++ b/tests/simplex/step-55.cc @@ -128,8 +128,8 @@ namespace Step55 vmult(VectorType &dst, const VectorType &src) const; private: - const SmartPointer matrix; - const Preconditioner &preconditioner; + const ObserverPointer matrix; + const Preconditioner &preconditioner; }; -- 2.39.5