From: Wolfgang Bangerth Date: Wed, 11 Sep 2024 22:39:44 +0000 (-0600) Subject: Rename Subscriptor -> EnableRefCountingByObserverPointer. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f9b811c22076dbada8f71ca6fe660e77ccdc465;p=dealii.git Rename Subscriptor -> EnableRefCountingByObserverPointer. --- diff --git a/doc/doxygen/headers/coding_conventions.h b/doc/doxygen/headers/coding_conventions.h index 92df3f8a94..d227f02117 100644 --- a/doc/doxygen/headers/coding_conventions.h +++ b/doc/doxygen/headers/coding_conventions.h @@ -211,7 +211,7 @@ functions with their own user-defined types by including the .templates.h files.
  • Finally, if we can not assume in advance which values template arguments -will take (e.g., any class derived from Subscriptor can be used as an argument), +will take (e.g., any class derived from EnableRefCountingByObserverPointer can be used as an argument), the definitions of functions are provided at the bottom of the header file with declarations. The definitions should be guarded with \#ifndef DOXYGEN ... \#endif to prevent Doxygen from picking them up.
  • diff --git a/doc/doxygen/headers/memory.h b/doc/doxygen/headers/memory.h index af44b75f58..fd833ff8c6 100644 --- a/doc/doxygen/headers/memory.h +++ b/doc/doxygen/headers/memory.h @@ -17,7 +17,7 @@ * @defgroup memory Memory handling * * This group has some basic classes and namespaces for memory - * handling. The Subscriptor and ObserverPointer classes are used for + * handling. The EnableRefCountingByObserverPointer 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, diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index bf57bc6b01..9afa6e3c1c 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -1052,9 +1052,10 @@ namespace Step14 // Based on the above description, the SetUpBase class then // looks as follows. To allow using the ObserverPointer class - // with this class, we derived from the Subscriptor class. + // with this class, we derived from the + // EnableRefCountingByObserverPointer class. template - struct SetUpBase : public Subscriptor + struct SetUpBase : public EnableRefCountingByObserverPointer { virtual const Function &get_boundary_values() const = 0; @@ -1383,7 +1384,7 @@ namespace Step14 // the right hand side, we only need to provide for a function that // assembles the right hand side for a given discretization: template - class DualFunctionalBase : public Subscriptor + class DualFunctionalBase : public EnableRefCountingByObserverPointer { public: virtual void assemble_rhs(const DoFHandler &dof_handler, diff --git a/examples/step-21/step-21.cc b/examples/step-21/step-21.cc index 589fd2f20e..97719ad2e0 100644 --- a/examples/step-21/step-21.cc +++ b/examples/step-21/step-21.cc @@ -409,7 +409,7 @@ namespace Step21 // maximum number of iterations equal to the maximum of the size of the linear // system and 200. template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m) @@ -433,7 +433,7 @@ namespace Step21 - class SchurComplement : public Subscriptor + class SchurComplement : public EnableRefCountingByObserverPointer { public: SchurComplement(const BlockSparseMatrix &A, @@ -460,7 +460,7 @@ namespace Step21 - class ApproximateSchurComplement : public Subscriptor + class ApproximateSchurComplement : public EnableRefCountingByObserverPointer { public: ApproximateSchurComplement(const BlockSparseMatrix &A) diff --git a/examples/step-22/doc/results.dox b/examples/step-22/doc/results.dox index 0aba8a21ad..0323ad696c 100644 --- a/examples/step-22/doc/results.dox +++ b/examples/step-22/doc/results.dox @@ -407,7 +407,7 @@ according to the derivation above can be specified by three successive operations: @code template -class BlockSchurPreconditioner : public Subscriptor +class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner (const BlockSparseMatrix &S, diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index 22634bd4cb..4c78dbc887 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -279,7 +279,7 @@ namespace Step22 // InverseMatrix object is created. The member function // vmult is obtained by solving a linear system: template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m, @@ -337,7 +337,7 @@ namespace Step22 // a preconditioner class as above, which affects the // ObserverPointer object m_inverse as well. template - class SchurComplement : public Subscriptor + class SchurComplement : public EnableRefCountingByObserverPointer { public: SchurComplement( diff --git a/examples/step-29/step-29.cc b/examples/step-29/step-29.cc index 527197bf6c..89ed4ec590 100644 --- a/examples/step-29/step-29.cc +++ b/examples/step-29/step-29.cc @@ -123,7 +123,7 @@ namespace Step29 // declare_parameters that declares all the necessary // parameters and a read_parameters function that is called // from outside to initiate the parameter reading process. - class ParameterReader : public Subscriptor + class ParameterReader : public EnableRefCountingByObserverPointer { public: ParameterReader(ParameterHandler &); diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 4181ce8650..76411eaf62 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -242,7 +242,7 @@ namespace Step31 // we can abort the program preserving information about where the // problem happened. template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m, @@ -342,7 +342,7 @@ namespace Step31 // preconditioners in the constructor and that the matrices we use here // are built upon Trilinos: template - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner( diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index 0b78838c35..81c8897727 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -224,7 +224,7 @@ namespace Step32 namespace LinearSolvers { template - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner(const TrilinosWrappers::BlockSparseMatrix &S, diff --git a/examples/step-37/step-37.cc b/examples/step-37/step-37.cc index be812ae91f..b109dc2255 100644 --- a/examples/step-37/step-37.cc +++ b/examples/step-37/step-37.cc @@ -245,9 +245,9 @@ namespace Step37 // This is the constructor of the @p LaplaceOperator class. All it does is // to call the default constructor of the base class - // MatrixFreeOperators::Base, which in turn is based on the Subscriptor - // class that asserts that this class is not accessed after going out of scope - // e.g. in a preconditioner. + // MatrixFreeOperators::Base, which in turn is based on the + // EnableRefCountingByObserverPointer class that asserts that this class is + // not accessed after going out of scope e.g. in a preconditioner. template LaplaceOperator::LaplaceOperator() : MatrixFreeOperators::Baseclear() // was called for the level matrices, since the matrices lock the sparsity - // pattern through the ObserverPointer and Subscriptor mechanism. + // pattern through the ObserverPointer and + // EnableRefCountingByObserverPointer 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 036e32f792..76f807ff6f 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -318,7 +318,7 @@ namespace Step43 namespace LinearSolvers { template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m, @@ -366,7 +366,7 @@ namespace Step43 } template - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner( diff --git a/examples/step-45/step-45.cc b/examples/step-45/step-45.cc index 9cd59e495a..5d1f56db0e 100644 --- a/examples/step-45/step-45.cc +++ b/examples/step-45/step-45.cc @@ -185,7 +185,7 @@ namespace Step45 template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m, diff --git a/examples/step-55/step-55.cc b/examples/step-55/step-55.cc index ec65240c80..8577068aa8 100644 --- a/examples/step-55/step-55.cc +++ b/examples/step-55/step-55.cc @@ -97,7 +97,7 @@ namespace Step55 // step-31 to convert a run-time exception into a failed assertion // should the inner solver not converge. template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const Matrix &m, const Preconditioner &preconditioner); @@ -145,7 +145,8 @@ namespace Step55 // The class A template class for a simple block diagonal preconditioner // for 2x2 matrices. template - class BlockDiagonalPreconditioner : public Subscriptor + class BlockDiagonalPreconditioner + : public EnableRefCountingByObserverPointer { public: BlockDiagonalPreconditioner(const PreconditionerA &preconditioner_A, diff --git a/examples/step-56/step-56.cc b/examples/step-56/step-56.cc index 6eb6cba25a..a047f5e1d4 100644 --- a/examples/step-56/step-56.cc +++ b/examples/step-56/step-56.cc @@ -301,7 +301,7 @@ namespace Step56 // Notice how we keep track of the sum of the inner iterations // (preconditioner applications). template - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner( diff --git a/examples/step-57/step-57.cc b/examples/step-57/step-57.cc index 68f03e665d..2a779e0aa4 100644 --- a/examples/step-57/step-57.cc +++ b/examples/step-57/step-57.cc @@ -182,7 +182,7 @@ namespace Step57 // positive definite, we can use CG to solve the corresponding linear // system. template - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner(double gamma, diff --git a/examples/step-59/step-59.cc b/examples/step-59/step-59.cc index e6b128af1c..f0490e671a 100644 --- a/examples/step-59/step-59.cc +++ b/examples/step-59/step-59.cc @@ -147,9 +147,9 @@ namespace Step59 // MatrixFreeOperators::Base because we want to present some additional // features of MatrixFree::loop() that are not available in the // 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 ObserverPointer. + // the EnableRefCountingByObserverPointer class to be able to use the operator + // within the Chebyshev preconditioner because that preconditioner stores the + // underlying matrix 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, @@ -160,7 +160,7 @@ namespace Step59 // step-39. template - class LaplaceOperator : public Subscriptor + class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/examples/step-64/step-64.cc b/examples/step-64/step-64.cc index 30a68604aa..8a7004b056 100644 --- a/examples/step-64/step-64.cc +++ b/examples/step-64/step-64.cc @@ -246,7 +246,7 @@ namespace Step64 // needs to have a `vmult()` function that performs the action of // the linear operator on a source vector. template - class HelmholtzOperator : public Subscriptor + class HelmholtzOperator : public EnableRefCountingByObserverPointer { public: HelmholtzOperator(const DoFHandler &dof_handler, diff --git a/examples/step-66/step-66.cc b/examples/step-66/step-66.cc index f0840377bf..23b47e5628 100644 --- a/examples/step-66/step-66.cc +++ b/examples/step-66/step-66.cc @@ -151,7 +151,7 @@ namespace Step66 // The constructor of the JacobianOperator just calls the // constructor of the base class MatrixFreeOperators::Base, which is itself - // derived from the Subscriptor class. + // derived from the EnableRefCountingByObserverPointer class. template JacobianOperator::JacobianOperator() : MatrixFreeOperators::Base - class LaplaceOperator : public Subscriptor + class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using VectorType = LinearAlgebra::distributed::Vector; diff --git a/examples/step-83/doc/intro.dox b/examples/step-83/doc/intro.dox index c7ece4db05..e2a5be2fdd 100644 --- a/examples/step-83/doc/intro.dox +++ b/examples/step-83/doc/intro.dox @@ -190,7 +190,7 @@ writes into the `values` member variable. If the class had more member variables, one would list them one after the other. The same is true if a class has base classes. For example, here is the corresponding function for the Quadrature class that stores quadrature points and -weights, and is derived from the Subscriptor base class: +weights, and is derived from the EnableRefCountingByObserverPointer base class: @code template template @@ -198,7 +198,7 @@ inline void Quadrature::serialize(Archive &ar, const unsigned int) { // Forward to the (de)serialization function in the base class: - ar & static_cast(*this); + ar & static_cast(*this); // Then (de)serialize the member variables: ar & quadrature_points & weights; diff --git a/include/deal.II/algorithms/any_data.h b/include/deal.II/algorithms/any_data.h index b1e257a020..05a1409c02 100644 --- a/include/deal.II/algorithms/any_data.h +++ b/include/deal.II/algorithms/any_data.h @@ -32,7 +32,7 @@ DEAL_II_NAMESPACE_OPEN * * @todo GK: Deprecate access to AnyData by index and change to a map. */ -class AnyData : public Subscriptor +class AnyData : public EnableRefCountingByObserverPointer { public: /// Default constructor for empty object diff --git a/include/deal.II/algorithms/general_data_storage.h b/include/deal.II/algorithms/general_data_storage.h index 04ae26bbe7..ac00548887 100644 --- a/include/deal.II/algorithms/general_data_storage.h +++ b/include/deal.II/algorithms/general_data_storage.h @@ -38,7 +38,7 @@ DEAL_II_NAMESPACE_OPEN * * When using this class, please cite @cite SartoriGiulianiBardelloni-2018-a. */ -class GeneralDataStorage : public Subscriptor +class GeneralDataStorage : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/algorithms/operator.h b/include/deal.II/algorithms/operator.h index 8768f85f43..ec2779fa80 100644 --- a/include/deal.II/algorithms/operator.h +++ b/include/deal.II/algorithms/operator.h @@ -62,7 +62,7 @@ namespace Algorithms * providing additional information and forwarded to the inner Operator * objects of the nested iteration. */ - class OperatorBase : public Subscriptor + class OperatorBase : public EnableRefCountingByObserverPointer { public: /** @@ -101,7 +101,7 @@ namespace Algorithms * in each step of an iteration. */ template - class OutputOperator : public Subscriptor + class OutputOperator : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/algorithms/timestep_control.h b/include/deal.II/algorithms/timestep_control.h index f15fd01aaa..8cd5fbbdb6 100644 --- a/include/deal.II/algorithms/timestep_control.h +++ b/include/deal.II/algorithms/timestep_control.h @@ -57,7 +57,7 @@ namespace Algorithms * with a more modern interface and better programming guarantees. Consider * using DiscreteTime instead of TimestepControl. */ - class TimestepControl : public Subscriptor + class TimestepControl : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/base/function.h b/include/deal.II/base/function.h index 36cd270d6e..7ee925649a 100644 --- a/include/deal.II/base/function.h +++ b/include/deal.II/base/function.h @@ -148,7 +148,7 @@ class TensorFunction; template class Function : public FunctionTime< typename numbers::NumberTraits::real_type>, - public Subscriptor + public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/base/logstream.h b/include/deal.II/base/logstream.h index 06783e0843..69c77f1e53 100644 --- a/include/deal.II/base/logstream.h +++ b/include/deal.II/base/logstream.h @@ -77,7 +77,7 @@ DEAL_II_NAMESPACE_OPEN * * @ingroup textoutput */ -class LogStream : public Subscriptor +class LogStream : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/base/mg_level_object.h b/include/deal.II/base/mg_level_object.h index 023fc675c5..356ab00922 100644 --- a/include/deal.II/base/mg_level_object.h +++ b/include/deal.II/base/mg_level_object.h @@ -45,7 +45,7 @@ DEAL_II_NAMESPACE_OPEN * @ingroup data */ template -class MGLevelObject : public Subscriptor +class MGLevelObject : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/base/observer_pointer.h b/include/deal.II/base/observer_pointer.h index d030dab065..9cf0290d58 100644 --- a/include/deal.II/base/observer_pointer.h +++ b/include/deal.II/base/observer_pointer.h @@ -45,10 +45,10 @@ DEAL_II_NAMESPACE_OPEN * through casting), but they make sure that the object pointed to is not * deleted or moved from in the course of use of the pointer by signaling the * pointee its use. This is achieved by keeping a use count for the pointed-to - * 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 ObserverPointer objects pointing to it. + * object (which for this purpose needs to be derived from the + * EnableRefCountingByObserverPointer 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 ObserverPointer objects pointing to it. * * Conceptually, ObserverPointer fills a gap between `std::unique_ptr` and * `std::shared_ptr`. While the former makes it clear that there is a unique @@ -96,7 +96,8 @@ DEAL_II_NAMESPACE_OPEN * to a constant object (disallowing write access when dereferenced), while * `ObserverPointer` is a mutable pointer. * - * @dealiiConceptRequires{std::is_base_of_v} + * @dealiiConceptRequires{std::is_base_of_v} * * @ingroup memory */ @@ -133,8 +134,9 @@ public: * not a null pointer, the constructor subscribes to the given object to * 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 - * ~ObserverPointer() in the call to Subscriptor::unsubscribe(). + * The id is used in the call to + * EnableRefCountingByObserverPointer::subscribe(id) and by ~ObserverPointer() + * in the call to EnableRefCountingByObserverPointer::unsubscribe(). */ ObserverPointer(T *t, const std::string &id); @@ -281,9 +283,10 @@ inline ObserverPointer::ObserverPointer() , id(typeid(P).name()) , pointed_to_object_is_alive(false) { - static_assert(std::is_base_of_v, - "This class can only be used if the first template argument " - "is a class derived from 'Subscriptor'."); + static_assert( + std::is_base_of_v, + "This class can only be used if the first template argument " + "is a class derived from 'EnableRefCountingByObserverPointer'."); } @@ -294,9 +297,10 @@ inline ObserverPointer::ObserverPointer(T *t) , id(typeid(P).name()) , pointed_to_object_is_alive(false) { - static_assert(std::is_base_of_v, - "This class can only be used if the first template argument " - "is a class derived from 'Subscriptor'."); + static_assert( + std::is_base_of_v, + "This class can only be used if the first template argument " + "is a class derived from 'EnableRefCountingByObserverPointer'."); if (t != nullptr) t->subscribe(&pointed_to_object_is_alive, id); @@ -310,9 +314,10 @@ inline ObserverPointer::ObserverPointer(T *t, const std::string &id) , id(id) , pointed_to_object_is_alive(false) { - static_assert(std::is_base_of_v, - "This class can only be used if the first template argument " - "is a class derived from 'Subscriptor'."); + static_assert( + std::is_base_of_v, + "This class can only be used if the first template argument " + "is a class derived from 'EnableRefCountingByObserverPointer'."); if (pointer != nullptr) pointer->subscribe(&pointed_to_object_is_alive, id); @@ -328,9 +333,10 @@ inline ObserverPointer::ObserverPointer( , id(other.id) , pointed_to_object_is_alive(false) { - static_assert(std::is_base_of_v, - "This class can only be used if the first template argument " - "is a class derived from 'Subscriptor'."); + static_assert( + std::is_base_of_v, + "This class can only be used if the first template argument " + "is a class derived from 'EnableRefCountingByObserverPointer'."); if (other != nullptr) { @@ -350,9 +356,10 @@ inline ObserverPointer::ObserverPointer( , id(other.id) , pointed_to_object_is_alive(false) { - static_assert(std::is_base_of_v, - "This class can only be used if the first template argument " - "is a class derived from 'Subscriptor'."); + static_assert( + std::is_base_of_v, + "This class can only be used if the first template argument " + "is a class derived from 'EnableRefCountingByObserverPointer'."); if (other != nullptr) { @@ -372,9 +379,10 @@ inline ObserverPointer::ObserverPointer( , id(other.id) , pointed_to_object_is_alive(false) { - static_assert(std::is_base_of_v, - "This class can only be used if the first template argument " - "is a class derived from 'Subscriptor'."); + static_assert( + std::is_base_of_v, + "This class can only be used if the first template argument " + "is a class derived from 'EnableRefCountingByObserverPointer'."); if (other != nullptr) { @@ -406,9 +414,10 @@ inline ObserverPointer::ObserverPointer( template inline ObserverPointer::~ObserverPointer() { - static_assert(std::is_base_of_v, - "This class can only be used if the first template argument " - "is a class derived from 'Subscriptor'."); + static_assert( + std::is_base_of_v, + "This class can only be used if the first template argument " + "is a class derived from 'EnableRefCountingByObserverPointer'."); if (pointed_to_object_is_alive && pointer != nullptr) pointer->unsubscribe(&pointed_to_object_is_alive, id); diff --git a/include/deal.II/base/parameter_acceptor.h b/include/deal.II/base/parameter_acceptor.h index 24046f3a5c..4767f6cd6a 100644 --- a/include/deal.II/base/parameter_acceptor.h +++ b/include/deal.II/base/parameter_acceptor.h @@ -355,7 +355,7 @@ namespace internal * * See the tutorial program step-60 for an example on how to use this class. */ -class ParameterAcceptor : public Subscriptor +class ParameterAcceptor : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/base/parameter_handler.h b/include/deal.II/base/parameter_handler.h index 181785e102..c373a702b5 100644 --- a/include/deal.II/base/parameter_handler.h +++ b/include/deal.II/base/parameter_handler.h @@ -851,7 +851,7 @@ class MultipleParameterLoop; * * @ingroup input */ -class ParameterHandler : public Subscriptor +class ParameterHandler : public EnableRefCountingByObserverPointer { public: /** @@ -2330,7 +2330,7 @@ ParameterHandler::save(Archive &ar, const unsigned int) const { // Forward to serialization // function in the base class. - ar &static_cast(*this); + ar &static_cast(*this); ar &*entries.get(); @@ -2350,7 +2350,7 @@ ParameterHandler::load(Archive &ar, const unsigned int) { // Forward to serialization // function in the base class. - ar &static_cast(*this); + ar &static_cast(*this); ar &*entries.get(); diff --git a/include/deal.II/base/polynomial.h b/include/deal.II/base/polynomial.h index a745458839..58464995b9 100644 --- a/include/deal.II/base/polynomial.h +++ b/include/deal.II/base/polynomial.h @@ -62,7 +62,7 @@ namespace Polynomials * TensorProductPolynomials class. */ template - class Polynomial : public Subscriptor + class Polynomial : public EnableRefCountingByObserverPointer { public: /** @@ -1031,7 +1031,7 @@ namespace Polynomials Polynomial::serialize(Archive &ar, const unsigned int) { // forward to serialization function in the base class. - ar &static_cast(*this); + ar &static_cast(*this); ar &coefficients; ar &in_lagrange_product_form; ar &lagrange_support_points; diff --git a/include/deal.II/base/polynomials_piecewise.h b/include/deal.II/base/polynomials_piecewise.h index b74880b4e4..828d53b0ac 100644 --- a/include/deal.II/base/polynomials_piecewise.h +++ b/include/deal.II/base/polynomials_piecewise.h @@ -60,7 +60,7 @@ namespace Polynomials * @ingroup Polynomials */ template - class PiecewisePolynomial : public Subscriptor + class PiecewisePolynomial : public EnableRefCountingByObserverPointer { public: /** @@ -301,7 +301,7 @@ namespace Polynomials PiecewisePolynomial::serialize(Archive &ar, const unsigned int) { // forward to serialization function in the base class. - ar &static_cast(*this); + ar &static_cast(*this); ar &polynomial; ar &n_intervals; ar &interval; diff --git a/include/deal.II/base/quadrature.h b/include/deal.II/base/quadrature.h index f79e9c6998..470153ac11 100644 --- a/include/deal.II/base/quadrature.h +++ b/include/deal.II/base/quadrature.h @@ -119,7 +119,7 @@ DEAL_II_NAMESPACE_OPEN * as "list of evaluation points". */ template -class Quadrature : public Subscriptor +class Quadrature : public EnableRefCountingByObserverPointer { public: /** @@ -545,7 +545,7 @@ Quadrature::serialize(Archive &ar, const unsigned int) { // forward to serialization // function in the base class. - ar &static_cast(*this); + ar &static_cast(*this); ar &quadrature_points &weights; } diff --git a/include/deal.II/base/quadrature_point_data.h b/include/deal.II/base/quadrature_point_data.h index a1fa0a48f5..1a93dcaa24 100644 --- a/include/deal.II/base/quadrature_point_data.h +++ b/include/deal.II/base/quadrature_point_data.h @@ -60,7 +60,7 @@ DEAL_II_NAMESPACE_OPEN * for example, adopting a level-set approach to describe material behavior. */ template -class CellDataStorage : public Subscriptor +class CellDataStorage : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/base/subscriptor.h b/include/deal.II/base/subscriptor.h index 6ee22b81bd..1b2865d2a5 100644 --- a/include/deal.II/base/subscriptor.h +++ b/include/deal.II/base/subscriptor.h @@ -34,14 +34,13 @@ DEAL_II_NAMESPACE_OPEN * * This class, as a base class, allows to keep track of other objects using a * specific object. It is used to avoid that pointers that point to an object of - * a class derived from Subscriptor are referenced after that object has been - * invalidated. Here, invalidation is assumed to happen when the object is - * 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 ObserverPointer) is then - * expected to check the state of the boolean before trying to access this - * class. + * a class derived from EnableRefCountingByObserverPointer are referenced after + * that object has been invalidated. Here, invalidation is assumed to happen + * when the object is 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 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 @@ -57,13 +56,13 @@ DEAL_II_NAMESPACE_OPEN * * @ingroup memory */ -class Subscriptor +class EnableRefCountingByObserverPointer { public: /** * Constructor setting the counter to zero. */ - Subscriptor(); + EnableRefCountingByObserverPointer(); /** * Copy-constructor. @@ -71,20 +70,22 @@ public: * The counter of the copy is zero, since references point to the original * object. */ - Subscriptor(const Subscriptor &); + EnableRefCountingByObserverPointer( + const EnableRefCountingByObserverPointer &); /** * Move constructor. * - * An object inheriting from Subscriptor can only be moved if no other - * objects are subscribing to it. + * An object inheriting from EnableRefCountingByObserverPointer can only be + * moved if no other objects are subscribing to it. */ - Subscriptor(Subscriptor &&) noexcept; + EnableRefCountingByObserverPointer( + EnableRefCountingByObserverPointer &&) noexcept; /** * Destructor, asserting that the counter is zero. */ - virtual ~Subscriptor(); + virtual ~EnableRefCountingByObserverPointer(); /** * Assignment operator. @@ -92,20 +93,21 @@ public: * This has to be handled with care, too, because the counter has to remain * the same. It therefore does nothing more than returning *this. */ - Subscriptor & - operator=(const Subscriptor &); + EnableRefCountingByObserverPointer & + operator=(const EnableRefCountingByObserverPointer &); /** * Move assignment operator. Only invalidates the object moved from. */ - Subscriptor & - operator=(Subscriptor &&) noexcept; + EnableRefCountingByObserverPointer & + operator=(EnableRefCountingByObserverPointer &&) noexcept; /** - * @name Subscriptor functionality + * @name EnableRefCountingByObserverPointer functionality * - * Classes derived from Subscriptor provide a facility to subscribe to this - * object. This is mostly used by the ObserverPointer class. + * Classes derived from EnableRefCountingByObserverPointer provide a facility + * to subscribe to this object. This is mostly used by the ObserverPointer + * class. * @{ */ @@ -173,7 +175,8 @@ public: /** * A subscriber with the identification string given to - * Subscriptor::unsubscribe() did not subscribe to the object. + * EnableRefCountingByObserverPointer::unsubscribe() did not subscribe to the + * object. */ DeclException2(ExcNoSubscriber, std::string, @@ -274,22 +277,24 @@ private: //--------------------------------------------------------------------------- -inline Subscriptor::Subscriptor() +inline EnableRefCountingByObserverPointer::EnableRefCountingByObserverPointer() : counter(0) , object_info(nullptr) {} -inline Subscriptor::Subscriptor(const Subscriptor &) +inline EnableRefCountingByObserverPointer::EnableRefCountingByObserverPointer( + const EnableRefCountingByObserverPointer &) : counter(0) , object_info(nullptr) {} -inline Subscriptor & -Subscriptor::operator=(const Subscriptor &s) +inline EnableRefCountingByObserverPointer & +EnableRefCountingByObserverPointer::operator=( + const EnableRefCountingByObserverPointer &s) { object_info = s.object_info; return *this; @@ -298,7 +303,7 @@ Subscriptor::operator=(const Subscriptor &s) inline unsigned int -Subscriptor::n_subscriptions() const +EnableRefCountingByObserverPointer::n_subscriptions() const { return counter; } @@ -307,7 +312,7 @@ Subscriptor::n_subscriptions() const template inline void -Subscriptor::serialize(Archive &, const unsigned int) +EnableRefCountingByObserverPointer::serialize(Archive &, const unsigned int) { // do nothing, as explained in the // documentation of this function @@ -315,7 +320,7 @@ Subscriptor::serialize(Archive &, const unsigned int) template inline void -Subscriptor::list_subscribers(StreamType &stream) const +EnableRefCountingByObserverPointer::list_subscribers(StreamType &stream) const { std::lock_guard lock(mutex); diff --git a/include/deal.II/base/table.h b/include/deal.II/base/table.h index 911042c973..5336ec6e30 100644 --- a/include/deal.II/base/table.h +++ b/include/deal.II/base/table.h @@ -437,7 +437,7 @@ namespace internal * @ingroup data */ template -class TableBase : public Subscriptor +class TableBase : public EnableRefCountingByObserverPointer { public: using value_type = T; @@ -2165,7 +2165,7 @@ TableBase::TableBase(const TableIndices &sizes, template TableBase::TableBase(const TableBase &src) - : Subscriptor() + : EnableRefCountingByObserverPointer() , values(src.values) , table_size(src.table_size) {} @@ -2185,7 +2185,7 @@ TableBase::TableBase(const TableBase &src) template TableBase::TableBase(TableBase &&src) noexcept - : Subscriptor(std::move(src)) + : EnableRefCountingByObserverPointer(std::move(src)) , values(std::move(src.values)) , table_size(src.table_size) { @@ -2199,7 +2199,7 @@ template inline void TableBase::serialize(Archive &ar, const unsigned int) { - ar &static_cast(*this); + ar &static_cast(*this); ar &values &table_size; } @@ -2342,10 +2342,11 @@ template inline TableBase & TableBase::operator=(TableBase &&m) noexcept { - static_cast(*this) = std::move(static_cast(m)); - values = std::move(m.values); - table_size = m.table_size; - m.table_size = TableIndices(); + static_cast(*this) = + std::move(static_cast(m)); + values = std::move(m.values); + table_size = m.table_size; + m.table_size = TableIndices(); return *this; } diff --git a/include/deal.II/base/tensor_function.h b/include/deal.II/base/tensor_function.h index e11b846d89..3e4dfda8e6 100644 --- a/include/deal.II/base/tensor_function.h +++ b/include/deal.II/base/tensor_function.h @@ -54,7 +54,7 @@ DEAL_II_NAMESPACE_OPEN template class TensorFunction : public FunctionTime::real_type>, - public Subscriptor + public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/distributed/repartitioning_policy_tools.h b/include/deal.II/distributed/repartitioning_policy_tools.h index 7fd684dfed..811c57b96a 100644 --- a/include/deal.II/distributed/repartitioning_policy_tools.h +++ b/include/deal.II/distributed/repartitioning_policy_tools.h @@ -45,7 +45,7 @@ namespace RepartitioningPolicyTools * See the description of RepartitioningPolicyTools for more information. */ template - class Base : public Subscriptor + class Base : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/distributed/shared_tria.h b/include/deal.II/distributed/shared_tria.h index b1f51ddc1b..0e5c040063 100644 --- a/include/deal.II/distributed/shared_tria.h +++ b/include/deal.II/distributed/shared_tria.h @@ -545,7 +545,8 @@ namespace internal * for more information about artificial cells. */ template - class TemporarilyRestoreSubdomainIds : public Subscriptor + class TemporarilyRestoreSubdomainIds + : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/distributed/tria.h b/include/deal.II/distributed/tria.h index 9593b9308c..854b2be01a 100644 --- a/include/deal.II/distributed/tria.h +++ b/include/deal.II/distributed/tria.h @@ -1113,7 +1113,8 @@ namespace parallel * The use of this class is demonstrated in step-75. */ template - class TemporarilyMatchRefineFlags : public Subscriptor + class TemporarilyMatchRefineFlags + : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/dofs/block_info.h b/include/deal.II/dofs/block_info.h index 1b9d32d9c3..27c598712b 100644 --- a/include/deal.II/dofs/block_info.h +++ b/include/deal.II/dofs/block_info.h @@ -91,7 +91,7 @@ class DoFHandler; * * @ingroup dofs */ -class BlockInfo : public Subscriptor +class BlockInfo : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/dofs/dof_handler.h b/include/deal.II/dofs/dof_handler.h index b8a3e344cf..c98c4d88e1 100644 --- a/include/deal.II/dofs/dof_handler.h +++ b/include/deal.II/dofs/dof_handler.h @@ -313,7 +313,7 @@ namespace parallel */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) -class DoFHandler : public Subscriptor +class DoFHandler : public EnableRefCountingByObserverPointer { using ActiveSelector = dealii::internal::DoFHandlerImplementation::Iterators; diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index a795c35e15..10d82f66b4 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -651,7 +651,8 @@ class FESystem; * @ingroup febase fe */ template -class FiniteElement : public Subscriptor, public FiniteElementData +class FiniteElement : public EnableRefCountingByObserverPointer, + public FiniteElementData { public: /** diff --git a/include/deal.II/fe/fe_series.h b/include/deal.II/fe/fe_series.h index 0c0874f991..9502429dcc 100644 --- a/include/deal.II/fe/fe_series.h +++ b/include/deal.II/fe/fe_series.h @@ -86,7 +86,7 @@ namespace FESeries * $ \bf k $ . */ template - class Fourier : public Subscriptor + class Fourier : public EnableRefCountingByObserverPointer { public: using CoefficientType = typename std::complex; @@ -256,7 +256,7 @@ namespace FESeries * $ \widetilde P_m(x) $ using tensor product rule. */ template - class Legendre : public Subscriptor + class Legendre : public EnableRefCountingByObserverPointer { public: using CoefficientType = double; diff --git a/include/deal.II/fe/fe_tools.h b/include/deal.II/fe/fe_tools.h index 69f0f7a7f0..86722d9f86 100644 --- a/include/deal.II/fe/fe_tools.h +++ b/include/deal.II/fe/fe_tools.h @@ -85,7 +85,7 @@ namespace FETools * FETools::add_fe_name() functions. */ template - class FEFactoryBase : public Subscriptor + class FEFactoryBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/fe/fe_tools.templates.h b/include/deal.II/fe/fe_tools.templates.h index 0340f47bea..b138eaed04 100644 --- a/include/deal.II/fe/fe_tools.templates.h +++ b/include/deal.II/fe/fe_tools.templates.h @@ -1073,7 +1073,9 @@ namespace FETools template void fill_no_codim_fe_names( - std::map> &result) + std::map> + &result) { result["FE_Q_Hierarchical"] = std::make_unique>>(); @@ -1153,7 +1155,9 @@ namespace FETools template void fill_codim_fe_names( - std::map> &result) + std::map> + &result) { result["FE_Bernstein"] = std::make_unique>>(); @@ -1192,13 +1196,17 @@ namespace FETools // fe_name_map[dimension][spacedimension] with the maps generated // by the functions above. std::array< - std::array>, - 4>, + std::array< + std::map>, + 4>, 4> inline fill_default_map() { std::array< - std::array>, - 4>, + std::array< + std::map>, + 4>, 4> result; @@ -1242,14 +1250,18 @@ namespace FETools // compiled for all dimensions at once, need to create objects for // each dimension and then separate between them further down inline std::array< - std::array>, - 4>, + std::array< + std::map>, + 4>, 4> & get_fe_name_map() { static std::array< - std::array>, - 4>, + std::array< + std::map>, + 4>, 4> fe_name_map = fill_default_map(); return fe_name_map; @@ -2248,7 +2260,7 @@ namespace FETools std::unique_lock lock( internal::FEToolsAddFENameHelper::fe_name_map_lock); internal::FEToolsAddFENameHelper::get_fe_name_map()[dim][spacedim].emplace( - name, std::unique_ptr(factory)); + name, std::unique_ptr(factory)); } @@ -2265,7 +2277,9 @@ namespace FETools std::unique_ptr> get_fe_by_name_ext( std::string &name, - const std::map> + const std::map< + std::string, + std::unique_ptr> &fe_name_map) { // Extract the name of the @@ -2385,7 +2399,8 @@ namespace FETools // argument, which defaults to 1, // so this properly returns // FE_Nothing() - const Subscriptor *ptr = fe_name_map.find(name_part)->second.get(); + const EnableRefCountingByObserverPointer *ptr = + fe_name_map.find(name_part)->second.get(); const FETools::FEFactoryBase *fef = dynamic_cast *>(ptr); return fef->get(1); @@ -2410,7 +2425,7 @@ namespace FETools const std::pair tmp = Utilities::get_integer_at_position(name, 0); name.erase(0, tmp.second + 1); - const Subscriptor *ptr = + const EnableRefCountingByObserverPointer *ptr = fe_name_map.find(name_part)->second.get(); const FETools::FEFactoryBase *fef = dynamic_cast *>( @@ -2428,7 +2443,7 @@ namespace FETools Utilities::get_integer_at_position(name, 0); // delete "))" name.erase(0, tmp.second + 2); - const Subscriptor *ptr = + const EnableRefCountingByObserverPointer *ptr = fe_name_map.find(name_part)->second.get(); const FETools::FEFactoryBase *fef = dynamic_cast< @@ -2441,7 +2456,7 @@ namespace FETools Utilities::get_integer_at_position(name, 0); // delete "))" name.erase(0, tmp.second + 2); - const Subscriptor *ptr = + const EnableRefCountingByObserverPointer *ptr = fe_name_map.find(name_part)->second.get(); const FETools::FEFactoryBase *fef = dynamic_cast< @@ -2463,7 +2478,7 @@ namespace FETools Utilities::get_integer_at_position(name, 0); // delete "))" name.erase(0, tmp.second + 2); - const Subscriptor *ptr = + const EnableRefCountingByObserverPointer *ptr = fe_name_map.find(name_part)->second.get(); const FETools::FEFactoryBase *fef = dynamic_cast< diff --git a/include/deal.II/fe/fe_values_base.h b/include/deal.II/fe/fe_values_base.h index 9d9175f8b0..d62f9b3834 100644 --- a/include/deal.II/fe/fe_values_base.h +++ b/include/deal.II/fe/fe_values_base.h @@ -151,7 +151,7 @@ DEAL_II_NAMESPACE_OPEN * @ingroup feaccess */ template -class FEValuesBase : public Subscriptor +class FEValuesBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/fe/mapping.h b/include/deal.II/fe/mapping.h index 0681682686..6033285667 100644 --- a/include/deal.II/fe/mapping.h +++ b/include/deal.II/fe/mapping.h @@ -314,7 +314,7 @@ enum MappingKind * @ingroup mapping */ template -class Mapping : public Subscriptor +class Mapping : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/grid/grid_tools_cache.h b/include/deal.II/grid/grid_tools_cache.h index 98ccfc25a9..76601ae89a 100644 --- a/include/deal.II/grid/grid_tools_cache.h +++ b/include/deal.II/grid/grid_tools_cache.h @@ -63,7 +63,7 @@ namespace GridTools * method mark_for_update() manually. */ template - class Cache : public Subscriptor + class Cache : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/grid/intergrid_map.h b/include/deal.II/grid/intergrid_map.h index 00807fdecd..4a8dca068c 100644 --- a/include/deal.II/grid/intergrid_map.h +++ b/include/deal.II/grid/intergrid_map.h @@ -113,7 +113,7 @@ DEAL_II_NAMESPACE_OPEN */ template DEAL_II_CXX20_REQUIRES(concepts::is_triangulation_or_dof_handler) -class InterGridMap : public Subscriptor +class InterGridMap : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/grid/manifold.h b/include/deal.II/grid/manifold.h index 623288d158..e4ef3851a0 100644 --- a/include/deal.II/grid/manifold.h +++ b/include/deal.II/grid/manifold.h @@ -282,7 +282,7 @@ namespace Manifolds * @ingroup manifold */ template -class Manifold : public Subscriptor +class Manifold : public EnableRefCountingByObserverPointer { public: // explicitly check for sensible template arguments diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 9b914d0d4b..be1d29e246 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -1319,7 +1319,7 @@ namespace internal */ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) -class Triangulation : public Subscriptor +class Triangulation : public EnableRefCountingByObserverPointer { private: /** diff --git a/include/deal.II/hp/collection.h b/include/deal.II/hp/collection.h index 0f65f10a98..ecf5960c89 100644 --- a/include/deal.II/hp/collection.h +++ b/include/deal.II/hp/collection.h @@ -221,7 +221,7 @@ namespace hp * @ingroup hp hpcollection */ template - class Collection : public Subscriptor + class Collection : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/hp/fe_values.h b/include/deal.II/hp/fe_values.h index 84d8608781..e4d86ac99c 100644 --- a/include/deal.II/hp/fe_values.h +++ b/include/deal.II/hp/fe_values.h @@ -64,7 +64,7 @@ namespace hp * @ingroup hp */ template - class FEValuesBase : public Subscriptor + class FEValuesBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/affine_constraints.h b/include/deal.II/lac/affine_constraints.h index 2e5f17b63c..1c01e178b4 100644 --- a/include/deal.II/lac/affine_constraints.h +++ b/include/deal.II/lac/affine_constraints.h @@ -503,7 +503,7 @@ namespace internal * @ingroup constraints */ template -class AffineConstraints : public Subscriptor +class AffineConstraints : public EnableRefCountingByObserverPointer { public: /** @@ -2370,7 +2370,7 @@ inline AffineConstraints::AffineConstraints( template inline AffineConstraints::AffineConstraints( const AffineConstraints &affine_constraints) - : Subscriptor() + : EnableRefCountingByObserverPointer() , lines(affine_constraints.lines) , lines_cache(affine_constraints.lines_cache) , locally_owned_dofs(affine_constraints.locally_owned_dofs) diff --git a/include/deal.II/lac/arpack_solver.h b/include/deal.II/lac/arpack_solver.h index 409d90935a..97c3c0da26 100644 --- a/include/deal.II/lac/arpack_solver.h +++ b/include/deal.II/lac/arpack_solver.h @@ -163,7 +163,7 @@ dseupd_(int *rvec, * @ref step_36 "step-36" * for an example. */ -class ArpackSolver : public Subscriptor +class ArpackSolver : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/block_indices.h b/include/deal.II/lac/block_indices.h index 1d813533b9..59903b54e9 100644 --- a/include/deal.II/lac/block_indices.h +++ b/include/deal.II/lac/block_indices.h @@ -56,7 +56,7 @@ DEAL_II_NAMESPACE_OPEN * @see * @ref GlossBlockLA "Block (linear algebra)" */ -class BlockIndices : public Subscriptor +class BlockIndices : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/block_matrix_base.h b/include/deal.II/lac/block_matrix_base.h index 0e22b3e1ae..86601ea0f6 100644 --- a/include/deal.II/lac/block_matrix_base.h +++ b/include/deal.II/lac/block_matrix_base.h @@ -346,7 +346,7 @@ namespace BlockMatrixIterators * @ref GlossBlockLA "Block (linear algebra)" */ template -class BlockMatrixBase : public Subscriptor +class BlockMatrixBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/block_sparse_matrix_ez.h b/include/deal.II/lac/block_sparse_matrix_ez.h index 464e148c9a..90f5a0045d 100644 --- a/include/deal.II/lac/block_sparse_matrix_ez.h +++ b/include/deal.II/lac/block_sparse_matrix_ez.h @@ -57,7 +57,7 @@ class BlockVector; * @ref GlossBlockLA "Block (linear algebra)" */ template -class BlockSparseMatrixEZ : public Subscriptor +class BlockSparseMatrixEZ : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/block_sparse_matrix_ez.templates.h b/include/deal.II/lac/block_sparse_matrix_ez.templates.h index 6c34c89d73..7467ff1330 100644 --- a/include/deal.II/lac/block_sparse_matrix_ez.templates.h +++ b/include/deal.II/lac/block_sparse_matrix_ez.templates.h @@ -82,7 +82,7 @@ BlockSparseMatrixEZ::operator=(const double d) template BlockSparseMatrixEZ::BlockSparseMatrixEZ( const BlockSparseMatrixEZ &m) - : Subscriptor(m) + : EnableRefCountingByObserverPointer(m) , row_indices(m.row_indices) , column_indices(m.column_indices) , blocks(m.blocks) diff --git a/include/deal.II/lac/block_vector_base.h b/include/deal.II/lac/block_vector_base.h index 01390fde39..cc6a9eae3a 100644 --- a/include/deal.II/lac/block_vector_base.h +++ b/include/deal.II/lac/block_vector_base.h @@ -438,7 +438,7 @@ namespace internal * @ref GlossBlockLA "Block (linear algebra)" */ template -class BlockVectorBase : public Subscriptor, +class BlockVectorBase : public EnableRefCountingByObserverPointer, public ReadVector { public: diff --git a/include/deal.II/lac/chunk_sparse_matrix.h b/include/deal.II/lac/chunk_sparse_matrix.h index 41e06921da..4fa5e1bbd9 100644 --- a/include/deal.II/lac/chunk_sparse_matrix.h +++ b/include/deal.II/lac/chunk_sparse_matrix.h @@ -445,7 +445,7 @@ DEAL_II_NAMESPACE_OPEN * in the manual). */ template -class ChunkSparseMatrix : public virtual Subscriptor +class ChunkSparseMatrix : public virtual EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/chunk_sparse_matrix.templates.h b/include/deal.II/lac/chunk_sparse_matrix.templates.h index 88df344726..960b6f4fa1 100644 --- a/include/deal.II/lac/chunk_sparse_matrix.templates.h +++ b/include/deal.II/lac/chunk_sparse_matrix.templates.h @@ -279,7 +279,7 @@ ChunkSparseMatrix::ChunkSparseMatrix() template ChunkSparseMatrix::ChunkSparseMatrix(const ChunkSparseMatrix &m) - : Subscriptor(m) + : EnableRefCountingByObserverPointer(m) , cols(nullptr, "ChunkSparseMatrix") , val(nullptr) , max_len(0) diff --git a/include/deal.II/lac/chunk_sparsity_pattern.h b/include/deal.II/lac/chunk_sparsity_pattern.h index 9debee1c4c..04398886da 100644 --- a/include/deal.II/lac/chunk_sparsity_pattern.h +++ b/include/deal.II/lac/chunk_sparsity_pattern.h @@ -241,7 +241,7 @@ namespace ChunkSparsityPatternIterators * * The use of this class is demonstrated in step-51. */ -class ChunkSparsityPattern : public Subscriptor +class ChunkSparsityPattern : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/diagonal_matrix.h b/include/deal.II/lac/diagonal_matrix.h index 1763c23116..e1a8daab0f 100644 --- a/include/deal.II/lac/diagonal_matrix.h +++ b/include/deal.II/lac/diagonal_matrix.h @@ -58,7 +58,7 @@ namespace LinearAlgebra * @endcode */ template > -class DiagonalMatrix : public Subscriptor +class DiagonalMatrix : public EnableRefCountingByObserverPointer { public: using value_type = typename VectorType::value_type; diff --git a/include/deal.II/lac/la_parallel_vector.h b/include/deal.II/lac/la_parallel_vector.h index 3a287bcdff..4237eab256 100644 --- a/include/deal.II/lac/la_parallel_vector.h +++ b/include/deal.II/lac/la_parallel_vector.h @@ -246,7 +246,8 @@ namespace LinearAlgebra * @endcode */ template - class Vector : public ::dealii::ReadVector, public Subscriptor + class Vector : public ::dealii::ReadVector, + public EnableRefCountingByObserverPointer { public: using memory_space = MemorySpace; diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 1072c6fc7c..1b2799df6f 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -730,7 +730,7 @@ namespace LinearAlgebra template Vector::Vector( const Vector &v) - : Subscriptor() + : EnableRefCountingByObserverPointer() , allocated_size(0) , vector_is_ghosted(false) , comm_sm(MPI_COMM_SELF) @@ -749,7 +749,8 @@ namespace LinearAlgebra Vector &&v) : Vector() { - static_cast(*this) = static_cast(v); + static_cast(*this) = + static_cast(v); this->swap(v); } @@ -1427,7 +1428,8 @@ namespace LinearAlgebra Vector::operator=( // NOLINT Vector &&v) { - static_cast(*this) = static_cast(v); + static_cast(*this) = + static_cast(v); this->swap(v); return *this; } diff --git a/include/deal.II/lac/lapack_full_matrix.h b/include/deal.II/lac/lapack_full_matrix.h index 137465ff02..05a273ca4b 100644 --- a/include/deal.II/lac/lapack_full_matrix.h +++ b/include/deal.II/lac/lapack_full_matrix.h @@ -1007,7 +1007,7 @@ private: * @ingroup Preconditioners */ template -class PreconditionLU : public Subscriptor +class PreconditionLU : public EnableRefCountingByObserverPointer { public: void diff --git a/include/deal.II/lac/matrix_block.h b/include/deal.II/lac/matrix_block.h index 44dda3c1d6..748dd7e0f4 100644 --- a/include/deal.II/lac/matrix_block.h +++ b/include/deal.II/lac/matrix_block.h @@ -89,7 +89,7 @@ namespace internal * @ref GlossBlockLA "Block (linear algebra)" */ template -class MatrixBlock : public Subscriptor +class MatrixBlock : public EnableRefCountingByObserverPointer { public: /** @@ -419,7 +419,7 @@ public: * @ingroup vector_valued */ template -class MGMatrixBlockVector : public Subscriptor +class MGMatrixBlockVector : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/parpack_solver.h b/include/deal.II/lac/parpack_solver.h index 479e0393a1..ee7408274d 100644 --- a/include/deal.II/lac/parpack_solver.h +++ b/include/deal.II/lac/parpack_solver.h @@ -207,7 +207,7 @@ extern "C" * PARPACK manual. */ template -class PArpackSolver : public Subscriptor +class PArpackSolver : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/petsc_matrix_base.h b/include/deal.II/lac/petsc_matrix_base.h index 4e87ac7d36..bc49ceb788 100644 --- a/include/deal.II/lac/petsc_matrix_base.h +++ b/include/deal.II/lac/petsc_matrix_base.h @@ -291,7 +291,7 @@ namespace PETScWrappers * @ingroup PETScWrappers * @ingroup Matrix1 */ - class MatrixBase : public Subscriptor + class MatrixBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/petsc_precondition.h b/include/deal.II/lac/petsc_precondition.h index 75535f9fbe..6869f16419 100644 --- a/include/deal.II/lac/petsc_precondition.h +++ b/include/deal.II/lac/petsc_precondition.h @@ -56,7 +56,7 @@ namespace PETScWrappers * * @ingroup PETScWrappers */ - class PreconditionBase : public Subscriptor + class PreconditionBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/petsc_snes.h b/include/deal.II/lac/petsc_snes.h index ff6b9c4cdf..a2afbbf872 100644 --- a/include/deal.II/lac/petsc_snes.h +++ b/include/deal.II/lac/petsc_snes.h @@ -170,7 +170,7 @@ namespace PETScWrappers * methods: * * @code - * class VectorType : public Subscriptor + * class VectorType : public EnableRefCountingByObserverPointer * ... * explicit VectorType(Vec); * ... @@ -179,7 +179,7 @@ namespace PETScWrappers * @endcode * * @code - * class MatrixType : public Subscriptor + * class MatrixType : public EnableRefCountingByObserverPointer * ... * explicit MatrixType(Mat); * ... diff --git a/include/deal.II/lac/petsc_ts.h b/include/deal.II/lac/petsc_ts.h index 666556d3be..9ac5f5b561 100644 --- a/include/deal.II/lac/petsc_ts.h +++ b/include/deal.II/lac/petsc_ts.h @@ -239,7 +239,7 @@ namespace PETScWrappers * methods: * * @code - * class VectorType : public Subscriptor + * class VectorType : public EnableRefCountingByObserverPointer * ... * explicit VectorType(Vec); * ... @@ -248,7 +248,7 @@ namespace PETScWrappers * @endcode * * @code - * class MatrixType : public Subscriptor + * class MatrixType : public EnableRefCountingByObserverPointer * ... * explicit MatrixType(Mat); * ... diff --git a/include/deal.II/lac/petsc_vector_base.h b/include/deal.II/lac/petsc_vector_base.h index 964507c7e1..e94d47cdcd 100644 --- a/include/deal.II/lac/petsc_vector_base.h +++ b/include/deal.II/lac/petsc_vector_base.h @@ -249,7 +249,8 @@ namespace PETScWrappers * * @ingroup PETScWrappers */ - class VectorBase : public ReadVector, public Subscriptor + class VectorBase : public ReadVector, + public EnableRefCountingByObserverPointer { public: /** @@ -1321,7 +1322,7 @@ namespace PETScWrappers VectorBase::save(Archive &ar, const unsigned int) const { // forward to serialization function in the base class. - ar &static_cast(*this); + ar &static_cast(*this); ar &size(); ar &local_range(); @@ -1343,7 +1344,7 @@ namespace PETScWrappers inline void VectorBase::load(Archive &ar, const unsigned int) { - ar &static_cast(*this); + ar &static_cast(*this); size_type size = 0; std::pair local_range; diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index 5d19f82955..1078656c4f 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -215,7 +215,7 @@ namespace internal * Alternatively, the IdentityMatrix class can be used to precondition in this * way. */ -class PreconditionIdentity : public Subscriptor +class PreconditionIdentity : public EnableRefCountingByObserverPointer { public: /** @@ -330,7 +330,7 @@ private: * multiplied. Still, this class is useful in multigrid smoother objects * (MGSmootherRelaxation). */ -class PreconditionRichardson : public Subscriptor +class PreconditionRichardson : public EnableRefCountingByObserverPointer { public: /** @@ -494,7 +494,7 @@ private: */ template , typename VectorType = Vector> -class PreconditionUseMatrix : public Subscriptor +class PreconditionUseMatrix : public EnableRefCountingByObserverPointer { public: /** @@ -562,7 +562,7 @@ private: */ template , typename PreconditionerType = IdentityMatrix> -class PreconditionRelaxation : public Subscriptor +class PreconditionRelaxation : public EnableRefCountingByObserverPointer { public: /** @@ -2025,13 +2025,14 @@ public: * *

    Requirements on the templated classes

    * - * The class `MatrixType` must be derived from Subscriptor because a - * 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 - * initialize(). Both the matrix and the preconditioner need to provide + * The class `MatrixType` must be derived from + * EnableRefCountingByObserverPointer because a 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 initialize(). Both the matrix and the preconditioner + * need to provide * @p vmult() functions for the matrix-vector product and @p m() functions for * accessing the number of rows in the (square) matrix. Furthermore, the * matrix must provide el(i,i) methods for accessing the matrix @@ -2100,7 +2101,7 @@ public: template , typename VectorType = Vector, typename PreconditionerType = DiagonalMatrix> -class PreconditionChebyshev : public Subscriptor +class PreconditionChebyshev : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/precondition_block.h b/include/deal.II/lac/precondition_block.h index 3f94cc5001..045b3e0cba 100644 --- a/include/deal.II/lac/precondition_block.h +++ b/include/deal.II/lac/precondition_block.h @@ -78,7 +78,7 @@ DEAL_II_NAMESPACE_OPEN */ template -class PreconditionBlock : public virtual Subscriptor, +class PreconditionBlock : public virtual EnableRefCountingByObserverPointer, protected PreconditionBlockBase { private: @@ -376,7 +376,7 @@ protected: template class PreconditionBlockJacobi - : public virtual Subscriptor, + : public virtual EnableRefCountingByObserverPointer, private PreconditionBlock { private: @@ -653,7 +653,7 @@ private: template class PreconditionBlockSOR - : public virtual Subscriptor, + : public virtual EnableRefCountingByObserverPointer, protected PreconditionBlock { public: @@ -810,7 +810,7 @@ protected: template class PreconditionBlockSSOR - : public virtual Subscriptor, + : public virtual EnableRefCountingByObserverPointer, private PreconditionBlockSOR { public: diff --git a/include/deal.II/lac/precondition_selector.h b/include/deal.II/lac/precondition_selector.h index 516395edd6..b172d731f4 100644 --- a/include/deal.II/lac/precondition_selector.h +++ b/include/deal.II/lac/precondition_selector.h @@ -97,7 +97,7 @@ class SparseMatrix; */ template , typename VectorType = dealii::Vector> -class PreconditionSelector : public Subscriptor +class PreconditionSelector : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/read_write_vector.h b/include/deal.II/lac/read_write_vector.h index d236cf9135..d43ae09a32 100644 --- a/include/deal.II/lac/read_write_vector.h +++ b/include/deal.II/lac/read_write_vector.h @@ -123,7 +123,8 @@ namespace LinearAlgebra * get the first index of the largest range. */ template - class ReadWriteVector : public Subscriptor, public ReadVector + class ReadWriteVector : public EnableRefCountingByObserverPointer, + public ReadVector { public: /** @@ -846,7 +847,7 @@ namespace LinearAlgebra template inline ReadWriteVector::ReadWriteVector( const ReadWriteVector &v) - : Subscriptor() + : EnableRefCountingByObserverPointer() { this->operator=(v); } diff --git a/include/deal.II/lac/relaxation_block.h b/include/deal.II/lac/relaxation_block.h index da2ac473cb..15c8d3262d 100644 --- a/include/deal.II/lac/relaxation_block.h +++ b/include/deal.II/lac/relaxation_block.h @@ -77,7 +77,7 @@ public: * structure in #block_list and an optional ordering of the blocks in * #order. */ - class AdditionalData : public Subscriptor + class AdditionalData : public EnableRefCountingByObserverPointer { public: /** @@ -283,7 +283,7 @@ template > class RelaxationBlockJacobi - : public virtual Subscriptor, + : public virtual EnableRefCountingByObserverPointer, protected RelaxationBlock { public: @@ -379,7 +379,7 @@ template > class RelaxationBlockSOR - : public virtual Subscriptor, + : public virtual EnableRefCountingByObserverPointer, protected RelaxationBlock { public: @@ -475,7 +475,7 @@ template > class RelaxationBlockSSOR - : public virtual Subscriptor, + : public virtual EnableRefCountingByObserverPointer, protected RelaxationBlock { public: diff --git a/include/deal.II/lac/solver.h b/include/deal.II/lac/solver.h index 78db56a7b4..6f06437025 100644 --- a/include/deal.II/lac/solver.h +++ b/include/deal.II/lac/solver.h @@ -338,7 +338,7 @@ class Vector; */ template > DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector) -class SolverBase : public Subscriptor +class SolverBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/solver_control.h b/include/deal.II/lac/solver_control.h index b3ff66ed11..847b7c7b40 100644 --- a/include/deal.II/lac/solver_control.h +++ b/include/deal.II/lac/solver_control.h @@ -63,7 +63,7 @@ class ParameterHandler; * number of iterations. * */ -class SolverControl : public Subscriptor +class SolverControl : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/solver_selector.h b/include/deal.II/lac/solver_selector.h index 0615ab5cf0..4f939d6ec5 100644 --- a/include/deal.II/lac/solver_selector.h +++ b/include/deal.II/lac/solver_selector.h @@ -89,7 +89,7 @@ DEAL_II_NAMESPACE_OPEN */ template > DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector) -class SolverSelector : public Subscriptor +class SolverSelector : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/sparse_decomposition.h b/include/deal.II/lac/sparse_decomposition.h index c86e28a687..51ae84fa15 100644 --- a/include/deal.II/lac/sparse_decomposition.h +++ b/include/deal.II/lac/sparse_decomposition.h @@ -104,7 +104,7 @@ DEAL_II_NAMESPACE_OPEN */ template class SparseLUDecomposition : protected SparseMatrix, - public virtual Subscriptor + public virtual EnableRefCountingByObserverPointer { protected: /** diff --git a/include/deal.II/lac/sparse_direct.h b/include/deal.II/lac/sparse_direct.h index f1d3e8b74e..e962a21505 100644 --- a/include/deal.II/lac/sparse_direct.h +++ b/include/deal.II/lac/sparse_direct.h @@ -88,7 +88,7 @@ namespace types * * @ingroup Solvers Preconditioners */ -class SparseDirectUMFPACK : public Subscriptor +class SparseDirectUMFPACK : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/sparse_matrix.h b/include/deal.II/lac/sparse_matrix.h index 1dd5f17671..73b65537d5 100644 --- a/include/deal.II/lac/sparse_matrix.h +++ b/include/deal.II/lac/sparse_matrix.h @@ -516,7 +516,7 @@ DEAL_II_NAMESPACE_OPEN * @ingroup Matrix1 */ template -class SparseMatrix : public virtual Subscriptor +class SparseMatrix : public virtual EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index 114569017a..d1467be7a8 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -55,7 +55,7 @@ SparseMatrix::SparseMatrix() template SparseMatrix::SparseMatrix(const SparseMatrix &m) - : Subscriptor(m) + : EnableRefCountingByObserverPointer(m) , cols(nullptr, "SparseMatrix") , val(nullptr) , max_len(0) @@ -72,7 +72,7 @@ SparseMatrix::SparseMatrix(const SparseMatrix &m) template SparseMatrix::SparseMatrix(SparseMatrix &&m) noexcept - : Subscriptor(std::move(m)) + : EnableRefCountingByObserverPointer(std::move(m)) , cols(std::move(m.cols)) , val(std::move(m.val)) , max_len(m.max_len) diff --git a/include/deal.II/lac/sparse_matrix_ez.h b/include/deal.II/lac/sparse_matrix_ez.h index 971600b462..b0a977f923 100644 --- a/include/deal.II/lac/sparse_matrix_ez.h +++ b/include/deal.II/lac/sparse_matrix_ez.h @@ -100,7 +100,7 @@ class FullMatrix; * where "EZ" is pronounced the same way as the word "easy". */ template -class SparseMatrixEZ : public Subscriptor +class SparseMatrixEZ : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/sparse_matrix_ez.templates.h b/include/deal.II/lac/sparse_matrix_ez.templates.h index 91bd0645ef..f63068d73b 100644 --- a/include/deal.II/lac/sparse_matrix_ez.templates.h +++ b/include/deal.II/lac/sparse_matrix_ez.templates.h @@ -40,7 +40,7 @@ SparseMatrixEZ::SparseMatrixEZ() template SparseMatrixEZ::SparseMatrixEZ(const SparseMatrixEZ &m) - : Subscriptor(m) + : EnableRefCountingByObserverPointer(m) , n_columns(0) , increment(m.increment) , saved_default_row_length(m.saved_default_row_length) diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index 778647e13f..4f5d405e18 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -1516,7 +1516,9 @@ inline void SparsityPattern::save(Archive &ar, const unsigned int) const { // forward to serialization function in the base class. - ar &boost::serialization::base_object(*this); + ar & + boost::serialization::base_object( + *this); ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed; @@ -1539,7 +1541,8 @@ inline void SparsityPattern::load(Archive &ar, const unsigned int) { // forward to serialization function in the base class. - ar &boost::serialization::base_object(*this); + ar &boost::serialization::base_object( + *this); ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed; diff --git a/include/deal.II/lac/sparsity_pattern_base.h b/include/deal.II/lac/sparsity_pattern_base.h index 778e32844e..28b8cf02df 100644 --- a/include/deal.II/lac/sparsity_pattern_base.h +++ b/include/deal.II/lac/sparsity_pattern_base.h @@ -35,7 +35,7 @@ DEAL_II_NAMESPACE_OPEN * Base class for all sparsity patterns, defining a common interface by which * new values can be added. */ -class SparsityPatternBase : public Subscriptor +class SparsityPatternBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/trilinos_epetra_vector.h b/include/deal.II/lac/trilinos_epetra_vector.h index 67ccd31627..23a2e510e1 100644 --- a/include/deal.II/lac/trilinos_epetra_vector.h +++ b/include/deal.II/lac/trilinos_epetra_vector.h @@ -223,7 +223,7 @@ namespace LinearAlgebra * @ingroup Vectors */ class Vector : public ReadVector, - public Subscriptor + public EnableRefCountingByObserverPointer { public: using value_type = VectorTraits::value_type; diff --git a/include/deal.II/lac/trilinos_precondition.h b/include/deal.II/lac/trilinos_precondition.h index b3f11382d1..a262b35651 100644 --- a/include/deal.II/lac/trilinos_precondition.h +++ b/include/deal.II/lac/trilinos_precondition.h @@ -73,7 +73,7 @@ namespace TrilinosWrappers * @ingroup TrilinosWrappers * @ingroup Preconditioners */ - class PreconditionBase : public Subscriptor + class PreconditionBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/trilinos_solver.h b/include/deal.II/lac/trilinos_solver.h index 6e1dc27f11..cc51c68264 100644 --- a/include/deal.II/lac/trilinos_solver.h +++ b/include/deal.II/lac/trilinos_solver.h @@ -482,7 +482,7 @@ namespace TrilinosWrappers * * @ingroup TrilinosWrappers */ - class SolverDirect : public Subscriptor + class SolverDirect : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index 37db5dbc99..2b7454702e 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -546,7 +546,7 @@ namespace TrilinosWrappers * @ingroup TrilinosWrappers * @ingroup Matrix1 */ - class SparseMatrix : public Subscriptor + class SparseMatrix : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/trilinos_tpetra_precondition.h b/include/deal.II/lac/trilinos_tpetra_precondition.h index dc3e8427d8..9e8544b942 100644 --- a/include/deal.II/lac/trilinos_tpetra_precondition.h +++ b/include/deal.II/lac/trilinos_tpetra_precondition.h @@ -53,7 +53,7 @@ namespace LinearAlgebra * @ingroup Preconditioners */ template - class PreconditionBase : public Subscriptor + class PreconditionBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h index 01e9567cf5..d6f0c55dec 100644 --- a/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_tpetra_sparse_matrix.h @@ -107,7 +107,7 @@ namespace LinearAlgebra * the matrix, you must call SparseMatrix::compress() again. */ template - class SparseMatrix : public Subscriptor + class SparseMatrix : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/trilinos_tpetra_vector.h b/include/deal.II/lac/trilinos_tpetra_vector.h index dc1f18ba2e..8631a6f533 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.h @@ -285,7 +285,8 @@ namespace LinearAlgebra * @ingroup Vectors */ template - class Vector : public ReadVector, public Subscriptor + class Vector : public ReadVector, + public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/lac/trilinos_tpetra_vector.templates.h b/include/deal.II/lac/trilinos_tpetra_vector.templates.h index acb36e1e97..6eec9b7dc5 100644 --- a/include/deal.II/lac/trilinos_tpetra_vector.templates.h +++ b/include/deal.II/lac/trilinos_tpetra_vector.templates.h @@ -78,7 +78,7 @@ namespace LinearAlgebra template Vector::Vector() - : Subscriptor() + : EnableRefCountingByObserverPointer() , compressed(true) , has_ghost(false) , vector(Utilities::Trilinos::internal::make_rcp< @@ -91,7 +91,7 @@ namespace LinearAlgebra template Vector::Vector(const Vector &V) - : Subscriptor() + : EnableRefCountingByObserverPointer() , compressed(V.compressed) , has_ghost(V.has_ghost) , vector(Utilities::Trilinos::internal::make_rcp< @@ -109,7 +109,7 @@ namespace LinearAlgebra template Vector::Vector( const Teuchos::RCP> V) - : Subscriptor() + : EnableRefCountingByObserverPointer() , compressed(true) , has_ghost(V->getMap()->isOneToOne() == false) , vector(V) @@ -120,7 +120,7 @@ namespace LinearAlgebra template Vector::Vector(const IndexSet ¶llel_partitioner, const MPI_Comm communicator) - : Subscriptor() + : EnableRefCountingByObserverPointer() , compressed(true) , has_ghost(false) , vector(Utilities::Trilinos::internal::make_rcp< @@ -136,7 +136,7 @@ namespace LinearAlgebra const IndexSet &ghost_entries, const MPI_Comm communicator, const bool vector_writable) - : Subscriptor() + : EnableRefCountingByObserverPointer() { if (!vector_writable) { diff --git a/include/deal.II/lac/trilinos_vector.h b/include/deal.II/lac/trilinos_vector.h index 9cc22e4249..0f092a0ef3 100644 --- a/include/deal.II/lac/trilinos_vector.h +++ b/include/deal.II/lac/trilinos_vector.h @@ -401,7 +401,8 @@ namespace TrilinosWrappers * @ingroup TrilinosWrappers * @ingroup Vectors */ - class Vector : public Subscriptor, public ReadVector + class Vector : public EnableRefCountingByObserverPointer, + public ReadVector { public: /** diff --git a/include/deal.II/lac/vector.h b/include/deal.II/lac/vector.h index fbd184ab71..219dd68594 100644 --- a/include/deal.II/lac/vector.h +++ b/include/deal.II/lac/vector.h @@ -116,7 +116,8 @@ namespace parallel * in the manual). */ template -class Vector : public Subscriptor, public ReadVector +class Vector : public EnableRefCountingByObserverPointer, + public ReadVector { public: /** @@ -1480,7 +1481,7 @@ inline void Vector::save(Archive &ar, const unsigned int) const { // forward to serialization function in the base class. - ar &static_cast(*this); + ar &static_cast(*this); ar &values; } @@ -1492,7 +1493,7 @@ inline void Vector::load(Archive &ar, const unsigned int) { // the load stuff again from the archive - ar &static_cast(*this); + ar &static_cast(*this); ar &values; maybe_reset_thread_partitioner(); } diff --git a/include/deal.II/lac/vector.templates.h b/include/deal.II/lac/vector.templates.h index 481245c874..a32065f2fd 100644 --- a/include/deal.II/lac/vector.templates.h +++ b/include/deal.II/lac/vector.templates.h @@ -52,7 +52,7 @@ DEAL_II_NAMESPACE_OPEN template Vector::Vector(const Vector &v) - : Subscriptor() + : EnableRefCountingByObserverPointer() { *this = v; } diff --git a/include/deal.II/lac/vector_memory.h b/include/deal.II/lac/vector_memory.h index 7e04f37cdf..2545107c4c 100644 --- a/include/deal.II/lac/vector_memory.h +++ b/include/deal.II/lac/vector_memory.h @@ -101,7 +101,7 @@ DEAL_II_NAMESPACE_OPEN * always returned. */ template > -class VectorMemory : public Subscriptor +class VectorMemory : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/matrix_free/fe_remote_evaluation.h b/include/deal.II/matrix_free/fe_remote_evaluation.h index c9ef3821cb..f54d0891cf 100644 --- a/include/deal.II/matrix_free/fe_remote_evaluation.h +++ b/include/deal.II/matrix_free/fe_remote_evaluation.h @@ -283,7 +283,7 @@ struct FERemoteCommunicationObjectTwoLevel * A class to fill the fields in PrecomputedEvaluationData. */ template -class FERemoteEvaluationCommunicator : public Subscriptor +class FERemoteEvaluationCommunicator : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index 21248b1287..ca7c7286d6 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -109,7 +109,7 @@ DEAL_II_NAMESPACE_OPEN template > -class MatrixFree : public Subscriptor +class MatrixFree : public EnableRefCountingByObserverPointer { static_assert( std::is_same_v, diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 51cd4c0f04..0a80f23e39 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -77,7 +77,7 @@ DEAL_II_NAMESPACE_OPEN template MatrixFree::MatrixFree() - : Subscriptor() + : EnableRefCountingByObserverPointer() , indices_are_initialized(false) , mapping_is_initialized(false) , mg_level(numbers::invalid_unsigned_int) @@ -88,7 +88,7 @@ MatrixFree::MatrixFree() template MatrixFree::MatrixFree( const MatrixFree &other) - : Subscriptor() + : EnableRefCountingByObserverPointer() { copy_from(other); } diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index 8f36705993..5991e00c44 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -184,7 +184,7 @@ namespace MatrixFreeOperators typename VectorType = LinearAlgebra::distributed::Vector, typename VectorizedArrayType = VectorizedArray> - class Base : public Subscriptor + class Base : public EnableRefCountingByObserverPointer { public: /** @@ -534,7 +534,7 @@ namespace MatrixFreeOperators * prolongation phase. */ template - class MGInterfaceOperator : public Subscriptor + class MGInterfaceOperator : public EnableRefCountingByObserverPointer { public: /** @@ -1215,7 +1215,7 @@ namespace MatrixFreeOperators //----------------- Base operator ----------------------------- template Base::Base() - : Subscriptor() + : EnableRefCountingByObserverPointer() , have_interface_matrices(false) {} @@ -1805,7 +1805,7 @@ namespace MatrixFreeOperators template MGInterfaceOperator::MGInterfaceOperator() - : Subscriptor() + : EnableRefCountingByObserverPointer() , mf_base_operator(nullptr) {} diff --git a/include/deal.II/matrix_free/portable_matrix_free.h b/include/deal.II/matrix_free/portable_matrix_free.h index e6f96b5d6b..6a20de94f7 100644 --- a/include/deal.II/matrix_free/portable_matrix_free.h +++ b/include/deal.II/matrix_free/portable_matrix_free.h @@ -86,7 +86,7 @@ namespace Portable * @note Only float and double are supported. */ template - class MatrixFree : public Subscriptor + class MatrixFree : public EnableRefCountingByObserverPointer { public: using jacobian_type = Tensor<2, dim, Tensor<1, dim, Number>>; diff --git a/include/deal.II/meshworker/local_integrator.h b/include/deal.II/meshworker/local_integrator.h index 51a665665a..ed5fafe313 100644 --- a/include/deal.II/meshworker/local_integrator.h +++ b/include/deal.II/meshworker/local_integrator.h @@ -56,7 +56,8 @@ namespace MeshWorker * @ingroup MeshWorker */ template - class DEAL_II_DEPRECATED LocalIntegrator : public Subscriptor + class DEAL_II_DEPRECATED LocalIntegrator + : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/meshworker/vector_selector.h b/include/deal.II/meshworker/vector_selector.h index f4d22af7a0..2f8dc0bc77 100644 --- a/include/deal.II/meshworker/vector_selector.h +++ b/include/deal.II/meshworker/vector_selector.h @@ -44,7 +44,7 @@ namespace MeshWorker * * @ingroup MeshWorker */ - class VectorSelector : public Subscriptor + class VectorSelector : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/multigrid/mg_base.h b/include/deal.II/multigrid/mg_base.h index 8a71fa177f..d0b9c42989 100644 --- a/include/deal.II/multigrid/mg_base.h +++ b/include/deal.II/multigrid/mg_base.h @@ -44,7 +44,7 @@ DEAL_II_NAMESPACE_OPEN * of matrices, will be sufficient for applications. */ template -class MGMatrixBase : public Subscriptor +class MGMatrixBase : public EnableRefCountingByObserverPointer { public: /* @@ -104,7 +104,7 @@ public: * will be done by derived classes. */ template -class MGCoarseGridBase : public Subscriptor +class MGCoarseGridBase : public EnableRefCountingByObserverPointer { public: /** @@ -168,7 +168,7 @@ public: * needed. */ template -class MGTransferBase : public Subscriptor +class MGTransferBase : public EnableRefCountingByObserverPointer { public: /** @@ -248,7 +248,7 @@ public: * in the vector @p u given the right hand side, which is done by smooth(). */ template -class MGSmootherBase : public Subscriptor +class MGSmootherBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/multigrid/mg_constrained_dofs.h b/include/deal.II/multigrid/mg_constrained_dofs.h index 24d0c69605..9807712554 100644 --- a/include/deal.II/multigrid/mg_constrained_dofs.h +++ b/include/deal.II/multigrid/mg_constrained_dofs.h @@ -41,7 +41,7 @@ class DoFHandler; * * @ingroup mg */ -class MGConstrainedDoFs : public Subscriptor +class MGConstrainedDoFs : public EnableRefCountingByObserverPointer { public: using size_dof = std::vector>::size_type; diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.h index b12a18b58c..a269e757b1 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.h @@ -216,7 +216,7 @@ namespace MGTransferGlobalCoarseningTools * accordingly. */ template -class MGTwoLevelTransferBase : public Subscriptor +class MGTwoLevelTransferBase : public EnableRefCountingByObserverPointer { public: static_assert( diff --git a/include/deal.II/multigrid/multigrid.h b/include/deal.II/multigrid/multigrid.h index 2574625995..89923df899 100644 --- a/include/deal.II/multigrid/multigrid.h +++ b/include/deal.II/multigrid/multigrid.h @@ -159,7 +159,7 @@ namespace mg * MGTransferBase. */ template -class Multigrid : public Subscriptor +class Multigrid : public EnableRefCountingByObserverPointer { public: /** @@ -499,7 +499,7 @@ private: * to be initialized with a separate DoFHandler for each block. */ template -class PreconditionMG : public Subscriptor +class PreconditionMG : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/multigrid/sparse_matrix_collection.h b/include/deal.II/multigrid/sparse_matrix_collection.h index f9028d5f1a..b7b2b0530d 100644 --- a/include/deal.II/multigrid/sparse_matrix_collection.h +++ b/include/deal.II/multigrid/sparse_matrix_collection.h @@ -38,7 +38,7 @@ namespace mg * multigrid with local refinement. */ template - class SparseMatrixCollection : public Subscriptor + class SparseMatrixCollection : public EnableRefCountingByObserverPointer { public: void diff --git a/include/deal.II/non_matching/mapping_info.h b/include/deal.II/non_matching/mapping_info.h index 2488167788..cf2e21dbe5 100644 --- a/include/deal.II/non_matching/mapping_info.h +++ b/include/deal.II/non_matching/mapping_info.h @@ -218,7 +218,7 @@ namespace NonMatching * held. */ template - class MappingInfo : public Subscriptor + class MappingInfo : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/non_matching/mesh_classifier.h b/include/deal.II/non_matching/mesh_classifier.h index aa631b135b..b5f5e19aae 100644 --- a/include/deal.II/non_matching/mesh_classifier.h +++ b/include/deal.II/non_matching/mesh_classifier.h @@ -105,7 +105,7 @@ namespace NonMatching * same way as for the discrete level set function. */ template - class MeshClassifier : public Subscriptor + class MeshClassifier : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/numerics/data_postprocessor.h b/include/deal.II/numerics/data_postprocessor.h index 6c091ebad4..2b1d4ce027 100644 --- a/include/deal.II/numerics/data_postprocessor.h +++ b/include/deal.II/numerics/data_postprocessor.h @@ -579,7 +579,7 @@ namespace DataPostprocessorInputs * @ingroup output */ template -class DataPostprocessor : public Subscriptor +class DataPostprocessor : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/numerics/time_dependent.h b/include/deal.II/numerics/time_dependent.h index 3be402ca36..04fadcef15 100644 --- a/include/deal.II/numerics/time_dependent.h +++ b/include/deal.II/numerics/time_dependent.h @@ -660,7 +660,7 @@ private: * following grids, and some functions to be called before a new loop over all * time steps is started. */ -class TimeStepBase : public Subscriptor +class TimeStepBase : public EnableRefCountingByObserverPointer { public: /** diff --git a/include/deal.II/particles/particle_handler.h b/include/deal.II/particles/particle_handler.h index 6fa00f8e6d..96aa1bd648 100644 --- a/include/deal.II/particles/particle_handler.h +++ b/include/deal.II/particles/particle_handler.h @@ -59,7 +59,7 @@ namespace Particles * finite-element solution see step-19, step-68, step-70, and step-83. */ template - class ParticleHandler : public Subscriptor + class ParticleHandler : public EnableRefCountingByObserverPointer { public: /** diff --git a/source/base/quadrature.cc b/source/base/quadrature.cc index d39f88611e..89de89c1d0 100644 --- a/source/base/quadrature.cc +++ b/source/base/quadrature.cc @@ -244,7 +244,7 @@ Quadrature<1>::Quadrature(const SubQuadrature &, const Quadrature<1> &q2) template <> Quadrature<0>::Quadrature(const Quadrature<1> &) - : Subscriptor() + : EnableRefCountingByObserverPointer() , quadrature_points(1) , weights(1, 1.) , is_tensor_product_flag(false) @@ -253,7 +253,7 @@ Quadrature<0>::Quadrature(const Quadrature<1> &) template <> Quadrature<1>::Quadrature(const Quadrature<0> &) - : Subscriptor() + : EnableRefCountingByObserverPointer() { // this function should never be called -- this should be the copy constructor // in 1d... @@ -265,7 +265,7 @@ Quadrature<1>::Quadrature(const Quadrature<0> &) template Quadrature::Quadrature(const Quadrature &q) - : Subscriptor() + : EnableRefCountingByObserverPointer() , quadrature_points(Utilities::fixed_power(q.size())) , weights(Utilities::fixed_power(q.size())) , is_tensor_product_flag(true) @@ -303,7 +303,7 @@ Quadrature::Quadrature(const Quadrature &q) template Quadrature::Quadrature(const Quadrature &q) - : Subscriptor() + : EnableRefCountingByObserverPointer() , quadrature_points(q.quadrature_points) , weights(q.weights) , is_tensor_product_flag(q.is_tensor_product_flag) diff --git a/source/base/subscriptor.cc b/source/base/subscriptor.cc index ece630d2eb..18a03f9875 100644 --- a/source/base/subscriptor.cc +++ b/source/base/subscriptor.cc @@ -26,10 +26,11 @@ DEAL_II_NAMESPACE_OPEN static const char *unknown_subscriber = "unknown subscriber"; -std::mutex Subscriptor::mutex; +std::mutex EnableRefCountingByObserverPointer::mutex; -Subscriptor::Subscriptor(Subscriptor &&subscriptor) noexcept +EnableRefCountingByObserverPointer::EnableRefCountingByObserverPointer( + EnableRefCountingByObserverPointer &&subscriptor) noexcept : counter(0) , object_info(subscriptor.object_info) { @@ -40,7 +41,7 @@ Subscriptor::Subscriptor(Subscriptor &&subscriptor) noexcept -Subscriptor::~Subscriptor() +EnableRefCountingByObserverPointer::~EnableRefCountingByObserverPointer() { for (auto *const validity_ptr : validity_pointers) *validity_ptr = false; @@ -49,7 +50,7 @@ Subscriptor::~Subscriptor() void -Subscriptor::check_no_subscribers() const noexcept +EnableRefCountingByObserverPointer::check_no_subscribers() const noexcept { // Check whether there are still subscriptions to this object. If so, output // the actual name of the class to which this object belongs, i.e. the most @@ -114,8 +115,9 @@ Subscriptor::check_no_subscribers() const noexcept -Subscriptor & -Subscriptor::operator=(Subscriptor &&s) noexcept +EnableRefCountingByObserverPointer & +EnableRefCountingByObserverPointer::operator=( + EnableRefCountingByObserverPointer &&s) noexcept { for (auto *const validity_ptr : s.validity_pointers) *validity_ptr = false; @@ -127,8 +129,8 @@ Subscriptor::operator=(Subscriptor &&s) noexcept void -Subscriptor::subscribe(std::atomic *const validity, - const std::string &id) const +EnableRefCountingByObserverPointer::subscribe(std::atomic *const validity, + const std::string &id) const { std::lock_guard lock(mutex); @@ -147,8 +149,9 @@ Subscriptor::subscribe(std::atomic *const validity, void -Subscriptor::unsubscribe(std::atomic *const validity, - const std::string &id) const +EnableRefCountingByObserverPointer::unsubscribe( + std::atomic *const validity, + const std::string &id) const { const std::string &name = id.empty() ? unknown_subscriber : id; @@ -183,7 +186,7 @@ Subscriptor::unsubscribe(std::atomic *const validity, AssertNothrow( validity_ptr_it != validity_pointers.end(), ExcMessage( - "This Subscriptor object does not know anything about the supplied pointer!")); + "This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer!")); return; } @@ -195,7 +198,7 @@ Subscriptor::unsubscribe(std::atomic *const validity, void -Subscriptor::list_subscribers() const +EnableRefCountingByObserverPointer::list_subscribers() const { list_subscribers(deallog); } diff --git a/source/grid/tria.cc b/source/grid/tria.cc index a496a30a66..573e1e63f6 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -12022,7 +12022,7 @@ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) Triangulation::Triangulation( Triangulation &&tria) noexcept - : Subscriptor(std::move(tria)) + : EnableRefCountingByObserverPointer(std::move(tria)) , smooth_grid(tria.smooth_grid) , reference_cells(std::move(tria.reference_cells)) , periodic_face_pairs_level_0(std::move(tria.periodic_face_pairs_level_0)) @@ -12050,7 +12050,7 @@ DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) Triangulation &Triangulation::operator=( Triangulation &&tria) noexcept { - Subscriptor::operator=(std::move(tria)); + EnableRefCountingByObserverPointer::operator=(std::move(tria)); smooth_grid = tria.smooth_grid; reference_cells = std::move(tria.reference_cells); diff --git a/source/hp/fe_values.cc b/source/hp/fe_values.cc index e7acf15fb6..23e985cb0b 100644 --- a/source/hp/fe_values.cc +++ b/source/hp/fe_values.cc @@ -134,7 +134,7 @@ namespace hp template FEValuesBase::FEValuesBase( const FEValuesBase &other) - : Subscriptor(other) + : EnableRefCountingByObserverPointer(other) , fe_collection(other.fe_collection) , mapping_collection(other.mapping_collection) , q_collection(other.q_collection) diff --git a/source/lac/chunk_sparsity_pattern.cc b/source/lac/chunk_sparsity_pattern.cc index 27d8fe6d45..a719355da5 100644 --- a/source/lac/chunk_sparsity_pattern.cc +++ b/source/lac/chunk_sparsity_pattern.cc @@ -29,7 +29,7 @@ ChunkSparsityPattern::ChunkSparsityPattern() ChunkSparsityPattern::ChunkSparsityPattern(const ChunkSparsityPattern &s) - : Subscriptor() + : EnableRefCountingByObserverPointer() , chunk_size(s.chunk_size) , sparsity_pattern(s.sparsity_pattern) { diff --git a/source/lac/petsc_vector_base.cc b/source/lac/petsc_vector_base.cc index 69a999e49d..dfa3626af7 100644 --- a/source/lac/petsc_vector_base.cc +++ b/source/lac/petsc_vector_base.cc @@ -128,7 +128,7 @@ namespace PETScWrappers VectorBase::VectorBase(const VectorBase &v) - : Subscriptor() + : EnableRefCountingByObserverPointer() , ghosted(v.ghosted) , ghost_indices(v.ghost_indices) , last_action(VectorOperation::unknown) @@ -143,7 +143,7 @@ namespace PETScWrappers VectorBase::VectorBase(const Vec &v) - : Subscriptor() + : EnableRefCountingByObserverPointer() , vector(v) , ghosted(false) , last_action(VectorOperation::unknown) diff --git a/source/lac/trilinos_epetra_vector.cc b/source/lac/trilinos_epetra_vector.cc index 8920dd2612..0ddaa7e7eb 100644 --- a/source/lac/trilinos_epetra_vector.cc +++ b/source/lac/trilinos_epetra_vector.cc @@ -81,7 +81,7 @@ namespace LinearAlgebra # endif Vector::Vector() - : Subscriptor() + : EnableRefCountingByObserverPointer() , vector(new Epetra_FEVector( Epetra_Map(0, 0, 0, Utilities::Trilinos::comm_self()))) {} @@ -89,7 +89,7 @@ namespace LinearAlgebra Vector::Vector(const Vector &V) - : Subscriptor() + : EnableRefCountingByObserverPointer() , vector(new Epetra_FEVector(V.trilinos_vector())) {} @@ -97,7 +97,7 @@ namespace LinearAlgebra Vector::Vector(const IndexSet ¶llel_partitioner, const MPI_Comm communicator) - : Subscriptor() + : EnableRefCountingByObserverPointer() , vector(new Epetra_FEVector( parallel_partitioner.make_trilinos_map(communicator, false))) {} diff --git a/source/lac/trilinos_vector.cc b/source/lac/trilinos_vector.cc index 9ed58caaa0..6af1b3e8e3 100644 --- a/source/lac/trilinos_vector.cc +++ b/source/lac/trilinos_vector.cc @@ -77,7 +77,7 @@ namespace TrilinosWrappers namespace MPI { Vector::Vector() - : Subscriptor() + : EnableRefCountingByObserverPointer() , last_action(Zero) , compressed(true) , has_ghosts(false) @@ -110,7 +110,8 @@ namespace TrilinosWrappers : Vector() { // initialize a minimal, valid object and swap - static_cast(*this) = static_cast(v); + static_cast(*this) = + static_cast(v); swap(v); } @@ -522,7 +523,8 @@ namespace TrilinosWrappers Vector & Vector::operator=(Vector &&v) noexcept { - static_cast(*this) = static_cast(v); + static_cast(*this) = + static_cast(v); swap(v); return *this; } diff --git a/tests/algorithms/newton_01.cc b/tests/algorithms/newton_01.cc index f7a1d452b1..f8adea55fc 100644 --- a/tests/algorithms/newton_01.cc +++ b/tests/algorithms/newton_01.cc @@ -24,7 +24,7 @@ // test computing square root of 2 with newton's method -class SquareRoot : public Subscriptor +class SquareRoot : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/base/assign_subscriptor.cc b/tests/base/assign_subscriptor.cc index 2958949b78..2643a4d089 100644 --- a/tests/base/assign_subscriptor.cc +++ b/tests/base/assign_subscriptor.cc @@ -14,8 +14,8 @@ -// Check the behavior of the ObserverPointer-Subscriptor pair -// for copy and move semantics. +// Check the behavior of the ObserverPointer-EnableRefCountingByObserverPointer +// pair for copy and move semantics. #include @@ -26,7 +26,7 @@ #include "../tests.h" -class Test : public Subscriptor +class Test : public EnableRefCountingByObserverPointer {}; int @@ -39,10 +39,12 @@ main() { deallog << "Checking copy assignment" << std::endl; - Subscriptor subscriptor_1; - Subscriptor subscriptor_2; - ObserverPointer smart_pointer_1(&subscriptor_1); - ObserverPointer smart_pointer_2(&subscriptor_2); + EnableRefCountingByObserverPointer subscriptor_1; + EnableRefCountingByObserverPointer subscriptor_2; + ObserverPointer smart_pointer_1( + &subscriptor_1); + ObserverPointer smart_pointer_2( + &subscriptor_2); subscriptor_2 = subscriptor_1; @@ -73,10 +75,11 @@ main() { deallog << "Checking copy construction" << std::endl; - Subscriptor subscriptor_1; - ObserverPointer smart_pointer_1(&subscriptor_1); + EnableRefCountingByObserverPointer subscriptor_1; + ObserverPointer smart_pointer_1( + &subscriptor_1); - Subscriptor subscriptor_2(subscriptor_1); + EnableRefCountingByObserverPointer subscriptor_2(subscriptor_1); deallog << "Checking smart_pointer_1" << std::endl; try @@ -94,10 +97,12 @@ main() { deallog << "Checking move assignment" << std::endl; - Subscriptor subscriptor_1; - Subscriptor subscriptor_2; - ObserverPointer smart_pointer_1(&subscriptor_1); - ObserverPointer smart_pointer_2(&subscriptor_2); + EnableRefCountingByObserverPointer subscriptor_1; + EnableRefCountingByObserverPointer subscriptor_2; + ObserverPointer smart_pointer_1( + &subscriptor_1); + ObserverPointer smart_pointer_2( + &subscriptor_2); subscriptor_2 = std::move(subscriptor_1); @@ -128,10 +133,11 @@ main() { deallog << "Checking move construction" << std::endl; - Subscriptor subscriptor_1; - ObserverPointer smart_pointer_1(&subscriptor_1); + EnableRefCountingByObserverPointer subscriptor_1; + ObserverPointer smart_pointer_1( + &subscriptor_1); - Subscriptor subscriptor_2(std::move(subscriptor_1)); + EnableRefCountingByObserverPointer subscriptor_2(std::move(subscriptor_1)); deallog << "Checking smart_pointer_1" << std::endl; try diff --git a/tests/base/reference.cc b/tests/base/reference.cc index c597c859fe..7b6644354d 100644 --- a/tests/base/reference.cc +++ b/tests/base/reference.cc @@ -32,7 +32,7 @@ std::vector memory(10000); int next = 0; -class Test : public Subscriptor +class Test : public EnableRefCountingByObserverPointer { const char *name; diff --git a/tests/base/smart_pointer_01.cc b/tests/base/smart_pointer_01.cc index e67a1b8eec..0a368162b3 100644 --- a/tests/base/smart_pointer_01.cc +++ b/tests/base/smart_pointer_01.cc @@ -27,7 +27,7 @@ #include "../tests.h" -class Test : public Subscriptor +class Test : public EnableRefCountingByObserverPointer {}; diff --git a/tests/base/smart_pointer_02.cc b/tests/base/smart_pointer_02.cc index da5af3a911..b67da69023 100644 --- a/tests/base/smart_pointer_02.cc +++ b/tests/base/smart_pointer_02.cc @@ -28,7 +28,7 @@ #include "../tests.h" -class Test : public Subscriptor +class Test : public EnableRefCountingByObserverPointer {}; diff --git a/tests/base/unsubscribe_subscriptor.cc b/tests/base/unsubscribe_subscriptor.cc index f16a916f90..98dfd66046 100644 --- a/tests/base/unsubscribe_subscriptor.cc +++ b/tests/base/unsubscribe_subscriptor.cc @@ -25,7 +25,7 @@ #include "../tests.h" -class Test : public Subscriptor +class Test : public EnableRefCountingByObserverPointer {}; int @@ -35,10 +35,10 @@ main() initlog(); - Subscriptor subscriptor; - std::atomic dummy_a; - const char *foo_a = "a"; - const char *foo_b = "b"; + EnableRefCountingByObserverPointer subscriptor; + std::atomic dummy_a; + const char *foo_a = "a"; + const char *foo_b = "b"; subscriptor.subscribe(&dummy_a, foo_a); subscriptor.unsubscribe(&dummy_a, foo_b); std::atomic dummy_b; diff --git a/tests/base/unsubscribe_subscriptor.debug.output b/tests/base/unsubscribe_subscriptor.debug.output index 8839743656..a8ffe034de 100644 --- a/tests/base/unsubscribe_subscriptor.debug.output +++ b/tests/base/unsubscribe_subscriptor.debug.output @@ -3,23 +3,23 @@ DEAL::Exception: ExcNoSubscriber(object_info->name(), name) DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic*, const string&) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic*, const string&) const The violated condition was: it != counter_map.end() Additional information: No subscriber with identifier subscribes to this object of class - N6dealii11SubscriptorE. Consequently, it cannot be unsubscribed. + N6dealii34EnableRefCountingByObserverPointerE. Consequently, it cannot be unsubscribed. -------------------------------------------------------- -DEAL::Exception: ExcMessage( "This Subscriptor object does not know anything about the supplied pointer!") +DEAL::Exception: ExcMessage( "This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer!") DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic*, const string&) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic*, const string&) const The violated condition was: validity_ptr_it != validity_pointers.end() Additional information: - This Subscriptor object does not know anything about the supplied + This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer! -------------------------------------------------------- diff --git a/tests/base/unsubscribe_subscriptor.debug.output.clang-6 b/tests/base/unsubscribe_subscriptor.debug.output.clang-6 index 7e8a4dde93..8356e57068 100644 --- a/tests/base/unsubscribe_subscriptor.debug.output.clang-6 +++ b/tests/base/unsubscribe_subscriptor.debug.output.clang-6 @@ -3,23 +3,23 @@ DEAL::Exception: ExcNoSubscriber(object_info->name(), name) DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic *const, const std::string &) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic *const, const std::string &) const The violated condition was: it != counter_map.end() Additional information: No subscriber with identifier subscribes to this object of class - N6dealii11SubscriptorE. Consequently, it cannot be unsubscribed. + N6dealii34EnableRefCountingByObserverPointerE. Consequently, it cannot be unsubscribed. -------------------------------------------------------- -DEAL::Exception: ExcMessage( "This Subscriptor object does not know anything about the supplied pointer!") +DEAL::Exception: ExcMessage( "This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer!") DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic *const, const std::string &) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic *const, const std::string &) const The violated condition was: validity_ptr_it != validity_pointers.end() Additional information: - This Subscriptor object does not know anything about the supplied + This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer! -------------------------------------------------------- diff --git a/tests/base/unsubscribe_subscriptor.debug.output.gcc-12 b/tests/base/unsubscribe_subscriptor.debug.output.gcc-12 index 6d0a0fa0fe..7442e1e7eb 100644 --- a/tests/base/unsubscribe_subscriptor.debug.output.gcc-12 +++ b/tests/base/unsubscribe_subscriptor.debug.output.gcc-12 @@ -3,23 +3,23 @@ DEAL::Exception: ExcNoSubscriber(object_info->name(), name) DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic*, const std::string&) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic*, const std::string&) const The violated condition was: it != counter_map.end() Additional information: No subscriber with identifier subscribes to this object of class - N6dealii11SubscriptorE. Consequently, it cannot be unsubscribed. + N6dealii34EnableRefCountingByObserverPointerE. Consequently, it cannot be unsubscribed. -------------------------------------------------------- -DEAL::Exception: ExcMessage( "This Subscriptor object does not know anything about the supplied pointer!") +DEAL::Exception: ExcMessage( "This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer!") DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic*, const std::string&) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic*, const std::string&) const The violated condition was: validity_ptr_it != validity_pointers.end() Additional information: - This Subscriptor object does not know anything about the supplied + This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer! -------------------------------------------------------- diff --git a/tests/base/unsubscribe_subscriptor.debug.output.intel b/tests/base/unsubscribe_subscriptor.debug.output.intel index cdd231ec98..4e36b2b911 100644 --- a/tests/base/unsubscribe_subscriptor.debug.output.intel +++ b/tests/base/unsubscribe_subscriptor.debug.output.intel @@ -3,23 +3,23 @@ DEAL::Exception: ExcNoSubscriber(object_info->name(), name) DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic *, const std::__cxx11::basic_string, std::allocator> &) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic *, const std::__cxx11::basic_string, std::allocator> &) const The violated condition was: it != counter_map.end() Additional information: No subscriber with identifier subscribes to this object of class - N6dealii11SubscriptorE. Consequently, it cannot be unsubscribed. + N6dealii34EnableRefCountingByObserverPointerE. Consequently, it cannot be unsubscribed. -------------------------------------------------------- -DEAL::Exception: ExcMessage( "This Subscriptor object does not know anything about the supplied pointer!") +DEAL::Exception: ExcMessage( "This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer!") DEAL:: -------------------------------------------------------- An error occurred in file in function - void dealii::Subscriptor::unsubscribe(std::atomic *, const std::__cxx11::basic_string, std::allocator> &) const + void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic *, const std::__cxx11::basic_string, std::allocator> &) const The violated condition was: validity_ptr_it != validity_pointers.end() Additional information: - This Subscriptor object does not know anything about the supplied + This EnableRefCountingByObserverPointer object does not know anything about the supplied pointer! -------------------------------------------------------- diff --git a/tests/base/unsubscribe_subscriptor_01.cc b/tests/base/unsubscribe_subscriptor_01.cc index a6754ff106..2eb1eab55e 100644 --- a/tests/base/unsubscribe_subscriptor_01.cc +++ b/tests/base/unsubscribe_subscriptor_01.cc @@ -27,7 +27,7 @@ #include "../tests.h" -class Test : public Subscriptor +class Test : public EnableRefCountingByObserverPointer {}; int @@ -37,10 +37,10 @@ main() initlog(); - Subscriptor subscriptor; - std::atomic dummy_a; - const char *foo = "a"; - const std::string foo_string = "a"; + EnableRefCountingByObserverPointer subscriptor; + std::atomic dummy_a; + const char *foo = "a"; + const std::string foo_string = "a"; subscriptor.subscribe(&dummy_a, foo); subscriptor.unsubscribe(&dummy_a, foo_string.c_str()); diff --git a/tests/bits/joa_1.cc b/tests/bits/joa_1.cc index bf9bab069a..30e3c994e0 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/ObserverPointer +// EnableRefCountingByObserverPointer/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 a3f77f1976..d594c9f11c 100644 --- a/tests/bits/sparse_lu_decomposition_1.cc +++ b/tests/bits/sparse_lu_decomposition_1.cc @@ -15,8 +15,8 @@ // 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 ObserverPointer +// associated lack of accessibility of the EnableRefCountingByObserverPointer +// functions to the ObserverPointer // // it was fixed around 2003-05-22 diff --git a/tests/bits/step-14.cc b/tests/bits/step-14.cc index 7f744fa638..7c866ce7c7 100644 --- a/tests/bits/step-14.cc +++ b/tests/bits/step-14.cc @@ -866,7 +866,7 @@ namespace LaplaceSolver namespace Data { template - struct SetUpBase : public Subscriptor + struct SetUpBase : public EnableRefCountingByObserverPointer { virtual const Function & get_boundary_values() const = 0; @@ -1095,7 +1095,7 @@ namespace Data namespace DualFunctional { template - class DualFunctionalBase : public Subscriptor + class DualFunctionalBase : public EnableRefCountingByObserverPointer { public: virtual void diff --git a/tests/fe/fe_q_dg0.cc b/tests/fe/fe_q_dg0.cc index 634fc10468..41df113156 100644 --- a/tests/fe/fe_q_dg0.cc +++ b/tests/fe/fe_q_dg0.cc @@ -312,7 +312,7 @@ namespace Step22 template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const Matrix &m, const Preconditioner &preconditioner); @@ -353,7 +353,7 @@ namespace Step22 } template - class SchurComplement : public Subscriptor + class SchurComplement : public EnableRefCountingByObserverPointer { public: SchurComplement( diff --git a/tests/hp/crash_21.cc b/tests/hp/crash_21.cc index 0723522c72..87c48d9d7a 100644 --- a/tests/hp/crash_21.cc +++ b/tests/hp/crash_21.cc @@ -52,7 +52,7 @@ namespace Step { template - class Problem : public Subscriptor + class Problem : public EnableRefCountingByObserverPointer { public: Problem(); diff --git a/tests/integrators/cells_and_faces_01.cc b/tests/integrators/cells_and_faces_01.cc index 9d488dc672..88c12f552c 100644 --- a/tests/integrators/cells_and_faces_01.cc +++ b/tests/integrators/cells_and_faces_01.cc @@ -45,7 +45,7 @@ const unsigned int n_functionals = 3; template -class Local : public Subscriptor +class Local : public EnableRefCountingByObserverPointer { public: using CellInfo = EmptyInfo; diff --git a/tests/integrators/functional_01.cc b/tests/integrators/functional_01.cc index e1481c077d..e2eee30ffa 100644 --- a/tests/integrators/functional_01.cc +++ b/tests/integrators/functional_01.cc @@ -43,7 +43,7 @@ const unsigned int n_functionals = 3; template -class Local : public Subscriptor +class Local : public EnableRefCountingByObserverPointer { public: using CellInfo = EmptyInfo; diff --git a/tests/integrators/mesh_worker_01.cc b/tests/integrators/mesh_worker_01.cc index 81c9f28410..5324199520 100644 --- a/tests/integrators/mesh_worker_01.cc +++ b/tests/integrators/mesh_worker_01.cc @@ -39,7 +39,7 @@ // Define a class that fills all available entries in the info objects // with recognizable numbers. template -class Local : public Subscriptor +class Local : public EnableRefCountingByObserverPointer { public: using CellInfo = MeshWorker::IntegrationInfo; diff --git a/tests/integrators/mesh_worker_02.cc b/tests/integrators/mesh_worker_02.cc index c10d8b8382..7214cadd13 100644 --- a/tests/integrators/mesh_worker_02.cc +++ b/tests/integrators/mesh_worker_02.cc @@ -38,7 +38,7 @@ // Use local matrices for Laplacian / interior penalty DG template -class MatrixIntegrator : public Subscriptor +class MatrixIntegrator : public EnableRefCountingByObserverPointer { public: static void diff --git a/tests/integrators/mesh_worker_03.cc b/tests/integrators/mesh_worker_03.cc index f13a69ba04..f553806aa6 100644 --- a/tests/integrators/mesh_worker_03.cc +++ b/tests/integrators/mesh_worker_03.cc @@ -39,7 +39,7 @@ // Local integrators fill every matrix entry with 10*block_row + block_col template -class MatrixIntegrator : public Subscriptor +class MatrixIntegrator : public EnableRefCountingByObserverPointer { public: static void diff --git a/tests/integrators/mesh_worker_matrix_01.cc b/tests/integrators/mesh_worker_matrix_01.cc index 84aa029c63..df017379c7 100644 --- a/tests/integrators/mesh_worker_matrix_01.cc +++ b/tests/integrators/mesh_worker_matrix_01.cc @@ -40,7 +40,7 @@ // Define a class that fills all available entries in the info objects // with recognizable numbers. template -class Local : public Subscriptor +class Local : public EnableRefCountingByObserverPointer { public: using CellInfo = MeshWorker::IntegrationInfo; diff --git a/tests/lac/precondition_chebyshev_07.cc b/tests/lac/precondition_chebyshev_07.cc index 05bfbd55d8..810e696a64 100644 --- a/tests/lac/precondition_chebyshev_07.cc +++ b/tests/lac/precondition_chebyshev_07.cc @@ -98,7 +98,7 @@ private: }; template -class MySparseMatrix : public Subscriptor +class MySparseMatrix : public EnableRefCountingByObserverPointer { public: MySparseMatrix(const SparseMatrixType &sparse_matrix) diff --git a/tests/lac/precondition_relaxation_01.cc b/tests/lac/precondition_relaxation_01.cc index 95128108d1..21756826ce 100644 --- a/tests/lac/precondition_relaxation_01.cc +++ b/tests/lac/precondition_relaxation_01.cc @@ -97,7 +97,7 @@ private: }; template -class MySparseMatrix : public Subscriptor +class MySparseMatrix : public EnableRefCountingByObserverPointer { public: MySparseMatrix(const SparseMatrixType &sparse_matrix) diff --git a/tests/matrix_free/compare_faces_by_cells.cc b/tests/matrix_free/compare_faces_by_cells.cc index 53e1b6996b..5530835e22 100644 --- a/tests/matrix_free/compare_faces_by_cells.cc +++ b/tests/matrix_free/compare_faces_by_cells.cc @@ -47,7 +47,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/multigrid_dg_periodic.cc b/tests/matrix_free/multigrid_dg_periodic.cc index bfce10da13..ec5a4e47c8 100644 --- a/tests/matrix_free/multigrid_dg_periodic.cc +++ b/tests/matrix_free/multigrid_dg_periodic.cc @@ -55,7 +55,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/multigrid_dg_sip_01.cc b/tests/matrix_free/multigrid_dg_sip_01.cc index 1db985938a..85f620f185 100644 --- a/tests/matrix_free/multigrid_dg_sip_01.cc +++ b/tests/matrix_free/multigrid_dg_sip_01.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/multigrid_dg_sip_02.cc b/tests/matrix_free/multigrid_dg_sip_02.cc index 65f89a1a8b..3110fa5e49 100644 --- a/tests/matrix_free/multigrid_dg_sip_02.cc +++ b/tests/matrix_free/multigrid_dg_sip_02.cc @@ -55,7 +55,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/parallel_multigrid.cc b/tests/matrix_free/parallel_multigrid.cc index bca5ab6276..a2546e81fb 100644 --- a/tests/matrix_free/parallel_multigrid.cc +++ b/tests/matrix_free/parallel_multigrid.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: LaplaceOperator(){}; diff --git a/tests/matrix_free/parallel_multigrid_adaptive_01.cc b/tests/matrix_free/parallel_multigrid_adaptive_01.cc index 3f2385974e..b84ac1c669 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_01.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_01.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: LaplaceOperator(){}; @@ -400,7 +400,7 @@ private: template -class MGInterfaceMatrix : public Subscriptor +class MGInterfaceMatrix : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/matrix_free/parallel_multigrid_adaptive_03.cc b/tests/matrix_free/parallel_multigrid_adaptive_03.cc index 133f3d61f4..00d2574038 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_03.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_03.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; @@ -407,7 +407,7 @@ private: template -class MGInterfaceMatrix : public Subscriptor +class MGInterfaceMatrix : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/matrix_free/parallel_multigrid_adaptive_05.cc b/tests/matrix_free/parallel_multigrid_adaptive_05.cc index d069070542..ecfec53f0a 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_05.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_05.cc @@ -51,7 +51,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; @@ -404,7 +404,7 @@ private: template -class MGInterfaceMatrix : public Subscriptor +class MGInterfaceMatrix : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/matrix_free/parallel_multigrid_adaptive_06.cc b/tests/matrix_free/parallel_multigrid_adaptive_06.cc index 916634bb3c..6d3dd57fbd 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_06.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_06.cc @@ -75,14 +75,14 @@ template > -class BlockLaplace : public Subscriptor +class BlockLaplace : public EnableRefCountingByObserverPointer { public: using value_type = typename BlockVectorType::value_type; using size_type = typename BlockVectorType::size_type; BlockLaplace() - : Subscriptor() + : EnableRefCountingByObserverPointer() {} void diff --git a/tests/matrix_free/parallel_multigrid_adaptive_07.cc b/tests/matrix_free/parallel_multigrid_adaptive_07.cc index 269e08932d..55f9e7c313 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_07.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_07.cc @@ -68,14 +68,14 @@ template > -class BlockLaplace : public Subscriptor +class BlockLaplace : public EnableRefCountingByObserverPointer { public: using value_type = typename BlockVectorType::value_type; using size_type = typename BlockVectorType::size_type; BlockLaplace() - : Subscriptor() + : EnableRefCountingByObserverPointer() {} void diff --git a/tests/matrix_free/parallel_multigrid_fullydistributed.cc b/tests/matrix_free/parallel_multigrid_fullydistributed.cc index b01e86552c..38d6eb06ac 100644 --- a/tests/matrix_free/parallel_multigrid_fullydistributed.cc +++ b/tests/matrix_free/parallel_multigrid_fullydistributed.cc @@ -57,7 +57,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/parallel_multigrid_interleave.cc b/tests/matrix_free/parallel_multigrid_interleave.cc index 71e497604b..7381351c80 100644 --- a/tests/matrix_free/parallel_multigrid_interleave.cc +++ b/tests/matrix_free/parallel_multigrid_interleave.cc @@ -50,7 +50,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/parallel_multigrid_interleave_renumber.cc b/tests/matrix_free/parallel_multigrid_interleave_renumber.cc index 2fd92164a3..628ecc31c6 100644 --- a/tests/matrix_free/parallel_multigrid_interleave_renumber.cc +++ b/tests/matrix_free/parallel_multigrid_interleave_renumber.cc @@ -51,7 +51,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/parallel_multigrid_mf.cc b/tests/matrix_free/parallel_multigrid_mf.cc index 1354945a23..5c684dab58 100644 --- a/tests/matrix_free/parallel_multigrid_mf.cc +++ b/tests/matrix_free/parallel_multigrid_mf.cc @@ -52,7 +52,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/solver_cg_interleave.cc b/tests/matrix_free/solver_cg_interleave.cc index c26f3101e6..58d8a87b52 100644 --- a/tests/matrix_free/solver_cg_interleave.cc +++ b/tests/matrix_free/solver_cg_interleave.cc @@ -49,7 +49,7 @@ template -class HelmholtzOperator : public Subscriptor +class HelmholtzOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/matrix_free/step-37.cc b/tests/matrix_free/step-37.cc index 21a070d87d..c38b44fa6a 100644 --- a/tests/matrix_free/step-37.cc +++ b/tests/matrix_free/step-37.cc @@ -118,7 +118,7 @@ namespace Step37 template - class LaplaceOperator : public Subscriptor + class LaplaceOperator : public EnableRefCountingByObserverPointer { public: LaplaceOperator(); @@ -171,7 +171,7 @@ namespace Step37 template LaplaceOperator::LaplaceOperator() - : Subscriptor() + : EnableRefCountingByObserverPointer() {} diff --git a/tests/matrix_free/stokes_computation.cc b/tests/matrix_free/stokes_computation.cc index 2661b52c6c..0d779619f3 100644 --- a/tests/matrix_free/stokes_computation.cc +++ b/tests/matrix_free/stokes_computation.cc @@ -87,7 +87,7 @@ namespace StokesClass class MassMatrixType, class PreconditionerA, class PreconditionerMp> - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: /** diff --git a/tests/matrix_free_kokkos/coefficient_eval_device.cc b/tests/matrix_free_kokkos/coefficient_eval_device.cc index a260a5c31e..010aa43544 100644 --- a/tests/matrix_free_kokkos/coefficient_eval_device.cc +++ b/tests/matrix_free_kokkos/coefficient_eval_device.cc @@ -75,7 +75,7 @@ DummyOperator::operator()( template -class DummyMatrixFree : public Subscriptor +class DummyMatrixFree : public EnableRefCountingByObserverPointer { public: DummyMatrixFree(const Portable::MatrixFree &data_in, diff --git a/tests/matrix_free_kokkos/matrix_vector_device_mf.h b/tests/matrix_free_kokkos/matrix_vector_device_mf.h index 7ac568cab4..9d4d437154 100644 --- a/tests/matrix_free_kokkos/matrix_vector_device_mf.h +++ b/tests/matrix_free_kokkos/matrix_vector_device_mf.h @@ -170,7 +170,7 @@ template , int n_q_points_1d = fe_degree + 1> -class MatrixFreeTest : public Subscriptor +class MatrixFreeTest : public EnableRefCountingByObserverPointer { public: MatrixFreeTest(const Portable::MatrixFree &data_in, diff --git a/tests/mpi/mesh_worker_matrix_01.cc b/tests/mpi/mesh_worker_matrix_01.cc index d2c7fd1f76..cc10048e62 100644 --- a/tests/mpi/mesh_worker_matrix_01.cc +++ b/tests/mpi/mesh_worker_matrix_01.cc @@ -46,7 +46,7 @@ // Define a class that fills all available entries in the info objects // with recognizable numbers. template -class Local : public Subscriptor +class Local : public EnableRefCountingByObserverPointer { public: using CellInfo = MeshWorker::IntegrationInfo; diff --git a/tests/multigrid-global-coarsening/multigrid_dg_periodic.cc b/tests/multigrid-global-coarsening/multigrid_dg_periodic.cc index cf0a7135bc..2a62b1e7ee 100644 --- a/tests/multigrid-global-coarsening/multigrid_dg_periodic.cc +++ b/tests/multigrid-global-coarsening/multigrid_dg_periodic.cc @@ -55,7 +55,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/multigrid-global-coarsening/multigrid_dg_sip_01.cc b/tests/multigrid-global-coarsening/multigrid_dg_sip_01.cc index 26628da8de..702da3a742 100644 --- a/tests/multigrid-global-coarsening/multigrid_dg_sip_01.cc +++ b/tests/multigrid-global-coarsening/multigrid_dg_sip_01.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/multigrid-global-coarsening/multigrid_dg_sip_02.cc b/tests/multigrid-global-coarsening/multigrid_dg_sip_02.cc index 496f7962e1..df8fd0782c 100644 --- a/tests/multigrid-global-coarsening/multigrid_dg_sip_02.cc +++ b/tests/multigrid-global-coarsening/multigrid_dg_sip_02.cc @@ -55,7 +55,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/multigrid-global-coarsening/multigrid_util.h b/tests/multigrid-global-coarsening/multigrid_util.h index 888e088f79..754cb0de7f 100644 --- a/tests/multigrid-global-coarsening/multigrid_util.h +++ b/tests/multigrid-global-coarsening/multigrid_util.h @@ -58,7 +58,7 @@ #include "../tests.h" template -class Operator : public Subscriptor +class Operator : public EnableRefCountingByObserverPointer { public: using value_type = Number; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid.cc b/tests/multigrid-global-coarsening/parallel_multigrid.cc index 02b8013ac7..67cbe00685 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: LaplaceOperator(){}; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc index 7f36689221..cc79886053 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_01.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: LaplaceOperator(){}; @@ -400,7 +400,7 @@ private: template -class MGInterfaceMatrix : public Subscriptor +class MGInterfaceMatrix : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc index 0cdc6ccecb..dc145420d1 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_03.cc @@ -54,7 +54,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; @@ -407,7 +407,7 @@ private: template -class MGInterfaceMatrix : public Subscriptor +class MGInterfaceMatrix : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc index 8f0d4851c6..529da593af 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_05.cc @@ -51,7 +51,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; @@ -404,7 +404,7 @@ private: template -class MGInterfaceMatrix : public Subscriptor +class MGInterfaceMatrix : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_06.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_06.cc index d3f8f71262..f58b47531a 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_06.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_06.cc @@ -75,14 +75,14 @@ template > -class BlockLaplace : public Subscriptor +class BlockLaplace : public EnableRefCountingByObserverPointer { public: using value_type = typename BlockVectorType::value_type; using size_type = typename BlockVectorType::size_type; BlockLaplace() - : Subscriptor() + : EnableRefCountingByObserverPointer() {} void diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_07.cc b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_07.cc index 8f0d1a9a48..7cd7fe8b99 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_07.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_adaptive_07.cc @@ -68,14 +68,14 @@ template > -class BlockLaplace : public Subscriptor +class BlockLaplace : public EnableRefCountingByObserverPointer { public: using value_type = typename BlockVectorType::value_type; using size_type = typename BlockVectorType::size_type; BlockLaplace() - : Subscriptor() + : EnableRefCountingByObserverPointer() {} void diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_fullydistributed.cc b/tests/multigrid-global-coarsening/parallel_multigrid_fullydistributed.cc index 420fea1066..bcfa3c9648 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_fullydistributed.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_fullydistributed.cc @@ -57,7 +57,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_interleave.cc b/tests/multigrid-global-coarsening/parallel_multigrid_interleave.cc index 455ff0fe86..75e4ea10ef 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_interleave.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_interleave.cc @@ -50,7 +50,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_interleave_renumber.cc b/tests/multigrid-global-coarsening/parallel_multigrid_interleave_renumber.cc index e1b82044ff..78fafa8ff1 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_interleave_renumber.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_interleave_renumber.cc @@ -51,7 +51,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/multigrid-global-coarsening/parallel_multigrid_mf.cc b/tests/multigrid-global-coarsening/parallel_multigrid_mf.cc index 347249f6d7..65af18c078 100644 --- a/tests/multigrid-global-coarsening/parallel_multigrid_mf.cc +++ b/tests/multigrid-global-coarsening/parallel_multigrid_mf.cc @@ -52,7 +52,7 @@ template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/multigrid-global-coarsening/stokes_computation.cc b/tests/multigrid-global-coarsening/stokes_computation.cc index c0ab2be5bb..09237aa19b 100644 --- a/tests/multigrid-global-coarsening/stokes_computation.cc +++ b/tests/multigrid-global-coarsening/stokes_computation.cc @@ -87,7 +87,7 @@ namespace StokesClass class MassMatrixType, class PreconditionerA, class PreconditionerMp> - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: /** diff --git a/tests/multigrid/mg_renumbered_02.cc b/tests/multigrid/mg_renumbered_02.cc index 80e3f09427..b9d540452d 100644 --- a/tests/multigrid/mg_renumbered_02.cc +++ b/tests/multigrid/mg_renumbered_02.cc @@ -142,7 +142,7 @@ diff(Vector &diff, template -class OutputCreator : public Subscriptor +class OutputCreator : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/multigrid/mg_renumbered_03.cc b/tests/multigrid/mg_renumbered_03.cc index 67033d8d63..d490c12ef3 100644 --- a/tests/multigrid/mg_renumbered_03.cc +++ b/tests/multigrid/mg_renumbered_03.cc @@ -189,7 +189,7 @@ print(const DoFHandler &dof, } template -class OutputCreator : public Subscriptor +class OutputCreator : public EnableRefCountingByObserverPointer { public: void diff --git a/tests/numerics/no_flux_18.cc b/tests/numerics/no_flux_18.cc index 388e6e92b7..93fc1c10be 100644 --- a/tests/numerics/no_flux_18.cc +++ b/tests/numerics/no_flux_18.cc @@ -88,7 +88,7 @@ namespace StokesClass class MassMatrixType, class PreconditionerA, class PreconditionerMp> - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: /** diff --git a/tests/performance/instrumentation_step_22.cc b/tests/performance/instrumentation_step_22.cc index 022cd1cbc2..292bc38b74 100644 --- a/tests/performance/instrumentation_step_22.cc +++ b/tests/performance/instrumentation_step_22.cc @@ -204,7 +204,7 @@ RightHandSide::value_list(const std::vector> &vp, template -class InverseMatrix : public Subscriptor +class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m, const PreconditionerType &preconditioner); @@ -243,7 +243,7 @@ InverseMatrix::vmult( template -class SchurComplement : public Subscriptor +class SchurComplement : public EnableRefCountingByObserverPointer { public: SchurComplement( diff --git a/tests/performance/timing_mg_glob_coarsen.cc b/tests/performance/timing_mg_glob_coarsen.cc index 95c416e3b1..ca28f3a6c8 100644 --- a/tests/performance/timing_mg_glob_coarsen.cc +++ b/tests/performance/timing_mg_glob_coarsen.cc @@ -79,7 +79,7 @@ dealii::ConditionalOStream debug_output(std::cout, false); template -class LaplaceOperator : public Subscriptor +class LaplaceOperator : public EnableRefCountingByObserverPointer { public: using value_type = number; diff --git a/tests/performance/timing_step_22.cc b/tests/performance/timing_step_22.cc index 0a0a9f60c6..9f44ee99b3 100644 --- a/tests/performance/timing_step_22.cc +++ b/tests/performance/timing_step_22.cc @@ -202,7 +202,7 @@ RightHandSide::value_list(const std::vector> &vp, template -class InverseMatrix : public Subscriptor +class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m, const PreconditionerType &preconditioner); @@ -241,7 +241,7 @@ InverseMatrix::vmult( template -class SchurComplement : public Subscriptor +class SchurComplement : public EnableRefCountingByObserverPointer { public: SchurComplement( diff --git a/tests/petsc/petsc_snes_02.cc b/tests/petsc/petsc_snes_02.cc index 7b1c88a4fe..1649405ad9 100644 --- a/tests/petsc/petsc_snes_02.cc +++ b/tests/petsc/petsc_snes_02.cc @@ -22,7 +22,7 @@ * and exceptions handling for PETSCWrappers::NonlinearSolver. */ -class VectorType : public Subscriptor +class VectorType : public EnableRefCountingByObserverPointer { public: explicit VectorType(Vec v) @@ -39,7 +39,7 @@ private: Vec v; }; -class MatrixType : public Subscriptor +class MatrixType : public EnableRefCountingByObserverPointer { public: explicit MatrixType(Mat A) diff --git a/tests/petsc/petsc_ts_01.cc b/tests/petsc/petsc_ts_01.cc index a052f609ec..27887db8e4 100644 --- a/tests/petsc/petsc_ts_01.cc +++ b/tests/petsc/petsc_ts_01.cc @@ -22,7 +22,7 @@ * and exceptions handling for PETSCWrappers::TimeStepper. */ -class VectorType : public Subscriptor +class VectorType : public EnableRefCountingByObserverPointer { public: explicit VectorType(Vec v) @@ -39,7 +39,7 @@ private: Vec v; }; -class MatrixType : public Subscriptor +class MatrixType : public EnableRefCountingByObserverPointer { public: explicit MatrixType(Mat A) diff --git a/tests/simplex/step-31.cc b/tests/simplex/step-31.cc index 1c609ce6e3..7f42cbfe4e 100644 --- a/tests/simplex/step-31.cc +++ b/tests/simplex/step-31.cc @@ -129,7 +129,7 @@ namespace Step31 namespace LinearSolvers { template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const MatrixType &m, @@ -169,7 +169,7 @@ namespace Step31 } } template - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner( diff --git a/tests/simplex/step-55.cc b/tests/simplex/step-55.cc index 3535122595..f519d446f4 100644 --- a/tests/simplex/step-55.cc +++ b/tests/simplex/step-55.cc @@ -118,7 +118,7 @@ namespace Step55 // with an option to specify a preconditioner, and to allow for different // vector types in the vmult function. template - class InverseMatrix : public Subscriptor + class InverseMatrix : public EnableRefCountingByObserverPointer { public: InverseMatrix(const Matrix &m, const Preconditioner &preconditioner); @@ -170,7 +170,8 @@ namespace Step55 // The class A template class for a simple block diagonal preconditioner // for 2x2 matrices. template - class BlockDiagonalPreconditioner : public Subscriptor + class BlockDiagonalPreconditioner + : public EnableRefCountingByObserverPointer { public: BlockDiagonalPreconditioner(const PreconditionerA &preconditioner_A, diff --git a/tests/simplex/stokes-sv.cc b/tests/simplex/stokes-sv.cc index 7e2c8e8252..1e0818bbb1 100644 --- a/tests/simplex/stokes-sv.cc +++ b/tests/simplex/stokes-sv.cc @@ -259,7 +259,7 @@ namespace Step56 } template - class BlockSchurPreconditioner : public Subscriptor + class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer { public: BlockSchurPreconditioner(