From: Guido Kanschat
Date: Fri, 12 Sep 2014 20:22:37 +0000 (+0200)
Subject: Remove NamedData class
X-Git-Tag: v8.3.0-rc1~329^2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F725%2Fhead;p=dealii.git
Remove NamedData class
---
diff --git a/doc/news/changes.h b/doc/news/changes.h
index 50c4e72e2c..76fb22e509 100644
--- a/doc/news/changes.h
+++ b/doc/news/changes.h
@@ -38,13 +38,21 @@ inconvenience this causes.
+ - Removed: The class NamedData has been removed after it had been
+ superceded by AnyData a while ago. This affects the use of classes
+ in Algorithms and MeshWorker
+
+ (Guido KAnschat, 2015/04/02)
+
+
- Removed: The CMake configuration does not use the variable
DEAL_II_CMAKE_MACROS_RELDIR
any more. Instead, the fixed
location ${DEAL_II_SHARE_RELDIR}/macros
is used
unconditionally
(Matthias Maier, 2015/03/26)
-
+
+
- Changed: The TrilinosWrappers::SparseMatrix::clear_row() function used
to call TrilinosWrappers::SparseMatrix::compress() before doing its work,
but this is neither efficient nor safe. You will now have to do this
diff --git a/examples/step-39/step-39.cc b/examples/step-39/step-39.cc
index ce4e0e03f1..64fd4a2b6a 100644
--- a/examples/step-39/step-39.cc
+++ b/examples/step-39/step-39.cc
@@ -649,13 +649,12 @@ namespace Step39
// Since this assembler allows us to fill several vectors, the interface is
// a little more complicated as above. The pointers to the vectors have to
- // be stored in a NamedData object. While this seems to cause two extra
+ // be stored in a AnyData object. While this seems to cause two extra
// lines of code here, it actually comes handy in more complex
// applications.
MeshWorker::Assembler::ResidualSimple > assembler;
- NamedData* > data;
- Vector *rhs = &right_hand_side;
- data.add(rhs, "RHS");
+ AnyData data;
+ data.add*>(&right_hand_side, "RHS");
assembler.initialize(data);
RHSIntegrator integrator;
@@ -763,10 +762,10 @@ namespace Step39
info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points+1, n_gauss_points);
// but now we need to notify the info box of the finite element function we
- // want to evaluate in the quadrature points. First, we create a NamedData
+ // want to evaluate in the quadrature points. First, we create an AnyData
// object with this vector, which is the solution we just computed.
- NamedData* > solution_data;
- solution_data.add(&solution, "solution");
+ AnyData solution_data;
+ solution_data.add*>(&solution, "solution");
// Then, we tell the Meshworker::VectorSelector for cells, that we need
// the second derivatives of this solution (to compute the
@@ -783,16 +782,15 @@ namespace Step39
// flags are already adjusted to the values and derivatives we requested
// above.
info_box.add_update_flags_boundary(update_quadrature_points);
- info_box.initialize(fe, mapping, solution_data);
+ info_box.initialize(fe, mapping, solution_data, solution);
MeshWorker::DoFInfo dof_info(dof_handler);
// The assembler stores one number per cell, but else this is the same as
// in the computation of the right hand side.
MeshWorker::Assembler::CellsAndFaces assembler;
- NamedData* > out_data;
- BlockVector *est = &estimates;
- out_data.add(est, "cells");
+ AnyData out_data;
+ out_data.add*>(&estimates, "cells");
assembler.initialize(out_data, false);
Estimator integrator;
@@ -831,8 +829,8 @@ namespace Step39
const unsigned int n_gauss_points = dof_handler.get_fe().tensor_degree()+1;
info_box.initialize_gauss_quadrature(n_gauss_points, n_gauss_points+1, n_gauss_points);
- NamedData* > solution_data;
- solution_data.add(&solution, "solution");
+ AnyData solution_data;
+ solution_data.add*>(&solution, "solution");
info_box.cell_selector.add("solution", true, true, false);
info_box.boundary_selector.add("solution", true, false, false);
@@ -840,14 +838,13 @@ namespace Step39
info_box.add_update_flags_cell(update_quadrature_points);
info_box.add_update_flags_boundary(update_quadrature_points);
- info_box.initialize(fe, mapping, solution_data);
+ info_box.initialize(fe, mapping, solution_data, solution);
MeshWorker::DoFInfo dof_info(dof_handler);
MeshWorker::Assembler::CellsAndFaces assembler;
- NamedData* > out_data;
- BlockVector *est = &errors;
- out_data.add(est, "cells");
+ AnyData out_data;
+ out_data.add* >(&errors, "cells");
assembler.initialize(out_data, false);
ErrorIntegrator integrator;
diff --git a/include/deal.II/algorithms/any_data.h b/include/deal.II/algorithms/any_data.h
index 912b24eb4b..69e3d24094 100644
--- a/include/deal.II/algorithms/any_data.h
+++ b/include/deal.II/algorithms/any_data.h
@@ -19,7 +19,6 @@
#include
#include
#include
-#include
#include
#include
@@ -49,7 +48,7 @@ public:
void add(type entry, const std::string &name);
/**
- * @brief Merge the data of another NamedData to the end of this object.
+ * @brief Merge the data of another AnyData to the end of this object.
*/
void merge(const AnyData &other);
@@ -171,10 +170,6 @@ public:
template
void list (STREAM &os) const;
- /// Conversion from old NamedData
- template
- AnyData(const NamedData &);
-
/// An entry with this name does not exist in the AnyData object.
DeclException1(ExcNameNotFound, std::string,
<< "No entry with the name " << arg1 << " exists.");
@@ -205,15 +200,6 @@ AnyData::AnyData()
{}
-template
-inline
-AnyData::AnyData(const NamedData &other)
-{
- for (unsigned int i=0; i
+#include
+
+#include
+
+DEAL_II_NAMESPACE_OPEN
+
+/**
+ * Select data from NamedData corresponding to the attached name.
+ *
+ * Given a list of names to search for (provided by add()), objects of
+ * this
+ * class provide an index list of the selected data.
+ *
+ * @author Guido Kanschat, 2009
+ */
+class NamedSelection
+{
+
+public:
+
+ /**
+ * Add a new name to be searched for in NamedData.
+ *
+ * @note Names will be added to the end of the current list.
+ */
+ void add (const std::string &name);
+
+
+ /**
+ * Create the index vector pointing into the AnyData object.
+ */
+ void initialize(const AnyData &data);
+
+
+ /**
+ * The number of names in this object. This function may be used
+ * whether
+ * initialize() was called before or not.
+ */
+ unsigned int size() const;
+
+
+ /**
+ * Return the corresponding index in the NamedData object supplied
+ * to the
+ * last initialize(). It is an error if initialize() has not been
+ * called
+ * before.
+ *
+ * Indices are in the same order as the calls to add().
+ */
+ unsigned int operator() (unsigned int i) const;
+
+
+private:
+
+ /**
+ * The selected names.
+ */
+ std::vector names;
+
+ /**
+ * The index map generated by initialize() and accessed by
+ * operator().
+ */
+ std::vector indices;
+
+};
+
+
+inline
+unsigned int
+NamedSelection::size() const
+{
+
+ return names.size();
+
+}
+
+
+inline
+void
+NamedSelection::add(const std::string &s)
+{
+
+ names.push_back(s);
+
+}
+
+
+inline
+unsigned int
+NamedSelection::operator() (unsigned int i) const
+{
+
+ Assert (indices.size() == names.size(), ExcNotInitialized());
+
+ AssertIndexRange(i, size());
+
+ return indices[i];
+
+}
+
+DEAL_II_NAMESPACE_CLOSE
+
+#endif
diff --git a/include/deal.II/algorithms/newton.h b/include/deal.II/algorithms/newton.h
index e3c3092183..53835d9137 100644
--- a/include/deal.II/algorithms/newton.h
+++ b/include/deal.II/algorithms/newton.h
@@ -96,11 +96,6 @@ namespace Algorithms
*/
virtual void operator() (AnyData &out, const AnyData &in);
- /**
- * @deprecated Use the function using AnyData
- */
- virtual void operator() (NamedData &out, const NamedData &in);
-
virtual void notify(const Event &);
/**
diff --git a/include/deal.II/algorithms/newton.templates.h b/include/deal.II/algorithms/newton.templates.h
index bb5fafa283..1cfb920113 100644
--- a/include/deal.II/algorithms/newton.templates.h
+++ b/include/deal.II/algorithms/newton.templates.h
@@ -90,13 +90,6 @@ namespace Algorithms
}
- template
- void
- Newton::operator() (NamedData &out, const NamedData &in)
- {
- Operator::operator() (out, in);
- }
-
template
void
Newton::operator() (AnyData &out, const AnyData &in)
@@ -133,13 +126,13 @@ namespace Algorithms
if (debug_vectors)
{
- NamedData out;
+ AnyData out;
VECTOR *p = &u;
- out.add(p, "solution");
+ out.add(p, "solution");
p = Du;
- out.add(p, "update");
+ out.add(p, "update");
p = res;
- out.add(p, "residual");
+ out.add(p, "residual");
*data_out << step;
*data_out << out;
}
@@ -164,13 +157,13 @@ namespace Algorithms
if (debug_vectors)
{
- NamedData out;
+ AnyData out;
VECTOR *p = &u;
- out.add(p, "solution");
+ out.add(p, "solution");
p = Du;
- out.add(p, "update");
+ out.add(p, "update");
p = res;
- out.add(p, "residual");
+ out.add(p, "residual");
*data_out << step;
*data_out << out;
}
diff --git a/include/deal.II/algorithms/operator.h b/include/deal.II/algorithms/operator.h
index f4bbf9f9cd..1902dd392b 100644
--- a/include/deal.II/algorithms/operator.h
+++ b/include/deal.II/algorithms/operator.h
@@ -19,7 +19,6 @@
#include
#include
-#include
#include
#include
@@ -131,37 +130,11 @@ namespace Algorithms
{
public:
Operator();
-
- /**
- * Implementation of the function in the base class in order to do
- * compatibility conversions between the old and the new interface.
- */
- virtual void operator() (AnyData &out, const AnyData &in);
-
- /**
- * @deprecated It is in particular this function which should not be used
- * anymore.
- *
- * The actual operation, which is implemented in a derived class.
- */
- virtual void operator() (NamedData &out, const NamedData &in);
-
- /**
- * Set this true to avoid compatibility warnings.
- */
- bool silent_compatibility;
-
- private:
- /**
- * While we are providing compatibility functions to the old interface,
- * this variable will ensure there is no endless loop.
- */
- bool compatibility_flag;
};
/**
- * An unary operator base class, intended to output the vectors in NamedData
- * in each step of an iteration.
+ * An unary operator base class, intended to output the vectors in
+ * AnyData in each step of an iteration.
*
* @author Guido Kanschat, 2010
*/
@@ -184,17 +157,12 @@ namespace Algorithms
/**
* Set the current step.
*/
- OutputOperator &operator<< (unsigned int step);
-
+ void set_step(const unsigned int step);
/**
* Output all the vectors in AnyData.
*/
virtual OutputOperator &operator<< (const AnyData &vectors);
- /**
- * @deprecated Output all the vectors in NamedData.
- */
- OutputOperator &operator<< (const NamedData &vectors);
protected:
unsigned int step;
private:
@@ -202,15 +170,29 @@ namespace Algorithms
};
template
- OutputOperator &
- OutputOperator::operator<< (unsigned int s)
+ inline
+ void
+ OutputOperator::set_step (const unsigned int s)
{
step = s;
- return *this;
}
-}
+ /**
+ * Set the step number in OutputOperator by shifting an integer value.
+ *
+ * @relates OutputOperator
+ */
+ template
+ inline
+ OutputOperator &
+ operator<< (OutputOperator &out, unsigned int step)
+ {
+ out.set_step(step);
+ return out;
+ }
+}
+
DEAL_II_NAMESPACE_CLOSE
#endif
diff --git a/include/deal.II/algorithms/operator.templates.h b/include/deal.II/algorithms/operator.templates.h
index d7b2809aa9..47659ae8e6 100644
--- a/include/deal.II/algorithms/operator.templates.h
+++ b/include/deal.II/algorithms/operator.templates.h
@@ -23,86 +23,8 @@ namespace Algorithms
{
template
Operator::Operator()
- : silent_compatibility(false), compatibility_flag(false)
{}
-
- template
- void
- Operator::operator() (AnyData &out, const AnyData &in)
- {
- // Had this function been overloaded in a derived clas, it would
- // not have been called. Therefore, we have to start the
- // compatibility engine. But before, we have to avoid an endless loop.
- Assert(!compatibility_flag, ExcMessage("Compatibility resolution of Operator generates and endless loop\n"
- "Please provide an operator() in a derived class"));
- compatibility_flag = true;
-
- NamedData new_out;
- for (unsigned int i=0; i(i))
- new_out.add(out.entry(i), out.name(i));
- else if (!silent_compatibility)
- deallog << "Cannot convert AnyData argument " << out.name(i) << " to NamedData"
- << std::endl;
- }
-
- NamedData new_in;
- for (unsigned int i=0; i(i))
- {
- // This const cast is due to the wrong constness handling
- // in NamedData. As soon as NamedData is gone, this code
- // will not be necessary anymore. And deprecating begins
- // now.
- VECTOR *p = const_cast (in.entry(i));
- new_in.add(p, in.name(i));
- }
- else if (in.is_type(i))
- {
- // This const cast is due to the wrong constness handling
- // in NamedData. As soon as NamedData is gone, this code
- // will not be necessary anymore. And deprecating begins
- // now.
- VECTOR *p = const_cast (in.entry(i));
- new_in.add(p, in.name(i));
- }
- else if (!silent_compatibility)
- deallog << "Cannot convert AnyData argument " << in.name(i)
- << " to NamedData" << std::endl;
- }
- this->operator() (new_out, new_in);
- compatibility_flag = false;
- }
-
-
- template
- void
- Operator::operator() (NamedData &out, const NamedData &in)
- {
- // Had this function been overloaded in a derived clas, it would
- // not have been called. Therefore, we have to start the
- // compatibility engine. But before, we have to avoid an endless loop.
- Assert(!compatibility_flag, ExcMessage("Compatibility resolution of Operator generates and endless loop\n"
- "Please provide an operator() in a derived class"));
- compatibility_flag = true;
-
- AnyData new_out;
- for (unsigned int i=0; ioperator() (new_out, new_in);
- compatibility_flag = false;
- }
-
-
template
OutputOperator::~OutputOperator()
{}
@@ -151,16 +73,6 @@ namespace Algorithms
}
return *this;
}
-
-
- template
- OutputOperator &
- OutputOperator::operator<< (const NamedData &vectors)
- {
- const AnyData newdata = vectors;
- (*this) << newdata;
- return *this;
- }
}
DEAL_II_NAMESPACE_CLOSE
diff --git a/include/deal.II/algorithms/theta_timestepping.templates.h b/include/deal.II/algorithms/theta_timestepping.templates.h
index ae13015a9d..8f754f491f 100644
--- a/include/deal.II/algorithms/theta_timestepping.templates.h
+++ b/include/deal.II/algorithms/theta_timestepping.templates.h
@@ -102,12 +102,6 @@ namespace Algorithms
if (output != 0)
(*output) << 0U << out;
- // Avoid warnings because time and timestep cannot be converted to VECTOR*
- const bool explicit_silent = op_explicit->silent_compatibility;
- const bool implicit_silent = op_implicit->silent_compatibility;
- op_explicit->silent_compatibility = true;
- op_implicit->silent_compatibility = true;
-
for (unsigned int count = 1; d_explicit.time < control.final(); ++count)
{
const bool step_change = control.advance();
@@ -134,8 +128,6 @@ namespace Algorithms
d_explicit.time = control.now();
}
- op_explicit->silent_compatibility = explicit_silent;
- op_implicit->silent_compatibility = implicit_silent;
deallog.pop();
}
}
diff --git a/include/deal.II/base/named_data.h b/include/deal.II/base/named_data.h
deleted file mode 100644
index 5f62dc72e0..0000000000
--- a/include/deal.II/base/named_data.h
+++ /dev/null
@@ -1,432 +0,0 @@
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2000 - 2015 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-#ifndef __deal2__named_data_h
-#define __deal2__named_data_h
-
-#include
-#include
-#include
-
-#include
-#include
-
-DEAL_II_NAMESPACE_OPEN
-
-class AnyData;
-
-/**
- * @deprecated The use of this class is deprecated and AnyData should be used
- * instead. It is not only more flexible, the way constness was assured in
- * this class never worked the way it was intended. Therefore, the according
- * checks have been disabled.
- *
- * This class is a collection of DATA objects. Each of the pointers has a name
- * associated, enabling identification by this name rather than the index in
- * the vector only.
- *
- * Note that it is the actual data stored in this object. Therefore, for
- * storing vectors and other large objects, it should be considered to use
- * SmartPointer or boost::shared_ptr for DATA.
- *
- * Objects of this kind have a smart way of treating constness: if a const
- * data object is added or a const NamedData is supplied with merge(), the
- * object will henceforth consider itself as const (#is_constant will be
- * true). Thus, any subsequent modification will be illegal and
- * ExcConstantObject will be raised in debug mode.
- *
- * @author Guido Kanschat, 2007, 2008, 2009
- */
-template
-class NamedData : public Subscriptor
-{
-public:
- /**
- * Standard constructor creating an empty object.
- */
- NamedData();
-
- /**
- * Assignment operator, copying conversible data from another object.
- */
- template
- NamedData &operator = (const NamedData &other);
-
- /**
- * \name Adding members
- */
-//@{
- /**
- * Add a new data item to the end of the collection.
- */
- void add(DATA &v, const std::string &name);
-
- /**
- * Add a new constant data item to the end of the collection and make the
- * collection constant.
- */
- void add(const DATA &v, const std::string &name);
-
- /**
- * Merge the data of another NamedData to the end of this object.
- *
- * If the other object had #is_constant set, so will have this object after
- * merge.
- */
- template
- void merge(NamedData &);
- /**
- * Merge the data of another NamedData to the end of this object.
- *
- * After this operation, all data in this object will be treated as const.
- */
- template
- void merge(const NamedData &);
-//@}
- /**
- * \name Accessing and querying contents
- */
-//@{
-/// Number of stored data objects.
- unsigned int size() const;
-
- /**
- * @brief Access to stored data object by index.
- *
- * @note This function throws an exception, if is_const() returns
- * true. In such a case, either cast the NamedData object to a
- * const reference, or use the function read() instead of this operator.
- */
- DATA &operator() (unsigned int i);
-
-/// Read-only access to stored data object by index.
- const DATA &operator() (unsigned int i) const;
-
-/// Read only access for a non-const object.
- const DATA &read (unsigned int i) const;
-
-/// Name of object at index.
- const std::string &name(unsigned int i) const;
-
-/// Find index of a named object
- unsigned int find(const std::string &name) const;
-
-/// Returns true if this object contains constant data
- bool is_const () const;
-
-/// List names of stored objects
- template
- void print(OUT &o) const;
-//@}
- /**
- * Exception indicating that a function expected a vector to have a certain
- * name, but NamedData had a different name in that position.
- */
- DeclException2(ExcNameMismatch, int, std::string,
- << "Name at position " << arg1 << " is not equal to " << arg2);
-
- /**
- * Exception indicating that read access to stored data was attempted
- * although the NamedData object contains const data and #is_constant was
- * true.
- */
- DeclException0(ExcConstantObject);
-
-private:
- /// True if the object is to be treated constant
- bool is_constant;
- /// The actual data stored
- std::vector data;
-
- /// Names for the data
- std::vector names;
-};
-
-
-/**
- * Select data from NamedData corresponding to the attached name.
- *
- * Given a list of names to search for (provided by add()), objects of this
- * class provide an index list of the selected data.
- *
- * @author Guido Kanschat, 2009
- */
-class NamedSelection
-{
-public:
- /**
- * Add a new name to be searched for in NamedData.
- *
- * @note Names will be added to the end of the current list.
- */
- void add (const std::string &name);
-
- /**
- * Create the index vector pointing into the NamedData object.
- */
- template
- void initialize(const NamedData &data);
-
- /**
- * Create the index vector pointing into the AnyData object.
- */
- void initialize(const AnyData &data);
-
- /**
- * The number of names in this object. This function may be used whether
- * initialize() was called before or not.
- */
- unsigned int size() const;
-
- /**
- * Return the corresponding index in the NamedData object supplied to the
- * last initialize(). It is an error if initialize() has not been called
- * before.
- *
- * Indices are in the same order as the calls to add().
- */
- unsigned int operator() (unsigned int i) const;
-
-private:
- /**
- * The selected names.
- */
- std::vector names;
- /**
- * The index map generated by initialize() and accessed by operator().
- */
- std::vector indices;
-};
-
-
-//----------------------------------------------------------------------//
-
-template
-inline
-NamedData::NamedData()
- :
- is_constant(false)
-{}
-
-
-template
-inline
-void
-NamedData::add(DATA &v, const std::string &n)
-{
- // see operator() below
-
- // Assert(!is_constant, ExcConstantObject());
- names.push_back(n);
- data.push_back(v);
-}
-
-
-template
-inline
-void
-NamedData::add(const DATA &v, const std::string &n)
-{
- // see operator() below
-
- // Assert(!is_constant, ExcConstantObject());
- DATA &aux = const_cast(v);
- data.push_back(aux);
- names.push_back(n);
- is_constant = true;
-}
-
-
-template
-template
-inline
-void
-NamedData::merge(NamedData &other)
-{
- // see operator() below
-
- // Assert(!is_constant, ExcConstantObject());
-
- for (unsigned int i=0; i
-template
-inline
-void
-NamedData::merge(const NamedData &other)
-{
- // see operator() below
-
- // Assert(!is_constant, ExcConstantObject());
- for (unsigned int i=0; i
-template
-inline
-NamedData &
-NamedData::operator= (const NamedData &other)
-{
- is_constant = false;
- merge(other);
- is_constant = other.is_const();
- return *this;
-}
-
-
-
-template
-inline
-unsigned int
-NamedData::size() const
-{
- return data.size();
-}
-
-
-template
-inline
-bool
-NamedData::is_const() const
-{
- return is_constant;
-}
-
-
-template
-inline
-DATA &
-NamedData::operator() (unsigned int i)
-{
- // Remove this assertion, since is_const() does not really assert
- // what we would like to. This can only be fixed by using constness
- // in AnyData.
-
- // Assert(!is_constant, ExcConstantObject());
- AssertIndexRange(i, size());
- return data[i];
-}
-
-
-template
-inline
-const DATA &
-NamedData::operator() (unsigned int i) const
-{
- AssertIndexRange(i, size());
- return data[i];
-}
-
-
-template
-inline
-const DATA &
-NamedData::read (unsigned int i) const
-{
- AssertIndexRange(i, size());
- return data[i];
-}
-
-
-template
-inline
-const std::string &
-NamedData::name(unsigned int i) const
-{
- AssertIndexRange(i, size());
- return names[i];
-}
-
-
-template
-inline
-unsigned int
-NamedData::find (const std::string &name) const
-{
- const std::vector::const_iterator
- i = std::find(names.begin(), names.end(), name);
- if (i == names.end())
- return numbers::invalid_unsigned_int;
- return i - names.begin();
-}
-
-
-template
-template
-inline
-void
-NamedData::print(OUT &o) const
-{
- o << "NamedData:";
- for (unsigned int i=0; i
-inline void
-NamedSelection::initialize(const NamedData &data)
-{
- indices.resize(names.size());
- for (unsigned int i=0; i
-#include
#include
#include
#include
@@ -26,6 +25,7 @@
#include
#include
#include
+#include
DEAL_II_NAMESPACE_OPEN
@@ -322,7 +322,7 @@ private:
template
class MatrixBlockVector
:
- private NamedData > >
+ private AnyData
{
public:
/**
@@ -335,6 +335,13 @@ public:
*/
typedef MatrixBlock value_type;
+ /**
+ * The pointer type used for storing the objects. We use a shard
+ * pointer, such that they get deleted automatically when not used
+ * anymore.
+ */
+ typedef std_cxx11::shared_ptr ptr_type;
+
/**
* Add a new matrix block at the position (row,column) in the block
* system.
@@ -382,10 +389,10 @@ public:
/**
* import functions from private base class
*/
- using NamedData >::subscribe;
- using NamedData >::unsubscribe;
- using NamedData >::size;
- using NamedData >::name;
+ using AnyData::subscribe;
+ using AnyData::unsubscribe;
+ using AnyData::size;
+ using AnyData::name;
};
@@ -531,7 +538,7 @@ public:
std::size_t memory_consumption () const;
private:
/// Clear one of the matrix objects
- void clear_object(NamedData > > &);
+ void clear_object(AnyData &);
/// Flag for storing matrices_in and matrices_out
const bool edge_matrices;
@@ -540,15 +547,15 @@ private:
const bool edge_flux_matrices;
/// The level matrices
- NamedData > > matrices;
+ AnyData matrices;
/// The matrix from the interior of a level to the refinement edge
- NamedData > > matrices_in;
+ AnyData matrices_in;
/// The matrix from the refinement edge to the interior of a level
- NamedData > > matrices_out;
+ AnyData matrices_out;
/// The DG flux from a level to the lower level
- NamedData > > flux_matrices_down;
+ AnyData flux_matrices_down;
/// The DG flux from the lower level to a level
- NamedData > > flux_matrices_up;
+ AnyData flux_matrices_up;
};
@@ -813,8 +820,8 @@ MatrixBlockVector::add(
size_type row, size_type column,
const std::string &name)
{
- std_cxx11::shared_ptr p(new value_type(row, column));
- NamedData >::add(p, name);
+ ptr_type p(new value_type(row, column));
+ AnyData::add(p, name);
}
@@ -850,7 +857,7 @@ template
inline const MatrixBlock &
MatrixBlockVector::block(size_type i) const
{
- return *this->read(i);
+ return *this->read(i);
}
@@ -858,7 +865,7 @@ template
inline MatrixBlock &
MatrixBlockVector::block(size_type i)
{
- return *(*this)(i);
+ return *this->entry(i);
}
@@ -866,7 +873,7 @@ template
inline MATRIX &
MatrixBlockVector::matrix(size_type i)
{
- return (*this)(i)->matrix;
+ return this->entry(i)->matrix;
}
@@ -920,7 +927,7 @@ template
inline const MGLevelObject > &
MGMatrixBlockVector::block(size_type i) const
{
- return matrices.read(i);
+ return *matrices.read* >(i);
}
@@ -928,7 +935,7 @@ template
inline MGLevelObject > &
MGMatrixBlockVector::block(size_type i)
{
- return matrices(i);
+ return *matrices.entry* >(i);
}
@@ -936,7 +943,7 @@ template
inline const MGLevelObject > &
MGMatrixBlockVector::block_in(size_type i) const
{
- return matrices_in.read(i);
+ return *matrices_in.read* >(i);
}
@@ -944,7 +951,7 @@ template
inline MGLevelObject > &
MGMatrixBlockVector::block_in(size_type i)
{
- return matrices_in(i);
+ return *matrices_in.entry* >(i);
}
@@ -952,7 +959,7 @@ template
inline const MGLevelObject > &
MGMatrixBlockVector::block_out(size_type i) const
{
- return matrices_out.read(i);
+ return *matrices_out.read* >(i);
}
@@ -960,7 +967,7 @@ template
inline MGLevelObject > &
MGMatrixBlockVector::block_out(size_type i)
{
- return matrices_out(i);
+ return *matrices_out.entry* >(i);
}
@@ -968,7 +975,7 @@ template
inline const MGLevelObject > &
MGMatrixBlockVector::block_up(size_type i) const
{
- return flux_matrices_up.read(i);
+ return *flux_matrices_up.read* >(i);
}
@@ -976,7 +983,7 @@ template
inline MGLevelObject > &
MGMatrixBlockVector::block_up(size_type i)
{
- return flux_matrices_up(i);
+ return *flux_matrices_up.entry* >(i);
}
@@ -984,7 +991,7 @@ template
inline const MGLevelObject > &
MGMatrixBlockVector::block_down(size_type i) const
{
- return flux_matrices_down.read(i);
+ return *flux_matrices_down.read* >(i);
}
@@ -992,7 +999,7 @@ template
inline MGLevelObject > &
MGMatrixBlockVector::block_down(size_type i)
{
- return flux_matrices_down(i);
+ return *flux_matrices_down.entry* >(i);
}
@@ -1070,11 +1077,11 @@ MGMatrixBlockVector::reinit_edge_flux(const MGLevelObject
inline void
-MGMatrixBlockVector::clear_object(NamedData > > &mo)
+MGMatrixBlockVector::clear_object(AnyData &mo)
{
for (size_type i=0; i > &o = mo(i);
+ MGLevelObject > &o = mo.entry* >(i);
for (size_type level = o.min_level(); level <= o.max_level(); ++level)
o[level].matrix.clear();
}
diff --git a/include/deal.II/meshworker/assembler.h b/include/deal.II/meshworker/assembler.h
index 344ba2c864..10a4029a49 100644
--- a/include/deal.II/meshworker/assembler.h
+++ b/include/deal.II/meshworker/assembler.h
@@ -17,7 +17,6 @@
#ifndef __deal2__mesh_worker_assembler_h
#define __deal2__mesh_worker_assembler_h
-#include
#include
#include
#include
@@ -25,6 +24,7 @@
#include
#include
#include
+#include
DEAL_II_NAMESPACE_OPEN
@@ -111,7 +111,7 @@ namespace MeshWorker
* Copy the BlockInfo and the matrix pointers into local variables.
*/
void initialize(const BlockInfo *block_info,
- NamedData &residuals);
+ AnyData &residuals);
/**
* Initialize the constraints.
*/
@@ -148,10 +148,9 @@ namespace MeshWorker
const std::vector