]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Replace explicite specializations of functions -- which really is not standards confo...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 24 May 2001 08:27:07 +0000 (08:27 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 24 May 2001 08:27:07 +0000 (08:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@4726 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_tools.h
deal.II/deal.II/include/grid/grid_generator.h
deal.II/deal.II/include/grid/grid_out.h
deal.II/deal.II/include/numerics/vectors.h
deal.II/deal.II/source/dofs/dof_tools.cc
deal.II/deal.II/source/grid/grid_generator.cc
deal.II/deal.II/source/grid/grid_out.cc
deal.II/deal.II/source/numerics/vectors.cc

index 816318674d06e1dd2153744b7c256a889dc63b99..7d537ca86937cb39109123af51ce4cca8c129ddb 100644 (file)
@@ -302,8 +302,18 @@ class DoFTools
     static void
     make_boundary_sparsity_pattern (const DoFHandler<dim>           &dof,
                                    const std::vector<unsigned int> &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<unsigned int> &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<unsigned int>  &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<unsigned int> &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 <int dim>
     static void
-    make_hanging_node_constraints (const DoFHandler<dim> &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 <int dim>
     static void
     extract_boundary_dofs (const DoFHandler<dim>      &dof_handler,
+                          const std::vector<bool>    &component_select,
+                          std::vector<bool>          &selected_dofs,
+                          const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
+
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void
+    extract_boundary_dofs (const DoFHandler<1>        &dof_handler,
                           const std::vector<bool>    &component_select,
                           std::vector<bool>          &selected_dofs,
                           const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
@@ -566,10 +612,25 @@ class DoFTools
                                      * contents of this array or
                                      * overwritten.
                                      */
-    template <int dim>
     static void
-    extract_hanging_node_dofs (const DoFHandler<dim> &dof_handler,
-                              std::vector<bool>     &selected_dofs);
+    extract_hanging_node_dofs (const DoFHandler<1> &dof_handler,
+                              std::vector<bool>   &selected_dofs);
+
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void
+    extract_hanging_node_dofs (const DoFHandler<2> &dof_handler,
+                              std::vector<bool>   &selected_dofs);
+
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void
+    extract_hanging_node_dofs (const DoFHandler<3> &dof_handler,
+                              std::vector<bool>   &selected_dofs);
 
                                     /**
                                      * Count how many degrees of
@@ -818,7 +879,30 @@ class DoFTools
                                   const InterGridMap<DoFHandler,dim> &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 <int dim>
     static void
     compute_intergrid_transfer_representation (const DoFHandler<dim>              &coarse_grid,
@@ -860,6 +944,14 @@ class DoFTools
     map_dof_to_boundary_indices (const DoFHandler<dim>      &dof_handler,
                                 std::vector<unsigned int>  &mapping);
 
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void
+    map_dof_to_boundary_indices (const DoFHandler<1>        &dof_handler,
+                                std::vector<unsigned int>  &mapping);
+    
                                     /**
                                      * Same as the previous function,
                                      * except that only those parts
@@ -877,6 +969,15 @@ class DoFTools
                                 const std::set<unsigned char> &boundary_indicators,
                                 std::vector<unsigned int>     &mapping);
 
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void
+    map_dof_to_boundary_indices (const DoFHandler<1>           &dof_handler,
+                                const std::set<unsigned char> &boundary_indicators,
+                                std::vector<unsigned int>     &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<unsigned int>  &dof_to_boundary_mapping,
-                                         SparsityPattern    &sparsity);
-template <>
-void DoFTools::make_boundary_sparsity_pattern (const DoFHandler<1> &dof_handler,
-                                              const std::vector<unsigned int>  &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<bool>  &component_select,
-                                std::vector<bool>        &selected_dofs,
-                                const std::set<unsigned char> &boundary_indicators);
-template <>
-void
-DoFTools::extract_hanging_node_dofs (const DoFHandler<1> &dof_handler,
-                                    std::vector<bool>   &selected_dofs);
-template <>
-void
-DoFTools::extract_hanging_node_dofs (const DoFHandler<2> &dof_handler,
-                                    std::vector<bool>   &selected_dofs);
-template <>
-void
-DoFTools::extract_hanging_node_dofs (const DoFHandler<3> &dof_handler,
-                                    std::vector<bool>   &selected_dofs);
-template <>
-void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
-                                           const std::set<unsigned char> &boundary_indicators,
-                                           std::vector<unsigned int> &mapping);
-template <>
-void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
-                                           std::vector<unsigned int> &mapping);
-
-
 
 // ---------------------- inline and template functions --------------------
 
index 6c45f4517266f770fa3fd3315ee124c0c9fad4b3..b8e16f279818d32b117a9da4da5fbf5599ffaeb0 100644 (file)
 
 
 #include <base/exceptions.h>
+#include <map>
+
 template <int dim> class Point;
 template <int dim> class Triangulation;
 template <typename number> class Vector;
 template <typename number> class SparseMatrix;
 
 
-//TODO:[WB] replace template functions and specializations with overloaded functions
-
-#include <map>
-
 /**
  * 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<int dim>
-    static void enclosed_hyper_cube (Triangulation<dim> &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 <int dim>
-    static void hyper_ball (Triangulation<dim> &tria,
-                           const Point<dim>   &center = Point<dim>(),
-                           const double        radius = 1.);
+    static void hyper_ball (Triangulation<1> &tria,
+                           const Point<1>   &center = Point<1>(),
+                           const double      radius = 1.);
+
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void hyper_ball (Triangulation<2> &tria,
+                           const Point<2>   &center = Point<2>(),
+                           const double      radius = 1.);
+
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void hyper_ball (Triangulation<3> &tria,
+                           const Point<3>   &center = 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 <int dim>
-    static void hyper_L (Triangulation<dim> &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 <int dim>
-    static void hyper_cube_slit (Triangulation<dim> &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 <int dim>
-    static void hyper_shell (Triangulation<dim> &tria,
-                            const Point<dim>   &center,
+    static void hyper_shell (Triangulation<1>   &tria,
+                            const Point<1>     &center,
+                            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>     &center,
+                            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>     &center,
                             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 <int dim>
-    static void half_hyper_shell (Triangulation<dim> &tria,
-                                 const Point<dim>   &center,
+    static void half_hyper_shell (Triangulation<2>   &tria,
+                                 const Point<2>     &center,
                                  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 <int dim>
     static void laplace_transformation (Triangulation<dim> &tria,
                                        const std::map<unsigned int,Point<dim> > &new_points);
+
+                                    /**
+                                     * Declaration of same function
+                                     * for different space dimension.
+                                     */
+    static void laplace_transformation (Triangulation<1> &tria,
+                                       const std::map<unsigned int,Point<1> > &new_points);
     
                                     /**
                                      * Exception
@@ -348,99 +476,25 @@ class GridGenerator
     static void colorize_hyper_rectangle (Triangulation<dim> &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<double> &S,
+    static void laplace_solve (const SparseMatrix<double>          &S,
                               const std::map<unsigned int,double> &m,
-                              Vector<double> &u);
+                              Vector<double>                      &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>     &center,
-                                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>     &center,
-                                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<unsigned int,Point<1> > &);
-
-
 #endif
index 765922212e17e980284f79c910d33586ab7726c0..13073c1bef45b5615fc5f3a7a0fb1c69e647627d 100644 (file)
@@ -449,8 +449,16 @@ class GridOut
     template <int dim>
     void write_gnuplot (const Triangulation<dim> &tria,
                        std::ostream             &out,
-                       const Mapping<dim> *mapping=0);
+                       const Mapping<dim>       *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<dim> &tria,
                    std::ostream             &out,
                    const Mapping<dim>       *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 <int dim>
     unsigned int n_boundary_faces (const Triangulation<dim> &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;
+};
 
 
 
index 27624dab11672760a50e9248590314dca25606f3..17d34967dda5145d260d7ef0dd92ee455d3c9b4a 100644 (file)
@@ -26,7 +26,6 @@ template <int dim> class Mapping;
 template <int dim> class DoFHandler;
 class ConstraintMatrix;
 
-//TODO:[WB] replace template functions and specializations with overloaded functions
 
 
 /**
@@ -403,6 +402,22 @@ class VectorTools
                         const Quadrature<dim-1>  &q_boundary = QGauss2<dim-1>(),
                         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<double>           &vec,
+                        const bool                enforce_zero_boundary = false,
+                        const Quadrature<0>      &q_boundary = *static_cast<const Quadrature<0>*>(0),
+                        const bool                project_to_boundary_first = false);
+    
                                     /**
                                      * Calls the @p{project}
                                      * function, see above, with
@@ -499,6 +514,17 @@ class VectorTools
                                             std::map<unsigned int,double> &boundary_values,
                                             const std::vector<bool>       &component_mask = std::vector<bool>());
 
+                                    /**
+                                     * 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<unsigned int,double> &boundary_values,
+                                            const std::vector<bool>       &component_mask = std::vector<bool>());
+
                                     /**
                                      * Same function as above, but
                                      * taking only one pair of
@@ -518,6 +544,18 @@ class VectorTools
                                             const Function<dim>           &boundary_function,
                                             std::map<unsigned int,double> &boundary_values,
                                             const std::vector<bool>       &component_mask = std::vector<bool>());
+
+                                    /**
+                                     * 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<unsigned int,double> &boundary_values,
+                                            const std::vector<bool>       &component_mask = std::vector<bool>());
     
                                     /**
                                      * Calls the other
@@ -570,6 +608,20 @@ class VectorTools
                                         const typename FunctionMap<dim>::type &boundary_functions,
                                         const Quadrature<dim-1>  &q,
                                         std::map<unsigned int,double> &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<unsigned int,double> &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<double>         &,
-  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<unsigned int,double> &boundary_values,
-  const std::vector<bool>       &component_mask_);
-
-template <> void VectorTools::interpolate_boundary_values (
-  const Mapping<1>              &mapping,
-  const DoFHandler<1>           &dof,
-  const FunctionMap<1>::type    &function_map,
-  std::map<unsigned int,double> &boundary_values,
-  const std::vector<bool>       &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<unsigned int,double> &boundary_values);
-
 
 #endif
index aa4ee1181fad7686b01769261aa583bdcd6d2159..71268fd57a132aa01d215ac47023f9f057a5b99e 100644 (file)
@@ -117,12 +117,11 @@ DoFTools::make_sparsity_pattern (const DoFHandler<dim>                 &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<unsigned int>  &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<unsigned int> &dof_to_boundary_mapping,
+                                         SparsityPattern                 &sparsity)
 {
   const unsigned int dofs_per_vertex = dof_handler.get_fe().dofs_per_vertex;
   std::vector<unsigned int> 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<unsigned int>  &dof_to_boundary_mapping,
                                               SparsityPattern    &sparsity)
@@ -508,7 +506,6 @@ DoFTools::make_flux_sparsity_pattern (const DoFHandler<dim> &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<dim>         &dof_handler,
 
 #else
 
-template <>
+
 void
 DoFTools::extract_boundary_dofs (const DoFHandler<1>      &dof_handler,
                                 const std::vector<bool>  &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<bool>   &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<bool>   &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<bool>   &selected_dofs)
@@ -1969,7 +1961,7 @@ DoFTools::compute_intergrid_weights_3 (const DoFHandler<dim>              &coars
 
 #if deal_II_dimension == 1
 
-template <>
+
 void DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
                                            const std::set<unsigned char> &boundary_indicators,
                                            std::vector<unsigned int> &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<unsigned int> &mapping)
 {
index f20f6838751b9c08689e6d070fd8365e1d230cc0..ef375359b7049a4b7eb3f484fbd283355406a7d0 100644 (file)
@@ -116,7 +116,6 @@ GridGenerator::hyper_rectangle (Triangulation<dim> &tria,
 
 
 
-template <>
 void
 GridGenerator::colorize_hyper_rectangle (Triangulation<1> &)
 {
@@ -157,9 +156,9 @@ GridGenerator::colorize_hyper_rectangle (Triangulation<dim> &tria)
 
 
 template <int dim>
-void GridGenerator::hyper_cube(Triangulation<dim> &tria,
-                              const double left,
-                              const double right)
+void GridGenerator::hyper_cube (Triangulation<dim> &tria,
+                               const double        left,
+                               const double        right)
 {
   Point<dim> p1;
   Point<dim> p2;
@@ -174,7 +173,6 @@ void GridGenerator::hyper_cube(Triangulation<dim> &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<Point<2> > 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>     &center,
                                 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>     &center,
@@ -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<Point<3> > 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<unsigned int,Point<1> > &)
 {
index 432ef4f5caafceb40ea50f8a28aa5d083a816d6a..e95c010e8e1d2bd21598fda1411e650c2564bc9d 100644 (file)
@@ -159,7 +159,6 @@ void GridOut::write_ucd (const Triangulation<dim> &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<dim> &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<dim> &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> *) 
index eccf23ab963263256f91bc688919929ea783556b..0421d80c5801ad821faca8488f3af5da56b2cfbf 100644 (file)
@@ -286,7 +286,6 @@ VectorTools::interpolate (const DoFHandler<dim>           &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<dim>    &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<dim>         &dof,
 
 #if deal_II_dimension == 1
 
-template <>
 void
 VectorTools::project_boundary_values (const Mapping<1>       &mapping,
                                      const DoFHandler<1>    &dof,

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.