#include <deal.II/lac/affine_constraints.h>
#include <deal.II/lac/block_vector_base.h>
#include <deal.II/lac/la_parallel_vector.h>
+#include <deal.II/lac/la_sm_vector.h>
#include <deal.II/lac/vector_operation.h>
#include <deal.II/matrix_free/dof_info.h>
initialize_dof_vector(LinearAlgebra::distributed::Vector<Number2> &vec,
const unsigned int dof_handler_index = 0) const;
+ template <typename Number2>
+ void
+ initialize_dof_vector(LinearAlgebra::SharedMPI::Vector<Number2> &vec,
+ const unsigned int dof_handler_index = 0) const;
+
/**
* Return the partitioner that represents the locally owned data and the
* ghost indices where access is needed to for the cell loop. The
+template <int dim, typename Number, typename VectorizedArrayType>
+template <typename Number2>
+inline void
+MatrixFree<dim, Number, VectorizedArrayType>::initialize_dof_vector(
+ LinearAlgebra::SharedMPI::Vector<Number2> &vec,
+ const unsigned int comp) const
+{
+ AssertIndexRange(comp, n_components());
+ vec.reinit(dof_info[comp].vector_partitioner);
+}
+
+
+
template <int dim, typename Number, typename VectorizedArrayType>
inline const std::shared_ptr<const Utilities::MPI::Partitioner> &
MatrixFree<dim, Number, VectorizedArrayType>::get_vector_partitioner(
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 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.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+// Test PolynomialsTet on quadrature points returned by QGaussTet.
+
+#include <deal.II/base/quadrature_lib.h>
+
+#include <deal.II/dofs/dof_handler.h>
+
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/mapping_q_generic.h>
+
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/tria.h>
+
+#include <deal.II/lac/la_sm_vector.h>
+
+#include <deal.II/matrix_free/matrix_free.h>
+
+#include "../tests.h"
+
+using namespace dealii;
+
+template <typename Number, int dim>
+void
+test(const int n_refinements, const int degree)
+{
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube(tria);
+ tria.refine_global(n_refinements);
+
+ DoFHandler<dim> dof_handler(tria);
+ FE_Q<dim> fe(degree);
+ dof_handler.distribute_dofs(fe);
+
+ AffineConstraints<Number> constraint;
+ constraint.close();
+
+ QGauss<1> quad(degree + 1);
+
+ MappingQGeneric<dim> mapping(1);
+
+ typename dealii::MatrixFree<dim, Number>::AdditionalData additional_data;
+ additional_data.mapping_update_flags =
+ update_gradients | update_JxW_values | update_quadrature_points;
+
+ dealii::MatrixFree<dim, Number> matrix_free;
+ matrix_free.reinit(mapping, dof_handler, constraint, quad, additional_data);
+
+ LinearAlgebra::SharedMPI::Vector<Number> vec;
+ matrix_free.initialize_dof_vector(vec);
+}
+
+int
+main()
+{
+ initlog();
+
+ test<double, 2>(1, 1);
+}
\ No newline at end of file