}
#endif
+// forward declaration
+template <typename> class ReinitRangeFactory;
+template <typename> class ReinitDomainFactory;
/*! @addtogroup Vectors
u.swap (v);
}
+
+/**
+ * Specialization for BlockVector<number>.
+ */
+template<typename number>
+class ReinitRangeFactory<BlockVector<number> >
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(BlockVector<number> &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](BlockVector<number> &v, bool fast)
+ {
+ v.reinit(matrix.get_row_indices(), fast);
+ };
+ }
+};
+
+
+/**
+ * Specialization for BlockVector<number>.
+ */
+template<typename number>
+class ReinitDomainFactory<BlockVector<number> >
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(BlockVector<number> &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](BlockVector<number> &v, bool fast)
+ {
+ v.reinit(matrix.get_column_indices(), fast);
+ };
+ }
+};
+
DEAL_II_NAMESPACE_CLOSE
#endif
u.swap (v);
}
-}
+} /* namespace TrilinosWrappers */
+
+
+/**
+ * Specialization for TrilinosWrappers::MPI::BlockVector.
+ */
+template<>
+class ReinitRangeFactory<TrilinosWrappers::MPI::BlockVector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::MPI::BlockVector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::MPI::BlockVector &v, bool fast)
+ {
+ v.reinit(matrix.range_partitioner(), fast);
+ };
+ }
+};
+
+
+/**
+ * Specialization for TrilinosWrappers::MPI::BlockVector.
+ */
+template<>
+class ReinitDomainFactory<TrilinosWrappers::MPI::BlockVector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::MPI::BlockVector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::MPI::BlockVector &v, bool fast)
+ {
+ v.reinit(matrix.domain_partitioner(), fast);
+ };
+ }
+};
+
+
+/**
+ * Specialization for TrilinosWrappers::BlockVector.
+ */
+template<>
+class ReinitRangeFactory<TrilinosWrappers::BlockVector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::BlockVector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::BlockVector &v, bool fast)
+ {
+ v.reinit(matrix.range_partitioner(), fast);
+ };
+ }
+};
+
+
+/**
+ * Specialization for TrilinosWrappers::BlockVector.
+ */
+template<>
+class ReinitDomainFactory<TrilinosWrappers::BlockVector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::BlockVector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::BlockVector &v, bool fast)
+ {
+ v.reinit(matrix.domain_partitioner(), fast);
+ };
+ }
+};
/*@}*/
// forward declaration
template <typename> class Vector;
+template <typename> class ReinitRangeFactory;
+template <typename> class ReinitDomainFactory;
+
/**
* @addtogroup TrilinosWrappers
* @{
#endif
-}
+} /* namespace TrilinosWrappers */
+
+
+/**
+ * Specialization for TrilinosWrappers::MPI::Vector.
+ */
+template<>
+class ReinitRangeFactory<TrilinosWrappers::MPI::Vector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::MPI::Vector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::MPI::Vector &v, bool fast)
+ {
+ v.reinit(matrix.range_partitioner(), fast);
+ };
+ }
+};
+
+
+/**
+ * Specialization for TrilinosWrappers::MPI::Vector.
+ */
+template<>
+class ReinitDomainFactory<TrilinosWrappers::MPI::Vector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::MPI::Vector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::MPI::Vector &v, bool fast)
+ {
+ v.reinit(matrix.domain_partitioner(), fast);
+ };
+ }
+};
+
+
+/**
+ * Specialization for TrilinosWrappers::MPI::Vector.
+ */
+template<>
+class ReinitRangeFactory<TrilinosWrappers::Vector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::Vector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::Vector &v, bool fast)
+ {
+ v.reinit(matrix.range_partitioner(), fast);
+ };
+ }
+};
+
+
+/**
+ * Specialization for TrilinosWrappers::MPI::Vector.
+ */
+template<>
+class ReinitDomainFactory<TrilinosWrappers::Vector>
+{
+public:
+
+ template <typename Matrix>
+ std::function<void(TrilinosWrappers::Vector &, bool)>
+ operator()(const Matrix &matrix)
+ {
+ return [&matrix](TrilinosWrappers::Vector &v, bool fast)
+ {
+ v.reinit(matrix.domain_partitioner(), fast);
+ };
+ }
+};
/*@}*/