From db479a9efebb3ac888f532624fcfd466915e51d6 Mon Sep 17 00:00:00 2001 From: guido Date: Mon, 15 Oct 2001 07:09:18 +0000 Subject: [PATCH] VectorTools::interpolate with vector templates git-svn-id: https://svn.dealii.org/trunk@5146 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/numerics/vectors.h | 18 ++--- deal.II/deal.II/source/numerics/vectors.cc | 76 ++++++++++++++++------ 2 files changed, 66 insertions(+), 28 deletions(-) diff --git a/deal.II/deal.II/include/numerics/vectors.h b/deal.II/deal.II/include/numerics/vectors.h index 4fcf3abe4f..64401c6164 100644 --- a/deal.II/deal.II/include/numerics/vectors.h +++ b/deal.II/deal.II/include/numerics/vectors.h @@ -325,21 +325,21 @@ class VectorTools * See the general documentation of this * class for further information. */ - template + template static void interpolate (const Mapping &mapping, const DoFHandler &dof, const Function &function, - Vector &vec); + VECTOR &vec); /** * Calls the @p{interpolate} * function, see above, with * @p{mapping=MappingQ1()}. */ - template - static void interpolate (const DoFHandler &dof, - const Function &function, - Vector &vec); + template + static void interpolate (const DoFHandler &dof, + const Function &function, + VECTOR &vec); /** * Interpolate different finite @@ -361,12 +361,12 @@ class VectorTools * make the result continuous * again. */ - template + template static void interpolate (const DoFHandler &dof_1, const DoFHandler &dof_2, const FullMatrix &transfer, - const Vector &data_1, - Vector &data_2); + const InVector &data_1, + OutVector &data_2); /** * Compute the projection of diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index b859fea894..b7e7a5a954 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -35,6 +36,7 @@ #include #include +//TODO:[GK] Move templates containing vector arguments to vectors.templates.h // if necessary try to work around a bug in the IBM xlC compiler #ifdef XLC_WORK_AROUND_STD_BUG @@ -60,11 +62,11 @@ inline double sqr_point (const Tensor<1,dim> &p) -template +template void VectorTools::interpolate (const Mapping &mapping, const DoFHandler &dof, const Function &function, - Vector &vec) + VECTOR &vec) { Assert (dof.get_fe().n_components() == function.n_components, ExcComponentMismatch()); @@ -221,10 +223,10 @@ void VectorTools::interpolate (const Mapping &mapping, } -template +template void VectorTools::interpolate (const DoFHandler &dof, const Function &function, - Vector &vec) + VECTOR &vec) { Assert (DEAL_II_COMPAT_MAPPING, ExcCompatibility("mapping")); static const MappingQ1 mapping; @@ -234,12 +236,13 @@ void VectorTools::interpolate (const DoFHandler &dof, -template void +template +void VectorTools::interpolate (const DoFHandler &dof_1, const DoFHandler &dof_2, const FullMatrix &transfer, - const Vector &data_1, - Vector &data_2) + const InVector &data_1, + OutVector &data_2) { Vector cell_data_1(dof_1.get_fe().dofs_per_cell); Vector cell_data_2(dof_2.get_fe().dofs_per_cell); @@ -1460,20 +1463,55 @@ VectorTools::compute_mean_value (const DoFHandler &dof, // explicit instantiations template -void VectorTools::interpolate (const Mapping &, - const DoFHandler &, - const Function &, - Vector &); +void VectorTools::interpolate (const Mapping&, + const DoFHandler&, + const Function&, + Vector&); +template +void VectorTools::interpolate (const DoFHandler&, + const Function&, + Vector&); +template +void VectorTools::interpolate (const Mapping&, + const DoFHandler&, + const Function&, + Vector&); +template +void VectorTools::interpolate (const DoFHandler&, + const Function&, + Vector&); template -void VectorTools::interpolate (const DoFHandler &, - const Function &, - Vector &); +void VectorTools::interpolate (const Mapping&, + const DoFHandler&, + const Function&, + BlockVector&); template -void VectorTools::interpolate(const DoFHandler &, - const DoFHandler &, - const FullMatrix &, - const Vector &, - Vector &); +void VectorTools::interpolate (const DoFHandler&, + const Function&, + BlockVector&); +template +void VectorTools::interpolate (const Mapping&, + const DoFHandler&, + const Function&, + BlockVector&); +template +void VectorTools::interpolate (const DoFHandler&, + const Function&, + BlockVector&); + +template +void VectorTools::interpolate(const DoFHandler&, + const DoFHandler&, + const FullMatrix&, + const Vector&, + Vector&); +template +void VectorTools::interpolate(const DoFHandler&, + const DoFHandler&, + const FullMatrix&, + const BlockVector&, + BlockVector&); + template void VectorTools::project (const DoFHandler &, const ConstraintMatrix &, -- 2.39.5