From eb82fbba58a00c55da505edfd5d963293c62c4d4 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 24 May 2001 08:27:07 +0000 Subject: [PATCH] Replace explicite specializations of functions -- which really is not standards conforming C++ -- by overloading these functions. git-svn-id: https://svn.dealii.org/trunk@4726 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/dofs/dof_tools.h | 163 ++++++---- deal.II/deal.II/include/grid/grid_generator.h | 290 +++++++++++------- deal.II/deal.II/include/grid/grid_out.h | 55 ++-- deal.II/deal.II/include/numerics/vectors.h | 89 +++--- deal.II/deal.II/source/dofs/dof_tools.cc | 21 +- deal.II/deal.II/source/grid/grid_generator.cc | 49 +-- deal.II/deal.II/source/grid/grid_out.cc | 4 - deal.II/deal.II/source/numerics/vectors.cc | 4 - 8 files changed, 391 insertions(+), 284 deletions(-) diff --git a/deal.II/deal.II/include/dofs/dof_tools.h b/deal.II/deal.II/include/dofs/dof_tools.h index 816318674d..7d537ca869 100644 --- a/deal.II/deal.II/include/dofs/dof_tools.h +++ b/deal.II/deal.II/include/dofs/dof_tools.h @@ -302,8 +302,18 @@ class DoFTools static void make_boundary_sparsity_pattern (const DoFHandler &dof, const std::vector &dof_to_boundary_mapping, - SparsityPattern &sparsity_pattern); + SparsityPattern &sparsity_pattern); + /** + * Declaration of same function + * for different space dimension. + */ + static void + make_boundary_sparsity_pattern (const DoFHandler<1> &dof, + const std::vector &dof_to_boundary_mapping, + SparsityPattern &sparsity_pattern); + + /** * Write the sparsity structure of the * matrix composed of the basis functions @@ -342,6 +352,17 @@ class DoFTools const std::vector &dof_to_boundary_mapping, SparsityPattern &sparsity); + /** + * Declaration of same function + * for different space dimension. + */ + static void + make_boundary_sparsity_pattern (const DoFHandler<1> &dof, + const FunctionMap<1>::type &boundary_indicators, + const std::vector &dof_to_boundary_mapping, + SparsityPattern &sparsity); + + /** * Generate sparsity pattern for * fluxes, i.e. formulations of @@ -418,11 +439,26 @@ class DoFTools * since you may want to enter other * constraints later on yourself. */ - template static void - make_hanging_node_constraints (const DoFHandler &dof_handler, + make_hanging_node_constraints (const DoFHandler<1> &dof_handler, ConstraintMatrix &constraints); + /** + * Declaration of same function + * for different space dimension. + */ + static void + make_hanging_node_constraints (const DoFHandler<2> &dof_handler, + ConstraintMatrix &constraints); + + /** + * Declaration of same function + * for different space dimension. + */ + static void + make_hanging_node_constraints (const DoFHandler<3> &dof_handler, + ConstraintMatrix &constraints); + /** * Take a vector of values which live on * cells (e.g. an error per cell) and @@ -550,6 +586,16 @@ class DoFTools template static void extract_boundary_dofs (const DoFHandler &dof_handler, + const std::vector &component_select, + std::vector &selected_dofs, + const std::set &boundary_indicators = std::set()); + + /** + * Declaration of same function + * for different space dimension. + */ + static void + extract_boundary_dofs (const DoFHandler<1> &dof_handler, const std::vector &component_select, std::vector &selected_dofs, const std::set &boundary_indicators = std::set()); @@ -566,10 +612,25 @@ class DoFTools * contents of this array or * overwritten. */ - template static void - extract_hanging_node_dofs (const DoFHandler &dof_handler, - std::vector &selected_dofs); + extract_hanging_node_dofs (const DoFHandler<1> &dof_handler, + std::vector &selected_dofs); + + /** + * Declaration of same function + * for different space dimension. + */ + static void + extract_hanging_node_dofs (const DoFHandler<2> &dof_handler, + std::vector &selected_dofs); + + /** + * Declaration of same function + * for different space dimension. + */ + static void + extract_hanging_node_dofs (const DoFHandler<3> &dof_handler, + std::vector &selected_dofs); /** * Count how many degrees of @@ -818,7 +879,30 @@ class DoFTools const InterGridMap &coarse_to_fine_grid_map, ConstraintMatrix &constraints); -//TODO:[WB] document this function. put it in the news file + + /** + * This function generates a + * matrix such that when a vector + * of data with as many elements + * as there are degrees of + * freedom of this component on + * the coarse grid is multiplied + * to this matrix, we obtain a + * vector with as many elements + * are there are global degrees + * of freedom on the fine + * grid. All the elements of the + * other components of the finite + * element fields on the fine + * grid are not touched. + * + * The output of this function is + * a compressed format that can + * be given to the @p{reinit} + * functions of the + * @ref{SparsityPattern} ad + * @ref{SparseMatrix} classes. + */ template static void compute_intergrid_transfer_representation (const DoFHandler &coarse_grid, @@ -860,6 +944,14 @@ class DoFTools map_dof_to_boundary_indices (const DoFHandler &dof_handler, std::vector &mapping); + /** + * Declaration of same function + * for different space dimension. + */ + static void + map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler, + std::vector &mapping); + /** * Same as the previous function, * except that only those parts @@ -877,6 +969,15 @@ class DoFTools const std::set &boundary_indicators, std::vector &mapping); + /** + * Declaration of same function + * for different space dimension. + */ + static void + map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler, + const std::set &boundary_indicators, + std::vector &mapping); + /** * Return a list of support * points for all the degrees of @@ -1034,54 +1135,6 @@ class DoFTools -/* -------------- declaration of explicit specializations ------------- */ - -template <> -void -DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1> &dof_handler, - const FunctionMap<1>::type &function_map, - const std::vector &dof_to_boundary_mapping, - SparsityPattern &sparsity); -template <> -void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1> &dof_handler, - const std::vector &dof_to_boundary_mapping, - SparsityPattern &sparsity); -template <> -void DoFTools::make_hanging_node_constraints (const DoFHandler<1> &, - ConstraintMatrix &); -template <> -void DoFTools::make_hanging_node_constraints (const DoFHandler<2> &, - ConstraintMatrix &); -template <> -void DoFTools::make_hanging_node_constraints (const DoFHandler<3> &, - ConstraintMatrix &); -template <> -void -DoFTools::extract_boundary_dofs (const DoFHandler<1> &dof_handler, - const std::vector &component_select, - std::vector &selected_dofs, - const std::set &boundary_indicators); -template <> -void -DoFTools::extract_hanging_node_dofs (const DoFHandler<1> &dof_handler, - std::vector &selected_dofs); -template <> -void -DoFTools::extract_hanging_node_dofs (const DoFHandler<2> &dof_handler, - std::vector &selected_dofs); -template <> -void -DoFTools::extract_hanging_node_dofs (const DoFHandler<3> &dof_handler, - std::vector &selected_dofs); -template <> -void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler, - const std::set &boundary_indicators, - std::vector &mapping); -template <> -void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler, - std::vector &mapping); - - // ---------------------- inline and template functions -------------------- diff --git a/deal.II/deal.II/include/grid/grid_generator.h b/deal.II/deal.II/include/grid/grid_generator.h index 6c45f45172..b8e16f2798 100644 --- a/deal.II/deal.II/include/grid/grid_generator.h +++ b/deal.II/deal.II/include/grid/grid_generator.h @@ -15,16 +15,14 @@ #include +#include + template class Point; template class Triangulation; template class Vector; template class SparseMatrix; -//TODO:[WB] replace template functions and specializations with overloaded functions - -#include - /** * This class offers triangulations of some standard domains such as hypercubes, * hyperball and the like. Following is a list of domains that can be generated @@ -176,13 +174,25 @@ class GridGenerator * 4/8, in z-direction 16/32. The cells * at corners and edges (3d) get * these values bitwise or'd. + * + * Presently only available in 2d + * and 3d. + */ + static void enclosed_hyper_cube (Triangulation<2> &tria, + const double left = 0., + const double right= 1., + const double thickness = 1., + const bool colorize = false); + + /** + * Declaration of same function + * for different space dimension. */ - template - static void enclosed_hyper_cube (Triangulation &tria, - const double left = 0., - const double right= 1., - const double thickness = 1., - bool colorize = false); + static void enclosed_hyper_cube (Triangulation<3> &tria, + const double left = 0., + const double right= 1., + const double thickness = 1., + const bool colorize = false); /** * Initialize the given @@ -198,11 +208,47 @@ class GridGenerator * The triangulation needs to be * void upon calling this * function. + * + * This function is declared to + * exist for triangulations of + * all space dimensions, but + * throws an error if called in + * 1d. + * + * This function is presently not + * implemented in 3d, since we + * fear that it might not be + * possible to represent a simple + * grid making up a ball with the + * requirements on the direction + * of lines and faces imposed by + * the triangulation classes. We + * hope that more complicated + * arrangements than the obvious + * one made up of 7 cells can + * cope with this situation, but + * this has not been implemented + * yet. */ - template - static void hyper_ball (Triangulation &tria, - const Point ¢er = Point(), - const double radius = 1.); + static void hyper_ball (Triangulation<1> &tria, + const Point<1> ¢er = Point<1>(), + const double radius = 1.); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_ball (Triangulation<2> &tria, + const Point<2> ¢er = Point<2>(), + const double radius = 1.); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_ball (Triangulation<3> &tria, + const Point<3> ¢er = Point<3>(), + const double radius = 1.); /** * Initialize the given @@ -217,11 +263,32 @@ class GridGenerator * The triangulation needs to be * void upon calling this * function. + * + * This function is declared to + * exist for triangulations of + * all space dimensions, but + * throws an error if called in + * 1d. */ - template - static void hyper_L (Triangulation &tria, - const double left = -1., - const double right= 1.); + static void hyper_L (Triangulation<1> &tria, + const double left = -1., + const double right= 1.); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_L (Triangulation<2> &tria, + const double left = -1., + const double right= 1.); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_L (Triangulation<3> &tria, + const double left = -1., + const double right= 1.); /** * Initialize the given @@ -230,13 +297,36 @@ class GridGenerator * from @p{(x=0,y=-1)} to * @p{(0,0)} in 2d. * - * The triangulation needs to be void - * upon calling this function. + * The triangulation needs to be + * void upon calling this + * function. + * + * This function is declared to + * exist for triangulations of + * all space dimensions, but + * throws an error if called in + * 1d. It is also not presently + * implemented in 3d. */ - template - static void hyper_cube_slit (Triangulation &tria, - const double left = 0., - const double right= 1.); + static void hyper_cube_slit (Triangulation<1> &tria, + const double left = 0., + const double right= 1.); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_cube_slit (Triangulation<2> &tria, + const double left = 0., + const double right= 1.); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_cube_slit (Triangulation<3> &tria, + const double left = 0., + const double right= 1.); /** * Produce a hyper-shell, @@ -257,10 +347,36 @@ class GridGenerator * The triangulation needs to be * void upon calling this * function. + * + * This function is declared to + * exist for triangulations of + * all space dimensions, but + * throws an error if called in + * 1d. It is also currently not + * implemented in 3d. */ - template - static void hyper_shell (Triangulation &tria, - const Point ¢er, + static void hyper_shell (Triangulation<1> &tria, + const Point<1> ¢er, + const double inner_radius, + const double outer_radius, + const unsigned int n_cells = 0); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_shell (Triangulation<2> &tria, + const Point<2> ¢er, + const double inner_radius, + const double outer_radius, + const unsigned int n_cells = 0); + + /** + * Declaration of same function + * for different space dimension. + */ + static void hyper_shell (Triangulation<3> &tria, + const Point<3> ¢er, const double inner_radius, const double outer_radius, const unsigned int n_cells = 0); @@ -300,10 +416,12 @@ class GridGenerator * The triangulation needs to be * void upon calling this * function. + * + * At present, this function only + * exists in 2d. */ - template - static void half_hyper_shell (Triangulation &tria, - const Point ¢er, + static void half_hyper_shell (Triangulation<2> &tria, + const Point<2> ¢er, const double inner_radius, const double outer_radius, const unsigned int n_cells = 0); @@ -327,10 +445,20 @@ class GridGenerator * triangulations, but the given * triangulation is changed * (overwritten). + * + * In 1d, this function is not + * currently implemented. */ template static void laplace_transformation (Triangulation &tria, const std::map > &new_points); + + /** + * Declaration of same function + * for different space dimension. + */ + static void laplace_transformation (Triangulation<1> &tria, + const std::map > &new_points); /** * Exception @@ -348,99 +476,25 @@ class GridGenerator static void colorize_hyper_rectangle (Triangulation &tria); /** - * Multiply called by the + * Declaration of the above + * function for 1d. + */ + static void colorize_hyper_rectangle (Triangulation<1> &tria); + + /** + * Solve the Laplace equation for * @p{laplace_transformation} - * function. Solves the Laplace - * equation for one of the - * @p{dim} dimension. + * function for one of the + * @p{dim} space + * dimensions. Externalized into + * a function of its own in order + * to allow parallel execution. */ - static void laplace_solve (const SparseMatrix &S, + static void laplace_solve (const SparseMatrix &S, const std::map &m, - Vector &u); + Vector &u); }; -/* -------------- declaration of explicit specializations ------------- */ - -template <> -void -GridGenerator::colorize_hyper_rectangle (Triangulation<1> &); -template <> -void GridGenerator::hyper_cube_slit (Triangulation<1> &, - const double, - const double); -template <> -void GridGenerator::hyper_L (Triangulation<1> &, - const double, - const double); -template <> -void GridGenerator::hyper_ball (Triangulation<1> &, - const Point<1> &, - const double); -template <> -void GridGenerator::hyper_shell (Triangulation<1> &, - const Point<1> &, - const double, - const double, - const unsigned int); -template <> -void -GridGenerator::hyper_cube_slit (Triangulation<2> &tria, - const double left, - const double right); -template <> -void -GridGenerator::hyper_L (Triangulation<2> &tria, - const double a, - const double b); -template <> -void -GridGenerator::hyper_ball (Triangulation<2> &tria, - const Point<2> &p, - const double radius); -template <> -void GridGenerator::hyper_shell (Triangulation<2> &tria, - const Point<2> ¢er, - const double inner_radius, - const double outer_radius, - const unsigned int n_cells); -template <> -void -GridGenerator::half_hyper_shell (Triangulation<2> &tria, - const Point<2> ¢er, - const double inner_radius, - const double outer_radius, - const unsigned int n_cells); -template <> -void GridGenerator::hyper_cube_slit (Triangulation<3> &, - const double, - const double); -template<> -void GridGenerator::enclosed_hyper_cube (Triangulation<3> &tria, - const double l, - const double r, - const double d, - bool colorize); -template <> -void -GridGenerator::hyper_L (Triangulation<3> &tria, - const double a, - const double b); -template <> -void -GridGenerator::hyper_ball (Triangulation<3> &tria, - const Point<3> &p, - const double radius); -template <> -void GridGenerator::hyper_shell (Triangulation<3> &, - const Point<3> &, - const double , - const double , - const unsigned int ); -template <> -void GridGenerator::laplace_transformation (Triangulation<1> &, - const std::map > &); - - #endif diff --git a/deal.II/deal.II/include/grid/grid_out.h b/deal.II/deal.II/include/grid/grid_out.h index 765922212e..13073c1bef 100644 --- a/deal.II/deal.II/include/grid/grid_out.h +++ b/deal.II/deal.II/include/grid/grid_out.h @@ -449,8 +449,16 @@ class GridOut template void write_gnuplot (const Triangulation &tria, std::ostream &out, - const Mapping *mapping=0); + const Mapping *mapping=0); + /** + * Declaration of the specialization + * of above function for 1d. + */ + void write_gnuplot (const Triangulation<1> &tria, + std::ostream &out, + const Mapping<1> *mapping=0); + /** * Write the triangulation in the * ucd format. @@ -550,6 +558,16 @@ class GridOut void write_eps (const Triangulation &tria, std::ostream &out, const Mapping *mapping=0); + + /** + * Declaration of the + * specialization of above + * function for 1d. This function + * is presently not implemented. + */ + void write_eps (const Triangulation<1> &tria, + std::ostream &out, + const Mapping<1> *mapping=0); /** * Write data and grid to @p{out} according @@ -724,6 +742,15 @@ class GridOut const unsigned int starting_index, std::ostream &out) const; + /** + * Declaration of the specialization + * of above function for 1d. Does + * nothing. + */ + void write_ucd_faces (const Triangulation<1> &tria, + const unsigned int starting_index, + std::ostream &out) const; + /** * Return the number of faces in the * triangulation which have a boundary @@ -744,26 +771,14 @@ class GridOut */ template unsigned int n_boundary_faces (const Triangulation &tria) const; -}; - - -/* -------------- declaration of explicit specializations ------------- */ - -template <> -unsigned int GridOut::n_boundary_faces (const Triangulation<1> &) const; -template <> -void GridOut::write_ucd_faces (const Triangulation<1> &, - const unsigned int, - std::ostream &) const; -template <> -void GridOut::write_gnuplot (const Triangulation<1> &tria, - std::ostream &out, - const Mapping<1> *); -template <> -void GridOut::write_eps (const Triangulation<1> &, - std::ostream &, - const Mapping<1> *); + /** + * Declaration of the specialization + * of above function for + * 1d. Simply returns zero. + */ + unsigned int n_boundary_faces (const Triangulation<1> &tria) const; +}; diff --git a/deal.II/deal.II/include/numerics/vectors.h b/deal.II/deal.II/include/numerics/vectors.h index 27624dab11..17d34967dd 100644 --- a/deal.II/deal.II/include/numerics/vectors.h +++ b/deal.II/deal.II/include/numerics/vectors.h @@ -26,7 +26,6 @@ template class Mapping; template class DoFHandler; class ConstraintMatrix; -//TODO:[WB] replace template functions and specializations with overloaded functions /** @@ -403,6 +402,22 @@ class VectorTools const Quadrature &q_boundary = QGauss2(), const bool project_to_boundary_first = false); + /** + * Declaration of specialization + * of the previous function for + * 1d. At present, it is not + * implemented. + */ + static void project (const Mapping<1> &mapping, + const DoFHandler<1> &dof, + const ConstraintMatrix &constraints, + const Quadrature<1> &quadrature, + const Function<1> &function, + Vector &vec, + const bool enforce_zero_boundary = false, + const Quadrature<0> &q_boundary = *static_cast*>(0), + const bool project_to_boundary_first = false); + /** * Calls the @p{project} * function, see above, with @@ -499,6 +514,17 @@ class VectorTools std::map &boundary_values, const std::vector &component_mask = std::vector()); + /** + * Declaration of specialization + * of the previous function for + * 1d. + */ + static void interpolate_boundary_values (const Mapping<1> &mapping, + const DoFHandler<1> &dof, + const FunctionMap<1>::type &function_map, + std::map &boundary_values, + const std::vector &component_mask = std::vector()); + /** * Same function as above, but * taking only one pair of @@ -518,6 +544,18 @@ class VectorTools const Function &boundary_function, std::map &boundary_values, const std::vector &component_mask = std::vector()); + + /** + * Declaration of specialization + * of the previous function for + * 1d. + */ + static void interpolate_boundary_values (const Mapping<1> &mapping, + const DoFHandler<1> &dof, + const unsigned char boundary_component, + const Function<1> &boundary_function, + std::map &boundary_values, + const std::vector &component_mask = std::vector()); /** * Calls the other @@ -570,6 +608,20 @@ class VectorTools const typename FunctionMap::type &boundary_functions, const Quadrature &q, std::map &boundary_values); + + /** + * Declaration of specialization + * of the previous function for + * 1d. Since in 1d projection + * equals interpolation, the + * interpolation function is + * called. + */ + static void project_boundary_values (const Mapping<1> &mapping, + const DoFHandler<1> &dof, + const FunctionMap<1>::type &boundary_functions, + const Quadrature<0> &q, + std::map &boundary_values); /** * Calls the @p{project_boundary_values} @@ -749,40 +801,5 @@ class VectorTools }; -/* -------------- declaration of explicit specializations ------------- */ - -template <> void VectorTools::project ( - const Mapping<1> &, - const DoFHandler<1> &, - const ConstraintMatrix &, - const Quadrature<1> &, - const Function<1> &, - Vector &, - const bool , - const Quadrature<0> &, - const bool ); - -template <> void VectorTools::interpolate_boundary_values ( - const Mapping<1> &, - const DoFHandler<1> &dof, - const unsigned char boundary_component, - const Function<1> &boundary_function, - std::map &boundary_values, - const std::vector &component_mask_); - -template <> void VectorTools::interpolate_boundary_values ( - const Mapping<1> &mapping, - const DoFHandler<1> &dof, - const FunctionMap<1>::type &function_map, - std::map &boundary_values, - const std::vector &component_mask); - -template <> void VectorTools::project_boundary_values ( - const Mapping<1> &mapping, - const DoFHandler<1> &dof, - const FunctionMap<1>::type &boundary_functions, - const Quadrature<0> &, - std::map &boundary_values); - #endif diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index aa4ee1181f..71268fd57a 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -117,12 +117,11 @@ DoFTools::make_sparsity_pattern (const DoFHandler &dof, #if deal_II_dimension == 1 -template <> void -DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1> &dof_handler, - const DoFHandler<1>::FunctionMap &function_map, - const std::vector &dof_to_boundary_mapping, - SparsityPattern &sparsity) +DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1> &dof_handler, + const FunctionMap<1>::type &function_map, + const std::vector &dof_to_boundary_mapping, + SparsityPattern &sparsity) { const unsigned int dofs_per_vertex = dof_handler.get_fe().dofs_per_vertex; std::vector boundary_dof_boundary_indices (dofs_per_vertex); @@ -161,7 +160,6 @@ DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1> &dof_handler, -template <> void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1> &dof_handler, const std::vector &dof_to_boundary_mapping, SparsityPattern &sparsity) @@ -508,7 +506,6 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler &dof, #if deal_II_dimension == 1 -template <> void DoFTools::make_hanging_node_constraints (const DoFHandler<1> &, ConstraintMatrix &) { @@ -521,7 +518,6 @@ void DoFTools::make_hanging_node_constraints (const DoFHandler<1> &, #if deal_II_dimension == 2 -template <> void DoFTools::make_hanging_node_constraints (const DoFHandler<2> &dof_handler, ConstraintMatrix &constraints) { @@ -609,7 +605,6 @@ void DoFTools::make_hanging_node_constraints (const DoFHandler<2> &dof_handler, #if deal_II_dimension == 3 -template <> void DoFTools::make_hanging_node_constraints (const DoFHandler<3> &dof_handler, ConstraintMatrix &constraints) { @@ -942,7 +937,7 @@ DoFTools::extract_boundary_dofs (const DoFHandler &dof_handler, #else -template <> + void DoFTools::extract_boundary_dofs (const DoFHandler<1> &dof_handler, const std::vector &component_select, @@ -1000,7 +995,6 @@ DoFTools::extract_boundary_dofs (const DoFHandler<1> &dof_handler, #if deal_II_dimension == 1 -template <> void DoFTools::extract_hanging_node_dofs (const DoFHandler<1> &dof_handler, std::vector &selected_dofs) @@ -1018,7 +1012,6 @@ DoFTools::extract_hanging_node_dofs (const DoFHandler<1> &dof_handler, #if deal_II_dimension == 2 -template <> void DoFTools::extract_hanging_node_dofs (const DoFHandler<2> &dof_handler, std::vector &selected_dofs) @@ -1058,7 +1051,6 @@ DoFTools::extract_hanging_node_dofs (const DoFHandler<2> &dof_handler, #if deal_II_dimension == 3 -template <> void DoFTools::extract_hanging_node_dofs (const DoFHandler<3> &dof_handler, std::vector &selected_dofs) @@ -1969,7 +1961,7 @@ DoFTools::compute_intergrid_weights_3 (const DoFHandler &coars #if deal_II_dimension == 1 -template <> + void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler, const std::set &boundary_indicators, std::vector &mapping) @@ -2010,7 +2002,6 @@ void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler, -template <> void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler, std::vector &mapping) { diff --git a/deal.II/deal.II/source/grid/grid_generator.cc b/deal.II/deal.II/source/grid/grid_generator.cc index f20f683875..ef375359b7 100644 --- a/deal.II/deal.II/source/grid/grid_generator.cc +++ b/deal.II/deal.II/source/grid/grid_generator.cc @@ -116,7 +116,6 @@ GridGenerator::hyper_rectangle (Triangulation &tria, -template <> void GridGenerator::colorize_hyper_rectangle (Triangulation<1> &) { @@ -157,9 +156,9 @@ GridGenerator::colorize_hyper_rectangle (Triangulation &tria) template -void GridGenerator::hyper_cube(Triangulation &tria, - const double left, - const double right) +void GridGenerator::hyper_cube (Triangulation &tria, + const double left, + const double right) { Point p1; Point p2; @@ -174,7 +173,6 @@ void GridGenerator::hyper_cube(Triangulation &tria, #if deal_II_dimension == 1 -template <> void GridGenerator::hyper_cube_slit (Triangulation<1> &, const double, const double) @@ -184,7 +182,6 @@ void GridGenerator::hyper_cube_slit (Triangulation<1> &, -template <> void GridGenerator::hyper_L (Triangulation<1> &, const double, const double) @@ -194,7 +191,6 @@ void GridGenerator::hyper_L (Triangulation<1> &, -template <> void GridGenerator::hyper_ball (Triangulation<1> &, const Point<1> &, const double) @@ -204,7 +200,6 @@ void GridGenerator::hyper_ball (Triangulation<1> &, -template <> void GridGenerator::hyper_shell (Triangulation<1> &, const Point<1> &, const double, @@ -220,12 +215,11 @@ void GridGenerator::hyper_shell (Triangulation<1> &, #if deal_II_dimension == 2 -template<> void GridGenerator::enclosed_hyper_cube (Triangulation<2> &tria, - const double l, - const double r, - const double d, - bool colorize) + const double l, + const double r, + const double d, + const bool colorize) { std::vector > vertices(16); double coords[4]; @@ -264,7 +258,6 @@ void GridGenerator::enclosed_hyper_cube (Triangulation<2> &tria, -template <> void GridGenerator::hyper_cube_slit (Triangulation<2> &tria, const double left, @@ -299,7 +292,6 @@ GridGenerator::hyper_cube_slit (Triangulation<2> &tria, -template <> void GridGenerator::hyper_L (Triangulation<2> &tria, const double a, @@ -334,10 +326,9 @@ GridGenerator::hyper_L (Triangulation<2> &tria, -template <> void GridGenerator::hyper_ball (Triangulation<2> &tria, - const Point<2> &p, + const Point<2> &p, const double radius) { // equilibrate cell sizes at @@ -375,7 +366,6 @@ GridGenerator::hyper_ball (Triangulation<2> &tria, -template <> void GridGenerator::hyper_shell (Triangulation<2> &tria, const Point<2> ¢er, const double inner_radius, @@ -437,7 +427,6 @@ void GridGenerator::hyper_shell (Triangulation<2> &tria, -template <> void GridGenerator::half_hyper_shell (Triangulation<2> &tria, const Point<2> ¢er, @@ -512,21 +501,21 @@ GridGenerator::half_hyper_shell (Triangulation<2> &tria, #if deal_II_dimension == 3 -template <> + void GridGenerator::hyper_cube_slit (Triangulation<3> &, const double, - const double) { + const double) +{ Assert (false, ExcNotImplemented()); }; -template<> void GridGenerator::enclosed_hyper_cube (Triangulation<3> &tria, - const double l, - const double r, - const double d, - bool colorize) + const double l, + const double r, + const double d, + const bool colorize) { std::vector > vertices(64); double coords[4]; @@ -578,11 +567,10 @@ void GridGenerator::enclosed_hyper_cube (Triangulation<3> &tria, -template <> void GridGenerator::hyper_L (Triangulation<3> &tria, - const double a, - const double b) + const double a, + const double b) { const unsigned int dim=3; // we slice out the top back right @@ -644,7 +632,6 @@ GridGenerator::hyper_L (Triangulation<3> &tria, -template <> void GridGenerator::hyper_ball (Triangulation<3> &tria, const Point<3> &p, @@ -724,7 +711,6 @@ GridGenerator::hyper_ball (Triangulation<3> &tria, -template <> void GridGenerator::hyper_shell (Triangulation<3> &, const Point<3> &, const double , @@ -740,7 +726,6 @@ void GridGenerator::hyper_shell (Triangulation<3> &, #if deal_II_dimension == 1 -template <> void GridGenerator::laplace_transformation (Triangulation<1> &, const std::map > &) { diff --git a/deal.II/deal.II/source/grid/grid_out.cc b/deal.II/deal.II/source/grid/grid_out.cc index 432ef4f5ca..e95c010e8e 100644 --- a/deal.II/deal.II/source/grid/grid_out.cc +++ b/deal.II/deal.II/source/grid/grid_out.cc @@ -159,7 +159,6 @@ void GridOut::write_ucd (const Triangulation &tria, #if deal_II_dimension == 1 -template <> unsigned int GridOut::n_boundary_faces (const Triangulation<1> &) const { return 0; @@ -188,7 +187,6 @@ unsigned int GridOut::n_boundary_faces (const Triangulation &tria) const #if deal_II_dimension == 1 -template <> void GridOut::write_ucd_faces (const Triangulation<1> &, const unsigned int, std::ostream &) const @@ -234,7 +232,6 @@ void GridOut::write_ucd_faces (const Triangulation &tria, #if deal_II_dimension==1 -template <> void GridOut::write_gnuplot (const Triangulation<1> &tria, std::ostream &out, const Mapping<1> *) @@ -498,7 +495,6 @@ struct LineEntry #if deal_II_dimension==1 -template <> void GridOut::write_eps (const Triangulation<1> &, std::ostream &, const Mapping<1> *) diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index eccf23ab96..0421d80c58 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -286,7 +286,6 @@ VectorTools::interpolate (const DoFHandler &dof_1, #if deal_II_dimension == 1 -template <> void VectorTools::project (const Mapping<1> &, const DoFHandler<1> &, const ConstraintMatrix &, @@ -548,7 +547,6 @@ void VectorTools::create_right_hand_side (const DoFHandler &dof_handler, #if deal_II_dimension == 1 -template <> void VectorTools::interpolate_boundary_values (const Mapping<1> &, const DoFHandler<1> &dof, @@ -622,7 +620,6 @@ VectorTools::interpolate_boundary_values (const Mapping<1> &, -template <> void VectorTools::interpolate_boundary_values (const Mapping<1> &mapping, const DoFHandler<1> &dof, @@ -804,7 +801,6 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, #if deal_II_dimension == 1 -template <> void VectorTools::project_boundary_values (const Mapping<1> &mapping, const DoFHandler<1> &dof, -- 2.39.5