From 6f89d175eab4e0d249d251d2716ed1133342b333 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Tue, 23 Feb 2016 13:57:59 +0100 Subject: [PATCH] fixed a bug introduced to VectorTools::interpolate_based_on_material_id() in 519d8b9 --- include/deal.II/numerics/vector_tools.templates.h | 11 ++++++----- source/numerics/vector_tools_interpolate.inst.in | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 6ed3e4d05b..f2a40b952b 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -344,10 +344,11 @@ namespace VectorTools interpolate_based_on_material_id (const Mapping &mapping, const DoFHandlerType &dof, - const std::map *> &function_map, + const std::map *> &function_map, VectorType &dst, const ComponentMask &component_mask) { + typedef typename VectorType::value_type number; const unsigned int dim = DoFHandlerType::dimension; Assert( component_mask.represents_n_components(dof.get_fe().n_components()), @@ -362,7 +363,7 @@ namespace VectorTools ExcMessage("You cannot specify the invalid material indicator " "in your function map.")); - for (typename std::map* > + for (typename std::map* > ::const_iterator iter = function_map.begin(); iter != function_map.end(); @@ -425,8 +426,8 @@ namespace VectorTools std::vector< types::global_dof_index> dofs_on_cell(fe.max_dofs_per_cell()); std::vector< Point > rep_points(max_rep_points); - std::vector< std::vector > function_values_scalar(fe.size()); - std::vector< std::vector< Vector > > function_values_system(fe.size()); + std::vector< std::vector > function_values_scalar(fe.size()); + std::vector< std::vector< Vector > > function_values_system(fe.size()); hp::QCollection support_quadrature; for (unsigned int fe_index = 0; fe_index < fe.size(); ++fe_index) @@ -459,7 +460,7 @@ namespace VectorTools if (fe_is_system) { function_values_system[fe_index].resize( n_rep_points[fe_index], - Vector(fe[fe_index].n_components()) ); + Vector(fe[fe_index].n_components()) ); function_map.find(cell->material_id())->second->vector_value_list(rep_points, function_values_system[fe_index]); diff --git a/source/numerics/vector_tools_interpolate.inst.in b/source/numerics/vector_tools_interpolate.inst.in index 454b944ccf..df0a33f94a 100644 --- a/source/numerics/vector_tools_interpolate.inst.in +++ b/source/numerics/vector_tools_interpolate.inst.in @@ -75,14 +75,14 @@ for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS; deal_II_space_dimens template void interpolate_based_on_material_id(const Mapping&, const DoFHandler&, - const std::map< types::material_id, const Function* >&, + const std::map< types::material_id, const Function* >&, VEC&, const ComponentMask&); template void interpolate_based_on_material_id(const Mapping&, const hp::DoFHandler&, - const std::map< types::material_id, const Function* >&, + const std::map< types::material_id, const Function* >&, VEC&, const ComponentMask&); -- 2.39.5