<code>.templates.h</code> files.
<li> 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 <code>\#ifndef
DOXYGEN ... \#endif</code> to prevent Doxygen from picking them up.</li>
* @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,
// Based on the above description, the <code>SetUpBase</code> class then
// looks as follows. To allow using the <code>ObserverPointer</code> class
- // with this class, we derived from the <code>Subscriptor</code> class.
+ // with this class, we derived from the
+ // <code>EnableRefCountingByObserverPointer</code> class.
template <int dim>
- struct SetUpBase : public Subscriptor
+ struct SetUpBase : public EnableRefCountingByObserverPointer
{
virtual const Function<dim> &get_boundary_values() const = 0;
// the right hand side, we only need to provide for a function that
// assembles the right hand side for a given discretization:
template <int dim>
- class DualFunctionalBase : public Subscriptor
+ class DualFunctionalBase : public EnableRefCountingByObserverPointer
{
public:
virtual void assemble_rhs(const DoFHandler<dim> &dof_handler,
// maximum number of iterations equal to the maximum of the size of the linear
// system and 200.
template <class MatrixType>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m)
- class SchurComplement : public Subscriptor
+ class SchurComplement : public EnableRefCountingByObserverPointer
{
public:
SchurComplement(const BlockSparseMatrix<double> &A,
- class ApproximateSchurComplement : public Subscriptor
+ class ApproximateSchurComplement : public EnableRefCountingByObserverPointer
{
public:
ApproximateSchurComplement(const BlockSparseMatrix<double> &A)
operations:
@code
template <class PreconditionerA, class PreconditionerMp>
-class BlockSchurPreconditioner : public Subscriptor
+class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner (const BlockSparseMatrix<double> &S,
// <code>InverseMatrix</code> object is created. The member function
// <code>vmult</code> is obtained by solving a linear system:
template <class MatrixType, class PreconditionerType>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m,
// a preconditioner class as above, which affects the
// <code>ObserverPointer</code> object <code>m_inverse</code> as well.
template <class PreconditionerType>
- class SchurComplement : public Subscriptor
+ class SchurComplement : public EnableRefCountingByObserverPointer
{
public:
SchurComplement(
// <code>declare_parameters</code> that declares all the necessary
// parameters and a <code>read_parameters</code> function that is called
// from outside to initiate the parameter reading process.
- class ParameterReader : public Subscriptor
+ class ParameterReader : public EnableRefCountingByObserverPointer
{
public:
ParameterReader(ParameterHandler &);
// we can abort the program preserving information about where the
// problem happened.
template <class MatrixType, class PreconditionerType>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m,
// preconditioners in the constructor and that the matrices we use here
// are built upon Trilinos:
template <class PreconditionerTypeA, class PreconditionerTypeMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner(
namespace LinearSolvers
{
template <class PreconditionerTypeA, class PreconditionerTypeMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner(const TrilinosWrappers::BlockSparseMatrix &S,
// 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 <int dim, int fe_degree, typename number>
LaplaceOperator<dim, fe_degree, number>::LaplaceOperator()
: MatrixFreeOperators::Base<dim,
mg_matrix_dg_down.clear_elements();
// It is important to update the sparsity patterns after <tt>clear()</tt>
// 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);
namespace LinearSolvers
{
template <class MatrixType, class PreconditionerType>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m,
}
template <class PreconditionerTypeA, class PreconditionerTypeMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner(
template <class MatrixType, class PreconditionerType>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m,
// step-31 to convert a run-time exception into a failed assertion
// should the inner solver not converge.
template <class Matrix, class Preconditioner>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const Matrix &m, const Preconditioner &preconditioner);
// The class A template class for a simple block diagonal preconditioner
// for 2x2 matrices.
template <class PreconditionerA, class PreconditionerS>
- class BlockDiagonalPreconditioner : public Subscriptor
+ class BlockDiagonalPreconditioner
+ : public EnableRefCountingByObserverPointer
{
public:
BlockDiagonalPreconditioner(const PreconditionerA &preconditioner_A,
// Notice how we keep track of the sum of the inner iterations
// (preconditioner applications).
template <class PreconditionerAType, class PreconditionerSType>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner(
// positive definite, we can use CG to solve the corresponding linear
// system.
template <class PreconditionerMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner(double gamma,
// 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,
// step-39.
template <int dim, int fe_degree, typename number>
- class LaplaceOperator : public Subscriptor
+ class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
// needs to have a `vmult()` function that performs the action of
// the linear operator on a source vector.
template <int dim, int fe_degree>
- class HelmholtzOperator : public Subscriptor
+ class HelmholtzOperator : public EnableRefCountingByObserverPointer
{
public:
HelmholtzOperator(const DoFHandler<dim> &dof_handler,
// The constructor of the <code>JacobianOperator</code> just calls the
// constructor of the base class MatrixFreeOperators::Base, which is itself
- // derived from the Subscriptor class.
+ // derived from the EnableRefCountingByObserverPointer class.
template <int dim, int fe_degree, typename number>
JacobianOperator<dim, fe_degree, number>::JacobianOperator()
: MatrixFreeOperators::Base<dim,
// still active references to an object and the object is still alive
// from the point of view of a using object. Basically, the method is along
// the following line: all objects that are subject to such potentially
- // dangerous pointers are derived from a class called Subscriptor. For
- // example, the Triangulation, DoFHandler, and a base class of the
- // FiniteElement class are derived from Subscriptor. This latter class
- // does not offer much functionality, but it has a built-in counter which
- // we can subscribe to, thus the name of the class. Whenever we initialize
- // a pointer to that object, we can increase its use counter, and when we
- // move away our pointer or do not need it any more, we decrease the
- // counter again. This way, we can always check how many objects still use
- // that object. Additionally, the class requires to know about a pointer
- // that it can use to tell the subscribing object about its invalidation.
+ // dangerous pointers are derived from a class called
+ // EnableRefCountingByObserverPointer. For example, the Triangulation,
+ // DoFHandler, and a base class of the FiniteElement class are derived from
+ // EnableRefCountingByObserverPointer. This latter class does not offer much
+ // functionality, but it has a built-in counter which we can subscribe to,
+ // thus the name of the class. Whenever we initialize a pointer to that
+ // object, we can increase its use counter, and when we move away our
+ // pointer or do not need it any more, we decrease the counter again. This
+ // way, we can always check how many objects still use that object.
+ // Additionally, the class requires to know about a pointer that it can use
+ // to tell the subscribing object about its invalidation.
//
- // If an object of a class that is derived from the Subscriptor class is
- // destroyed, it also has to call the destructor of the Subscriptor class.
- // In this destructor, we tell all the subscribing objects about the
+ // If an object of a class that is derived from the
+ // EnableRefCountingByObserverPointer class is destroyed, it also has to
+ // call the destructor of the EnableRefCountingByObserverPointer class. In
+ // this destructor, we tell all the subscribing objects about the
// invalidation of the object using the stored pointers. The same happens
// when the object appears on the right hand side of a move expression,
// i.e., it will no longer contain valid content after the operation. The
// points. Here, we introduce an alias to FEEvaluation with the correct
// template parameters so that we do not have to worry about them later on.
template <int dim, typename number>
- class LaplaceOperator : public Subscriptor
+ class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using VectorType = LinearAlgebra::distributed::Vector<number>;
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 <int dim>
template <class Archive>
Quadrature<dim>::serialize(Archive &ar, const unsigned int)
{
// Forward to the (de)serialization function in the base class:
- ar & static_cast<Subscriptor &>(*this);
+ ar & static_cast<EnableRefCountingByObserverPointer &>(*this);
// Then (de)serialize the member variables:
ar & quadrature_points & weights;
*
* @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
*
* When using this class, please cite @cite SartoriGiulianiBardelloni-2018-a.
*/
-class GeneralDataStorage : public Subscriptor
+class GeneralDataStorage : public EnableRefCountingByObserverPointer
{
public:
/**
* providing additional information and forwarded to the inner Operator
* objects of the nested iteration.
*/
- class OperatorBase : public Subscriptor
+ class OperatorBase : public EnableRefCountingByObserverPointer
{
public:
/**
* in each step of an iteration.
*/
template <typename VectorType>
- class OutputOperator : public Subscriptor
+ class OutputOperator : public EnableRefCountingByObserverPointer
{
public:
/**
* with a more modern interface and better programming guarantees. Consider
* using DiscreteTime instead of TimestepControl.
*/
- class TimestepControl : public Subscriptor
+ class TimestepControl : public EnableRefCountingByObserverPointer
{
public:
/**
template <int dim, typename RangeNumberType = double>
class Function : public FunctionTime<
typename numbers::NumberTraits<RangeNumberType>::real_type>,
- public Subscriptor
+ public EnableRefCountingByObserverPointer
{
public:
/**
*
* @ingroup textoutput
*/
-class LogStream : public Subscriptor
+class LogStream : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup data
*/
template <class Object>
-class MGLevelObject : public Subscriptor
+class MGLevelObject : public EnableRefCountingByObserverPointer
{
public:
/**
* 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
* to a constant object (disallowing write access when dereferenced), while
* `ObserverPointer<T>` is a mutable pointer.
*
- * @dealiiConceptRequires{std::is_base_of_v<Subscriptor, T>}
+ * @dealiiConceptRequires{std::is_base_of_v<EnableRefCountingByObserverPointer,
+ * T>}
*
* @ingroup memory
*/
* 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 <tt>id</tt> is used in the call to Subscriptor::subscribe(id) and by
- * ~ObserverPointer() in the call to Subscriptor::unsubscribe().
+ * The <tt>id</tt> 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);
, id(typeid(P).name())
, pointed_to_object_is_alive(false)
{
- static_assert(std::is_base_of_v<Subscriptor, T>,
- "This class can only be used if the first template argument "
- "is a class derived from 'Subscriptor'.");
+ static_assert(
+ std::is_base_of_v<EnableRefCountingByObserverPointer, T>,
+ "This class can only be used if the first template argument "
+ "is a class derived from 'EnableRefCountingByObserverPointer'.");
}
, id(typeid(P).name())
, pointed_to_object_is_alive(false)
{
- static_assert(std::is_base_of_v<Subscriptor, T>,
- "This class can only be used if the first template argument "
- "is a class derived from 'Subscriptor'.");
+ static_assert(
+ std::is_base_of_v<EnableRefCountingByObserverPointer, T>,
+ "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);
, id(id)
, pointed_to_object_is_alive(false)
{
- static_assert(std::is_base_of_v<Subscriptor, T>,
- "This class can only be used if the first template argument "
- "is a class derived from 'Subscriptor'.");
+ static_assert(
+ std::is_base_of_v<EnableRefCountingByObserverPointer, T>,
+ "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);
, id(other.id)
, pointed_to_object_is_alive(false)
{
- static_assert(std::is_base_of_v<Subscriptor, T>,
- "This class can only be used if the first template argument "
- "is a class derived from 'Subscriptor'.");
+ static_assert(
+ std::is_base_of_v<EnableRefCountingByObserverPointer, T>,
+ "This class can only be used if the first template argument "
+ "is a class derived from 'EnableRefCountingByObserverPointer'.");
if (other != nullptr)
{
, id(other.id)
, pointed_to_object_is_alive(false)
{
- static_assert(std::is_base_of_v<Subscriptor, T>,
- "This class can only be used if the first template argument "
- "is a class derived from 'Subscriptor'.");
+ static_assert(
+ std::is_base_of_v<EnableRefCountingByObserverPointer, T>,
+ "This class can only be used if the first template argument "
+ "is a class derived from 'EnableRefCountingByObserverPointer'.");
if (other != nullptr)
{
, id(other.id)
, pointed_to_object_is_alive(false)
{
- static_assert(std::is_base_of_v<Subscriptor, T>,
- "This class can only be used if the first template argument "
- "is a class derived from 'Subscriptor'.");
+ static_assert(
+ std::is_base_of_v<EnableRefCountingByObserverPointer, T>,
+ "This class can only be used if the first template argument "
+ "is a class derived from 'EnableRefCountingByObserverPointer'.");
if (other != nullptr)
{
template <typename T, typename P>
inline ObserverPointer<T, P>::~ObserverPointer()
{
- static_assert(std::is_base_of_v<Subscriptor, T>,
- "This class can only be used if the first template argument "
- "is a class derived from 'Subscriptor'.");
+ static_assert(
+ std::is_base_of_v<EnableRefCountingByObserverPointer, T>,
+ "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);
*
* See the tutorial program step-60 for an example on how to use this class.
*/
-class ParameterAcceptor : public Subscriptor
+class ParameterAcceptor : public EnableRefCountingByObserverPointer
{
public:
/**
*
* @ingroup input
*/
-class ParameterHandler : public Subscriptor
+class ParameterHandler : public EnableRefCountingByObserverPointer
{
public:
/**
{
// Forward to serialization
// function in the base class.
- ar &static_cast<const Subscriptor &>(*this);
+ ar &static_cast<const EnableRefCountingByObserverPointer &>(*this);
ar &*entries.get();
{
// Forward to serialization
// function in the base class.
- ar &static_cast<Subscriptor &>(*this);
+ ar &static_cast<EnableRefCountingByObserverPointer &>(*this);
ar &*entries.get();
* TensorProductPolynomials class.
*/
template <typename number>
- class Polynomial : public Subscriptor
+ class Polynomial : public EnableRefCountingByObserverPointer
{
public:
/**
Polynomial<number>::serialize(Archive &ar, const unsigned int)
{
// forward to serialization function in the base class.
- ar &static_cast<Subscriptor &>(*this);
+ ar &static_cast<EnableRefCountingByObserverPointer &>(*this);
ar &coefficients;
ar &in_lagrange_product_form;
ar &lagrange_support_points;
* @ingroup Polynomials
*/
template <typename number>
- class PiecewisePolynomial : public Subscriptor
+ class PiecewisePolynomial : public EnableRefCountingByObserverPointer
{
public:
/**
PiecewisePolynomial<number>::serialize(Archive &ar, const unsigned int)
{
// forward to serialization function in the base class.
- ar &static_cast<Subscriptor &>(*this);
+ ar &static_cast<EnableRefCountingByObserverPointer &>(*this);
ar &polynomial;
ar &n_intervals;
ar &interval;
* as "list of evaluation points".
*/
template <int dim>
-class Quadrature : public Subscriptor
+class Quadrature : public EnableRefCountingByObserverPointer
{
public:
/**
{
// forward to serialization
// function in the base class.
- ar &static_cast<Subscriptor &>(*this);
+ ar &static_cast<EnableRefCountingByObserverPointer &>(*this);
ar &quadrature_points &weights;
}
* for example, adopting a level-set approach to describe material behavior.
*/
template <typename CellIteratorType, typename DataType>
-class CellDataStorage : public Subscriptor
+class CellDataStorage : public EnableRefCountingByObserverPointer
{
public:
/**
*
* 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
*
* @ingroup memory
*/
-class Subscriptor
+class EnableRefCountingByObserverPointer
{
public:
/**
* Constructor setting the counter to zero.
*/
- Subscriptor();
+ EnableRefCountingByObserverPointer();
/**
* Copy-constructor.
* 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.
* This has to be handled with care, too, because the counter has to remain
* the same. It therefore does nothing more than returning <tt>*this</tt>.
*/
- 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.
* @{
*/
/**
* 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,
//---------------------------------------------------------------------------
-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;
inline unsigned int
-Subscriptor::n_subscriptions() const
+EnableRefCountingByObserverPointer::n_subscriptions() const
{
return counter;
}
template <class Archive>
inline void
-Subscriptor::serialize(Archive &, const unsigned int)
+EnableRefCountingByObserverPointer::serialize(Archive &, const unsigned int)
{
// do nothing, as explained in the
// documentation of this function
template <typename StreamType>
inline void
-Subscriptor::list_subscribers(StreamType &stream) const
+EnableRefCountingByObserverPointer::list_subscribers(StreamType &stream) const
{
std::lock_guard<std::mutex> lock(mutex);
* @ingroup data
*/
template <int N, typename T>
-class TableBase : public Subscriptor
+class TableBase : public EnableRefCountingByObserverPointer
{
public:
using value_type = T;
template <int N, typename T>
TableBase<N, T>::TableBase(const TableBase<N, T> &src)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, values(src.values)
, table_size(src.table_size)
{}
template <int N, typename T>
TableBase<N, T>::TableBase(TableBase<N, T> &&src) noexcept
- : Subscriptor(std::move(src))
+ : EnableRefCountingByObserverPointer(std::move(src))
, values(std::move(src.values))
, table_size(src.table_size)
{
inline void
TableBase<N, T>::serialize(Archive &ar, const unsigned int)
{
- ar &static_cast<Subscriptor &>(*this);
+ ar &static_cast<EnableRefCountingByObserverPointer &>(*this);
ar &values &table_size;
}
inline TableBase<N, T> &
TableBase<N, T>::operator=(TableBase<N, T> &&m) noexcept
{
- static_cast<Subscriptor &>(*this) = std::move(static_cast<Subscriptor &>(m));
- values = std::move(m.values);
- table_size = m.table_size;
- m.table_size = TableIndices<N>();
+ static_cast<EnableRefCountingByObserverPointer &>(*this) =
+ std::move(static_cast<EnableRefCountingByObserverPointer &>(m));
+ values = std::move(m.values);
+ table_size = m.table_size;
+ m.table_size = TableIndices<N>();
return *this;
}
template <int rank, int dim, typename Number = double>
class TensorFunction
: public FunctionTime<typename numbers::NumberTraits<Number>::real_type>,
- public Subscriptor
+ public EnableRefCountingByObserverPointer
{
public:
/**
* See the description of RepartitioningPolicyTools for more information.
*/
template <int dim, int spacedim = dim>
- class Base : public Subscriptor
+ class Base : public EnableRefCountingByObserverPointer
{
public:
/**
* for more information about artificial cells.
*/
template <int dim, int spacedim = dim>
- class TemporarilyRestoreSubdomainIds : public Subscriptor
+ class TemporarilyRestoreSubdomainIds
+ : public EnableRefCountingByObserverPointer
{
public:
/**
* The use of this class is demonstrated in step-75.
*/
template <int dim, int spacedim = dim>
- class TemporarilyMatchRefineFlags : public Subscriptor
+ class TemporarilyMatchRefineFlags
+ : public EnableRefCountingByObserverPointer
{
public:
/**
*
* @ingroup dofs
*/
-class BlockInfo : public Subscriptor
+class BlockInfo : public EnableRefCountingByObserverPointer
{
public:
/**
*/
template <int dim, int spacedim = dim>
DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
-class DoFHandler : public Subscriptor
+class DoFHandler : public EnableRefCountingByObserverPointer
{
using ActiveSelector =
dealii::internal::DoFHandlerImplementation::Iterators<dim, spacedim, false>;
* @ingroup febase fe
*/
template <int dim, int spacedim = dim>
-class FiniteElement : public Subscriptor, public FiniteElementData<dim>
+class FiniteElement : public EnableRefCountingByObserverPointer,
+ public FiniteElementData<dim>
{
public:
/**
* $ \bf k $ .
*/
template <int dim, int spacedim = dim>
- class Fourier : public Subscriptor
+ class Fourier : public EnableRefCountingByObserverPointer
{
public:
using CoefficientType = typename std::complex<double>;
* $ \widetilde P_m(x) $ using tensor product rule.
*/
template <int dim, int spacedim = dim>
- class Legendre : public Subscriptor
+ class Legendre : public EnableRefCountingByObserverPointer
{
public:
using CoefficientType = double;
* FETools::add_fe_name() functions.
*/
template <int dim, int spacedim = dim>
- class FEFactoryBase : public Subscriptor
+ class FEFactoryBase : public EnableRefCountingByObserverPointer
{
public:
/**
template <int dim>
void
fill_no_codim_fe_names(
- std::map<std::string, std::unique_ptr<const Subscriptor>> &result)
+ std::map<std::string,
+ std::unique_ptr<const EnableRefCountingByObserverPointer>>
+ &result)
{
result["FE_Q_Hierarchical"] =
std::make_unique<FETools::FEFactory<FE_Q_Hierarchical<dim>>>();
template <int dim, int spacedim>
void
fill_codim_fe_names(
- std::map<std::string, std::unique_ptr<const Subscriptor>> &result)
+ std::map<std::string,
+ std::unique_ptr<const EnableRefCountingByObserverPointer>>
+ &result)
{
result["FE_Bernstein"] =
std::make_unique<FETools::FEFactory<FE_Bernstein<dim, spacedim>>>();
// fe_name_map[dimension][spacedimension] with the maps generated
// by the functions above.
std::array<
- std::array<std::map<std::string, std::unique_ptr<const Subscriptor>>,
- 4>,
+ std::array<
+ std::map<std::string,
+ std::unique_ptr<const EnableRefCountingByObserverPointer>>,
+ 4>,
4> inline fill_default_map()
{
std::array<
- std::array<std::map<std::string, std::unique_ptr<const Subscriptor>>,
- 4>,
+ std::array<
+ std::map<std::string,
+ std::unique_ptr<const EnableRefCountingByObserverPointer>>,
+ 4>,
4>
result;
// 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<std::map<std::string, std::unique_ptr<const Subscriptor>>,
- 4>,
+ std::array<
+ std::map<std::string,
+ std::unique_ptr<const EnableRefCountingByObserverPointer>>,
+ 4>,
4> &
get_fe_name_map()
{
static std::array<
- std::array<std::map<std::string, std::unique_ptr<const Subscriptor>>,
- 4>,
+ std::array<
+ std::map<std::string,
+ std::unique_ptr<const EnableRefCountingByObserverPointer>>,
+ 4>,
4>
fe_name_map = fill_default_map();
return fe_name_map;
std::unique_lock<std::shared_mutex> lock(
internal::FEToolsAddFENameHelper::fe_name_map_lock);
internal::FEToolsAddFENameHelper::get_fe_name_map()[dim][spacedim].emplace(
- name, std::unique_ptr<const Subscriptor>(factory));
+ name, std::unique_ptr<const EnableRefCountingByObserverPointer>(factory));
}
std::unique_ptr<FiniteElement<dim, spacedim>>
get_fe_by_name_ext(
std::string &name,
- const std::map<std::string, std::unique_ptr<const Subscriptor>>
+ const std::map<
+ std::string,
+ std::unique_ptr<const EnableRefCountingByObserverPointer>>
&fe_name_map)
{
// Extract the name of the
// 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<dim, spacedim> *fef =
dynamic_cast<const FETools::FEFactoryBase<dim, spacedim> *>(ptr);
return fef->get(1);
const std::pair<int, unsigned int> 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<dim, spacedim> *fef =
dynamic_cast<const FETools::FEFactoryBase<dim, spacedim> *>(
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<dim, spacedim> *fef =
dynamic_cast<
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<dim, spacedim> *fef =
dynamic_cast<
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<dim, spacedim> *fef =
dynamic_cast<
* @ingroup feaccess
*/
template <int dim, int spacedim>
-class FEValuesBase : public Subscriptor
+class FEValuesBase : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup mapping
*/
template <int dim, int spacedim = dim>
-class Mapping : public Subscriptor
+class Mapping : public EnableRefCountingByObserverPointer
{
public:
/**
* method mark_for_update() manually.
*/
template <int dim, int spacedim = dim>
- class Cache : public Subscriptor
+ class Cache : public EnableRefCountingByObserverPointer
{
public:
/**
*/
template <typename MeshType>
DEAL_II_CXX20_REQUIRES(concepts::is_triangulation_or_dof_handler<MeshType>)
-class InterGridMap : public Subscriptor
+class InterGridMap : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup manifold
*/
template <int dim, int spacedim = dim>
-class Manifold : public Subscriptor
+class Manifold : public EnableRefCountingByObserverPointer
{
public:
// explicitly check for sensible template arguments
*/
template <int dim, int spacedim = dim>
DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
-class Triangulation : public Subscriptor
+class Triangulation : public EnableRefCountingByObserverPointer
{
private:
/**
* @ingroup hp hpcollection
*/
template <typename T>
- class Collection : public Subscriptor
+ class Collection : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup hp
*/
template <int dim, int q_dim, typename FEValuesType>
- class FEValuesBase : public Subscriptor
+ class FEValuesBase : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup constraints
*/
template <typename number = double>
-class AffineConstraints : public Subscriptor
+class AffineConstraints : public EnableRefCountingByObserverPointer
{
public:
/**
template <typename number>
inline AffineConstraints<number>::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)
* @ref step_36 "step-36"
* for an example.
*/
-class ArpackSolver : public Subscriptor
+class ArpackSolver : public EnableRefCountingByObserverPointer
{
public:
/**
* @see
* @ref GlossBlockLA "Block (linear algebra)"
*/
-class BlockIndices : public Subscriptor
+class BlockIndices : public EnableRefCountingByObserverPointer
{
public:
/**
* @ref GlossBlockLA "Block (linear algebra)"
*/
template <typename MatrixType>
-class BlockMatrixBase : public Subscriptor
+class BlockMatrixBase : public EnableRefCountingByObserverPointer
{
public:
/**
* @ref GlossBlockLA "Block (linear algebra)"
*/
template <typename Number>
-class BlockSparseMatrixEZ : public Subscriptor
+class BlockSparseMatrixEZ : public EnableRefCountingByObserverPointer
{
public:
/**
template <typename number>
BlockSparseMatrixEZ<number>::BlockSparseMatrixEZ(
const BlockSparseMatrixEZ<number> &m)
- : Subscriptor(m)
+ : EnableRefCountingByObserverPointer(m)
, row_indices(m.row_indices)
, column_indices(m.column_indices)
, blocks(m.blocks)
* @ref GlossBlockLA "Block (linear algebra)"
*/
template <typename VectorType>
-class BlockVectorBase : public Subscriptor,
+class BlockVectorBase : public EnableRefCountingByObserverPointer,
public ReadVector<typename VectorType::value_type>
{
public:
* in the manual).
*/
template <typename number>
-class ChunkSparseMatrix : public virtual Subscriptor
+class ChunkSparseMatrix : public virtual EnableRefCountingByObserverPointer
{
public:
/**
template <typename number>
ChunkSparseMatrix<number>::ChunkSparseMatrix(const ChunkSparseMatrix &m)
- : Subscriptor(m)
+ : EnableRefCountingByObserverPointer(m)
, cols(nullptr, "ChunkSparseMatrix")
, val(nullptr)
, max_len(0)
*
* The use of this class is demonstrated in step-51.
*/
-class ChunkSparsityPattern : public Subscriptor
+class ChunkSparsityPattern : public EnableRefCountingByObserverPointer
{
public:
/**
* @endcode
*/
template <typename VectorType = Vector<double>>
-class DiagonalMatrix : public Subscriptor
+class DiagonalMatrix : public EnableRefCountingByObserverPointer
{
public:
using value_type = typename VectorType::value_type;
* @endcode
*/
template <typename Number, typename MemorySpace = MemorySpace::Host>
- class Vector : public ::dealii::ReadVector<Number>, public Subscriptor
+ class Vector : public ::dealii::ReadVector<Number>,
+ public EnableRefCountingByObserverPointer
{
public:
using memory_space = MemorySpace;
template <typename Number, typename MemorySpaceType>
Vector<Number, MemorySpaceType>::Vector(
const Vector<Number, MemorySpaceType> &v)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, allocated_size(0)
, vector_is_ghosted(false)
, comm_sm(MPI_COMM_SELF)
Vector<Number, MemorySpaceType> &&v)
: Vector()
{
- static_cast<Subscriptor &>(*this) = static_cast<Subscriptor &&>(v);
+ static_cast<EnableRefCountingByObserverPointer &>(*this) =
+ static_cast<EnableRefCountingByObserverPointer &&>(v);
this->swap(v);
}
Vector<Number, MemorySpaceType>::operator=( // NOLINT
Vector<Number, MemorySpaceType> &&v)
{
- static_cast<Subscriptor &>(*this) = static_cast<Subscriptor &&>(v);
+ static_cast<EnableRefCountingByObserverPointer &>(*this) =
+ static_cast<EnableRefCountingByObserverPointer &&>(v);
this->swap(v);
return *this;
}
* @ingroup Preconditioners
*/
template <typename number>
-class PreconditionLU : public Subscriptor
+class PreconditionLU : public EnableRefCountingByObserverPointer
{
public:
void
* @ref GlossBlockLA "Block (linear algebra)"
*/
template <typename MatrixType>
-class MatrixBlock : public Subscriptor
+class MatrixBlock : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup vector_valued
*/
template <typename MatrixType>
-class MGMatrixBlockVector : public Subscriptor
+class MGMatrixBlockVector : public EnableRefCountingByObserverPointer
{
public:
/**
* PARPACK manual.
*/
template <typename VectorType>
-class PArpackSolver : public Subscriptor
+class PArpackSolver : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup PETScWrappers
* @ingroup Matrix1
*/
- class MatrixBase : public Subscriptor
+ class MatrixBase : public EnableRefCountingByObserverPointer
{
public:
/**
*
* @ingroup PETScWrappers
*/
- class PreconditionBase : public Subscriptor
+ class PreconditionBase : public EnableRefCountingByObserverPointer
{
public:
/**
* methods:
*
* @code
- * class VectorType : public Subscriptor
+ * class VectorType : public EnableRefCountingByObserverPointer
* ...
* explicit VectorType(Vec);
* ...
* @endcode
*
* @code
- * class MatrixType : public Subscriptor
+ * class MatrixType : public EnableRefCountingByObserverPointer
* ...
* explicit MatrixType(Mat);
* ...
* methods:
*
* @code
- * class VectorType : public Subscriptor
+ * class VectorType : public EnableRefCountingByObserverPointer
* ...
* explicit VectorType(Vec);
* ...
* @endcode
*
* @code
- * class MatrixType : public Subscriptor
+ * class MatrixType : public EnableRefCountingByObserverPointer
* ...
* explicit MatrixType(Mat);
* ...
*
* @ingroup PETScWrappers
*/
- class VectorBase : public ReadVector<PetscScalar>, public Subscriptor
+ class VectorBase : public ReadVector<PetscScalar>,
+ public EnableRefCountingByObserverPointer
{
public:
/**
VectorBase::save(Archive &ar, const unsigned int) const
{
// forward to serialization function in the base class.
- ar &static_cast<const Subscriptor &>(*this);
+ ar &static_cast<const EnableRefCountingByObserverPointer &>(*this);
ar &size();
ar &local_range();
inline void
VectorBase::load(Archive &ar, const unsigned int)
{
- ar &static_cast<Subscriptor &>(*this);
+ ar &static_cast<EnableRefCountingByObserverPointer &>(*this);
size_type size = 0;
std::pair<size_type, size_type> local_range;
* Alternatively, the IdentityMatrix class can be used to precondition in this
* way.
*/
-class PreconditionIdentity : public Subscriptor
+class PreconditionIdentity : public EnableRefCountingByObserverPointer
{
public:
/**
* multiplied. Still, this class is useful in multigrid smoother objects
* (MGSmootherRelaxation).
*/
-class PreconditionRichardson : public Subscriptor
+class PreconditionRichardson : public EnableRefCountingByObserverPointer
{
public:
/**
*/
template <typename MatrixType = SparseMatrix<double>,
typename VectorType = Vector<double>>
-class PreconditionUseMatrix : public Subscriptor
+class PreconditionUseMatrix : public EnableRefCountingByObserverPointer
{
public:
/**
*/
template <typename MatrixType = SparseMatrix<double>,
typename PreconditionerType = IdentityMatrix>
-class PreconditionRelaxation : public Subscriptor
+class PreconditionRelaxation : public EnableRefCountingByObserverPointer
{
public:
/**
*
* <h4>Requirements on the templated classes</h4>
*
- * 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 <tt>el(i,i)</tt> methods for accessing the matrix
template <typename MatrixType = SparseMatrix<double>,
typename VectorType = Vector<double>,
typename PreconditionerType = DiagonalMatrix<VectorType>>
-class PreconditionChebyshev : public Subscriptor
+class PreconditionChebyshev : public EnableRefCountingByObserverPointer
{
public:
/**
*/
template <typename MatrixType,
typename inverse_type = typename MatrixType::value_type>
-class PreconditionBlock : public virtual Subscriptor,
+class PreconditionBlock : public virtual EnableRefCountingByObserverPointer,
protected PreconditionBlockBase<inverse_type>
{
private:
template <typename MatrixType,
typename inverse_type = typename MatrixType::value_type>
class PreconditionBlockJacobi
- : public virtual Subscriptor,
+ : public virtual EnableRefCountingByObserverPointer,
private PreconditionBlock<MatrixType, inverse_type>
{
private:
template <typename MatrixType,
typename inverse_type = typename MatrixType::value_type>
class PreconditionBlockSOR
- : public virtual Subscriptor,
+ : public virtual EnableRefCountingByObserverPointer,
protected PreconditionBlock<MatrixType, inverse_type>
{
public:
template <typename MatrixType,
typename inverse_type = typename MatrixType::value_type>
class PreconditionBlockSSOR
- : public virtual Subscriptor,
+ : public virtual EnableRefCountingByObserverPointer,
private PreconditionBlockSOR<MatrixType, inverse_type>
{
public:
*/
template <typename MatrixType = SparseMatrix<double>,
typename VectorType = dealii::Vector<double>>
-class PreconditionSelector : public Subscriptor
+class PreconditionSelector : public EnableRefCountingByObserverPointer
{
public:
/**
* get the first index of the largest range.
*/
template <typename Number>
- class ReadWriteVector : public Subscriptor, public ReadVector<Number>
+ class ReadWriteVector : public EnableRefCountingByObserverPointer,
+ public ReadVector<Number>
{
public:
/**
template <typename Number>
inline ReadWriteVector<Number>::ReadWriteVector(
const ReadWriteVector<Number> &v)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
{
this->operator=(v);
}
* structure in #block_list and an optional ordering of the blocks in
* #order.
*/
- class AdditionalData : public Subscriptor
+ class AdditionalData : public EnableRefCountingByObserverPointer
{
public:
/**
typename InverseNumberType = typename MatrixType::value_type,
typename VectorType = Vector<double>>
class RelaxationBlockJacobi
- : public virtual Subscriptor,
+ : public virtual EnableRefCountingByObserverPointer,
protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
{
public:
typename InverseNumberType = typename MatrixType::value_type,
typename VectorType = Vector<double>>
class RelaxationBlockSOR
- : public virtual Subscriptor,
+ : public virtual EnableRefCountingByObserverPointer,
protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
{
public:
typename InverseNumberType = typename MatrixType::value_type,
typename VectorType = Vector<double>>
class RelaxationBlockSSOR
- : public virtual Subscriptor,
+ : public virtual EnableRefCountingByObserverPointer,
protected RelaxationBlock<MatrixType, InverseNumberType, VectorType>
{
public:
*/
template <typename VectorType = Vector<double>>
DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
-class SolverBase : public Subscriptor
+class SolverBase : public EnableRefCountingByObserverPointer
{
public:
/**
* number of iterations.
* </ul>
*/
-class SolverControl : public Subscriptor
+class SolverControl : public EnableRefCountingByObserverPointer
{
public:
/**
*/
template <typename VectorType = Vector<double>>
DEAL_II_CXX20_REQUIRES(concepts::is_vector_space_vector<VectorType>)
-class SolverSelector : public Subscriptor
+class SolverSelector : public EnableRefCountingByObserverPointer
{
public:
/**
*/
template <typename number>
class SparseLUDecomposition : protected SparseMatrix<number>,
- public virtual Subscriptor
+ public virtual EnableRefCountingByObserverPointer
{
protected:
/**
*
* @ingroup Solvers Preconditioners
*/
-class SparseDirectUMFPACK : public Subscriptor
+class SparseDirectUMFPACK : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup Matrix1
*/
template <typename number>
-class SparseMatrix : public virtual Subscriptor
+class SparseMatrix : public virtual EnableRefCountingByObserverPointer
{
public:
/**
template <typename number>
SparseMatrix<number>::SparseMatrix(const SparseMatrix &m)
- : Subscriptor(m)
+ : EnableRefCountingByObserverPointer(m)
, cols(nullptr, "SparseMatrix")
, val(nullptr)
, max_len(0)
template <typename number>
SparseMatrix<number>::SparseMatrix(SparseMatrix<number> &&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)
* where "EZ" is pronounced the same way as the word "easy".
*/
template <typename number>
-class SparseMatrixEZ : public Subscriptor
+class SparseMatrixEZ : public EnableRefCountingByObserverPointer
{
public:
/**
template <typename number>
SparseMatrixEZ<number>::SparseMatrixEZ(const SparseMatrixEZ<number> &m)
- : Subscriptor(m)
+ : EnableRefCountingByObserverPointer(m)
, n_columns(0)
, increment(m.increment)
, saved_default_row_length(m.saved_default_row_length)
SparsityPattern::save(Archive &ar, const unsigned int) const
{
// forward to serialization function in the base class.
- ar &boost::serialization::base_object<const Subscriptor>(*this);
+ ar &
+ boost::serialization::base_object<const EnableRefCountingByObserverPointer>(
+ *this);
ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed;
SparsityPattern::load(Archive &ar, const unsigned int)
{
// forward to serialization function in the base class.
- ar &boost::serialization::base_object<Subscriptor>(*this);
+ ar &boost::serialization::base_object<EnableRefCountingByObserverPointer>(
+ *this);
ar &max_dim &rows &cols &max_vec_len &max_row_length &compressed;
* 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:
/**
* @ingroup Vectors
*/
class Vector : public ReadVector<VectorTraits::value_type>,
- public Subscriptor
+ public EnableRefCountingByObserverPointer
{
public:
using value_type = VectorTraits::value_type;
* @ingroup TrilinosWrappers
* @ingroup Preconditioners
*/
- class PreconditionBase : public Subscriptor
+ class PreconditionBase : public EnableRefCountingByObserverPointer
{
public:
/**
*
* @ingroup TrilinosWrappers
*/
- class SolverDirect : public Subscriptor
+ class SolverDirect : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup TrilinosWrappers
* @ingroup Matrix1
*/
- class SparseMatrix : public Subscriptor
+ class SparseMatrix : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup Preconditioners
*/
template <typename Number, typename MemorySpace = dealii::MemorySpace::Host>
- class PreconditionBase : public Subscriptor
+ class PreconditionBase : public EnableRefCountingByObserverPointer
{
public:
/**
* the matrix, you must call SparseMatrix::compress() again.
*/
template <typename Number, typename MemorySpace = dealii::MemorySpace::Host>
- class SparseMatrix : public Subscriptor
+ class SparseMatrix : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup Vectors
*/
template <typename Number, typename MemorySpace = dealii::MemorySpace::Host>
- class Vector : public ReadVector<Number>, public Subscriptor
+ class Vector : public ReadVector<Number>,
+ public EnableRefCountingByObserverPointer
{
public:
/**
template <typename Number, typename MemorySpace>
Vector<Number, MemorySpace>::Vector()
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, compressed(true)
, has_ghost(false)
, vector(Utilities::Trilinos::internal::make_rcp<
template <typename Number, typename MemorySpace>
Vector<Number, MemorySpace>::Vector(const Vector<Number, MemorySpace> &V)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, compressed(V.compressed)
, has_ghost(V.has_ghost)
, vector(Utilities::Trilinos::internal::make_rcp<
template <typename Number, typename MemorySpace>
Vector<Number, MemorySpace>::Vector(
const Teuchos::RCP<TpetraTypes::VectorType<Number, MemorySpace>> V)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, compressed(true)
, has_ghost(V->getMap()->isOneToOne() == false)
, vector(V)
template <typename Number, typename MemorySpace>
Vector<Number, MemorySpace>::Vector(const IndexSet ¶llel_partitioner,
const MPI_Comm communicator)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, compressed(true)
, has_ghost(false)
, vector(Utilities::Trilinos::internal::make_rcp<
const IndexSet &ghost_entries,
const MPI_Comm communicator,
const bool vector_writable)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
{
if (!vector_writable)
{
* @ingroup TrilinosWrappers
* @ingroup Vectors
*/
- class Vector : public Subscriptor, public ReadVector<TrilinosScalar>
+ class Vector : public EnableRefCountingByObserverPointer,
+ public ReadVector<TrilinosScalar>
{
public:
/**
* in the manual).
*/
template <typename Number>
-class Vector : public Subscriptor, public ReadVector<Number>
+class Vector : public EnableRefCountingByObserverPointer,
+ public ReadVector<Number>
{
public:
/**
Vector<Number>::save(Archive &ar, const unsigned int) const
{
// forward to serialization function in the base class.
- ar &static_cast<const Subscriptor &>(*this);
+ ar &static_cast<const EnableRefCountingByObserverPointer &>(*this);
ar &values;
}
Vector<Number>::load(Archive &ar, const unsigned int)
{
// the load stuff again from the archive
- ar &static_cast<Subscriptor &>(*this);
+ ar &static_cast<EnableRefCountingByObserverPointer &>(*this);
ar &values;
maybe_reset_thread_partitioner();
}
template <typename Number>
Vector<Number>::Vector(const Vector<Number> &v)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
{
*this = v;
}
* <i>always</i> returned.
*/
template <typename VectorType = dealii::Vector<double>>
-class VectorMemory : public Subscriptor
+class VectorMemory : public EnableRefCountingByObserverPointer
{
public:
/**
* A class to fill the fields in PrecomputedEvaluationData.
*/
template <int dim>
-class FERemoteEvaluationCommunicator : public Subscriptor
+class FERemoteEvaluationCommunicator : public EnableRefCountingByObserverPointer
{
public:
/**
template <int dim,
typename Number = double,
typename VectorizedArrayType = VectorizedArray<Number>>
-class MatrixFree : public Subscriptor
+class MatrixFree : public EnableRefCountingByObserverPointer
{
static_assert(
std::is_same_v<Number, typename VectorizedArrayType::value_type>,
template <int dim, typename Number, typename VectorizedArrayType>
MatrixFree<dim, Number, VectorizedArrayType>::MatrixFree()
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, indices_are_initialized(false)
, mapping_is_initialized(false)
, mg_level(numbers::invalid_unsigned_int)
template <int dim, typename Number, typename VectorizedArrayType>
MatrixFree<dim, Number, VectorizedArrayType>::MatrixFree(
const MatrixFree<dim, Number, VectorizedArrayType> &other)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
{
copy_from(other);
}
typename VectorType = LinearAlgebra::distributed::Vector<double>,
typename VectorizedArrayType =
VectorizedArray<typename VectorType::value_type>>
- class Base : public Subscriptor
+ class Base : public EnableRefCountingByObserverPointer
{
public:
/**
* prolongation phase.
*/
template <typename OperatorType>
- class MGInterfaceOperator : public Subscriptor
+ class MGInterfaceOperator : public EnableRefCountingByObserverPointer
{
public:
/**
//----------------- Base operator -----------------------------
template <int dim, typename VectorType, typename VectorizedArrayType>
Base<dim, VectorType, VectorizedArrayType>::Base()
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, have_interface_matrices(false)
{}
template <typename OperatorType>
MGInterfaceOperator<OperatorType>::MGInterfaceOperator()
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, mf_base_operator(nullptr)
{}
* @note Only float and double are supported.
*/
template <int dim, typename Number = double>
- class MatrixFree : public Subscriptor
+ class MatrixFree : public EnableRefCountingByObserverPointer
{
public:
using jacobian_type = Tensor<2, dim, Tensor<1, dim, Number>>;
* @ingroup MeshWorker
*/
template <int dim, int spacedim = dim, typename number = double>
- class DEAL_II_DEPRECATED LocalIntegrator : public Subscriptor
+ class DEAL_II_DEPRECATED LocalIntegrator
+ : public EnableRefCountingByObserverPointer
{
public:
/**
*
* @ingroup MeshWorker
*/
- class VectorSelector : public Subscriptor
+ class VectorSelector : public EnableRefCountingByObserverPointer
{
public:
/**
* of matrices, will be sufficient for applications.
*/
template <typename VectorType>
-class MGMatrixBase : public Subscriptor
+class MGMatrixBase : public EnableRefCountingByObserverPointer
{
public:
/*
* will be done by derived classes.
*/
template <typename VectorType>
-class MGCoarseGridBase : public Subscriptor
+class MGCoarseGridBase : public EnableRefCountingByObserverPointer
{
public:
/**
* needed.
*/
template <typename VectorType>
-class MGTransferBase : public Subscriptor
+class MGTransferBase : public EnableRefCountingByObserverPointer
{
public:
/**
* in the vector @p u given the right hand side, which is done by smooth().
*/
template <typename VectorType>
-class MGSmootherBase : public Subscriptor
+class MGSmootherBase : public EnableRefCountingByObserverPointer
{
public:
/**
*
* @ingroup mg
*/
-class MGConstrainedDoFs : public Subscriptor
+class MGConstrainedDoFs : public EnableRefCountingByObserverPointer
{
public:
using size_dof = std::vector<std::set<types::global_dof_index>>::size_type;
* accordingly.
*/
template <typename VectorType>
-class MGTwoLevelTransferBase : public Subscriptor
+class MGTwoLevelTransferBase : public EnableRefCountingByObserverPointer
{
public:
static_assert(
* MGTransferBase.
*/
template <typename VectorType>
-class Multigrid : public Subscriptor
+class Multigrid : public EnableRefCountingByObserverPointer
{
public:
/**
* to be initialized with a separate DoFHandler for each block.
*/
template <int dim, typename VectorType, typename TransferType>
-class PreconditionMG : public Subscriptor
+class PreconditionMG : public EnableRefCountingByObserverPointer
{
public:
/**
* multigrid with local refinement.
*/
template <typename number>
- class SparseMatrixCollection : public Subscriptor
+ class SparseMatrixCollection : public EnableRefCountingByObserverPointer
{
public:
void
* held.
*/
template <int dim, int spacedim = dim, typename Number = double>
- class MappingInfo : public Subscriptor
+ class MappingInfo : public EnableRefCountingByObserverPointer
{
public:
/**
* same way as for the discrete level set function.
*/
template <int dim>
- class MeshClassifier : public Subscriptor
+ class MeshClassifier : public EnableRefCountingByObserverPointer
{
public:
/**
* @ingroup output
*/
template <int dim>
-class DataPostprocessor : public Subscriptor
+class DataPostprocessor : public EnableRefCountingByObserverPointer
{
public:
/**
* 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:
/**
* finite-element solution see step-19, step-68, step-70, and step-83.
*/
template <int dim, int spacedim = dim>
- class ParticleHandler : public Subscriptor
+ class ParticleHandler : public EnableRefCountingByObserverPointer
{
public:
/**
template <>
Quadrature<0>::Quadrature(const Quadrature<1> &)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, quadrature_points(1)
, weights(1, 1.)
, is_tensor_product_flag(false)
template <>
Quadrature<1>::Quadrature(const Quadrature<0> &)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
{
// this function should never be called -- this should be the copy constructor
// in 1d...
template <int dim>
Quadrature<dim>::Quadrature(const Quadrature<dim != 1 ? 1 : 0> &q)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, quadrature_points(Utilities::fixed_power<dim>(q.size()))
, weights(Utilities::fixed_power<dim>(q.size()))
, is_tensor_product_flag(true)
template <int dim>
Quadrature<dim>::Quadrature(const Quadrature<dim> &q)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, quadrature_points(q.quadrature_points)
, weights(q.weights)
, is_tensor_product_flag(q.is_tensor_product_flag)
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)
{
-Subscriptor::~Subscriptor()
+EnableRefCountingByObserverPointer::~EnableRefCountingByObserverPointer()
{
for (auto *const validity_ptr : validity_pointers)
*validity_ptr = false;
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
-Subscriptor &
-Subscriptor::operator=(Subscriptor &&s) noexcept
+EnableRefCountingByObserverPointer &
+EnableRefCountingByObserverPointer::operator=(
+ EnableRefCountingByObserverPointer &&s) noexcept
{
for (auto *const validity_ptr : s.validity_pointers)
*validity_ptr = false;
void
-Subscriptor::subscribe(std::atomic<bool> *const validity,
- const std::string &id) const
+EnableRefCountingByObserverPointer::subscribe(std::atomic<bool> *const validity,
+ const std::string &id) const
{
std::lock_guard<std::mutex> lock(mutex);
void
-Subscriptor::unsubscribe(std::atomic<bool> *const validity,
- const std::string &id) const
+EnableRefCountingByObserverPointer::unsubscribe(
+ std::atomic<bool> *const validity,
+ const std::string &id) const
{
const std::string &name = id.empty() ? unknown_subscriber : id;
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;
}
void
-Subscriptor::list_subscribers() const
+EnableRefCountingByObserverPointer::list_subscribers() const
{
list_subscribers(deallog);
}
DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim<dim, spacedim>))
Triangulation<dim, spacedim>::Triangulation(
Triangulation<dim, spacedim> &&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))
Triangulation<dim, spacedim> &Triangulation<dim, spacedim>::operator=(
Triangulation<dim, spacedim> &&tria) noexcept
{
- Subscriptor::operator=(std::move(tria));
+ EnableRefCountingByObserverPointer::operator=(std::move(tria));
smooth_grid = tria.smooth_grid;
reference_cells = std::move(tria.reference_cells);
template <int dim, int q_dim, typename FEValuesType>
FEValuesBase<dim, q_dim, FEValuesType>::FEValuesBase(
const FEValuesBase<dim, q_dim, FEValuesType> &other)
- : Subscriptor(other)
+ : EnableRefCountingByObserverPointer(other)
, fe_collection(other.fe_collection)
, mapping_collection(other.mapping_collection)
, q_collection(other.q_collection)
ChunkSparsityPattern::ChunkSparsityPattern(const ChunkSparsityPattern &s)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, chunk_size(s.chunk_size)
, sparsity_pattern(s.sparsity_pattern)
{
VectorBase::VectorBase(const VectorBase &v)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, ghosted(v.ghosted)
, ghost_indices(v.ghost_indices)
, last_action(VectorOperation::unknown)
VectorBase::VectorBase(const Vec &v)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, vector(v)
, ghosted(false)
, last_action(VectorOperation::unknown)
# endif
Vector::Vector()
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, vector(new Epetra_FEVector(
Epetra_Map(0, 0, 0, Utilities::Trilinos::comm_self())))
{}
Vector::Vector(const Vector &V)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, vector(new Epetra_FEVector(V.trilinos_vector()))
{}
Vector::Vector(const IndexSet ¶llel_partitioner,
const MPI_Comm communicator)
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, vector(new Epetra_FEVector(
parallel_partitioner.make_trilinos_map(communicator, false)))
{}
namespace MPI
{
Vector::Vector()
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
, last_action(Zero)
, compressed(true)
, has_ghosts(false)
: Vector()
{
// initialize a minimal, valid object and swap
- static_cast<Subscriptor &>(*this) = static_cast<Subscriptor &&>(v);
+ static_cast<EnableRefCountingByObserverPointer &>(*this) =
+ static_cast<EnableRefCountingByObserverPointer &&>(v);
swap(v);
}
Vector &
Vector::operator=(Vector &&v) noexcept
{
- static_cast<Subscriptor &>(*this) = static_cast<Subscriptor &&>(v);
+ static_cast<EnableRefCountingByObserverPointer &>(*this) =
+ static_cast<EnableRefCountingByObserverPointer &&>(v);
swap(v);
return *this;
}
// test computing square root of 2 with newton's method
-class SquareRoot : public Subscriptor
+class SquareRoot : public EnableRefCountingByObserverPointer
{
public:
void
-// 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 <deal.II/base/observer_pointer.h>
#include "../tests.h"
-class Test : public Subscriptor
+class Test : public EnableRefCountingByObserverPointer
{};
int
{
deallog << "Checking copy assignment" << std::endl;
- Subscriptor subscriptor_1;
- Subscriptor subscriptor_2;
- ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
- ObserverPointer<Subscriptor> smart_pointer_2(&subscriptor_2);
+ EnableRefCountingByObserverPointer subscriptor_1;
+ EnableRefCountingByObserverPointer subscriptor_2;
+ ObserverPointer<EnableRefCountingByObserverPointer> smart_pointer_1(
+ &subscriptor_1);
+ ObserverPointer<EnableRefCountingByObserverPointer> smart_pointer_2(
+ &subscriptor_2);
subscriptor_2 = subscriptor_1;
{
deallog << "Checking copy construction" << std::endl;
- Subscriptor subscriptor_1;
- ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
+ EnableRefCountingByObserverPointer subscriptor_1;
+ ObserverPointer<EnableRefCountingByObserverPointer> smart_pointer_1(
+ &subscriptor_1);
- Subscriptor subscriptor_2(subscriptor_1);
+ EnableRefCountingByObserverPointer subscriptor_2(subscriptor_1);
deallog << "Checking smart_pointer_1" << std::endl;
try
{
deallog << "Checking move assignment" << std::endl;
- Subscriptor subscriptor_1;
- Subscriptor subscriptor_2;
- ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
- ObserverPointer<Subscriptor> smart_pointer_2(&subscriptor_2);
+ EnableRefCountingByObserverPointer subscriptor_1;
+ EnableRefCountingByObserverPointer subscriptor_2;
+ ObserverPointer<EnableRefCountingByObserverPointer> smart_pointer_1(
+ &subscriptor_1);
+ ObserverPointer<EnableRefCountingByObserverPointer> smart_pointer_2(
+ &subscriptor_2);
subscriptor_2 = std::move(subscriptor_1);
{
deallog << "Checking move construction" << std::endl;
- Subscriptor subscriptor_1;
- ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
+ EnableRefCountingByObserverPointer subscriptor_1;
+ ObserverPointer<EnableRefCountingByObserverPointer> 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
std::vector<char> memory(10000);
int next = 0;
-class Test : public Subscriptor
+class Test : public EnableRefCountingByObserverPointer
{
const char *name;
#include "../tests.h"
-class Test : public Subscriptor
+class Test : public EnableRefCountingByObserverPointer
{};
#include "../tests.h"
-class Test : public Subscriptor
+class Test : public EnableRefCountingByObserverPointer
{};
#include "../tests.h"
-class Test : public Subscriptor
+class Test : public EnableRefCountingByObserverPointer
{};
int
initlog();
- Subscriptor subscriptor;
- std::atomic<bool> dummy_a;
- const char *foo_a = "a";
- const char *foo_b = "b";
+ EnableRefCountingByObserverPointer subscriptor;
+ std::atomic<bool> 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<bool> dummy_b;
DEAL::
--------------------------------------------------------
An error occurred in file <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool>*, const string&) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool>*, const string&) const
The violated condition was:
it != counter_map.end()
Additional information:
No subscriber with identifier <b> 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 <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool>*, const string&) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool>*, 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!
--------------------------------------------------------
DEAL::
--------------------------------------------------------
An error occurred in file <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool> *const, const std::string &) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool> *const, const std::string &) const
The violated condition was:
it != counter_map.end()
Additional information:
No subscriber with identifier <b> 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 <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool> *const, const std::string &) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool> *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!
--------------------------------------------------------
DEAL::
--------------------------------------------------------
An error occurred in file <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool>*, const std::string&) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool>*, const std::string&) const
The violated condition was:
it != counter_map.end()
Additional information:
No subscriber with identifier <b> 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 <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool>*, const std::string&) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool>*, 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!
--------------------------------------------------------
DEAL::
--------------------------------------------------------
An error occurred in file <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool> *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool> *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &) const
The violated condition was:
it != counter_map.end()
Additional information:
No subscriber with identifier <b> 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 <subscriptor.cc> in function
- void dealii::Subscriptor::unsubscribe(std::atomic<bool> *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &) const
+ void dealii::EnableRefCountingByObserverPointer::unsubscribe(std::atomic<bool> *, const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> &) 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!
--------------------------------------------------------
#include "../tests.h"
-class Test : public Subscriptor
+class Test : public EnableRefCountingByObserverPointer
{};
int
initlog();
- Subscriptor subscriptor;
- std::atomic<bool> dummy_a;
- const char *foo = "a";
- const std::string foo_string = "a";
+ EnableRefCountingByObserverPointer subscriptor;
+ std::atomic<bool> 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());
// finite element object which counts
// how many objects use that finite
// element (this is what the
-// <code>Subscriptor</code>/<code>ObserverPointer</code>
+// <code>EnableRefCountingByObserverPointer</code>/<code>ObserverPointer</code>
// class pair is used for, in case
// you want something like this for
// your own programs; see step-7 for
// 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
namespace Data
{
template <int dim>
- struct SetUpBase : public Subscriptor
+ struct SetUpBase : public EnableRefCountingByObserverPointer
{
virtual const Function<dim> &
get_boundary_values() const = 0;
namespace DualFunctional
{
template <int dim>
- class DualFunctionalBase : public Subscriptor
+ class DualFunctionalBase : public EnableRefCountingByObserverPointer
{
public:
virtual void
template <class Matrix, class Preconditioner>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const Matrix &m, const Preconditioner &preconditioner);
}
template <class Preconditioner>
- class SchurComplement : public Subscriptor
+ class SchurComplement : public EnableRefCountingByObserverPointer
{
public:
SchurComplement(
namespace Step
{
template <int dim>
- class Problem : public Subscriptor
+ class Problem : public EnableRefCountingByObserverPointer
{
public:
Problem();
const unsigned int n_functionals = 3;
template <int dim>
-class Local : public Subscriptor
+class Local : public EnableRefCountingByObserverPointer
{
public:
using CellInfo = EmptyInfo;
const unsigned int n_functionals = 3;
template <int dim>
-class Local : public Subscriptor
+class Local : public EnableRefCountingByObserverPointer
{
public:
using CellInfo = EmptyInfo;
// Define a class that fills all available entries in the info objects
// with recognizable numbers.
template <int dim>
-class Local : public Subscriptor
+class Local : public EnableRefCountingByObserverPointer
{
public:
using CellInfo = MeshWorker::IntegrationInfo<dim>;
// Use local matrices for Laplacian / interior penalty DG
template <int dim>
-class MatrixIntegrator : public Subscriptor
+class MatrixIntegrator : public EnableRefCountingByObserverPointer
{
public:
static void
// Local integrators fill every matrix entry with 10*block_row + block_col
template <int dim>
-class MatrixIntegrator : public Subscriptor
+class MatrixIntegrator : public EnableRefCountingByObserverPointer
{
public:
static void
// Define a class that fills all available entries in the info objects
// with recognizable numbers.
template <int dim>
-class Local : public Subscriptor
+class Local : public EnableRefCountingByObserverPointer
{
public:
using CellInfo = MeshWorker::IntegrationInfo<dim>;
};
template <typename SparseMatrixType>
-class MySparseMatrix : public Subscriptor
+class MySparseMatrix : public EnableRefCountingByObserverPointer
{
public:
MySparseMatrix(const SparseMatrixType &sparse_matrix)
};
template <typename SparseMatrixType>
-class MySparseMatrix : public Subscriptor
+class MySparseMatrix : public EnableRefCountingByObserverPointer
{
public:
MySparseMatrix(const SparseMatrixType &sparse_matrix)
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
LaplaceOperator(){};
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
LaplaceOperator(){};
template <typename LAPLACEOPERATOR>
-class MGInterfaceMatrix : public Subscriptor
+class MGInterfaceMatrix : public EnableRefCountingByObserverPointer
{
public:
void
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <typename LAPLACEOPERATOR>
-class MGInterfaceMatrix : public Subscriptor
+class MGInterfaceMatrix : public EnableRefCountingByObserverPointer
{
public:
void
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <typename LAPLACEOPERATOR>
-class MGInterfaceMatrix : public Subscriptor
+class MGInterfaceMatrix : public EnableRefCountingByObserverPointer
{
public:
void
int n_q_points_1d = fe_degree + 1,
typename BlockVectorType =
LinearAlgebra::distributed::BlockVector<double>>
-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
int n_q_points_1d,
typename BlockVectorType =
LinearAlgebra::distributed::BlockVector<double>>
-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
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class HelmholtzOperator : public Subscriptor
+class HelmholtzOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, int fe_degree, typename number>
- class LaplaceOperator : public Subscriptor
+ class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
LaplaceOperator();
template <int dim, int fe_degree, typename number>
LaplaceOperator<dim, fe_degree, number>::LaplaceOperator()
- : Subscriptor()
+ : EnableRefCountingByObserverPointer()
{}
class MassMatrixType,
class PreconditionerA,
class PreconditionerMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
/**
template <int dim, int fe_degree>
-class DummyMatrixFree : public Subscriptor
+class DummyMatrixFree : public EnableRefCountingByObserverPointer
{
public:
DummyMatrixFree(const Portable::MatrixFree<dim, double> &data_in,
typename VectorType =
LinearAlgebra::distributed::Vector<double, MemorySpace::Default>,
int n_q_points_1d = fe_degree + 1>
-class MatrixFreeTest : public Subscriptor
+class MatrixFreeTest : public EnableRefCountingByObserverPointer
{
public:
MatrixFreeTest(const Portable::MatrixFree<dim, Number> &data_in,
// Define a class that fills all available entries in the info objects
// with recognizable numbers.
template <int dim>
-class Local : public Subscriptor
+class Local : public EnableRefCountingByObserverPointer
{
public:
using CellInfo = MeshWorker::IntegrationInfo<dim>;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
#include "../tests.h"
template <int dim_, int n_components = dim_, typename Number = double>
-class Operator : public Subscriptor
+class Operator : public EnableRefCountingByObserverPointer
{
public:
using value_type = Number;
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
LaplaceOperator(){};
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
LaplaceOperator(){};
template <typename LAPLACEOPERATOR>
-class MGInterfaceMatrix : public Subscriptor
+class MGInterfaceMatrix : public EnableRefCountingByObserverPointer
{
public:
void
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <typename LAPLACEOPERATOR>
-class MGInterfaceMatrix : public Subscriptor
+class MGInterfaceMatrix : public EnableRefCountingByObserverPointer
{
public:
void
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <typename LAPLACEOPERATOR>
-class MGInterfaceMatrix : public Subscriptor
+class MGInterfaceMatrix : public EnableRefCountingByObserverPointer
{
public:
void
int n_q_points_1d = fe_degree + 1,
typename BlockVectorType =
LinearAlgebra::distributed::BlockVector<double>>
-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
int n_q_points_1d,
typename BlockVectorType =
LinearAlgebra::distributed::BlockVector<double>>
-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
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
int fe_degree,
int n_q_points_1d = fe_degree + 1,
typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
class MassMatrixType,
class PreconditionerA,
class PreconditionerMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
/**
template <int dim>
-class OutputCreator : public Subscriptor
+class OutputCreator : public EnableRefCountingByObserverPointer
{
public:
void
}
template <int dim>
-class OutputCreator : public Subscriptor
+class OutputCreator : public EnableRefCountingByObserverPointer
{
public:
void
class MassMatrixType,
class PreconditionerA,
class PreconditionerMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
/**
template <class MatrixType, class PreconditionerType>
-class InverseMatrix : public Subscriptor
+class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m, const PreconditionerType &preconditioner);
template <class PreconditionerType>
-class SchurComplement : public Subscriptor
+class SchurComplement : public EnableRefCountingByObserverPointer
{
public:
SchurComplement(
template <int dim, typename number = double>
-class LaplaceOperator : public Subscriptor
+class LaplaceOperator : public EnableRefCountingByObserverPointer
{
public:
using value_type = number;
template <class MatrixType, class PreconditionerType>
-class InverseMatrix : public Subscriptor
+class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m, const PreconditionerType &preconditioner);
template <class PreconditionerType>
-class SchurComplement : public Subscriptor
+class SchurComplement : public EnableRefCountingByObserverPointer
{
public:
SchurComplement(
* and exceptions handling for PETSCWrappers::NonlinearSolver.
*/
-class VectorType : public Subscriptor
+class VectorType : public EnableRefCountingByObserverPointer
{
public:
explicit VectorType(Vec v)
Vec v;
};
-class MatrixType : public Subscriptor
+class MatrixType : public EnableRefCountingByObserverPointer
{
public:
explicit MatrixType(Mat A)
* and exceptions handling for PETSCWrappers::TimeStepper.
*/
-class VectorType : public Subscriptor
+class VectorType : public EnableRefCountingByObserverPointer
{
public:
explicit VectorType(Vec v)
Vec v;
};
-class MatrixType : public Subscriptor
+class MatrixType : public EnableRefCountingByObserverPointer
{
public:
explicit MatrixType(Mat A)
namespace LinearSolvers
{
template <class MatrixType, class PreconditionerType>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const MatrixType &m,
}
}
template <class PreconditionerTypeA, class PreconditionerTypeMp>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner(
// with an option to specify a preconditioner, and to allow for different
// vector types in the vmult function.
template <class Matrix, class Preconditioner>
- class InverseMatrix : public Subscriptor
+ class InverseMatrix : public EnableRefCountingByObserverPointer
{
public:
InverseMatrix(const Matrix &m, const Preconditioner &preconditioner);
// The class A template class for a simple block diagonal preconditioner
// for 2x2 matrices.
template <class PreconditionerA, class PreconditionerS>
- class BlockDiagonalPreconditioner : public Subscriptor
+ class BlockDiagonalPreconditioner
+ : public EnableRefCountingByObserverPointer
{
public:
BlockDiagonalPreconditioner(const PreconditionerA &preconditioner_A,
}
template <class PreconditionerAType, class PreconditionerSType>
- class BlockSchurPreconditioner : public Subscriptor
+ class BlockSchurPreconditioner : public EnableRefCountingByObserverPointer
{
public:
BlockSchurPreconditioner(