*
* These are the classes, where no reasonable predetermined set of instances
* exists. Therefore, all member definitions are included in the header file
- * and are instantiated wherever needed. An example would be the SmartPointer
+ * and are instantiated wherever needed. An example would be the ObserverPointer
* class template that can be used with virtually any template argument.
*/
* @defgroup memory Memory handling
*
* This group has some basic classes and namespaces for memory
- * handling. The Subscriptor and SmartPointer classes are used for
- * counted memory handling, i.e. whenever a SmartPointer is set to
+ * handling. The Subscriptor and ObserverPointer classes are used for
+ * counted memory handling, i.e. whenever a ObserverPointer is set to
* point to an object, it increases a counter in that object; when the
* pointer is set to point elsewhere, it decreases it again. This way,
* one always knows how many users of an object there still are. While
<li> <p>
Fixed: The <code>Subscriptor</code> uses a counter to
- count how many <code>SmartPointer</code> objects subscribe
+ count how many <code>ObserverPointer</code> objects subscribe
to the pointed-to object. This counter needs to be a volatile variable
in multithreaded mode, to avoid false compiler optimizations based on
the assumption that the variable cannot change between two subsequent
New: Class <code>Subscriptor</code> receives a
text argument allowing to identify the violating pointer more
easily. The additional feature is being incorporated into <code
- class="class">SmartPointer</code> constructors throughout the
+ class="class">ObserverPointer</code> constructors throughout the
library.
<br>
(GK, 2005/03/16)
(WB 2006/08/02)
</p>
- <li> <p> Changed: When there is still a <code>SmartPointer</code> object
+ <li> <p> Changed: When there is still a <code>ObserverPointer</code> object
pointing to another object at the time it is destroyed, this would cause
the program to be aborted. However, there are cases where this is not
desirable, for example here:
</li>
<li>
- Changed: SmartPointer and Subscriptor use a `std::string`
+ Changed: ObserverPointer and Subscriptor use a `std::string`
instead of a `const char *` for subscriber identification. As a result,
subscriber strings are no longer compared by their memory address but instead
by their content.
</li>
<li>
- Changed: The class Subscriptor and SmartPointer check for dangling pointers and
+ Changed: The class Subscriptor and ObserverPointer check for dangling pointers and
use-after-move. The destructor of Subscriptor doesn't signal an error when there
is still an object subscribed to it. Instead, validity is checked when
- dereferencing the SmartPointer object.
+ dereferencing the ObserverPointer object.
<br>
(Daniel Arndt, 2018/11/02)
</li>
-Deprecated: SmartPointer is clearly documented as not owning the
-object it points to. Yet, SmartPointer::clear() deletes the object
-pointed to, thereby assuming that the SmartPointer object actually
+Deprecated: ObserverPointer is clearly documented as not owning the
+object it points to. Yet, ObserverPointer::clear() deletes the object
+pointed to, thereby assuming that the ObserverPointer object actually
owns the object. This must surely be confusing. As a consequence the
function is now deprecated.
<br>
// a triangulation in the constructor and storing it henceforth. Since
// this triangulation will be used throughout all computations, we have to
// make sure that the triangulation is valid until it is last used. We
- // do this by keeping a <code>SmartPointer</code> to this triangulation,
+ // do this by keeping a <code>ObserverPointer</code> to this triangulation,
// as explained in step-7.
//
// Note that while the pointer itself is declared constant
virtual unsigned int n_dofs() const = 0;
protected:
- const SmartPointer<Triangulation<dim>> triangulation;
+ const ObserverPointer<Triangulation<dim>> triangulation;
};
// member variables, of which the use should be clear from the previous
// examples:
protected:
- const SmartPointer<const FiniteElement<dim>> fe;
- const SmartPointer<const Quadrature<dim>> quadrature;
- DoFHandler<dim> dof_handler;
- Vector<double> solution;
- const SmartPointer<const Function<dim>> boundary_values;
+ const ObserverPointer<const FiniteElement<dim>> fe;
+ const ObserverPointer<const Quadrature<dim>> quadrature;
+ DoFHandler<dim> dof_handler;
+ Vector<double> solution;
+ const ObserverPointer<const Function<dim>> boundary_values;
// Then we declare an abstract function that will be used to assemble
// the right hand side. As explained above, there are various cases for
// constructor takes the same data as does that of the underlying class
// (to which it passes all information) except for one function object
// that denotes the right hand side of the problem. A pointer to this
- // object is stored (again as a <code>SmartPointer</code>, in order to
+ // object is stored (again as a <code>ObserverPointer</code>, in order to
// make sure that the function object is not deleted as long as it is
// still used by this class).
//
const Function<dim> &boundary_values);
protected:
- const SmartPointer<const Function<dim>> rhs_function;
+ const ObserverPointer<const Function<dim>> rhs_function;
virtual void assemble_rhs(Vector<double> &rhs) const override;
};
virtual void output_solution() const = 0;
protected:
- const SmartPointer<Triangulation<dim>> triangulation;
+ const ObserverPointer<Triangulation<dim>> triangulation;
unsigned int refinement_cycle;
};
virtual unsigned int n_dofs() const override;
protected:
- const SmartPointer<const FiniteElement<dim>> fe;
- const SmartPointer<const Quadrature<dim>> quadrature;
- const SmartPointer<const Quadrature<dim - 1>> face_quadrature;
- DoFHandler<dim> dof_handler;
- Vector<double> solution;
- const SmartPointer<const Function<dim>> boundary_values;
+ const ObserverPointer<const FiniteElement<dim>> fe;
+ const ObserverPointer<const Quadrature<dim>> quadrature;
+ const ObserverPointer<const Quadrature<dim - 1>> face_quadrature;
+ DoFHandler<dim> dof_handler;
+ Vector<double> solution;
+ const ObserverPointer<const Function<dim>> boundary_values;
virtual void assemble_rhs(Vector<double> &rhs) const = 0;
virtual void output_solution() const override;
protected:
- const SmartPointer<const Function<dim>> rhs_function;
+ const ObserverPointer<const Function<dim>> rhs_function;
virtual void assemble_rhs(Vector<double> &rhs) const override;
};
virtual void refine_grid() override;
private:
- const SmartPointer<const Function<dim>> weighting_function;
+ const ObserverPointer<const Function<dim>> weighting_function;
};
// @sect4{The SetUpBase and SetUp classes}
// Based on the above description, the <code>SetUpBase</code> class then
- // looks as follows. To allow using the <code>SmartPointer</code> class
+ // looks as follows. To allow using the <code>ObserverPointer</code> class
// with this class, we derived from the <code>Subscriptor</code> class.
template <int dim>
struct SetUpBase : public Subscriptor
const DualFunctional::DualFunctionalBase<dim> &dual_functional);
protected:
- const SmartPointer<const DualFunctional::DualFunctionalBase<dim>>
+ const ObserverPointer<const DualFunctional::DualFunctionalBase<dim>>
dual_functional;
virtual void assemble_rhs(Vector<double> &rhs) const override;
// that will serve as the "scratch data" class of the WorkStream concept:
struct CellData
{
- FEValues<dim> fe_values;
- const SmartPointer<const Function<dim>> right_hand_side;
+ FEValues<dim> fe_values;
+ const ObserverPointer<const Function<dim>> right_hand_side;
std::vector<double> cell_residual;
std::vector<double> rhs_values;
}
private:
- const SmartPointer<const MatrixType> matrix;
+ const ObserverPointer<const MatrixType> matrix;
};
}
private:
- const SmartPointer<const BlockSparseMatrix<double>> system_matrix;
- const SmartPointer<const InverseMatrix<SparseMatrix<double>>> m_inverse;
+ const ObserverPointer<const BlockSparseMatrix<double>> system_matrix;
+ const ObserverPointer<const InverseMatrix<SparseMatrix<double>>> m_inverse;
mutable Vector<double> tmp1, tmp2;
};
}
private:
- const SmartPointer<const BlockSparseMatrix<double>> system_matrix;
+ const ObserverPointer<const BlockSparseMatrix<double>> system_matrix;
mutable Vector<double> tmp1, tmp2;
};
const BlockVector<double> &src) const;
private:
- const SmartPointer<const BlockSparseMatrix<double> > system_matrix;
- const SmartPointer<const InverseMatrix<SparseMatrix<double>,
+ const ObserverPointer<const BlockSparseMatrix<double> > system_matrix;
+ const ObserverPointer<const InverseMatrix<SparseMatrix<double>,
PreconditionerMp > > m_inverse;
const PreconditionerA &a_preconditioner;
void vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const MatrixType> matrix;
- const SmartPointer<const PreconditionerType> preconditioner;
+ const ObserverPointer<const MatrixType> matrix;
+ const ObserverPointer<const PreconditionerType> preconditioner;
};
// consequence of the definition above, the declaration
// <code>InverseMatrix</code> now contains the second template parameter for
// a preconditioner class as above, which affects the
- // <code>SmartPointer</code> object <code>m_inverse</code> as well.
+ // <code>ObserverPointer</code> object <code>m_inverse</code> as well.
template <class PreconditionerType>
class SchurComplement : public Subscriptor
{
void vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const BlockSparseMatrix<double>> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const BlockSparseMatrix<double>> system_matrix;
+ const ObserverPointer<
const InverseMatrix<SparseMatrix<double>, PreconditionerType>>
A_inverse;
void vmult(VectorType &dst, const VectorType &src) const;
private:
- const SmartPointer<const MatrixType> matrix;
- const PreconditionerType &preconditioner;
+ const ObserverPointer<const MatrixType> matrix;
+ const PreconditionerType &preconditioner;
};
const TrilinosWrappers::MPI::BlockVector &src) const;
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix>
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
stokes_matrix;
- const SmartPointer<const InverseMatrix<TrilinosWrappers::SparseMatrix,
- PreconditionerTypeMp>>
+ const ObserverPointer<const InverseMatrix<TrilinosWrappers::SparseMatrix,
+ PreconditionerTypeMp>>
m_inverse;
const PreconditionerTypeA &a_preconditioner;
}
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix>
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
stokes_matrix;
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix>
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
stokes_preconditioner_matrix;
const PreconditionerTypeMp &mp_preconditioner;
const PreconditionerTypeA &a_preconditioner;
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 SmartPointer and Subscriptor mechanism.
+ // pattern through the ObserverPointer and Subscriptor mechanism.
mg_sparsity.resize(0, n_levels - 1);
mg_sparsity_dg_interface.resize(0, n_levels - 1);
void vmult(VectorType &dst, const VectorType &src) const;
private:
- const SmartPointer<const MatrixType> matrix;
- const PreconditionerType &preconditioner;
+ const ObserverPointer<const MatrixType> matrix;
+ const PreconditionerType &preconditioner;
};
const TrilinosWrappers::MPI::BlockVector &src) const;
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix>
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
darcy_matrix;
- const SmartPointer<const InverseMatrix<TrilinosWrappers::SparseMatrix,
- PreconditionerTypeMp>>
+ const ObserverPointer<const InverseMatrix<TrilinosWrappers::SparseMatrix,
+ PreconditionerTypeMp>>
m_inverse;
const PreconditionerTypeA &a_preconditioner;
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const MatrixType> matrix;
- const SmartPointer<const PreconditionerType> preconditioner;
+ const ObserverPointer<const MatrixType> matrix;
+ const ObserverPointer<const PreconditionerType> preconditioner;
mutable TrilinosWrappers::MPI::Vector tmp;
};
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
+ system_matrix;
+ const ObserverPointer<
const InverseMatrix<TrilinosWrappers::SparseMatrix, PreconditionerType>>
A_inverse;
mutable TrilinosWrappers::MPI::Vector tmp1, tmp2;
void vmult(VectorType &dst, const VectorType &src) const;
private:
- const SmartPointer<const Matrix> matrix;
- const Preconditioner &preconditioner;
+ const ObserverPointer<const Matrix> matrix;
+ const Preconditioner &preconditioner;
};
// general-purpose class MatrixFreeOperators::Base. We derive the class from
// the Subscriptor class to be able to use the operator within the Chebyshev
// preconditioner because that preconditioner stores the underlying matrix
- // via a SmartPointer.
+ // via a ObserverPointer.
//
// Given that we implement a complete matrix interface by hand, we need to
// add an `initialize()` function, an `m()` function, a `vmult()` function,
const MPI_Comm mpi_communicator;
TimerOutput &computing_timer;
- SmartPointer<const Discretization<dim>> discretization;
+ ObserverPointer<const Discretization<dim>> discretization;
};
// @sect4{The <code>ProblemDescription</code> class}
const MPI_Comm mpi_communicator;
TimerOutput &computing_timer;
- SmartPointer<const OfflineData<dim>> offline_data;
- SmartPointer<const InitialValues<dim>> initial_values;
+ ObserverPointer<const OfflineData<dim>> offline_data;
+ ObserverPointer<const InitialValues<dim>> initial_values;
SparseMatrix<double> dij_matrix;
const MPI_Comm mpi_communicator;
TimerOutput &computing_timer;
- SmartPointer<const OfflineData<dim>> offline_data;
+ ObserverPointer<const OfflineData<dim>> offline_data;
Vector<double> r;
#include <deal.II/dofs/dof_renumbering.h>
// Then we will show a little trick how we can make sure that objects are not
// deleted while they are still in use. For this purpose, deal.II has the
-// SmartPointer helper class, which is declared in this file:
+// ObserverPointer helper class, which is declared in this file:
#include <deal.II/base/smartpointer.h>
// Next, we will want to use the function VectorTools::integrate_difference()
// mentioned in the introduction, and we are going to use a ConvergenceTable
// subscribing class is expected to check the value stored in its
// corresponding pointer before trying to access the object subscribed to.
//
- // This is exactly what the SmartPointer class is doing. It basically acts
- // just like a pointer, i.e. it can be dereferenced, can be assigned to and
- // from other pointers, and so on. On top of that it uses the mechanism
+ // This is exactly what the ObserverPointer class is doing. It basically
+ // acts just like a pointer, i.e. it can be dereferenced, can be assigned to
+ // and from other pointers, and so on. On top of that it uses the mechanism
// described above to find out if the pointer this class is representing is
// dangling when we try to dereference it. In that case an exception is
// thrown.
// In the present example program, we want to protect the finite element
// object from the situation that for some reason the finite element
// pointed to is destroyed while still in use. We therefore use a
- // SmartPointer to the finite element object; since the finite element
+ // ObserverPointer to the finite element object; since the finite element
// object is actually never changed in our computations, we pass a const
- // FiniteElement<dim> as template argument to the SmartPointer
+ // FiniteElement<dim> as template argument to the ObserverPointer
// class. Note that the pointer so declared is assigned at construction
// time of the solve object, and destroyed upon destruction, so the lock
// on the destruction of the finite element object extends throughout the
Triangulation<dim> triangulation;
DoFHandler<dim> dof_handler;
- SmartPointer<const FiniteElement<dim>> fe;
+ ObserverPointer<const FiniteElement<dim>> fe;
AffineConstraints<double> hanging_node_constraints;
/**
* The operator computing the residual.
*/
- SmartPointer<OperatorBase, Newton<VectorType>> residual;
+ ObserverPointer<OperatorBase, Newton<VectorType>> residual;
/**
* The operator applying the inverse derivative to the residual.
*/
- SmartPointer<OperatorBase, Newton<VectorType>> inverse_derivative;
+ ObserverPointer<OperatorBase, Newton<VectorType>> inverse_derivative;
/**
* The operator handling the output in case the debug_vectors is true.
* Call the initialize function first.
*/
- SmartPointer<OutputOperator<VectorType>, Newton<VectorType>> data_out;
+ ObserverPointer<OutputOperator<VectorType>, Newton<VectorType>> data_out;
/**
* This flag is set by the function assemble(), indicating that the matrix
* them <code>Implicit</code> and <code>Explicit</code>. They both share the
* public interface of Operator, and additionally provide storage for the
* matrices to be used and a pointer to TimestepData. Note that we do not
- * use a SmartPointer here, since the TimestepData will be destroyed before
+ * use a ObserverPointer here, since the TimestepData will be destroyed before
* the operator.
*
* @code
* void operator()(AnyData &out, const AnyData &in);
*
* private:
- * SmartPointer<const FullMatrix<double>, Explicit> matrix;
+ * ObserverPointer<const FullMatrix<double>, Explicit> matrix;
* FullMatrix<double> m;
* };
*
* void operator()(AnyData &out, const AnyData &in);
*
* private:
- * SmartPointer<const FullMatrix<double>, Implicit> matrix;
+ * ObserverPointer<const FullMatrix<double>, Implicit> matrix;
* FullMatrix<double> m;
* };
* @endcode
* vector, $M$ the @ref GlossMassMatrix "mass matrix", $F$ the operator in space and $c$ is the
* adjusted time step size $(1-\theta) \Delta t$.
*/
- SmartPointer<OperatorBase, ThetaTimestepping<VectorType>> op_explicit;
+ ObserverPointer<OperatorBase, ThetaTimestepping<VectorType>> op_explicit;
/**
* The operator solving the implicit part of the scheme. It will receive
* the input data, <i>M</i> the @ref GlossMassMatrix "mass matrix", <i>F</i> the operator in
* space and <i>c</i> is the adjusted time step size $ \theta \Delta t$
*/
- SmartPointer<OperatorBase, ThetaTimestepping<VectorType>> op_implicit;
+ ObserverPointer<OperatorBase, ThetaTimestepping<VectorType>> op_implicit;
/**
* The operator writing the output in each time step
*/
- SmartPointer<OutputOperator<VectorType>, ThetaTimestepping<VectorType>>
+ ObserverPointer<OutputOperator<VectorType>, ThetaTimestepping<VectorType>>
output;
};
private:
// The higher-dimensional function that has been restricted.
- const SmartPointer<const Function<dim + 1>> function;
+ const ObserverPointer<const Function<dim + 1>> function;
// The (`dim + 1`)-coordinate direction that has been restricted.
const unsigned int restricted_direction;
private:
// The higher-dimensional function that has been restricted.
- const SmartPointer<const Function<dim + 1>> function;
+ const ObserverPointer<const Function<dim + 1>> function;
// The (`dim + 1`)-coordinate direction that is kept "open"
const unsigned int open_direction;
* A pointer to the LogStream object to which the prefix is
* applied.
*/
- SmartPointer<LogStream, LogStream::Prefix> stream;
+ ObserverPointer<LogStream, LogStream::Prefix> stream;
};
/**
* Reference to the Triangulation object used during reinit().
*/
- SmartPointer<const Triangulation<dim, spacedim>> tria;
+ ObserverPointer<const Triangulation<dim, spacedim>> tria;
/**
* Reference to the Mapping object used during reinit().
*/
- SmartPointer<const Mapping<dim, spacedim>> mapping;
+ ObserverPointer<const Mapping<dim, spacedim>> mapping;
/**
* (One-to-one) relation of points and cells.
* may reflect, for example, different constitutive models of continuum
* mechanics in different parts of the domain.
*
- * @note The first time this method is called, it stores a SmartPointer to the
+ * @note The first time this method is called, it stores a ObserverPointer to the
* Triangulation object that owns the cell. The future invocations of this
* method expects the cell to be from the same stored triangulation.
*
* Triangulation, we need to store a reference to that Triangulation within
* the class.
*/
- SmartPointer<const Triangulation<dimension, space_dimension>,
- CellDataStorage<CellIteratorType, DataType>>
+ ObserverPointer<const Triangulation<dimension, space_dimension>,
+ CellDataStorage<CellIteratorType, DataType>>
tria;
/**
* object (which for this purpose needs to be derived from the Subscriptor
* class), and ensuring that the pointed-to object's destructor triggers an
* error if that use-count is larger than zero -- i.e., if there are still
- * observing SmartPointer objects pointing to it.
+ * observing ObserverPointer objects pointing to it.
*
- * Conceptually, SmartPointer fills a gap between `std::unique_ptr` and
+ * Conceptually, ObserverPointer fills a gap between `std::unique_ptr` and
* `std::shared_ptr`. While the former makes it clear that there is a unique
* owner of an object (namely the scope in which the `std::unique_ptr` resides),
* it does not allow other places in a code base to point to the object. In
* but none of them is the "owner" of the object: They all are, and the last
* one to stop pointing to the object is responsible for deleting it.
*
- * SmartPointer utilizes semantics in which one place owns an object and others
- * can point to it. The owning place is responsible for destroying the object
- * when it is no longer needed, and as mentioned above, this will trigger an
- * error if other places are still pointing to it via SmartPointer pointers.
+ * ObserverPointer utilizes semantics in which one place owns an object and
+ * others can point to it. The owning place is responsible for destroying the
+ * object when it is no longer needed, and as mentioned above, this will trigger
+ * an error if other places are still pointing to it via ObserverPointer
+ * pointers.
*
* In practice, using this scheme, if you try to destroy an object to which
- * observers still point via SmartPointer objects, you will get an error that
+ * observers still point via ObserverPointer objects, you will get an error that
* says that there are still observers of the object and that the object can
* consequently not be destroyed without creating "dangling" pointers. This
* is often not very helpful in *finding* where these pointers are. As a
* consequence, this class also provides two ways to annotate the observer
* count with information about what other places still observe an object.
- * First, when initializing a SmartPointer object with the address of the
+ * First, when initializing a ObserverPointer object with the address of the
* object pointed to, you can also attach a string that describes the
* observing location, and this string will then be shown in error messages
* listing all remaining observers. Second, if no such string is provided,
* the name second template argument `P` is used as the debug string. This
- * allows to encode the observer information in the type of the SmartPointer.
+ * allows to encode the observer information in the type of the ObserverPointer.
*
- * @note Unlike `std::unique_ptr` and `std::shared_ptr`, SmartPointer does
+ * @note Unlike `std::unique_ptr` and `std::shared_ptr`, ObserverPointer does
* NOT implement any memory handling. In particular, deleting a
- * SmartPointer does not delete the object because the semantics
+ * ObserverPointer does not delete the object because the semantics
* of this class are that it only *observes* an object, but does not
* take over ownership. As a consequence, this is a sure way of creating
* a memory leak:
* @code
- * SmartPointer<T> dont_do_this = new T;
+ * ObserverPointer<T> dont_do_this = new T;
* @endcode
* This is because here, no variable "owns" the object pointed to, and
* the destruction of the `dont_do_this` pointer does not trigger the
* release of the memory pointed to.
*
* @note This class correctly handles `const`-ness of an object, i.e.,
- * a `SmartPointer<const T>` really behaves as if it were a pointer
+ * a `ObserverPointer<const T>` really behaves as if it were a pointer
* to a constant object (disallowing write access when dereferenced), while
- * `SmartPointer<T>` is a mutable pointer.
+ * `ObserverPointer<T>` is a mutable pointer.
*
* @dealiiConceptRequires{std::is_base_of_v<Subscriptor, T>}
*
* @ingroup memory
*/
template <typename T, typename P = void>
-class SmartPointer
+class ObserverPointer
{
public:
/**
* Standard constructor for null pointer. The id of this pointer is set to
* the name of the class P.
*/
- SmartPointer();
+ ObserverPointer();
/**
- * Copy constructor for SmartPointer. We do not copy the object subscribed
+ * Copy constructor for ObserverPointer. We do not copy the object subscribed
* to from <tt>tt</tt>, but subscribe ourselves to it again.
*/
template <class Q>
- SmartPointer(const SmartPointer<T, Q> &other);
+ ObserverPointer(const ObserverPointer<T, Q> &other);
/**
- * Copy constructor for SmartPointer. We do not copy the object subscribed
+ * Copy constructor for ObserverPointer. We do not copy the object subscribed
* to from <tt>tt</tt>, but subscribe ourselves to it again.
*/
- SmartPointer(const SmartPointer<T, P> &other);
+ ObserverPointer(const ObserverPointer<T, P> &other);
/**
- * Move constructor for SmartPointer.
+ * Move constructor for ObserverPointer.
*/
- SmartPointer(SmartPointer<T, P> &&other) noexcept;
+ ObserverPointer(ObserverPointer<T, P> &&other) noexcept;
/**
* Constructor taking a normal pointer. If possible, i.e. if the pointer is
* 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
- * ~SmartPointer() in the call to Subscriptor::unsubscribe().
+ * ~ObserverPointer() in the call to Subscriptor::unsubscribe().
*/
- SmartPointer(T *t, const std::string &id);
+ ObserverPointer(T *t, const std::string &id);
/**
* Constructor taking a normal pointer. If possible, i.e. if the pointer is
* lock it, i.e. to prevent its destruction before the end of its use. The
* id of this pointer is set to the name of the class P.
*/
- SmartPointer(T *t);
+ ObserverPointer(T *t);
/**
* Destructor, removing the subscription.
*/
- ~SmartPointer();
+ ~ObserverPointer();
/**
* Assignment operator for normal pointers. The pointer subscribes to the
* will not try to subscribe to a null-pointer, but still delete the old
* subscription.
*/
- SmartPointer<T, P> &
+ ObserverPointer<T, P> &
operator=(T *tt);
/**
- * Assignment operator for SmartPointer. The pointer subscribes to the new
+ * Assignment operator for ObserverPointer. The pointer subscribes to the new
* object automatically and unsubscribes to an old one if it exists.
*/
template <class Q>
- SmartPointer<T, P> &
- operator=(const SmartPointer<T, Q> &other);
+ ObserverPointer<T, P> &
+ operator=(const ObserverPointer<T, Q> &other);
/**
- * Assignment operator for SmartPointer. The pointer subscribes to the new
+ * Assignment operator for ObserverPointer. The pointer subscribes to the new
* object automatically and unsubscribes to an old one if it exists.
*/
- SmartPointer<T, P> &
- operator=(const SmartPointer<T, P> &other);
+ ObserverPointer<T, P> &
+ operator=(const ObserverPointer<T, P> &other);
/**
- * Move assignment operator for SmartPointer.
+ * Move assignment operator for ObserverPointer.
*/
- SmartPointer<T, P> &
- operator=(SmartPointer<T, P> &&other) noexcept;
+ ObserverPointer<T, P> &
+ operator=(ObserverPointer<T, P> &&other) noexcept;
/**
* Delete the object pointed to and set the pointer to nullptr. Note
* that unlike what the documentation of the class describes, *this
* function actually deletes the object pointed to*. That is, this
- * function assumes a SmartPointer's ownership of the object pointed to.
+ * function assumes a ObserverPointer's ownership of the object pointed to.
*
* @deprecated This function is deprecated. It does not use the
* semantics we usually use for this class, and its use is surely
*/
template <class Q>
void
- swap(SmartPointer<T, Q> &tt);
+ swap(ObserverPointer<T, Q> &tt);
/**
* Swap pointers between this object and the pointer given. As this releases
template <typename T, typename P>
-inline SmartPointer<T, P>::SmartPointer()
+inline ObserverPointer<T, P>::ObserverPointer()
: pointer(nullptr)
, id(typeid(P).name())
, pointed_to_object_is_alive(false)
template <typename T, typename P>
-inline SmartPointer<T, P>::SmartPointer(T *t)
+inline ObserverPointer<T, P>::ObserverPointer(T *t)
: pointer(t)
, id(typeid(P).name())
, pointed_to_object_is_alive(false)
template <typename T, typename P>
-inline SmartPointer<T, P>::SmartPointer(T *t, const std::string &id)
+inline ObserverPointer<T, P>::ObserverPointer(T *t, const std::string &id)
: pointer(t)
, id(id)
, pointed_to_object_is_alive(false)
template <typename T, typename P>
template <class Q>
-inline SmartPointer<T, P>::SmartPointer(const SmartPointer<T, Q> &other)
+inline ObserverPointer<T, P>::ObserverPointer(
+ const ObserverPointer<T, Q> &other)
: pointer(other.pointer)
, id(other.id)
, pointed_to_object_is_alive(false)
template <typename T, typename P>
-inline SmartPointer<T, P>::SmartPointer(const SmartPointer<T, P> &other)
+inline ObserverPointer<T, P>::ObserverPointer(
+ const ObserverPointer<T, P> &other)
: pointer(other.pointer)
, id(other.id)
, pointed_to_object_is_alive(false)
template <typename T, typename P>
-inline SmartPointer<T, P>::SmartPointer(SmartPointer<T, P> &&other) noexcept
+inline ObserverPointer<T, P>::ObserverPointer(
+ ObserverPointer<T, P> &&other) noexcept
: pointer(other.pointer)
, id(other.id)
, pointed_to_object_is_alive(false)
template <typename T, typename P>
-inline SmartPointer<T, P>::~SmartPointer()
+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 "
template <typename T, typename P>
inline void
-SmartPointer<T, P>::clear()
+ObserverPointer<T, P>::clear()
{
if (pointed_to_object_is_alive && pointer != nullptr)
{
template <typename T, typename P>
-inline SmartPointer<T, P> &
-SmartPointer<T, P>::operator=(T *tt)
+inline ObserverPointer<T, P> &
+ObserverPointer<T, P>::operator=(T *tt)
{
// optimize if no real action is requested
if (pointer == tt)
template <typename T, typename P>
template <class Q>
-inline SmartPointer<T, P> &
-SmartPointer<T, P>::operator=(const SmartPointer<T, Q> &other)
+inline ObserverPointer<T, P> &
+ObserverPointer<T, P>::operator=(const ObserverPointer<T, Q> &other)
{
// if objects on the left and right
// hand side of the operator= are
template <typename T, typename P>
-inline SmartPointer<T, P> &
-SmartPointer<T, P>::operator=(const SmartPointer<T, P> &other)
+inline ObserverPointer<T, P> &
+ObserverPointer<T, P>::operator=(const ObserverPointer<T, P> &other)
{
// if objects on the left and right
// hand side of the operator= are
template <typename T, typename P>
-inline SmartPointer<T, P> &
-SmartPointer<T, P>::operator=(SmartPointer<T, P> &&other) noexcept
+inline ObserverPointer<T, P> &
+ObserverPointer<T, P>::operator=(ObserverPointer<T, P> &&other) noexcept
{
if (other == nullptr)
{
template <typename T, typename P>
-inline SmartPointer<T, P>::operator T *() const
+inline ObserverPointer<T, P>::operator T *() const
{
return pointer;
}
template <typename T, typename P>
inline T &
-SmartPointer<T, P>::operator*() const
+ObserverPointer<T, P>::operator*() const
{
Assert(pointer != nullptr, ExcNotInitialized());
Assert(pointed_to_object_is_alive,
template <typename T, typename P>
inline T *
-SmartPointer<T, P>::get() const
+ObserverPointer<T, P>::get() const
{
Assert(pointer != nullptr, ExcNotInitialized());
Assert(pointed_to_object_is_alive,
template <typename T, typename P>
inline T *
-SmartPointer<T, P>::operator->() const
+ObserverPointer<T, P>::operator->() const
{
return this->get();
}
template <typename T, typename P>
template <class Q>
inline void
-SmartPointer<T, P>::swap(SmartPointer<T, Q> &other)
+ObserverPointer<T, P>::swap(ObserverPointer<T, Q> &other)
{
#ifdef DEBUG
- SmartPointer<T, P> aux(pointer, id);
+ ObserverPointer<T, P> aux(pointer, id);
*this = other;
other = aux;
#else
template <typename T, typename P>
inline void
-SmartPointer<T, P>::swap(T *&ptr)
+ObserverPointer<T, P>::swap(T *&ptr)
{
if (pointed_to_object_is_alive && pointer != nullptr)
pointer->unsubscribe(pointed_to_object_is_alive, id);
template <typename T, typename P>
inline std::size_t
-SmartPointer<T, P>::memory_consumption() const
+ObserverPointer<T, P>::memory_consumption() const
{
- return sizeof(SmartPointer<T, P>);
+ return sizeof(ObserverPointer<T, P>);
}
// The following function is not strictly necessary but is an optimization
-// for places where you call swap(p1,p2) with SmartPointer objects p1, p2.
+// for places where you call swap(p1,p2) with ObserverPointer objects p1, p2.
// Unfortunately, MS Visual Studio (at least up to the 2013 edition) trips
// over it when calling std::swap(v1,v2) where v1,v2 are std::vectors of
-// SmartPointer objects: it can't determine whether it should call std::swap
+// ObserverPointer objects: it can't determine whether it should call std::swap
// or dealii::swap on the individual elements (see bug #184 on our Google Code
// site. Consequently, just take this function out of the competition for this
// compiler.
*/
template <typename T, typename P, class Q>
inline void
-swap(SmartPointer<T, P> &t1, SmartPointer<T, Q> &t2)
+swap(ObserverPointer<T, P> &t1, ObserverPointer<T, Q> &t2)
{
t1.swap(t2);
}
*/
template <typename T, typename P>
inline void
-swap(SmartPointer<T, P> &t1, T *&t2)
+swap(ObserverPointer<T, P> &t1, T *&t2)
{
t1.swap(t2);
}
*/
template <typename T, typename P>
inline void
-swap(T *&t1, SmartPointer<T, P> &t2)
+swap(T *&t1, ObserverPointer<T, P> &t2)
{
t2.swap(t1);
}
* moved from or destroyed.
* The mechanism works as follows: The member function subscribe() accepts a
* pointer to a boolean that is modified on invalidation. The object that owns
- * this pointer (usually an object of class type SmartPointer) is then expected
- * to check the state of the boolean before trying to access this class.
+ * this pointer (usually an object of class type ObserverPointer) is then
+ * expected to check the state of the boolean before trying to access this
+ * class.
*
* The utility of this class is even enhanced by providing identifying strings
* to the functions subscribe() and unsubscribe(). These strings are represented
* <code>x</code> is some object. Therefore, the pointers provided to
* subscribe() and to unsubscribe() must be the same. Strings with equal
* contents will not be recognized to be the same. The handling in
- * SmartPointer will take care of this.
+ * ObserverPointer will take care of this.
* The current subscribers to this class can be obtained by calling
* list_subscribers().
*
* @name Subscriptor functionality
*
* Classes derived from Subscriptor provide a facility to subscribe to this
- * object. This is mostly used by the SmartPointer class.
+ * object. This is mostly used by the ObserverPointer class.
* @{
*/
using map_iterator = decltype(counter_map)::iterator;
/**
- * In this vector, we store pointers to the validity bool in the SmartPointer
- * objects that subscribe to this class.
+ * In this vector, we store pointers to the validity bool in the
+ * ObserverPointer objects that subscribe to this class.
*/
mutable std::vector<std::atomic<bool> *> validity_pointers;
/**
* Pointer to the triangulation to work with.
*/
- SmartPointer<const parallel::distributed::Triangulation<dim, spacedim>,
- CellDataTransfer<dim, spacedim, VectorType>>
+ ObserverPointer<const parallel::distributed::Triangulation<dim, spacedim>,
+ CellDataTransfer<dim, spacedim, VectorType>>
triangulation;
/**
/**
* Partitioner used during repartition().
*/
- SmartPointer<const RepartitioningPolicyTools::Base<dim, spacedim>>
+ ObserverPointer<const RepartitioningPolicyTools::Base<dim, spacedim>>
partitioner_distributed;
/**
/**
* The modified parallel::shared::Triangulation.
*/
- const SmartPointer<
+ const ObserverPointer<
const dealii::parallel::shared::Triangulation<dim, spacedim>>
shared_tria;
/**
* The modified parallel::distributed::Triangulation.
*/
- const SmartPointer<
+ const ObserverPointer<
dealii::parallel::distributed::Triangulation<dim, spacedim>>
distributed_tria;
/**
* Address of the triangulation to work on.
*/
- SmartPointer<const Triangulation<dim, spacedim>, DoFHandler<dim, spacedim>>
+ ObserverPointer<const Triangulation<dim, spacedim>, DoFHandler<dim, spacedim>>
tria;
/**
/**
* The DoFHandler object on which this policy object works.
*/
- SmartPointer<DoFHandler<dim, spacedim>> dof_handler;
+ ObserverPointer<DoFHandler<dim, spacedim>> dof_handler;
};
/**
* The DoFHandler object on which this policy object works.
*/
- SmartPointer<DoFHandler<dim, spacedim>> dof_handler;
+ ObserverPointer<DoFHandler<dim, spacedim>> dof_handler;
};
/**
* The DoFHandler object on which this policy object works.
*/
- SmartPointer<DoFHandler<dim, spacedim>> dof_handler;
+ ObserverPointer<DoFHandler<dim, spacedim>> dof_handler;
};
} // namespace Policy
} // namespace DoFHandlerImplementation
/**
* Pointer to first FEValuesBase object.
*/
- SmartPointer<const FEValuesBase<dim1, spacedim>> first_fe_values;
+ ObserverPointer<const FEValuesBase<dim1, spacedim>> first_fe_values;
/**
* Pointer to second FEValuesBase object.
*/
- SmartPointer<const FEValuesBase<dim2, spacedim>> second_fe_values;
+ ObserverPointer<const FEValuesBase<dim2, spacedim>> second_fe_values;
/**
* Renumbering data for the first FEValuesBase object.
/**
* hp::FECollection for which transformation matrices will be calculated.
*/
- SmartPointer<const hp::FECollection<dim, spacedim>> fe_collection;
+ ObserverPointer<const hp::FECollection<dim, spacedim>> fe_collection;
/**
* hp::QCollection used in calculation of transformation matrices.
/**
* hp::FECollection for which transformation matrices will be calculated.
*/
- SmartPointer<const hp::FECollection<dim, spacedim>> fe_collection;
+ ObserverPointer<const hp::FECollection<dim, spacedim>> fe_collection;
/**
* hp::QCollection used in calculation of transformation matrices.
/**
* A pointer to the mapping object associated with this FEValues object.
*/
- const SmartPointer<const Mapping<dim, spacedim>, FEValuesBase<dim, spacedim>>
+ const ObserverPointer<const Mapping<dim, spacedim>,
+ FEValuesBase<dim, spacedim>>
mapping;
/**
* A pointer to the finite element object associated with this FEValues
* object.
*/
- const SmartPointer<const FiniteElement<dim, spacedim>,
- FEValuesBase<dim, spacedim>>
+ const ObserverPointer<const FiniteElement<dim, spacedim>,
+ FEValuesBase<dim, spacedim>>
fe;
/**
/**
* A pointer to the FEValuesBase object we operate on.
*/
- SmartPointer<const FEValuesBase<dim, spacedim>> fe_values;
+ ObserverPointer<const FEValuesBase<dim, spacedim>> fe_values;
/**
* The single scalar component this view represents of the FEValuesBase
/**
* A pointer to the FEValuesBase object we operate on.
*/
- SmartPointer<const FEValuesBase<dim, spacedim>> fe_values;
+ ObserverPointer<const FEValuesBase<dim, spacedim>> fe_values;
/**
* The first component of the vector this view represents of the
/**
* A pointer to the FEValuesBase object we operate on.
*/
- SmartPointer<const FEValuesBase<dim, spacedim>> fe_values;
+ ObserverPointer<const FEValuesBase<dim, spacedim>> fe_values;
/**
* The first component of the vector this view represents of the
/**
* A pointer to the FEValuesBase object we operate on.
*/
- SmartPointer<const FEValuesBase<dim, spacedim>> fe_values;
+ ObserverPointer<const FEValuesBase<dim, spacedim>> fe_values;
/**
* The first component of the vector this view represents of the
/**
* A pointer to the underlying finite element.
*/
- SmartPointer<const FiniteElement<dim, spacedim>> fe;
+ ObserverPointer<const FiniteElement<dim, spacedim>> fe;
/**
* Values of shape functions. Access by function @p shape.
/**
* Reference to the vector of shifts.
*/
- std::vector<
- SmartPointer<const VectorType, MappingFEField<dim, spacedim, VectorType>>>
+ std::vector<ObserverPointer<const VectorType,
+ MappingFEField<dim, spacedim, VectorType>>>
euler_vector;
/**
* Pointer to the DoFHandler to which the mapping vector is associated.
*/
- SmartPointer<const DoFHandler<dim, spacedim>,
- MappingFEField<dim, spacedim, VectorType>>
+ ObserverPointer<const DoFHandler<dim, spacedim>,
+ MappingFEField<dim, spacedim, VectorType>>
euler_dof_handler;
private:
*
* Updated each.
*/
- mutable SmartPointer<const Manifold<dim, spacedim>> manifold;
+ mutable ObserverPointer<const Manifold<dim, spacedim>> manifold;
};
private:
/**
* Reference to the vector of shifts.
*/
- SmartPointer<const VectorType, MappingQ1Eulerian<dim, VectorType, spacedim>>
+ ObserverPointer<const VectorType,
+ MappingQ1Eulerian<dim, VectorType, spacedim>>
euler_transform_vectors;
/**
* Pointer to the DoFHandler to which the mapping vector is associated.
*/
- SmartPointer<const DoFHandler<dim, spacedim>,
- MappingQ1Eulerian<dim, VectorType, spacedim>>
+ ObserverPointer<const DoFHandler<dim, spacedim>,
+ MappingQ1Eulerian<dim, VectorType, spacedim>>
shiftmap_dof_handler;
};
/**
* Reference to the vector of shifts.
*/
- SmartPointer<const VectorType, MappingQEulerian<dim, VectorType, spacedim>>
+ ObserverPointer<const VectorType, MappingQEulerian<dim, VectorType, spacedim>>
euler_vector;
/**
* Pointer to the DoFHandler to which the mapping vector is associated.
*/
- SmartPointer<const DoFHandler<dim, spacedim>,
- MappingQEulerian<dim, VectorType, spacedim>>
+ ObserverPointer<const DoFHandler<dim, spacedim>,
+ MappingQEulerian<dim, VectorType, spacedim>>
euler_dof_handler;
private:
/**
* The first ChartManifold.
*/
- SmartPointer<
+ ObserverPointer<
const ChartManifold<dim1, intermediate_dim, chartdim>,
CompositionManifold<dim, spacedim, chartdim, dim1, dim2, intermediate_dim>>
F;
/**
* The second ChartManifold.
*/
- SmartPointer<
+ ObserverPointer<
const ChartManifold<dim2, spacedim, intermediate_dim>,
CompositionManifold<dim, spacedim, chartdim, dim1, dim2, intermediate_dim>>
G;
/**
* Store address of the triangulation to be fed with the data read in.
*/
- SmartPointer<Triangulation<dim, spacedim>, GridIn<dim, spacedim>> tria;
+ ObserverPointer<Triangulation<dim, spacedim>, GridIn<dim, spacedim>> tria;
/**
* This function can write the raw cell data objects created by the
/**
* A pointer to the Triangulation.
*/
- SmartPointer<const Triangulation<dim, spacedim>, Cache<dim, spacedim>> tria;
+ ObserverPointer<const Triangulation<dim, spacedim>, Cache<dim, spacedim>>
+ tria;
/**
* Mapping to use when computing on the Triangulation.
*/
- SmartPointer<const Mapping<dim, spacedim>, Cache<dim, spacedim>> mapping;
+ ObserverPointer<const Mapping<dim, spacedim>, Cache<dim, spacedim>> mapping;
/**
using cell_iterator = typename MeshType::cell_iterator;
/**
- * Constructor setting the class name arguments in the SmartPointer members.
+ * Constructor setting the class name arguments in the ObserverPointer
+ * members.
*/
InterGridMap();
/**
* Store a pointer to the source grid.
*/
- SmartPointer<const MeshType, InterGridMap<MeshType>> source_grid;
+ ObserverPointer<const MeshType, InterGridMap<MeshType>> source_grid;
/**
* Likewise for the destination grid.
*/
- SmartPointer<const MeshType, InterGridMap<MeshType>> destination_grid;
+ ObserverPointer<const MeshType, InterGridMap<MeshType>> destination_grid;
/**
* Set the mapping for the pair of cells given. These shall match in level
/**
* Pointer to the push_forward function.
*/
- SmartPointer<const Function<chartdim>,
- FunctionManifold<dim, spacedim, chartdim>>
+ ObserverPointer<const Function<chartdim>,
+ FunctionManifold<dim, spacedim, chartdim>>
push_forward_function;
/**
* Pointer to the pull_back function.
*/
- SmartPointer<const Function<spacedim>,
- FunctionManifold<dim, spacedim, chartdim>>
+ ObserverPointer<const Function<spacedim>,
+ FunctionManifold<dim, spacedim, chartdim>>
pull_back_function;
/**
/**
* This grid shall be used as coarse grid.
*/
- SmartPointer<const Triangulation<dim, spacedim>,
- PersistentTriangulation<dim, spacedim>>
+ ObserverPointer<const Triangulation<dim, spacedim>,
+ PersistentTriangulation<dim, spacedim>>
coarse_grid;
/**
/**
* A pointer to the collection of finite elements to be used.
*/
- const SmartPointer<const FECollection<dim, FEValuesType::space_dimension>,
- FEValuesBase<dim, q_dim, FEValuesType>>
+ const ObserverPointer<
+ const FECollection<dim, FEValuesType::space_dimension>,
+ FEValuesBase<dim, q_dim, FEValuesType>>
fe_collection;
/**
* A pointer to the collection of mappings to be used.
*/
- const SmartPointer<
+ const ObserverPointer<
const MappingCollection<dim, FEValuesType::space_dimension>,
FEValuesBase<dim, q_dim, FEValuesType>>
mapping_collection;
/**
* Array of sub-matrices.
*/
- Table<2, SmartPointer<BlockType, BlockMatrixBase<MatrixType>>> sub_objects;
+ Table<2, ObserverPointer<BlockType, BlockMatrixBase<MatrixType>>> sub_objects;
/**
* This function collects the sizes of the sub-objects and stores them in
/**
* Pointer to the block sparsity pattern used for this matrix. In order to
* guarantee that it is not deleted while still in use, we subscribe to it
- * using the SmartPointer class.
+ * using the ObserverPointer class.
*/
- SmartPointer<const BlockSparsityPattern, BlockSparseMatrix<number>>
+ ObserverPointer<const BlockSparsityPattern, BlockSparseMatrix<number>>
sparsity_pattern;
};
/**
* Pointer to the sparsity pattern used for this matrix. In order to
* guarantee that it is not deleted while still in use, we subscribe to it
- * using the SmartPointer class.
+ * using the ObserverPointer class.
*/
- SmartPointer<const ChunkSparsityPattern, ChunkSparseMatrix<number>> cols;
+ ObserverPointer<const ChunkSparsityPattern, ChunkSparseMatrix<number>> cols;
/**
* Array of values for all the nonzero entries. The position of an
Tvmult(BlockVector<number> &, const BlockVector<number> &) const;
private:
- SmartPointer<const LAPACKFullMatrix<number>, PreconditionLU<number>> matrix;
- SmartPointer<VectorMemory<Vector<number>>, PreconditionLU<number>> mem;
+ ObserverPointer<const LAPACKFullMatrix<number>, PreconditionLU<number>>
+ matrix;
+ ObserverPointer<VectorMemory<Vector<number>>, PreconditionLU<number>> mem;
};
/*---------------------- Inline functions -----------------------------------*/
/**
* Pointers to the internal PETSc matrix objects.
*/
- SmartPointer<AMatrixType, NonlinearSolver> A;
- SmartPointer<PMatrixType, NonlinearSolver> P;
+ ObserverPointer<AMatrixType, NonlinearSolver> A;
+ ObserverPointer<PMatrixType, NonlinearSolver> P;
/**
* This flag is used to support versions of PETSc older than 3.13.
* copy the data from this object before starting the solution process,
* and copy the data back into it afterwards.
*/
- SmartPointer<SolverControl, SolverBase> solver_control;
+ ObserverPointer<SolverControl, SolverBase> solver_control;
/**
* Utility to create the KSP object and attach convergence test.
/**
* Pointers to the internal PETSc matrix objects.
*/
- SmartPointer<AMatrixType, TimeStepper> A;
- SmartPointer<PMatrixType, TimeStepper> P;
+ ObserverPointer<AMatrixType, TimeStepper> A;
+ ObserverPointer<PMatrixType, TimeStepper> P;
/**
* Object to apply solve_with_jacobian.
/**
* Pointer to the matrix object.
*/
- SmartPointer<const MatrixType, PreconditionRelaxation<MatrixType>> A;
+ ObserverPointer<const MatrixType, PreconditionRelaxation<MatrixType>> A;
/**
* Stores the additional data passed to the initialize function, obtained
}
private:
- const SmartPointer<const MatrixType> A;
- const double relaxation;
+ const ObserverPointer<const MatrixType> A;
+ const double relaxation;
};
template <typename MatrixType>
}
private:
- const SmartPointer<const MatrixType> A;
- const double relaxation;
+ const ObserverPointer<const MatrixType> A;
+ const double relaxation;
};
template <typename MatrixType>
}
private:
- const SmartPointer<const MatrixType> A;
- const double relaxation;
+ const ObserverPointer<const MatrixType> A;
+ const double relaxation;
/**
* An array that stores for each matrix row where the first position after
}
private:
- const SmartPointer<const MatrixType> A;
- const double relaxation;
+ const ObserverPointer<const MatrixType> A;
+ const double relaxation;
const std::vector<size_type> &permutation;
const std::vector<size_type> &inverse_permutation;
* <h4>Requirements on the templated classes</h4>
*
* The class `MatrixType` must be derived from Subscriptor because a
- * SmartPointer to `MatrixType` is held in the class. In particular, this means
- * that the matrix object needs to persist during the lifetime of
+ * ObserverPointer to `MatrixType` is held in the class. In particular, this
+ * means that the matrix object needs to persist during the lifetime of
* PreconditionChebyshev. The preconditioner is held in a shared_ptr that is
* copied into the AdditionalData member variable of the class, so the
* variable used for initialization can safely be discarded after calling
/**
* A pointer to the underlying matrix.
*/
- SmartPointer<
+ ObserverPointer<
const MatrixType,
PreconditionChebyshev<MatrixType, VectorType, PreconditionerType>>
matrix_ptr;
* inverse matrices should not be stored) until the last call of the
* preconditoining @p vmult function of the derived classes.
*/
- SmartPointer<const MatrixType, PreconditionBlock<MatrixType, inverse_type>> A;
+ ObserverPointer<const MatrixType, PreconditionBlock<MatrixType, inverse_type>>
+ A;
/**
* Relaxation parameter to be used by derived classes.
*/
* Matrix that is used for the matrix-builtin preconditioning function. cf.
* also @p PreconditionUseMatrix.
*/
- SmartPointer<const MatrixType, PreconditionSelector<MatrixType, VectorType>>
+ ObserverPointer<const MatrixType,
+ PreconditionSelector<MatrixType, VectorType>>
A;
/**
* inverse matrices should not be stored) until the last call of the
* preconditioning @p vmult function of the derived classes.
*/
- SmartPointer<const MatrixType,
- RelaxationBlock<MatrixType, InverseNumberType, VectorType>>
+ ObserverPointer<const MatrixType,
+ RelaxationBlock<MatrixType, InverseNumberType, VectorType>>
A;
/**
* Control information.
*/
- SmartPointer<const AdditionalData,
- RelaxationBlock<MatrixType, InverseNumberType, VectorType>>
+ ObserverPointer<const AdditionalData,
+ RelaxationBlock<MatrixType, InverseNumberType, VectorType>>
additional_data;
private:
* Stores the @p SolverControl that is needed in the constructor of each @p
* Solver class. This can be changed with @p set_control().
*/
- SmartPointer<SolverControl, SolverSelector<VectorType>> control;
+ ObserverPointer<SolverControl, SolverSelector<VectorType>> control;
/**
* Stores the name of the solver.
/**
* Pointer to the sparsity pattern used for this matrix. In order to
* guarantee that it is not deleted while still in use, we subscribe to it
- * using the SmartPointer class.
+ * using the ObserverPointer class.
*/
- SmartPointer<const SparsityPattern, SparseMatrix<number>> cols;
+ ObserverPointer<const SparsityPattern, SparseMatrix<number>> cols;
/**
* Array of values for all the nonzero entries. The position of an
/**
* Pointer to the matrix.
*/
- SmartPointer<const SparseMatrix<number>, SparseVanka<number>> matrix;
+ ObserverPointer<const SparseMatrix<number>, SparseVanka<number>> matrix;
/**
* Indices of those degrees of freedom that we shall work on.
* Array of inverse matrices, one for each degree of freedom. Only those
* elements will be used that are tagged in @p selected.
*/
- mutable std::vector<SmartPointer<FullMatrix<float>, SparseVanka<number>>>
+ mutable std::vector<ObserverPointer<FullMatrix<float>, SparseVanka<number>>>
inverses;
/**
SparseVanka<number>::~SparseVanka()
{
typename std::vector<
- SmartPointer<FullMatrix<float>, SparseVanka<number>>>::iterator i;
+ ObserverPointer<FullMatrix<float>, SparseVanka<number>>>::iterator i;
for (i = inverses.begin(); i != inverses.end(); ++i)
{
FullMatrix<float> *p = *i;
/**
* Pointer to the Mapping object passed to the constructor.
*/
- SmartPointer<const Mapping<dim, spacedim>> mapping;
+ ObserverPointer<const Mapping<dim, spacedim>> mapping;
/**
* Pointer to the FiniteElement object passed to the constructor.
*/
- SmartPointer<const FiniteElement<dim, spacedim>> fe;
+ ObserverPointer<const FiniteElement<dim, spacedim>> fe;
/**
* Description of the 1d polynomial basis for tensor product elements used
* Pointer to currently used mapping info (either on the fly or external
* precomputed).
*/
- SmartPointer<NonMatching::MappingInfo<dim, spacedim, Number>> mapping_info;
+ ObserverPointer<NonMatching::MappingInfo<dim, spacedim, Number>> mapping_info;
/**
* The current cell index to access mapping data from mapping info.
/**
* Underlying communicator which handles update of the ghost values.
*/
- SmartPointer<const FERemoteEvaluationCommunicator<dim>> comm;
+ ObserverPointer<const FERemoteEvaluationCommunicator<dim>> comm;
/**
* Pointer to MeshType if used with Triangulation.
*/
- SmartPointer<const Triangulation<dim>> tria;
+ ObserverPointer<const Triangulation<dim>> tria;
/**
* Pointer to MeshType if used with DoFHandler.
*/
- SmartPointer<const DoFHandler<dim>> dof_handler;
+ ObserverPointer<const DoFHandler<dim>> dof_handler;
/**
* First selected component.
/**
* The pointer to the first entry of mapping_collection.
*/
- SmartPointer<const Mapping<dim>> mapping;
+ ObserverPointer<const Mapping<dim>> mapping;
/**
* Reference-cell type related to each quadrature and active quadrature
/**
* Pointers to the DoFHandlers underlying the current problem.
*/
- std::vector<SmartPointer<const DoFHandler<dim>>> dof_handlers;
+ std::vector<ObserverPointer<const DoFHandler<dim>>> dof_handlers;
/**
* Pointers to the AffineConstraints underlying the current problem. Only
* template parameter as the `Number` template of MatrixFree is passed to
* reinit(). Filled with nullptr otherwise.
*/
- std::vector<SmartPointer<const AffineConstraints<Number>>> affine_constraints;
+ std::vector<ObserverPointer<const AffineConstraints<Number>>>
+ affine_constraints;
/**
* Contains the information about degrees of freedom on the individual cells
void
store_affine_constraints(
const dealii::AffineConstraints<Number2> *,
- SmartPointer<const dealii::AffineConstraints<Number>> &stored_constraints)
+ ObserverPointer<const dealii::AffineConstraints<Number>>
+ &stored_constraints)
{
stored_constraints = nullptr;
}
template <typename Number>
void
store_affine_constraints(
- const dealii::AffineConstraints<Number> *affine_constraints,
- SmartPointer<const dealii::AffineConstraints<Number>> &stored_constraints)
+ const dealii::AffineConstraints<Number> *affine_constraints,
+ ObserverPointer<const dealii::AffineConstraints<Number>>
+ &stored_constraints)
{
stored_constraints = affine_constraints;
}
std::vector<bool>
compute_dof_info(
const std::vector<const dealii::AffineConstraints<number> *> &constraint,
- const std::vector<IndexSet> &locally_owned_dofs,
- const std::vector<SmartPointer<const DoFHandler<dim>>> &dof_handlers,
- const Table<2, MatrixFreeFunctions::ShapeInfo<double>> &shape_infos,
+ const std::vector<IndexSet> &locally_owned_dofs,
+ const std::vector<ObserverPointer<const DoFHandler<dim>>> &dof_handlers,
+ const Table<2, MatrixFreeFunctions::ShapeInfo<double>> &shape_infos,
const unsigned int cell_level_index_end_local,
const unsigned int mg_level,
const bool hold_all_faces_to_owned_cells,
/**
* Const pointer to the operator class.
*/
- SmartPointer<const OperatorType> mf_base_operator;
+ ObserverPointer<const OperatorType> mf_base_operator;
};
/**
* Reference to the underlying MatrixFree object.
*/
- SmartPointer<const MatrixFree<dim, Number, VectorizedArrayType>>
+ ObserverPointer<const MatrixFree<dim, Number, VectorizedArrayType>>
matrix_free;
/**
/**
* A pointer to the object containing the block structure.
*/
- SmartPointer<const BlockInfo,
- ResidualLocalBlocksToGlobalBlocks<VectorType>>
+ ObserverPointer<const BlockInfo,
+ ResidualLocalBlocksToGlobalBlocks<VectorType>>
block_info;
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const AffineConstraints<typename VectorType::value_type>,
- ResidualLocalBlocksToGlobalBlocks<VectorType>>
+ ObserverPointer<const AffineConstraints<typename VectorType::value_type>,
+ ResidualLocalBlocksToGlobalBlocks<VectorType>>
constraints;
};
/**
* The global matrices, stored as a vector of pointers.
*/
- SmartPointer<MatrixBlockVector<MatrixType>,
- MatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
+ ObserverPointer<MatrixBlockVector<MatrixType>,
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
matrices;
/**
* A pointer to the object containing the block structure.
*/
- SmartPointer<const BlockInfo,
- MatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
+ ObserverPointer<const BlockInfo,
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
block_info;
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const AffineConstraints<typename MatrixType::value_type>,
- MatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
+ ObserverPointer<const AffineConstraints<typename MatrixType::value_type>,
+ MatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
constraints;
/**
public:
using MatrixPtrVector = MGMatrixBlockVector<MatrixType>;
using MatrixPtrVectorPtr =
- SmartPointer<MatrixPtrVector,
- MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>>;
+ ObserverPointer<MatrixPtrVector,
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>>;
/**
* Constructor, initializing the #threshold, which limits how small
/**
* A pointer to the object containing the block structure.
*/
- SmartPointer<const BlockInfo,
- MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
+ ObserverPointer<const BlockInfo,
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
block_info;
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const MGConstrainedDoFs,
- MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
+ ObserverPointer<const MGConstrainedDoFs,
+ MGMatrixLocalBlocksToGlobalBlocks<MatrixType, number>>
mg_constrained_dofs;
/// The block structure of the system
- SmartPointer<const BlockInfo, DoFInfo<dim, spacedim>> block_info;
+ ObserverPointer<const BlockInfo, DoFInfo<dim, spacedim>> block_info;
/**
* The structure refers to a cell with level data instead of active data.
/**
* The pointer to the (system) element used for initialization.
*/
- SmartPointer<const FiniteElement<dim, spacedim>,
- IntegrationInfo<dim, spacedim>>
+ ObserverPointer<const FiniteElement<dim, spacedim>,
+ IntegrationInfo<dim, spacedim>>
fe_pointer;
/**
{
public:
/**
- * Create an empty ScratchData object. A SmartPointer pointing to
+ * Create an empty ScratchData object. A ObserverPointer pointing to
* @p mapping and @p fe is stored internally. Make sure they live longer
* than this class instance.
*
const UpdateFlags &neighbor_face_update_flags = update_default);
/**
- * Create an empty ScratchData object. A SmartPointer pointing to
+ * Create an empty ScratchData object. A ObserverPointer pointing to
* @p mapping_collection and @p fe_collection is stored internally. Make sure they live longer
* than this class instance.
*
* The mapping used by the internal FEValues. Make sure it lives
* longer than this class.
*/
- SmartPointer<const Mapping<dim, spacedim>> mapping;
+ ObserverPointer<const Mapping<dim, spacedim>> mapping;
/**
* The finite element used by the internal FEValues. Make sure it lives
* longer than this class.
*/
- SmartPointer<const FiniteElement<dim, spacedim>> fe;
+ ObserverPointer<const FiniteElement<dim, spacedim>> fe;
/**
* Quadrature formula used to integrate on the current cell, and on its
* The mapping collection used by the internal hp::FEValues. Make sure it
* lives longer than this class.
*/
- SmartPointer<const hp::MappingCollection<dim, spacedim>> mapping_collection;
+ ObserverPointer<const hp::MappingCollection<dim, spacedim>>
+ mapping_collection;
/**
* The finite element used by the internal FEValues. Make sure it lives
* longer than this class.
*/
- SmartPointer<const hp::FECollection<dim, spacedim>> fe_collection;
+ ObserverPointer<const hp::FECollection<dim, spacedim>> fe_collection;
/**
* Quadrature formula used to integrate on the current cell, and on its
* A pointer to the last used FEValues/FEFaceValues, or FESubfaceValues
* object on this cell.
*/
- SmartPointer<const FEValuesBase<dim, spacedim>> current_fe_values;
+ ObserverPointer<const FEValuesBase<dim, spacedim>> current_fe_values;
/**
* A pointer to the last used FEValues/FEFaceValues, or FESubfaceValues
* object on the neighbor cell.
*/
- SmartPointer<const FEValuesBase<dim, spacedim>> current_neighbor_fe_values;
+ ObserverPointer<const FEValuesBase<dim, spacedim>>
+ current_neighbor_fe_values;
};
#ifndef DOXYGEN
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const AffineConstraints<typename VectorType::value_type>,
- ResidualSimple<VectorType>>
+ ObserverPointer<const AffineConstraints<typename VectorType::value_type>,
+ ResidualSimple<VectorType>>
constraints;
};
/**
* The vector of global matrices being assembled.
*/
- std::vector<SmartPointer<MatrixType, MatrixSimple<MatrixType>>> matrix;
+ std::vector<ObserverPointer<MatrixType, MatrixSimple<MatrixType>>> matrix;
/**
* The smallest positive number that will be entered into the global
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const AffineConstraints<typename MatrixType::value_type>,
- MatrixSimple<MatrixType>>
+ ObserverPointer<const AffineConstraints<typename MatrixType::value_type>,
+ MatrixSimple<MatrixType>>
constraints;
};
/**
* The global matrix being assembled.
*/
- SmartPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
+ ObserverPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
matrix;
/**
* The matrix used for face flux terms across the refinement edge,
* coupling coarse to fine.
*/
- SmartPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
+ ObserverPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
flux_up;
/**
* The matrix used for face flux terms across the refinement edge,
* coupling fine to coarse.
*/
- SmartPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
+ ObserverPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
flux_down;
/**
* The matrix used for face contributions for continuous elements across
* the refinement edge, coupling coarse to fine.
*/
- SmartPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
+ ObserverPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
interface_in;
/**
* The matrix used for face contributions for continuous elements across
* the refinement edge, coupling fine to coarse.
*/
- SmartPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
+ ObserverPointer<MGLevelObject<MatrixType>, MGMatrixSimple<MatrixType>>
interface_out;
/**
* A pointer to the object containing constraints.
*/
- SmartPointer<const MGConstrainedDoFs, MGMatrixSimple<MatrixType>>
+ ObserverPointer<const MGConstrainedDoFs, MGMatrixSimple<MatrixType>>
mg_constrained_dofs;
/**
VectorData<VectorType, dim, spacedim>::initialize(const VectorType *v,
const std::string &name)
{
- SmartPointer<const VectorType, VectorData<VectorType, dim, spacedim>> p = v;
+ ObserverPointer<const VectorType, VectorData<VectorType, dim, spacedim>> p =
+ v;
this->data.add(p, name);
VectorSelector::initialize(this->data);
}
const MGLevelObject<VectorType> *v,
const std::string &name)
{
- SmartPointer<const MGLevelObject<VectorType>,
- MGVectorData<VectorType, dim, spacedim>>
+ ObserverPointer<const MGLevelObject<VectorType>,
+ MGVectorData<VectorType, dim, spacedim>>
p = v;
this->data.add(p, name);
VectorSelector::initialize(this->data);
/**
* Memory for auxiliary vectors.
*/
- SmartPointer<VectorMemory<BlockVector<number>>,
- MGSmootherBlock<MatrixType, RelaxationType, number>>
+ ObserverPointer<VectorMemory<BlockVector<number>>,
+ MGSmootherBlock<MatrixType, RelaxationType, number>>
mem;
};
/**
* Reference to the smoother.
*/
- SmartPointer<const MGSmootherBase<VectorType>,
- MGCoarseGridApplySmoother<VectorType>>
+ ObserverPointer<const MGSmootherBase<VectorType>,
+ MGCoarseGridApplySmoother<VectorType>>
coarse_smooth;
};
/**
* Reference to the solver.
*/
- SmartPointer<SolverType,
- MGCoarseGridIterativeSolver<VectorType,
- SolverType,
- MatrixType,
- PreconditionerType>>
+ ObserverPointer<SolverType,
+ MGCoarseGridIterativeSolver<VectorType,
+ SolverType,
+ MatrixType,
+ PreconditionerType>>
solver;
/**
* Reference to the matrix.
*/
- SmartPointer<const MatrixType,
- MGCoarseGridIterativeSolver<VectorType,
- SolverType,
- MatrixType,
- PreconditionerType>>
+ ObserverPointer<const MatrixType,
+ MGCoarseGridIterativeSolver<VectorType,
+ SolverType,
+ MatrixType,
+ PreconditionerType>>
matrix;
/**
* Reference to the preconditioner.
*/
- SmartPointer<const PreconditionerType,
- MGCoarseGridIterativeSolver<VectorType,
- SolverType,
- MatrixType,
- PreconditionerType>>
+ ObserverPointer<const PreconditionerType,
+ MGCoarseGridIterativeSolver<VectorType,
+ SolverType,
+ MatrixType,
+ PreconditionerType>>
preconditioner;
};
MGCoarseGridApplySmoother<VectorType>::initialize(
const MGSmootherBase<VectorType> &coarse_smooth_)
{
- coarse_smooth =
- SmartPointer<const MGSmootherBase<VectorType>,
- MGCoarseGridApplySmoother<VectorType>>(&coarse_smooth_,
- typeid(*this).name());
+ coarse_smooth = ObserverPointer<const MGSmootherBase<VectorType>,
+ MGCoarseGridApplySmoother<VectorType>>(
+ &coarse_smooth_, typeid(*this).name());
}
public:
/**
* Constructor. @p row and @p col are the coordinate of the selected block.
- * The other argument is handed over to the @p SmartPointer constructor.
+ * The other argument is handed over to the @p ObserverPointer constructor.
*/
MGMatrixSelect(const unsigned int row = 0,
const unsigned int col = 0,
/**
* Pointer to the matrix objects on each level.
*/
- SmartPointer<MGLevelObject<MatrixType>, MGMatrixSelect<MatrixType, number>>
+ ObserverPointer<MGLevelObject<MatrixType>, MGMatrixSelect<MatrixType, number>>
matrix;
/**
* Row coordinate of selected block.
/**
* The mg_constrained_dofs of the level systems.
*/
- SmartPointer<const MGConstrainedDoFs> mg_constrained_dofs;
+ ObserverPointer<const MGConstrainedDoFs> mg_constrained_dofs;
private:
/**
/**
* The mg_constrained_dofs of the level systems.
*/
- SmartPointer<const MGConstrainedDoFs> mg_constrained_dofs;
+ ObserverPointer<const MGConstrainedDoFs> mg_constrained_dofs;
/**
* In the function copy_to_mg, we need to access ghosted entries of the
* The mg_constrained_dofs of the level systems.
*/
- SmartPointer<const MGConstrainedDoFs, MGTransferBlockBase>
+ ObserverPointer<const MGConstrainedDoFs, MGTransferBlockBase>
mg_constrained_dofs;
};
* Memory pool required if additional multiplication using #factors is
* desired.
*/
- SmartPointer<VectorMemory<Vector<number>>, MGTransferBlock<number>> memory;
+ ObserverPointer<VectorMemory<Vector<number>>, MGTransferBlock<number>> memory;
};
* The constraints of the global system.
*/
public:
- SmartPointer<const AffineConstraints<double>> constraints;
+ ObserverPointer<const AffineConstraints<double>> constraints;
};
/** @} */
/**
* Matrix-free object on the fine side.
*/
- SmartPointer<const MatrixFree<dim, Number>> matrix_free_fine;
+ ObserverPointer<const MatrixFree<dim, Number>> matrix_free_fine;
/**
* Index within the list of DoFHandler objects in the matrix_free_fine
/**
* Matrix-free object on the coarse side.
*/
- SmartPointer<const MatrixFree<dim, Number>> matrix_free_coarse;
+ ObserverPointer<const MatrixFree<dim, Number>> matrix_free_coarse;
/**
* Index within the list of DoFHandler objects in the matrix_free_coarse
/**
* Pointer to the DoFHandler object used during initialization.
*/
- SmartPointer<const DoFHandler<dim>> dof_handler_fine;
+ ObserverPointer<const DoFHandler<dim>> dof_handler_fine;
/**
* Multigrid level used during initialization.
/**
* Pointer to the DoFHandler object used during initialization.
*/
- SmartPointer<const DoFHandler<dim>> dof_handler_fine;
+ ObserverPointer<const DoFHandler<dim>> dof_handler_fine;
/**
* Multigrid level used during initialization.
*/
void
initialize_internal_transfer(
- const DoFHandler<dim> &dof_handler,
- const SmartPointer<const MGConstrainedDoFs> &mg_constrained_dofs);
+ const DoFHandler<dim> &dof_handler,
+ const ObserverPointer<const MGConstrainedDoFs> &mg_constrained_dofs);
/**
* Retrieve finest DoFHandler from two-level transfer objects.
/**
* Collection of the two-level transfer operators.
*/
- MGLevelObject<SmartPointer<MGTwoLevelTransferBase<VectorType>>> transfer;
+ MGLevelObject<ObserverPointer<MGTwoLevelTransferBase<VectorType>>> transfer;
/**
* External partitioners used during initialize_dof_vector().
/**
* Non-block version of transfer operation.
*/
- std::vector<SmartPointer<const MGTransferMF<dim, Number>>> transfer_operators;
+ std::vector<ObserverPointer<const MGTransferMF<dim, Number>>>
+ transfer_operators;
};
template <int dim, typename Number>
void
MGTransferMF<dim, Number>::initialize_internal_transfer(
- const DoFHandler<dim> &dof_handler,
- const SmartPointer<const MGConstrainedDoFs> &mg_constrained_dofs)
+ const DoFHandler<dim> &dof_handler,
+ const ObserverPointer<const MGConstrainedDoFs> &mg_constrained_dofs)
{
const unsigned int min_level = 0;
const unsigned int max_level =
/**
* The matrix for each level.
*/
- SmartPointer<const MGMatrixBase<VectorType>, Multigrid<VectorType>> matrix;
+ ObserverPointer<const MGMatrixBase<VectorType>, Multigrid<VectorType>> matrix;
/**
* The matrix for each level.
*/
- SmartPointer<const MGCoarseGridBase<VectorType>, Multigrid<VectorType>>
+ ObserverPointer<const MGCoarseGridBase<VectorType>, Multigrid<VectorType>>
coarse;
/**
* Object for grid transfer.
*/
- SmartPointer<const MGTransferBase<VectorType>, Multigrid<VectorType>>
+ ObserverPointer<const MGTransferBase<VectorType>, Multigrid<VectorType>>
transfer;
/**
* The pre-smoothing object.
*/
- SmartPointer<const MGSmootherBase<VectorType>, Multigrid<VectorType>>
+ ObserverPointer<const MGSmootherBase<VectorType>, Multigrid<VectorType>>
pre_smooth;
/**
* The post-smoothing object.
*/
- SmartPointer<const MGSmootherBase<VectorType>, Multigrid<VectorType>>
+ ObserverPointer<const MGSmootherBase<VectorType>, Multigrid<VectorType>>
post_smooth;
/**
*
* @note Only <tt>vmult</tt> is used for these matrices.
*/
- SmartPointer<const MGMatrixBase<VectorType>> edge_out;
+ ObserverPointer<const MGMatrixBase<VectorType>> edge_out;
/**
* Transpose edge matrix from the refinement edge to the interior of the
*
* @note Only <tt>Tvmult</tt> is used for these matrices.
*/
- SmartPointer<const MGMatrixBase<VectorType>> edge_in;
+ ObserverPointer<const MGMatrixBase<VectorType>> edge_in;
/**
* Edge matrix from fine to coarse.
*
* @note Only <tt>vmult</tt> is used for these matrices.
*/
- SmartPointer<const MGMatrixBase<VectorType>, Multigrid<VectorType>> edge_down;
+ ObserverPointer<const MGMatrixBase<VectorType>, Multigrid<VectorType>>
+ edge_down;
/**
* Transpose edge matrix from coarse to fine.
*
* @note Only <tt>Tvmult</tt> is used for these matrices.
*/
- SmartPointer<const MGMatrixBase<VectorType>, Multigrid<VectorType>> edge_up;
+ ObserverPointer<const MGMatrixBase<VectorType>, Multigrid<VectorType>>
+ edge_up;
template <int dim, typename OtherVectorType, typename TransferType>
friend class PreconditionMG;
/**
* Associated @p DoFHandler.
*/
- std::vector<SmartPointer<const DoFHandler<dim>,
- PreconditionMG<dim, VectorType, TransferType>>>
+ std::vector<ObserverPointer<const DoFHandler<dim>,
+ PreconditionMG<dim, VectorType, TransferType>>>
dof_handler_vector;
/**
* Storage for the pointers to the DoFHandler objects
- * without SmartPointer wrapper.
+ * without ObserverPointer wrapper.
*/
std::vector<const DoFHandler<dim> *> dof_handler_vector_raw;
/**
* The multigrid object.
*/
- SmartPointer<Multigrid<VectorType>,
- PreconditionMG<dim, VectorType, TransferType>>
+ ObserverPointer<Multigrid<VectorType>,
+ PreconditionMG<dim, VectorType, TransferType>>
multigrid;
/**
* Object for grid transfer.
*/
- SmartPointer<const TransferType,
- PreconditionMG<dim, VectorType, TransferType>>
+ ObserverPointer<const TransferType,
+ PreconditionMG<dim, VectorType, TransferType>>
transfer;
/**
/**
* A pointer to the collection of mappings to be used.
*/
- const SmartPointer<const hp::MappingCollection<dim>> mapping_collection;
+ const ObserverPointer<const hp::MappingCollection<dim>> mapping_collection;
/**
* A pointer to the collection of finite elements to be used.
*/
- const SmartPointer<const hp::FECollection<dim>> fe_collection;
+ const ObserverPointer<const hp::FECollection<dim>> fe_collection;
/**
* Collection of 1-dimensional quadrature rules that are used by
/**
* Pointer to the MeshClassifier passed to the constructor.
*/
- const SmartPointer<const MeshClassifier<dim>> mesh_classifier;
+ const ObserverPointer<const MeshClassifier<dim>> mesh_classifier;
/**
* For each element in the FECollection passed to the constructor,
/**
* A pointer to the collection of mappings to be used.
*/
- const SmartPointer<const hp::MappingCollection<dim>> mapping_collection;
+ const ObserverPointer<const hp::MappingCollection<dim>> mapping_collection;
/**
* A pointer to the collection of finite elements to be used.
*/
- const SmartPointer<const hp::FECollection<dim>> fe_collection;
+ const ObserverPointer<const hp::FECollection<dim>> fe_collection;
/**
* Collection of 1-dimensional quadrature rules that are used by
/**
* Pointer to the MeshClassifier passed to the constructor.
*/
- const SmartPointer<const MeshClassifier<dim>> mesh_classifier;
+ const ObserverPointer<const MeshClassifier<dim>> mesh_classifier;
/**
* FEInterfaceValues corresponding to cells with LocationToLevelSet
public:
static UpdateFlags
required_update_flags(
- const SmartPointer<const Mapping<dim, spacedim>> &mapping,
- const UpdateFlags &update_flags)
+ const ObserverPointer<const Mapping<dim, spacedim>> &mapping,
+ const UpdateFlags &update_flags)
{
return mapping->requires_update_flags(update_flags);
}
static void
compute_mapping_data_for_quadrature(
- const SmartPointer<const Mapping<dim, spacedim>> &mapping,
- const UpdateFlags &update_flags_mapping,
+ const ObserverPointer<const Mapping<dim, spacedim>> &mapping,
+ const UpdateFlags &update_flags_mapping,
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
CellSimilarity::Similarity &cell_similarity,
const Quadrature<dim> &quadrature,
static void
compute_mapping_data_for_immersed_surface_quadrature(
- const SmartPointer<const Mapping<dim, spacedim>> &mapping,
- const UpdateFlags &update_flags_mapping,
+ const ObserverPointer<const Mapping<dim, spacedim>> &mapping,
+ const UpdateFlags &update_flags_mapping,
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const ImmersedSurfaceQuadrature<dim> &quadrature,
std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
static void
compute_mapping_data_for_face_quadrature(
- const SmartPointer<const Mapping<dim, spacedim>> &mapping,
- const UpdateFlags &update_flags_mapping,
+ const ObserverPointer<const Mapping<dim, spacedim>> &mapping,
+ const UpdateFlags &update_flags_mapping,
const typename Triangulation<dim, spacedim>::cell_iterator &cell,
const unsigned int face_no,
const Quadrature<dim - 1> &quadrature,
/**
* A pointer to the underlying mapping.
*/
- const SmartPointer<const Mapping<dim, spacedim>> mapping;
+ const ObserverPointer<const Mapping<dim, spacedim>> mapping;
/**
* The desired update flags for the evaluation.
* reinit functions. This field is only set if
* AdditionalData::store_cells is enabled.
*/
- SmartPointer<const Triangulation<dim, spacedim>> triangulation;
+ ObserverPointer<const Triangulation<dim, spacedim>> triangulation;
/**
* Level and indices of cells passed to the reinit functions. This
/**
* Pointer to the triangulation that should be classified.
*/
- const SmartPointer<const Triangulation<dim>> triangulation;
+ const ObserverPointer<const Triangulation<dim>> triangulation;
/**
* Pointer to an object that describes what we need to know about the
* One dimensional quadrature rules used to create the immersed
* quadratures.
*/
- const SmartPointer<const hp::QCollection<1>> q_collection1D;
+ const ObserverPointer<const hp::QCollection<1>> q_collection1D;
/**
* Stores options/settings for the algorithm.
* Index of the quadrature in q_collection1d that should use to
* generate the immersed quadrature rules.
*/
- const SmartPointer<const hp::QCollection<1>> q_collection1D;
+ const ObserverPointer<const hp::QCollection<1>> q_collection1D;
/**
* Quadratures that the derived classes create.
/**
* Pointer to the triangulation to work with.
*/
- SmartPointer<const Triangulation<dim, spacedim>,
- CellDataTransfer<dim, spacedim, VectorType>>
+ ObserverPointer<const Triangulation<dim, spacedim>,
+ CellDataTransfer<dim, spacedim, VectorType>>
triangulation;
/**
/**
* Pointer to the DoFHandler object that the vector is based on.
*/
- SmartPointer<const DoFHandler<dim, spacedim>> dof_handler;
+ ObserverPointer<const DoFHandler<dim, spacedim>> dof_handler;
/**
* Names of the components of this data vector.
* Pointer to a DataPostprocessing object which shall be applied to this
* data vector.
*/
- SmartPointer<const dealii::DataPostprocessor<spacedim>> postprocessor;
+ ObserverPointer<const dealii::DataPostprocessor<spacedim>> postprocessor;
/**
* Number of output variables this dataset provides (either number of
/**
* Pointer to the triangulation object.
*/
- SmartPointer<const Triangulation<dim, spacedim>> triangulation;
+ ObserverPointer<const Triangulation<dim, spacedim>> triangulation;
/**
* Pointer to the optional handler object.
*/
- SmartPointer<const DoFHandler<dim, spacedim>> dofs;
+ ObserverPointer<const DoFHandler<dim, spacedim>> dofs;
/**
* List of data elements with vectors of values for each degree of freedom.
Exceptions::DataOutImplementation::ExcOldDataStillPresent());
triangulation =
- SmartPointer<const Triangulation<dim, spacedim>>(&d.get_triangulation(),
- typeid(*this).name());
+ ObserverPointer<const Triangulation<dim, spacedim>>(&d.get_triangulation(),
+ typeid(*this).name());
dofs =
- SmartPointer<const DoFHandler<dim, spacedim>>(&d, typeid(*this).name());
+ ObserverPointer<const DoFHandler<dim, spacedim>>(&d, typeid(*this).name());
}
Exceptions::DataOutImplementation::ExcOldDataStillPresent());
triangulation =
- SmartPointer<const Triangulation<dim, spacedim>>(&tria,
- typeid(*this).name());
+ ObserverPointer<const Triangulation<dim, spacedim>>(&tria,
+ typeid(*this).name());
}
}
else
{
- triangulation = SmartPointer<const Triangulation<dim, spacedim>>(
+ triangulation = ObserverPointer<const Triangulation<dim, spacedim>>(
&dof_handler.get_triangulation(), typeid(*this).name());
}
if (triangulation == nullptr)
{
Assert(dof_handler != nullptr, ExcInternalError());
- triangulation = SmartPointer<const Triangulation<dim, spacedim>>(
+ triangulation = ObserverPointer<const Triangulation<dim, spacedim>>(
&dof_handler->get_triangulation(), typeid(*this).name());
}
&data_component_interpretation_)
{
if (triangulation == nullptr)
- triangulation = SmartPointer<const Triangulation<dim, spacedim>>(
+ triangulation = ObserverPointer<const Triangulation<dim, spacedim>>(
&dof_handler.get_triangulation(), typeid(*this).name());
Assert(&dof_handler.get_triangulation() == triangulation,
/**
* Mapping used in connection with patch_tria.
*/
- const SmartPointer<const Mapping<patch_dim, spacedim>> patch_mapping;
+ const ObserverPointer<const Mapping<patch_dim, spacedim>> patch_mapping;
/**
* DataOut object that does the actual building of the patches.
/**
* Mapping of the original triangulation provided in update_mapping().
*/
- SmartPointer<const Mapping<dim, spacedim>> mapping;
+ ObserverPointer<const Mapping<dim, spacedim>> mapping;
};
DEAL_II_NAMESPACE_CLOSE
* DoF handler to be used for the data corresponding to the present
* parameter value.
*/
- SmartPointer<const DoFHandler<dim, spacedim>, DataOutStack<dim, spacedim>>
+ ObserverPointer<const DoFHandler<dim, spacedim>, DataOutStack<dim, spacedim>>
dof_handler;
/**
operator<<(const AnyData &vectors) override;
private:
- SmartPointer<const DoFHandler<dim, spacedim>,
- DoFOutputOperator<VectorType, dim, spacedim>>
+ ObserverPointer<const DoFHandler<dim, spacedim>,
+ DoFOutputOperator<VectorType, dim, spacedim>>
dof;
const std::string filename_base;
/**
* Pointer to the dof handler.
*/
- SmartPointer<const DoFHandler<dim, spacedim>,
- FEFieldFunction<dim, VectorType, spacedim>>
+ ObserverPointer<const DoFHandler<dim, spacedim>,
+ FEFieldFunction<dim, VectorType, spacedim>>
dh;
/**
* A smart pointer to the dof_handler supplied to the constructor. This can
* be released by calling @p clear().
*/
- SmartPointer<const DoFHandler<dim>, PointValueHistory<dim>> dof_handler;
+ ObserverPointer<const DoFHandler<dim>, PointValueHistory<dim>> dof_handler;
/**
/**
* Pointer to the degree of freedom handler to work with.
*/
- SmartPointer<const DoFHandler<dim, spacedim>,
- SolutionTransfer<dim, VectorType, spacedim>>
+ ObserverPointer<const DoFHandler<dim, spacedim>,
+ SolutionTransfer<dim, VectorType, spacedim>>
dof_handler;
/**
/**
* Pointer to the degree of freedom handler to work with.
*/
- SmartPointer<const DoFHandler<dim, spacedim>,
- SolutionTransfer<dim, VectorType, spacedim>>
+ ObserverPointer<const DoFHandler<dim, spacedim>,
+ SolutionTransfer<dim, VectorType, spacedim>>
dof_handler;
/**
* this object operates on. Note that this object takes possession of the
* objects pointed to by the pointers in this collection.
*/
- std::vector<SmartPointer<TimeStepBase, TimeDependent>> timesteps;
+ std::vector<ObserverPointer<TimeStepBase, TimeDependent>> timesteps;
/**
* Number of the present sweep. This is reset by the @p start_sweep function
* the functions @p sleep and @p wake_up to save memory, if such a behavior
* is specified in the @p flags structure.
*/
- SmartPointer<Triangulation<dim, dim>, TimeStepBase_Tria<dim>> tria;
+ ObserverPointer<Triangulation<dim, dim>, TimeStepBase_Tria<dim>> tria;
/**
* Pointer to a grid which is to be used as the coarse grid for this time
* level. This pointer is set through the constructor; ownership remains
* with the owner of this management object.
*/
- SmartPointer<const Triangulation<dim, dim>, TimeStepBase_Tria<dim>>
+ ObserverPointer<const Triangulation<dim, dim>, TimeStepBase_Tria<dim>>
coarse_grid;
/**
/**
* Address of the triangulation to work on.
*/
- SmartPointer<const Triangulation<dim, spacedim>,
- ParticleHandler<dim, spacedim>>
+ ObserverPointer<const Triangulation<dim, spacedim>,
+ ParticleHandler<dim, spacedim>>
triangulation;
/**
* Address of the mapping to work on.
*/
- SmartPointer<const Mapping<dim, spacedim>, ParticleHandler<dim, spacedim>>
+ ObserverPointer<const Mapping<dim, spacedim>,
+ ParticleHandler<dim, spacedim>>
mapping;
/**
std::cerr
<< "---------------------------------------------------------"
<< std::endl
- << "An object pointed to by a SmartPointer is being destroyed."
+ << "An object pointed to by a ObserverPointer is being destroyed."
<< std::endl
<< "Under normal circumstances, this would abort the program."
<< std::endl
void
fill_internal(
const DoFHandler<dim, spacedim> &mg_dof,
- SmartPointer<const MGConstrainedDoFs> mg_constrained_dofs,
+ ObserverPointer<const MGConstrainedDoFs> mg_constrained_dofs,
const MPI_Comm mpi_communicator,
const bool transfer_solution_vectors,
std::vector<Table<2, unsigned int>> ©_indices,
/**
* Pointer to the DoFHandler associated with the level set function.
*/
- const SmartPointer<const DoFHandler<dim>> dof_handler;
+ const ObserverPointer<const DoFHandler<dim>> dof_handler;
/**
* Pointer to the vector containing the level set function's global dof
* values.
*/
- const SmartPointer<const VectorType> level_set;
+ const ObserverPointer<const VectorType> level_set;
};
/**
* Pointer to the level set function.
*/
- const SmartPointer<const Function<dim>> level_set;
+ const ObserverPointer<const Function<dim>> level_set;
/**
* Collection containing the single element which we locally interpolate
/**
* Pointer to the DoFHandler passed to the constructor.
*/
- const SmartPointer<const DoFHandler<dim>> dof_handler;
+ const ObserverPointer<const DoFHandler<dim>> dof_handler;
/**
* Pointer to the vector of solution coefficients passed to the
* constructor.
*/
- const SmartPointer<const VectorType> global_dof_values;
+ const ObserverPointer<const VectorType> global_dof_values;
/**
* Pointer to the element associated with the cell in the last call to
* set_active_cell().
*/
- SmartPointer<const FiniteElement<dim>> element;
+ ObserverPointer<const FiniteElement<dim>> element;
/**
* DOF-indices of the cell in the last call to set_active_cell().
else
{
// inner time step
- const std::vector<SmartPointer<TimeStepBase, TimeDependent>>::iterator
+ const std::vector<ObserverPointer<TimeStepBase, TimeDependent>>::iterator
insert_position =
std::find(timesteps.begin(), timesteps.end(), position);
// check iterators again to satisfy coverity: both insert_position and
// Remember time step object for
// later deletion and unlock
- // SmartPointer
+ // ObserverPointer
TimeStepBase *t = timesteps[position];
timesteps[position] = nullptr;
// Now delete unsubscribed object
timesteps[position - 1]->set_next_timestep(
(position < timesteps.size()) ?
timesteps[position] :
- /*null*/ SmartPointer<TimeStepBase, TimeDependent>());
+ /*null*/ ObserverPointer<TimeStepBase, TimeDependent>());
// same for "previous" pointer of next
// time step
if (position < timesteps.size())
timesteps[position]->set_previous_timestep(
- (position != 0) ? timesteps[position - 1] :
- /*null*/ SmartPointer<TimeStepBase, TimeDependent>());
+ (position != 0) ?
+ timesteps[position - 1] :
+ /*null*/ ObserverPointer<TimeStepBase, TimeDependent>());
}
class SquareRootResidual : public Algorithms::OperatorBase
{
- SmartPointer<SquareRoot, SquareRootResidual> discretization;
+ ObserverPointer<SquareRoot, SquareRootResidual> discretization;
public:
SquareRootResidual(SquareRoot &problem)
class SquareRootSolver : public Algorithms::OperatorBase
{
- SmartPointer<SquareRoot, SquareRootSolver> solver;
+ ObserverPointer<SquareRoot, SquareRootSolver> solver;
public:
SquareRootSolver(SquareRoot &problem)
}
private:
- SmartPointer<const DoFHandler<dim>, TestOutputOperator<VectorType, dim>> dof;
+ ObserverPointer<const DoFHandler<dim>, TestOutputOperator<VectorType, dim>>
+ dof;
};
class ZeroResidual : public Algorithms::OperatorBase
operator()(AnyData &out, const AnyData &in);
private:
- SmartPointer<const FullMatrix<double>, Explicit> matrix;
- FullMatrix<double> m;
+ ObserverPointer<const FullMatrix<double>, Explicit> matrix;
+ FullMatrix<double> m;
};
operator()(AnyData &out, const AnyData &in);
private:
- SmartPointer<const FullMatrix<double>, Implicit> matrix;
- FullMatrix<double> m;
+ ObserverPointer<const FullMatrix<double>, Implicit> matrix;
+ FullMatrix<double> m;
};
// End of declarations
-// Check the behavior of the SmartPointer-Subscriptor pair
+// Check the behavior of the ObserverPointer-Subscriptor pair
// for copy and move semantics.
{
deallog << "Checking copy assignment" << std::endl;
- Subscriptor subscriptor_1;
- Subscriptor subscriptor_2;
- SmartPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
- SmartPointer<Subscriptor> smart_pointer_2(&subscriptor_2);
+ Subscriptor subscriptor_1;
+ Subscriptor subscriptor_2;
+ ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
+ ObserverPointer<Subscriptor> smart_pointer_2(&subscriptor_2);
subscriptor_2 = subscriptor_1;
{
deallog << "Checking copy construction" << std::endl;
- Subscriptor subscriptor_1;
- SmartPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
+ Subscriptor subscriptor_1;
+ ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
Subscriptor subscriptor_2(subscriptor_1);
{
deallog << "Checking move assignment" << std::endl;
- Subscriptor subscriptor_1;
- Subscriptor subscriptor_2;
- SmartPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
- SmartPointer<Subscriptor> smart_pointer_2(&subscriptor_2);
+ Subscriptor subscriptor_1;
+ Subscriptor subscriptor_2;
+ ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
+ ObserverPointer<Subscriptor> smart_pointer_2(&subscriptor_2);
subscriptor_2 = std::move(subscriptor_1);
{
deallog << "Checking move construction" << std::endl;
- Subscriptor subscriptor_1;
- SmartPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
+ Subscriptor subscriptor_1;
+ ObserverPointer<Subscriptor> smart_pointer_1(&subscriptor_1);
Subscriptor subscriptor_2(std::move(subscriptor_1));
-// check that SmartPointers preserve constness etc of the objects they
-// point to, through assignment of SmartPointers to each other and
+// check that ObserverPointers preserve constness etc of the objects they
+// point to, through assignment of ObserverPointers to each other and
// other tests.
Test a("A");
const Test &b("B");
- SmartPointer<Test, Test> r(&a, "Test R");
- SmartPointer<const Test, Test> s(&a, "const Test S");
- // SmartPointer<Test,Test> t=&b; // this one should not work
- SmartPointer<Test, Test> t(const_cast<Test *>(&b), "Test T");
- SmartPointer<const Test, Test> u(&b, "const Test");
+ ObserverPointer<Test, Test> r(&a, "Test R");
+ ObserverPointer<const Test, Test> s(&a, "const Test S");
+ // ObserverPointer<Test,Test> t=&b; // this one should not work
+ ObserverPointer<Test, Test> t(const_cast<Test *>(&b), "Test T");
+ ObserverPointer<const Test, Test> u(&b, "const Test");
deallog << "a ";
-// Check that it is possible to put SmartPointer objects into a
+// Check that it is possible to put ObserverPointer objects into a
// std::any object.
{
initlog();
- Test t;
- SmartPointer<Test> r(&t);
- std::any a = r;
+ Test t;
+ ObserverPointer<Test> r(&t);
+ std::any a = r;
}
// finite element object which counts
// how many objects use that finite
// element (this is what the
-// <code>Subscriptor</code>/<code>SmartPointer</code>
+// <code>Subscriptor</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 SmartPointer
+// the ObserverPointer
//
// it was fixed around 2003-05-22
{
initlog();
- SmartPointer<SparseLUDecomposition<double>> sparse_decomp;
+ ObserverPointer<SparseLUDecomposition<double>> sparse_decomp;
deallog << "OK" << std::endl;
n_dofs() const = 0;
protected:
- const SmartPointer<Triangulation<dim>> triangulation;
+ const ObserverPointer<Triangulation<dim>> triangulation;
};
n_dofs() const;
protected:
- const SmartPointer<const FiniteElement<dim>> fe;
- const SmartPointer<const Quadrature<dim>> quadrature;
- DoFHandler<dim> dof_handler;
- Vector<double> solution;
- const SmartPointer<const Function<dim>> boundary_values;
+ const ObserverPointer<const FiniteElement<dim>> fe;
+ const ObserverPointer<const Quadrature<dim>> quadrature;
+ DoFHandler<dim> dof_handler;
+ Vector<double> solution;
+ const ObserverPointer<const Function<dim>> boundary_values;
virtual void
assemble_rhs(Vector<double> &rhs) const = 0;
const Function<dim> &boundary_values);
protected:
- const SmartPointer<const Function<dim>> rhs_function;
+ const ObserverPointer<const Function<dim>> rhs_function;
virtual void
assemble_rhs(Vector<double> &rhs) const;
};
output_solution() const = 0;
protected:
- const SmartPointer<Triangulation<dim>> triangulation;
+ const ObserverPointer<Triangulation<dim>> triangulation;
unsigned int refinement_cycle;
};
n_dofs() const;
protected:
- const SmartPointer<const FiniteElement<dim>> fe;
- const SmartPointer<const Quadrature<dim>> quadrature;
- const SmartPointer<const Quadrature<dim - 1>> face_quadrature;
- DoFHandler<dim> dof_handler;
- Vector<double> solution;
- const SmartPointer<const Function<dim>> boundary_values;
+ const ObserverPointer<const FiniteElement<dim>> fe;
+ const ObserverPointer<const Quadrature<dim>> quadrature;
+ const ObserverPointer<const Quadrature<dim - 1>> face_quadrature;
+ DoFHandler<dim> dof_handler;
+ Vector<double> solution;
+ const ObserverPointer<const Function<dim>> boundary_values;
virtual void
assemble_rhs(Vector<double> &rhs) const = 0;
output_solution() const;
protected:
- const SmartPointer<const Function<dim>> rhs_function;
+ const ObserverPointer<const Function<dim>> rhs_function;
virtual void
assemble_rhs(Vector<double> &rhs) const;
refine_grid();
private:
- const SmartPointer<const Function<dim>> weighting_function;
+ const ObserverPointer<const Function<dim>> weighting_function;
};
postprocess(const Evaluation::EvaluationBase<dim> &postprocessor) const;
protected:
- const SmartPointer<const DualFunctional::DualFunctionalBase<dim>>
+ const ObserverPointer<const DualFunctional::DualFunctionalBase<dim>>
dual_functional;
virtual void
assemble_rhs(Vector<double> &rhs) const;
struct CellData
{
- FEValues<dim> fe_values;
- const SmartPointer<const Function<dim>> right_hand_side;
+ FEValues<dim> fe_values;
+ const ObserverPointer<const Function<dim>> right_hand_side;
std::vector<double> cell_residual;
std::vector<double> rhs_values;
unsigned int primal_fe_degree;
unsigned int dual_fe_degree;
- SmartPointer<const Data::SetUpBase<dim>> data;
+ ObserverPointer<const Data::SetUpBase<dim>> data;
enum RefinementCriterion
{
RefinementCriterion refinement_criterion;
- SmartPointer<const DualFunctional::DualFunctionalBase<dim>> dual_functional;
+ ObserverPointer<const DualFunctional::DualFunctionalBase<dim>>
+ dual_functional;
EvaluatorList evaluator_list;
- SmartPointer<const Function<dim>> kelly_weight;
+ ObserverPointer<const Function<dim>> kelly_weight;
unsigned int max_degrees_of_freedom;
Triangulation<dim> triangulation;
DoFHandler<dim> dof_handler;
- SmartPointer<const FiniteElement<dim>> fe;
+ ObserverPointer<const FiniteElement<dim>> fe;
AffineConstraints<double> hanging_node_constraints;
double
term_D(const Tensor<1, 3> &r, const Tensor<1, 3> &a1, const Tensor<1, 3> &a2);
- SmartPointer<FEValues<dim, dim + 1>> fe_values;
+ ObserverPointer<FEValues<dim, dim + 1>> fe_values;
};
template <>
DoFHandler<dim, spacedim> dh(tria);
dh.distribute_dofs(fe);
- SmartPointer<const FiniteElement<dim, spacedim>> fe_p(&dh.get_fe());
+ ObserverPointer<const FiniteElement<dim, spacedim>> fe_p(&dh.get_fe());
dh.distribute_dofs(*fe_p);
DoFHandler<dim, spacedim> dh(tria);
dh.distribute_dofs(fe_collection);
- SmartPointer<const hp::FECollection<dim, spacedim>> fe_p(
+ ObserverPointer<const hp::FECollection<dim, spacedim>> fe_p(
&dh.get_fe_collection());
dh.distribute_dofs(*fe_p);
const Vector<double> &dof_vector,
std::vector<double> &jumps);
- SmartPointer<const FiniteElement<dim>> fe_ptr;
- Triangulation<dim> triangulation;
- DoFHandler<dim> dof_handler;
- AffineConstraints<double> constraints;
+ ObserverPointer<const FiniteElement<dim>> fe_ptr;
+ Triangulation<dim> triangulation;
+ DoFHandler<dim> dof_handler;
+ AffineConstraints<double> constraints;
Vector<double> random_fe_function;
vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const Matrix> matrix;
- const SmartPointer<const Preconditioner> preconditioner;
+ const ObserverPointer<const Matrix> matrix;
+ const ObserverPointer<const Preconditioner> preconditioner;
};
vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const BlockSparseMatrix<double>> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const BlockSparseMatrix<double>> system_matrix;
+ const ObserverPointer<
const InverseMatrix<SparseMatrix<double>, Preconditioner>>
A_inverse;
n_dofs() const = 0;
protected:
- const SmartPointer<Triangulation<dim>> triangulation;
+ const ObserverPointer<Triangulation<dim>> triangulation;
};
n_dofs() const;
protected:
- const SmartPointer<const hp::FECollection<dim>> fe;
- const SmartPointer<const hp::QCollection<dim>> quadrature;
- DoFHandler<dim> dof_handler;
- Vector<double> solution;
- const SmartPointer<const Function<dim>> boundary_values;
+ const ObserverPointer<const hp::FECollection<dim>> fe;
+ const ObserverPointer<const hp::QCollection<dim>> quadrature;
+ DoFHandler<dim> dof_handler;
+ Vector<double> solution;
+ const ObserverPointer<const Function<dim>> boundary_values;
virtual void
assemble_rhs(Vector<double> &rhs) const = 0;
const Function<dim> &boundary_values);
protected:
- const SmartPointer<const Function<dim>> rhs_function;
+ const ObserverPointer<const Function<dim>> rhs_function;
virtual void
assemble_rhs(Vector<double> &rhs) const;
};
Triangulation<dim> triangulation;
DoFHandler<dim> dof_handler;
- SmartPointer<const hp::FECollection<dim>> fe;
+ ObserverPointer<const hp::FECollection<dim>> fe;
AffineConstraints<double> hanging_node_constraints;
}
private:
- SmartPointer<const LAPLACEOPERATOR> laplace;
+ ObserverPointer<const LAPLACEOPERATOR> laplace;
};
}
private:
- SmartPointer<const LAPLACEOPERATOR> laplace;
+ ObserverPointer<const LAPLACEOPERATOR> laplace;
};
}
private:
- SmartPointer<const LAPLACEOPERATOR> laplace;
+ ObserverPointer<const LAPLACEOPERATOR> laplace;
};
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const Matrix> matrix;
- const SmartPointer<const Preconditioner> preconditioner;
+ const ObserverPointer<const Matrix> matrix;
+ const ObserverPointer<const Preconditioner> preconditioner;
mutable TrilinosWrappers::MPI::Vector tmp;
};
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
+ system_matrix;
+ const ObserverPointer<
const InverseMatrix<TrilinosWrappers::SparseMatrix, Preconditioner>>
A_inverse;
mutable TrilinosWrappers::MPI::Vector tmp1, tmp2;
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const Matrix> matrix;
- const SmartPointer<const Preconditioner> preconditioner;
+ const ObserverPointer<const Matrix> matrix;
+ const ObserverPointer<const Preconditioner> preconditioner;
mutable TrilinosWrappers::MPI::Vector tmp;
};
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
+ system_matrix;
+ const ObserverPointer<
const InverseMatrix<TrilinosWrappers::SparseMatrix, Preconditioner>>
A_inverse;
mutable TrilinosWrappers::MPI::Vector tmp1, tmp2;
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const Matrix> matrix;
- const SmartPointer<const Preconditioner> preconditioner;
+ const ObserverPointer<const Matrix> matrix;
+ const ObserverPointer<const Preconditioner> preconditioner;
mutable TrilinosWrappers::MPI::Vector tmp;
};
const TrilinosWrappers::MPI::Vector &src) const;
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
+ system_matrix;
+ const ObserverPointer<
const InverseMatrix<TrilinosWrappers::SparseMatrix, Preconditioner>>
A_inverse;
mutable TrilinosWrappers::MPI::Vector tmp1, tmp2;
}
private:
- SmartPointer<const LAPLACEOPERATOR> laplace;
+ ObserverPointer<const LAPLACEOPERATOR> laplace;
};
}
private:
- SmartPointer<const LAPLACEOPERATOR> laplace;
+ ObserverPointer<const LAPLACEOPERATOR> laplace;
};
}
private:
- SmartPointer<const LAPLACEOPERATOR> laplace;
+ ObserverPointer<const LAPLACEOPERATOR> laplace;
};
const FE_Q<dim> element;
Triangulation<dim> triangulation;
DoFHandler<dim> dof_handler;
- const SmartPointer<const Mapping<dim>> mapping;
+ const ObserverPointer<const Mapping<dim>> mapping;
NonMatching::ImmersedSurfaceQuadrature<dim> quadrature;
};
vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const MatrixType> matrix;
- const SmartPointer<const PreconditionerType> preconditioner;
+ const ObserverPointer<const MatrixType> matrix;
+ const ObserverPointer<const PreconditionerType> preconditioner;
};
vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const BlockSparseMatrix<double>> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const BlockSparseMatrix<double>> system_matrix;
+ const ObserverPointer<
const InverseMatrix<SparseMatrix<double>, PreconditionerType>>
A_inverse;
}
private:
- SmartPointer<const MGSmootherBase<VectorType>> coarse_smooth;
- const std::vector<unsigned int> *constrained_dofs;
+ ObserverPointer<const MGSmootherBase<VectorType>> coarse_smooth;
+ const std::vector<unsigned int> *constrained_dofs;
mutable VectorType src_copy;
};
vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const MatrixType> matrix;
- const SmartPointer<const PreconditionerType> preconditioner;
+ const ObserverPointer<const MatrixType> matrix;
+ const ObserverPointer<const PreconditionerType> preconditioner;
};
vmult(Vector<double> &dst, const Vector<double> &src) const;
private:
- const SmartPointer<const BlockSparseMatrix<double>> system_matrix;
- const SmartPointer<
+ const ObserverPointer<const BlockSparseMatrix<double>> system_matrix;
+ const ObserverPointer<
const InverseMatrix<SparseMatrix<double>, PreconditionerType>>
A_inverse;
Triangulation<dim> triangulation;
DoFHandler<dim> dof_handler;
- SmartPointer<const FiniteElement<dim>> fe;
+ ObserverPointer<const FiniteElement<dim>> fe;
AffineConstraints<double> hanging_node_constraints;
vmult(VectorType &dst, const VectorType &src) const;
private:
- const SmartPointer<const MatrixType> matrix;
- const PreconditionerType &preconditioner;
+ const ObserverPointer<const MatrixType> matrix;
+ const PreconditionerType &preconditioner;
};
template <class MatrixType, class PreconditionerType>
InverseMatrix<MatrixType, PreconditionerType>::InverseMatrix(
const TrilinosWrappers::MPI::BlockVector &src) const;
private:
- const SmartPointer<const TrilinosWrappers::BlockSparseMatrix>
+ const ObserverPointer<const TrilinosWrappers::BlockSparseMatrix>
stokes_matrix;
- const SmartPointer<const InverseMatrix<TrilinosWrappers::SparseMatrix,
- PreconditionerTypeMp>>
+ const ObserverPointer<const InverseMatrix<TrilinosWrappers::SparseMatrix,
+ PreconditionerTypeMp>>
m_inverse;
const PreconditionerTypeA &a_preconditioner;
mutable TrilinosWrappers::MPI::Vector tmp;
vmult(VectorType &dst, const VectorType &src) const;
private:
- const SmartPointer<const Matrix> matrix;
- const Preconditioner &preconditioner;
+ const ObserverPointer<const Matrix> matrix;
+ const Preconditioner &preconditioner;
};