From f7b8630d7051d3501a5b92c9ca8a715a4a627b19 Mon Sep 17 00:00:00 2001 From: guido <guido@0785d39b-7218-0410-832d-ea1e28bc413d> Date: Fri, 7 Dec 2001 14:43:55 +0000 Subject: [PATCH] compute_mean_value takes BlockVector git-svn-id: https://svn.dealii.org/trunk@5325 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/numerics/vectors.h | 10 ++-- deal.II/deal.II/source/numerics/vectors.cc | 60 ++++++++++++++++++---- 2 files changed, 54 insertions(+), 16 deletions(-) diff --git a/deal.II/deal.II/include/numerics/vectors.h b/deal.II/deal.II/include/numerics/vectors.h index dd2e555363..3b0a4bae0b 100644 --- a/deal.II/deal.II/include/numerics/vectors.h +++ b/deal.II/deal.II/include/numerics/vectors.h @@ -844,22 +844,22 @@ class VectorTools * Stokes with complete Dirichlet * boundaries for the velocities. */ - template <int dim> + template <int dim, class InVector> static double compute_mean_value (const Mapping<dim> &mapping, const DoFHandler<dim> &dof, const Quadrature<dim> &quadrature, - Vector<double> &v, + InVector &v, const unsigned int component); /** - * Calls the @p{integrate_difference} + * Calls the @p{compute_mean_value} * function, see above, with * @p{mapping=MappingQ1<dim>()}. */ - template <int dim> + template <int dim, class InVector> static double compute_mean_value (const DoFHandler<dim> &dof, const Quadrature<dim> &quadrature, - Vector<double> &v, + InVector &v, const unsigned int component); /** diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index c2f8c94d66..b2bbb2a092 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -1408,12 +1408,12 @@ VectorTools::integrate_difference (const DoFHandler<dim> &dof, -template <int dim> +template <int dim, class InVector> double VectorTools::compute_mean_value (const Mapping<dim> &mapping, const DoFHandler<dim> &dof, const Quadrature<dim> &quadrature, - Vector<double> &v, + InVector &v, const unsigned int component) { Assert (component < dof.get_fe().n_components(), @@ -1445,11 +1445,11 @@ VectorTools::compute_mean_value (const Mapping<dim> &mapping, }; -template <int dim> +template <int dim, class InVector> double VectorTools::compute_mean_value (const DoFHandler<dim> &dof, const Quadrature<dim> &quadrature, - Vector<double> &v, + InVector &v, const unsigned int component) { Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping")); @@ -1704,18 +1704,56 @@ void VectorTools::project_boundary_values (const DoFHandler<deal_II_dimension> const FunctionMap<deal_II_dimension>::type &, const Quadrature<deal_II_dimension-1>&, std::map<unsigned int,double> &); + template -double VectorTools::compute_mean_value (const Mapping<deal_II_dimension> &, - const DoFHandler<deal_II_dimension> &, - const Quadrature<deal_II_dimension> &, - Vector<double> &, +double VectorTools::compute_mean_value (const Mapping<deal_II_dimension>&, + const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + Vector<double>&, const unsigned int); template -double VectorTools::compute_mean_value (const DoFHandler<deal_II_dimension> &, - const Quadrature<deal_II_dimension> &, - Vector<double> &, +double VectorTools::compute_mean_value (const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + Vector<double>&, + const unsigned int); + +template +double VectorTools::compute_mean_value (const Mapping<deal_II_dimension>&, + const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + BlockVector<double>&, + const unsigned int); +template +double VectorTools::compute_mean_value (const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + BlockVector<double>&, + const unsigned int); + +template +double VectorTools::compute_mean_value (const Mapping<deal_II_dimension>&, + const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + Vector<float>&, + const unsigned int); +template +double VectorTools::compute_mean_value (const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + Vector<float>&, const unsigned int); +template +double VectorTools::compute_mean_value (const Mapping<deal_II_dimension>&, + const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + BlockVector<float>&, + const unsigned int); +template +double VectorTools::compute_mean_value (const DoFHandler<deal_II_dimension>&, + const Quadrature<deal_II_dimension>&, + BlockVector<float>&, + const unsigned int); + + // the following two functions are not derived from a template in 1d // and thus need no explicit instantiation -- 2.39.5