From 05879f8a793a376aa1b8bb594f8fe50ee476a4bd Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 14 Aug 2010 03:09:47 +0000 Subject: [PATCH] Make sure we don't actually call a function that isn't meant to be called for this particular space dimension. We use the idiom: void foo (Quadrature<3> &q) {...} template void foo (Quadrature &q) { Assert (false, ExcInternalError()); } for functions that are supposed to be called only in 3d. git-svn-id: https://svn.dealii.org/trunk@21656 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/numerics/vectors.templates.h | 77 ++++++++++++++++--- 1 file changed, 66 insertions(+), 11 deletions(-) diff --git a/deal.II/deal.II/include/numerics/vectors.templates.h b/deal.II/deal.II/include/numerics/vectors.templates.h index 033ff60afa..e40974fb8f 100644 --- a/deal.II/deal.II/include/numerics/vectors.templates.h +++ b/deal.II/deal.II/include/numerics/vectors.templates.h @@ -2930,17 +2930,19 @@ namespace internals // This function computes the // projection of the boundary // function on edges for 3D. - template + template void compute_edge_projection (const cell_iterator& cell, const unsigned int face, const unsigned int line, - FEValues& fe_values, - const Quadrature& quadrature, - const Function& boundary_function, + FEValues<3>& fe_values, + const Quadrature<3>& quadrature, + const Function<3>& boundary_function, const unsigned int first_vector_component, std::vector& dof_values) { + const unsigned int dim = 3; + fe_values.reinit (cell); // Initialize the required @@ -3149,20 +3151,41 @@ namespace internals } + // dummy implementation of above + // function for all other + // dimensions + template + void + compute_edge_projection (const cell_iterator&, + const unsigned int, + const unsigned int, + FEValues&, + const Quadrature&, + const Function&, + const unsigned int, + std::vector&) + { + Assert (false, ExcInternalError()); + } + + + // This function computes the // projection of the boundary // function on the interior of // faces in 3D. - template + template void compute_face_projection (const cell_iterator& cell, const unsigned int face, - FEValues& fe_values, - const Function& boundary_function, + FEValues<3>& fe_values, + const Function<3>& boundary_function, const unsigned int first_vector_component, std::vector& dof_values) { + const unsigned dim = 3; + fe_values.reinit (cell); // Initialize the required objects. @@ -3397,20 +3420,36 @@ namespace internals + // dummy implementation of above + // function for dim != 3 + template + void + compute_face_projection (const cell_iterator&, + const unsigned int, + FEValues&, + const Function&, + const unsigned int, + std::vector&) + { + Assert (false, ExcInternalError ()); + } + // This function computes the // projection of the boundary // function on the faces in 2D. - template + template void compute_face_projection (const cell_iterator& cell, const unsigned int face, - FEValues& fe_values, - const Quadrature& quadrature, - const Function& boundary_function, + FEValues<2>& fe_values, + const Quadrature<2>& quadrature, + const Function<2>& boundary_function, const unsigned int first_vector_component, std::vector& dof_values) { + const unsigned int dim = 2; + fe_values.reinit (cell); // Initialize the required objects. @@ -3570,6 +3609,22 @@ namespace internals dof_values[i + 1] = solution (i); } } + + + // dummy implementation of above + // function for dim != 2 + template + void + compute_face_projection (const cell_iterator&, + const unsigned int, + FEValues&, + const Quadrature& quadrature, + const Function&, + const unsigned int, + std::vector&) + { + Assert (false, ExcInternalError ()); + } } } -- 2.39.5