#include <deal.II/base/config.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/subscriptor.h>
+#include <deal.II/base/named_data.h>
#include <boost/any.hpp>
#include <vector>
public Subscriptor
{
public:
+ /// Default constructor for empty object
+ AnyData();
+
/// Number of stored data objects.
unsigned int size() const;
/// Find out if object is of a certain type
template <typename type>
bool is_type(const unsigned int i) const;
+
+ /// Conversion from old NamedData
+ template <typename type>
+ AnyData(const NamedData<type>&);
/// The requested type and the stored type are different
DeclException2(ExcTypeMismatch,
};
+AnyData::AnyData()
+{}
+
+
+template <typename type>
+AnyData::AnyData(const NamedData<type>& other)
+{
+ for (unsigned int i=0;i<other.size();++i)
+ add(other(i), other.name(i));
+}
+
+
unsigned int
inline
AnyData::size () const
DEAL_II_NAMESPACE_OPEN
+class AnyData;
/**
* @deprecated The use of this class is deprecated and AnyData should
template <typename DATA>
void initialize(const NamedData<DATA> &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
memory_consumption.cc
mpi.cc
multithread_info.cc
+ named_selection.cc
parallel.cc
parameter_handler.cc
parsed_function.cc
--- /dev/null
+// ---------------------------------------------------------------------
+// $Id: logstream.cc 31932 2013-12-08 02:15:54Z heister $
+//
+// Copyright (C) 1998 - 2013 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.
+//
+// ---------------------------------------------------------------------
+
+#include <deal.II/base/named_data.h>
+#include <deal.II/algorithms/any_data.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+void
+NamedSelection::initialize(const AnyData &data)
+{
+ indices.resize(names.size());
+ for (unsigned int i=0; i<names.size(); ++i)
+ indices[i] = data.find(names[i]);
+}
+
+DEAL_II_NAMESPACE_CLOSE
+