]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Change distributed and fe directories so that files are compiled only once and not...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 Nov 2010 15:21:40 +0000 (15:21 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 10 Nov 2010 15:21:40 +0000 (15:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@22676 0785d39b-7218-0410-832d-ea1e28bc413d

68 files changed:
deal.II/include/deal.II/fe/fe_abf.h
deal.II/include/deal.II/fe/fe_bdm.h
deal.II/include/deal.II/fe/fe_dg_vector.h
deal.II/include/deal.II/fe/fe_nedelec.h
deal.II/include/deal.II/fe/fe_raviart_thomas.h
deal.II/include/deal.II/fe/fe_system.h
deal.II/source/Makefile
deal.II/source/distributed/grid_refinement.cc [moved from deal.II/source/distributed/grid_refinement.all_dimensions.cc with 100% similarity]
deal.II/source/distributed/solution_transfer.cc
deal.II/source/distributed/solution_transfer.inst.in [new file with mode: 0644]
deal.II/source/distributed/tria.cc
deal.II/source/distributed/tria.inst.in [new file with mode: 0644]
deal.II/source/fe/fe.cc
deal.II/source/fe/fe.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_abf.cc
deal.II/source/fe/fe_abf.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_bdm.cc
deal.II/source/fe/fe_bdm.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_data.cc [moved from deal.II/source/fe/fe_data.all_dimensions.cc with 100% similarity]
deal.II/source/fe/fe_dg_vector.cc
deal.II/source/fe/fe_dg_vector.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_dgp.cc
deal.II/source/fe/fe_dgp.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_dgp_monomial.cc
deal.II/source/fe/fe_dgp_monomial.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_dgp_nonparametric.cc
deal.II/source/fe/fe_dgp_nonparametric.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_dgq.cc
deal.II/source/fe/fe_dgq.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_face.cc
deal.II/source/fe/fe_face.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_nedelec.cc
deal.II/source/fe/fe_nedelec.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_nothing.cc
deal.II/source/fe/fe_nothing.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_poly.cc
deal.II/source/fe/fe_poly.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_poly_tensor.cc
deal.II/source/fe/fe_poly_tensor.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_q.cc
deal.II/source/fe/fe_q.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_q_hierarchical.cc
deal.II/source/fe/fe_q_hierarchical.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_raviart_thomas.cc
deal.II/source/fe/fe_raviart_thomas.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_raviart_thomas_nodal.cc
deal.II/source/fe/fe_raviart_thomas_nodal.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_system.cc
deal.II/source/fe/fe_system.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_tools.all_dimensions.cc [deleted file]
deal.II/source/fe/fe_tools.cc
deal.II/source/fe/fe_tools.inst.in [new file with mode: 0644]
deal.II/source/fe/fe_values.cc
deal.II/source/fe/fe_values.inst.in
deal.II/source/fe/mapping.cc
deal.II/source/fe/mapping.inst.in [new file with mode: 0644]
deal.II/source/fe/mapping_c1.cc
deal.II/source/fe/mapping_c1.inst.in [new file with mode: 0644]
deal.II/source/fe/mapping_cartesian.cc
deal.II/source/fe/mapping_cartesian.inst.in [new file with mode: 0644]
deal.II/source/fe/mapping_q.cc
deal.II/source/fe/mapping_q.inst.in [new file with mode: 0644]
deal.II/source/fe/mapping_q1.cc
deal.II/source/fe/mapping_q1.inst.in [new file with mode: 0644]
deal.II/source/fe/mapping_q1_eulerian.cc
deal.II/source/fe/mapping_q1_eulerian.inst.in [new file with mode: 0644]
deal.II/source/fe/mapping_q_eulerian.cc
deal.II/source/fe/mapping_q_eulerian.inst.in [new file with mode: 0644]

index b2df64ce45a328125bb84709a2769f9444290851..24c6fb817c285262674b80c5ef77d74e5fd1feef 100644 (file)
@@ -380,14 +380,6 @@ class FE_ABF : public FE_PolyTensor<PolynomialsABF<dim>, dim>
 
 /*@}*/
 
-/* -------------- declaration of explicit specializations ------------- */
-
-#ifndef DOXYGEN
-
-template <>
-std::vector<unsigned int> FE_ABF<1>::get_dpo_vector (const unsigned int);
-
-#endif // DOXYGEN
 
 DEAL_II_NAMESPACE_CLOSE
 
index 8b91e325cb6e2b30b8fe4a7c0a3ffaf14ca10e05..8b6ebbc7ca3b3ee004c83dfbf65fe22e170b7d57 100644 (file)
@@ -23,7 +23,8 @@
 
 #include <vector>
 
-using namespace dealii;
+
+DEAL_II_NAMESPACE_OPEN
 
 /**
  * The Brezzi-Douglas-Marini element.
@@ -123,4 +124,6 @@ class FE_BDM
     std::vector<std::vector<double> > test_values;
 };
 
+DEAL_II_NAMESPACE_CLOSE
+
 #endif
index c351d7cff8bd676cd25ca53fdeaeeb33b79cb1ef..7ad6d58165ccdcd0d3cee48b0a62ef48548cbdb3 100644 (file)
@@ -190,7 +190,6 @@ class FE_DGVector
 };
 
 
-/* -------------- declaration of explicit specializations ------------- */
 
 DEAL_II_NAMESPACE_CLOSE
 
index 79177cd0358d8fb304968f168c57c721f7912060..065076d8ca580b53f1a6af66dbf0018ebf160836 100644 (file)
@@ -226,7 +226,7 @@ class FE_Nedelec : public FE_PolyTensor<PolynomialsNedelec<dim>, dim> {
     const;
     virtual unsigned int memory_consumption () const;
     virtual FiniteElement<dim> * clone() const;
-    
+
   private:
                                 /**
                                      * Only for internal use. Its
@@ -333,7 +333,7 @@ class FE_Nedelec : public FE_PolyTensor<PolynomialsNedelec<dim>, dim> {
                                      * integration.
                                      */
     Table<2, double> boundary_weights;
-    
+
                                     /**
                                      * Allow access from other
                                      * dimensions.
@@ -345,8 +345,6 @@ class FE_Nedelec : public FE_PolyTensor<PolynomialsNedelec<dim>, dim> {
 
 #ifndef DOXYGEN
 
-template <>
-std::vector<unsigned int> FE_Nedelec<1>::get_dpo_vector (const unsigned int);
 template <>
 void
 FE_Nedelec<1>::initialize_restriction();
index 0b3c25321f99e90d6f9751a462e13e90109cab5b..1e94f4949c1568d93ca4eb7e286fb0e3f900581c 100644 (file)
@@ -424,8 +424,6 @@ class FE_RaviartThomasNodal
 
 #ifndef DOXYGEN
 
-template <>
-std::vector<unsigned int> FE_RaviartThomas<1>::get_dpo_vector (const unsigned int);
 template <>
 void
 FE_RaviartThomas<1>::initialize_restriction();
index 18c24781beba6c0f32fc71ce662cc2a39d4dd2f8..326e7342778d00c53458d0ab482d12a2d26789f4 100644 (file)
@@ -143,7 +143,7 @@ DEAL_II_NAMESPACE_OPEN
  * see the documentation of Triangulation.
  *
  * @ingroup febase fe vector_valued
- * 
+ *
  * @author Wolfgang Bangerth, Guido Kanschat, 1999, 2002, 2003, 2006, Ralf Hartmann 2001.
  */
 template <int dim, int spacedim=dim>
@@ -174,7 +174,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     FESystem (const FiniteElement<dim,spacedim> &fe,
              const unsigned int n_elements);
 
-                                    /** 
+                                    /**
                                      * Constructor for mixed
                                      * discretizations with two
                                      * base elements.
@@ -184,7 +184,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     FESystem (const FiniteElement<dim,spacedim> &fe1, const unsigned int n1,
              const FiniteElement<dim,spacedim> &fe2, const unsigned int n2);
 
-                                    /** 
+                                    /**
                                      * Constructor for mixed
                                      * discretizations with three
                                      * base elements.
@@ -195,7 +195,7 @@ class FESystem : public FiniteElement<dim,spacedim>
              const FiniteElement<dim,spacedim> &fe2, const unsigned int n2,
              const FiniteElement<dim,spacedim> &fe3, const unsigned int n3);
 
-                                    /** 
+                                    /**
                                      * Constructor for mixed
                                      * discretizations with four
                                      * base elements.
@@ -207,7 +207,7 @@ class FESystem : public FiniteElement<dim,spacedim>
              const FiniteElement<dim,spacedim> &fe3, const unsigned int n3,
              const FiniteElement<dim,spacedim> &fe4, const unsigned int n4);
 
-                                    /** 
+                                    /**
                                      * Constructor for mixed
                                      * discretizations with five
                                      * base elements.
@@ -291,7 +291,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     virtual double shape_value_component (const unsigned int i,
                                          const Point<dim> &p,
                                          const unsigned int component) const;
-    
+
                                     /**
                                      * Return the gradient of the
                                      * @p ith shape function at the
@@ -398,7 +398,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     shape_grad_grad_component (const unsigned int i,
                                const Point<dim> &p,
                                const unsigned int component) const;
-    
+
                                     /**
                                      * Return the matrix
                                      * interpolating from the given
@@ -425,7 +425,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     get_interpolation_matrix (const FiniteElement<dim,spacedim> &source,
                              FullMatrix<double>           &matrix) const;
 
-                                     /** 
+                                     /**
                                      * Number of different base
                                      * elements of this object.
                                      *
@@ -458,7 +458,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      */
     virtual const FiniteElement<dim,spacedim> &
     base_element (const unsigned int index) const;
-    
+
                                     /**
                                      * Check for non-zero values on a
                                      * face.
@@ -484,7 +484,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     virtual
     Point<dim>
     unit_support_point (const unsigned int index) const;
-    
+
                                      /**
                                       * Implementation of the
                                       * respective function in the
@@ -495,10 +495,10 @@ class FESystem : public FiniteElement<dim,spacedim>
     unit_face_support_point (const unsigned int index) const;
 
                                     /**
-                                     * @name Functions to support hp 
+                                     * @name Functions to support hp
                                      * @{
                                      */
-    
+
                                      /**
                                       * Return whether this element
                                       * implements its hanging node
@@ -511,12 +511,12 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      * this function.
                                       */
     virtual bool hp_constraints_are_implemented () const;
-    
+
                                     /**
                                      * Return the matrix
                                      * interpolating from a face of
                                      * of one element to the face of
-                                     * the neighboring element. 
+                                     * the neighboring element.
                                      * The size of the matrix is
                                      * then <tt>source.dofs_per_face</tt> times
                                      * <tt>this->dofs_per_face</tt>.
@@ -537,13 +537,13 @@ class FESystem : public FiniteElement<dim,spacedim>
     virtual void
     get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &source,
                                   FullMatrix<double>       &matrix) const;
-    
+
 
                                     /**
                                      * Return the matrix
                                      * interpolating from a face of
                                      * of one element to the subface of
-                                     * the neighboring element. 
+                                     * the neighboring element.
                                      * The size of the matrix is
                                      * then <tt>source.dofs_per_face</tt> times
                                      * <tt>this->dofs_per_face</tt>.
@@ -625,7 +625,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     virtual
     std::vector<std::pair<unsigned int, unsigned int> >
     hp_quad_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const;
-    
+
                                     /**
                                      * Return whether this element dominates
                                      * the one given as argument when they
@@ -642,7 +642,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     FiniteElementDomination::Domination
     compare_for_face_domination (const FiniteElement<dim,spacedim> &fe_other) const;
                                     //@}
-    
+
                                     /**
                                      * Determine an estimate for the
                                      * memory consumption (in bytes)
@@ -654,15 +654,15 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      * pointers to their base class,
                                      * rather than the class itself.
                                      */
-    virtual unsigned int memory_consumption () const;    
-  
+    virtual unsigned int memory_consumption () const;
+
   protected:
                                     /**
                                      * Compute flags for initial
                                      * update only.
                                      */
     virtual UpdateFlags update_once (const UpdateFlags flags) const;
-  
+
                                     /**
                                      * Compute flags for update on
                                      * each cell.
@@ -677,7 +677,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      * constructors of @p FESystem.
                                      */
     virtual FiniteElement<dim,spacedim> * clone() const;
-  
+
                                     /**
                                      * Prepare internal data
                                      * structures and fill in values
@@ -717,7 +717,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      * @p compute_fill that does the
                                      * work for all three
                                      * <tt>fill_fe*_values</tt> functions.
-                                     */    
+                                     */
     virtual void
     fill_fe_face_values (const Mapping<dim,spacedim>                   &mapping,
                         const typename Triangulation<dim,spacedim>::cell_iterator &cell,
@@ -746,12 +746,12 @@ class FESystem : public FiniteElement<dim,spacedim>
                            typename Mapping<dim,spacedim>::InternalDataBase      &mapping_data,
                            typename Mapping<dim,spacedim>::InternalDataBase      &fe_data,
                            FEValuesData<dim,spacedim>                    &data) const ;
-    
+
 
                                     /**
                                      * Do the work for the three
                                      * <tt>fill_fe*_values</tt> functions.
-                                     * 
+                                     *
                                      * Calls (among other things)
                                      * <tt>fill_fe_([sub]face)_values</tt>
                                      * of the base elements. Calls
@@ -789,13 +789,13 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      * invalid.
                                      */
     static const unsigned int invalid_face_number = numbers::invalid_unsigned_int;
-    
+
                                     /**
                                      * Pairs of multiplicity and
                                      * element type.
                                      */
     typedef std::pair<const FiniteElement<dim,spacedim> *, unsigned int> ElementPair;
-    
+
                                     /**
                                      * Pointer to underlying finite
                                      * element classes.
@@ -836,7 +836,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      * constructor.
                                      */
     void initialize_quad_dof_index_permutation ();
-    
+
                                     /**
                                      * Helper function used in the constructor:
                                      * take a @p FiniteElementData object
@@ -851,7 +851,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     static FiniteElementData<dim>
     multiply_dof_numbers (const FiniteElementData<dim> &fe_data,
                          const unsigned int            N);
-    
+
                                     /**
                                      * Same as above for mixed elements
                                      * with two different sub-elements.
@@ -918,7 +918,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     compute_restriction_is_additive_flags (
       const FiniteElement<dim,spacedim> &fe,
       const unsigned int        N);
-    
+
                                     /**
                                      * Same as above for mixed elements
                                      * with two different sub-elements.
@@ -985,8 +985,8 @@ class FESystem : public FiniteElement<dim,spacedim>
     compute_restriction_is_additive_flags (
       const std::vector<const FiniteElement<dim,spacedim>*> &fes,
       const std::vector<unsigned int>              &multiplicities);
-    
-    
+
+
                                     /**
                                      * Compute the non-zero vector
                                      * components of a composed
@@ -1061,7 +1061,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     static std::vector<std::vector<bool> >
     compute_nonzero_components (const std::vector<const FiniteElement<dim,spacedim>*> &fes,
                                const std::vector<unsigned int>              &multiplicities);
-    
+
                                     /**
                                      * This function is simply
                                      * singled out of the
@@ -1078,7 +1078,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                      * Used by @p initialize.
                                      */
     void build_cell_tables();
-    
+
                                     /**
                                      * Used by @p initialize.
                                      */
@@ -1099,7 +1099,7 @@ class FESystem : public FiniteElement<dim,spacedim>
     template <int structdim>
     std::vector<std::pair<unsigned int, unsigned int> >
     hp_object_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const;
-    
+
                                     /**
                                      * Usually: Fields of
                                      * cell-independent data.
@@ -1122,7 +1122,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                          * @p n_base_elements.
                                          */
        InternalData (const unsigned int n_base_elements);
-       
+
                                         /**
                                          * Destructor. Deletes all
                                          * @p InternalDatas whose
@@ -1138,7 +1138,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                          * be computed.
                                          */
        bool compute_hessians;
-       
+
                                         /**
                                          * Gives write-access to the
                                          * pointer to a
@@ -1154,7 +1154,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                          * pointer to a
                                          * @p InternalData of the
                                          * @p base_noth base element.
-                                         */    
+                                         */
        typename FiniteElement<dim,spacedim>::InternalDataBase &
        get_fe_data (const unsigned int base_no) const;
 
@@ -1174,7 +1174,7 @@ class FESystem : public FiniteElement<dim,spacedim>
                                          * pointer to a
                                          * @p FEValuesData for the
                                          * @p base_noth base element.
-                                         */    
+                                         */
        FEValuesData<dim,spacedim> & get_fe_values_data (const unsigned int base_no) const;
 
                                         /**
@@ -1213,9 +1213,9 @@ class FESystem : public FiniteElement<dim,spacedim>
                                           * of the sub-data objects.
                                           */
         virtual void clear_first_cell ();
-       
+
       private:
-       
+
                                         /**
                                          * Pointers to
                                          * @p InternalData objects
@@ -1263,12 +1263,6 @@ class FESystem : public FiniteElement<dim,spacedim>
 };
 
 
-/* -------------- declaration of explicit specializations ------------- */
-
-
-template <> void FESystem<1>::initialize_unit_face_support_points ();
-template <> void FESystem<1,2>::initialize_unit_face_support_points ();
-
 
 DEAL_II_NAMESPACE_CLOSE
 
index d07ffa33b53d30f68dbaed923a47bd5f1b18714a..7b93b2f61fc3dfa37818c10abddc780761769ede 100644 (file)
@@ -16,8 +16,8 @@ default all: debug optimized
 
 
 # list the dimension dependent and dimension independent directories
-dim-dep-dirs   := dofs fe hp multigrid numerics distributed
-dim-indep-dirs := base lac grid
+dim-dep-dirs   := dofs hp multigrid numerics
+dim-indep-dirs := base lac fe grid distributed
 all-dirs       := $(dim-dep-dirs) $(dim-indep-dirs)
 
 # create lists of file names.
index 5ba92a7b859b1c5d6b09054de4eb25f612ce636d..4393bb6c5c88732c918a907aa5f80a2f22e64382 100644 (file)
@@ -235,37 +235,7 @@ namespace parallel
 
 
 // explicit instantiations
-
-namespace parallel
-{
-  namespace distributed
-  {
-#if deal_II_dimension > 1
-    template class SolutionTransfer<deal_II_dimension,Vector<double>, DoFHandler<deal_II_dimension> >;
-
-
-#ifdef DEAL_II_USE_PETSC
-    template class SolutionTransfer<deal_II_dimension, PETScWrappers::Vector, DoFHandler<deal_II_dimension> >;
-
-    template class SolutionTransfer<deal_II_dimension, PETScWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
-
-    template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
-
-    template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::BlockVector, DoFHandler<deal_II_dimension> >;
-#endif
-
-#ifdef DEAL_II_USE_TRILINOS
-    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::Vector, DoFHandler<deal_II_dimension> >;
-
-    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
-
-    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
-
-    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::BlockVector, DoFHandler<deal_II_dimension> >;
-#endif
-#endif
-  }
-}
+#include "solution_transfer.inst"
 
 DEAL_II_NAMESPACE_CLOSE
 
diff --git a/deal.II/source/distributed/solution_transfer.inst.in b/deal.II/source/distributed/solution_transfer.inst.in
new file mode 100644 (file)
index 0000000..f622eed
--- /dev/null
@@ -0,0 +1,49 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+  namespace parallel
+  \{
+    namespace distributed
+    \{
+#if deal_II_dimension > 1
+    template class SolutionTransfer<deal_II_dimension,Vector<double>, DoFHandler<deal_II_dimension> >;
+
+
+#ifdef DEAL_II_USE_PETSC
+    template class SolutionTransfer<deal_II_dimension, PETScWrappers::Vector, DoFHandler<deal_II_dimension> >;
+
+    template class SolutionTransfer<deal_II_dimension, PETScWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
+
+    template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
+
+    template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::BlockVector, DoFHandler<deal_II_dimension> >;
+#endif
+
+#ifdef DEAL_II_USE_TRILINOS
+    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::Vector, DoFHandler<deal_II_dimension> >;
+
+    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
+
+    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
+
+    template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::BlockVector, DoFHandler<deal_II_dimension> >;
+#endif
+#endif
+    \}
+  \}
+
+  }
+
index c90a8205f6933b0a60351c08633fc01c97480aa0..fb3b8c0628bbdfd1309246898be9e3a832f94e34 100644 (file)
@@ -193,7 +193,6 @@ namespace internal
        size_t (&connectivity_memory_used) (types<2>::connectivity * p4est);
     };
 
-#if deal_II_dimension == 2
     int (&functions<2>::quadrant_compare) (const void *v1, const void *v2)
     = p4est_quadrant_compare;
 
@@ -316,9 +315,7 @@ namespace internal
     size_t (&functions<2>::connectivity_memory_used) (types<2>::connectivity * p4est)
     = p4est_connectivity_memory_used;
 
-#endif
 
-    
     template <> struct functions<3>
     {
        static
@@ -444,8 +441,7 @@ namespace internal
        size_t (&connectivity_memory_used) (types<3>::connectivity * p4est);
     };
 
-#if deal_II_dimension == 3
-    
+
     int (&functions<3>::quadrant_compare) (const void *v1, const void *v2)
     = p8est_quadrant_compare;
 
@@ -570,7 +566,6 @@ namespace internal
     size_t (&functions<3>::connectivity_memory_used) (types<3>::connectivity * p4est)
     = p8est_connectivity_memory_used;
 
-#endif
 
 
     template <int dim>
@@ -1983,12 +1978,11 @@ namespace parallel
 
 
 
-#if deal_II_dimension == 2
-
-    template <int dim, int spacedim>
+    template <>
     void
-    Triangulation<dim,spacedim>::copy_new_triangulation_to_p4est (internal::int2type<2>)
+    Triangulation<2,2>::copy_new_triangulation_to_p4est (internal::int2type<2>)
     {
+      const unsigned int dim = 2, spacedim = 2;
       Assert (this->n_cells(0) > 0, ExcInternalError());
       Assert (this->n_levels() == 1, ExcInternalError());
 
@@ -2057,14 +2051,91 @@ namespace parallel
                    /* user_pointer */ this);
     }
 
+
+
+                               // TODO: This is a verbatim copy of the 2,2
+                               // case. However, we can't just specialize the
+                               // dim template argument, but let spacedim open 
+    template <>
+    void
+    Triangulation<2,3>::copy_new_triangulation_to_p4est (internal::int2type<2>)
+    {
+      const unsigned int dim = 2, spacedim = 3;
+      Assert (this->n_cells(0) > 0, ExcInternalError());
+      Assert (this->n_levels() == 1, ExcInternalError());
+
+                                      // data structures that counts how many
+                                      // cells touch each vertex
+                                      // (vertex_touch_count), and which cells
+                                      // touch a given vertex (together with
+                                      // the local numbering of that vertex
+                                      // within the cells that touch it)
+      std::vector<unsigned int> vertex_touch_count;
+      std::vector<
+      std::list<
+      std::pair<typename Triangulation<dim,spacedim>::active_cell_iterator,
+       unsigned int> > >
+       vertex_to_cell;
+      get_vertex_to_cell_mappings (*this,
+                                  vertex_touch_count,
+                                  vertex_to_cell);
+      const internal::p4est::types<2>::locidx
+       num_vtt = std::accumulate (vertex_touch_count.begin(),
+                                  vertex_touch_count.end(),
+                                  0);
+
+                                      // now create a connectivity
+                                      // object with the right sizes
+                                      // for all arrays. set vertex
+                                      // information only in debug
+                                      // mode (saves a few bytes in
+                                      // optimized mode)
+      const bool set_vertex_info
+#ifdef DEBUG
+       = true
+#else
+       = false
 #endif
+       ;
 
-#if deal_II_dimension == 3
+      connectivity
+       = internal::p4est::functions<2>::
+       connectivity_new ((set_vertex_info == true ? this->n_vertices() : 0),
+                         this->n_cells(0),
+                         this->n_vertices(),
+                         num_vtt);
 
-    template <int dim, int spacedim>
+      set_vertex_and_cell_info (*this,
+                               vertex_touch_count,
+                               vertex_to_cell,
+                               coarse_cell_to_p4est_tree_permutation,
+                               set_vertex_info,
+                               connectivity);
+
+      Assert (p4est_connectivity_is_valid (connectivity) == 1,
+             ExcInternalError());
+
+                                      // now create a forest out of the
+                                      // connectivity data structure
+      parallel_forest
+       = internal::p4est::functions<2>::
+       new_forest (mpi_communicator,
+                   connectivity,
+                   /* minimum initial number of quadrants per tree */ 0,
+                    /* minimum level of upfront refinement */ 0,
+                    /* use uniform upfront refinement */ 1,
+                   /* user_data_size = */ 0,
+                   /* user_data_constructor = */ NULL,
+                   /* user_pointer */ this);
+    }
+
+
+
+    template <>
     void
-    Triangulation<dim,spacedim>::copy_new_triangulation_to_p4est (internal::int2type<3>)
+    Triangulation<3,3>::copy_new_triangulation_to_p4est (internal::int2type<3>)
     {
+      const int dim = 3, spacedim = 3;
       Assert (this->n_cells(0) > 0, ExcInternalError());
       Assert (this->n_levels() == 1, ExcInternalError());
 
@@ -2214,7 +2285,6 @@ namespace parallel
                    /* user_pointer */ this);
     }
 
-#endif
 
 
     template <int dim, int spacedim>
@@ -2686,6 +2756,7 @@ namespace parallel
     types::subdomain_id_t
     Triangulation<dim,spacedim>::locally_owned_subdomain () const
     {
+      Assert (dim > 1, ExcNotImplemented());
       return my_subdomain;
     }
 
@@ -2802,7 +2873,7 @@ namespace parallel
     MPI_Comm
     Triangulation<dim,spacedim>::get_communicator () const
     {
-      return mpi_communicator;
+       return mpi_communicator;
     }
 
 
@@ -2902,48 +2973,75 @@ namespace parallel
                                                     p4est_coarse_cell,
                                                     attached_data_pack_callbacks);
        }
+    }
+
 
 
+                               // TODO: again problems with specialization in
+                               // only one template argument
+    template <>
+    Triangulation<1,1>::Triangulation (MPI_Comm)
+    {
+      Assert (false, ExcNotImplemented());
+    }
 
 
+    template <>
+    Triangulation<1,1>::~Triangulation ()
+    {
+      Assert (false, ExcNotImplemented());
     }
 
 
 
+    template <>
+    types::subdomain_id_t
+    Triangulation<1,1>::locally_owned_subdomain () const
+    {
+      Assert (false, ExcNotImplemented());
+      return 0;
+    }
 
-#if deal_II_dimension == 1
-    template <int spacedim>
-    Triangulation<1,spacedim>::Triangulation (MPI_Comm)
+
+    template <>
+    MPI_Comm
+    Triangulation<1,1>::get_communicator () const
+    {
+      return MPI_COMM_WORLD;
+    }
+
+
+
+    template <>
+    Triangulation<1,2>::Triangulation (MPI_Comm)
     {
       Assert (false, ExcNotImplemented());
     }
 
 
-    template <int spacedim>
-    Triangulation<1,spacedim>::~Triangulation ()
+    template <>
+    Triangulation<1,2>::~Triangulation ()
     {
       Assert (false, ExcNotImplemented());
     }
 
 
 
-    template <int spacedim>
+    template <>
     types::subdomain_id_t
-    Triangulation<1,spacedim>::locally_owned_subdomain () const
+    Triangulation<1,2>::locally_owned_subdomain () const
     {
       Assert (false, ExcNotImplemented());
       return 0;
     }
 
 
-    template <int spacedim>
+    template <>
     MPI_Comm
-    Triangulation<1,spacedim>::get_communicator () const
+    Triangulation<1,2>::get_communicator () const
     {
       return MPI_COMM_WORLD;
     }
-#endif
-
   }
 }
 
@@ -2983,51 +3081,9 @@ namespace parallel
 
 
 
-#ifdef DEAL_II_USE_P4EST
-
-// explicit instantiations
-namespace internal
-{
-  namespace p4est
-  {
-#  if deal_II_dimension > 1
-    template
-    void
-    init_quadrant_children<deal_II_dimension>
-    (const types<deal_II_dimension>::quadrant & p4est_cell,
-     types<deal_II_dimension>::quadrant (&p4est_children)[GeometryInfo<deal_II_dimension>::max_children_per_cell]);
-
-    template
-    void
-    init_coarse_quadrant<deal_II_dimension>
-    (types<deal_II_dimension>::quadrant & quad);
-
-    template
-    bool
-    quadrant_is_equal<deal_II_dimension>
-    (const types<deal_II_dimension>::quadrant & q1,
-     const types<deal_II_dimension>::quadrant & q2);
-
-    template
-    bool
-    quadrant_is_ancestor<deal_II_dimension>
-    (const types<deal_II_dimension>::quadrant & q1,
-     const types<deal_II_dimension>::quadrant & q2);
-#endif
-  }
-}
-namespace parallel
-{
-  namespace distributed
-  {
-    template class Triangulation<deal_II_dimension>;
-#  if deal_II_dimension < 3
-    template class Triangulation<deal_II_dimension, deal_II_dimension+1>;
-#  endif
-  }
-}
 
-#endif // DEAL_II_USE_P4EST
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "tria.inst"
 
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/distributed/tria.inst.in b/deal.II/source/distributed/tria.inst.in
new file mode 100644 (file)
index 0000000..f77f9f4
--- /dev/null
@@ -0,0 +1,64 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+
+#   ifdef DEAL_II_USE_P4EST
+
+    namespace internal
+    \{
+      namespace p4est
+      \{
+#if     deal_II_dimension > 1
+       template
+       void
+       init_quadrant_children<deal_II_dimension>
+       (const types<deal_II_dimension>::quadrant & p4est_cell,
+                types<deal_II_dimension>::quadrant (&p4est_children)[GeometryInfo<deal_II_dimension>::max_children_per_cell]);
+
+       template
+       void
+       init_coarse_quadrant<deal_II_dimension>
+       (types<deal_II_dimension>::quadrant & quad);
+
+       template
+       bool
+       quadrant_is_equal<deal_II_dimension>
+       (const types<deal_II_dimension>::quadrant & q1,
+         const types<deal_II_dimension>::quadrant & q2);
+
+       template
+       bool
+       quadrant_is_ancestor<deal_II_dimension>
+       (const types<deal_II_dimension>::quadrant & q1,
+                const types<deal_II_dimension>::quadrant & q2);
+#      endif
+      \}
+    \}
+    namespace parallel
+    \{
+      namespace distributed
+      \{
+        template class Triangulation<deal_II_dimension>;
+#      if deal_II_dimension < 3
+       template class Triangulation<deal_II_dimension, deal_II_dimension+1>;
+#      endif
+      \}
+    \}
+
+#   endif // DEAL_II_USE_P4EST
+
+  }
+
index 32784952bcc65c86676438f0919275b4baa4bda5..b45135b67041f8e7188671e3eef09e0d8acdb133 100644 (file)
@@ -33,11 +33,11 @@ DEAL_II_NAMESPACE_OPEN
 /*------------------------------- FiniteElement ----------------------*/
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const double FiniteElement<dim,spacedim>::fd_step_length = 1.0e-6;
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::
 InternalDataBase::initialize_2nd (const FiniteElement<dim,spacedim> *element,
@@ -59,7 +59,7 @@ InternalDataBase::initialize_2nd (const FiniteElement<dim,spacedim> *element,
                                   // FEValues objects with slightly
                                   // shifted positions
   std::vector<Point<dim> > diff_points (quadrature.size());
-  
+
   differences.resize(2*dim);
   for (unsigned int d=0; d<dim; ++d)
     {
@@ -82,14 +82,14 @@ InternalDataBase::initialize_2nd (const FiniteElement<dim,spacedim> *element,
        diff_points[i] = quadrature.point(i) - shift;
       const Quadrature<dim> minus_quad (diff_points, quadrature.get_weights());
       differences[d+dim] = new FEValues<dim,spacedim> (mapping, *element,
-                                             minus_quad, update_gradients); 
+                                             minus_quad, update_gradients);
     }
 }
 
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 FiniteElement<dim,spacedim>::InternalDataBase::~InternalDataBase ()
 {
   for (unsigned int i=0; i<differences.size (); ++i)
@@ -106,7 +106,7 @@ FiniteElement<dim,spacedim>::InternalDataBase::~InternalDataBase ()
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 FiniteElement<dim,spacedim>::FiniteElement (
   const FiniteElementData<dim> &fe_data,
   const std::vector<bool> &r_i_a_f,
@@ -119,7 +119,7 @@ FiniteElement<dim,spacedim>::FiniteElement (
                adjust_line_dof_index_for_line_orientation_table (dim == 3 ?
                                                                  this->dofs_per_line : 0),
                 system_to_base_table(this->dofs_per_cell),
-                face_system_to_base_table(this->dofs_per_face),                
+                face_system_to_base_table(this->dofs_per_face),
                 component_to_base_table (this->components,
                                          std::make_pair(std::make_pair(0U, 0U), 0U)),
                 restriction_is_additive_flags(r_i_a_f),
@@ -141,7 +141,7 @@ FiniteElement<dim,spacedim>::FiniteElement (
         = const_cast<std::vector<bool>&> (restriction_is_additive_flags);
        aux.resize(ndofs, restriction_is_additive_flags[0]);
      }
-   
+
    if (nonzero_components.size() == 1 && ndofs > 1)
      {
        std::vector<std::vector<bool> >& aux
@@ -160,8 +160,8 @@ FiniteElement<dim,spacedim>::FiniteElement (
                                       std::bind2nd(std::not_equal_to<unsigned int>(),
                                                    1U))
                         == n_nonzero_components_table.end());
-   
-   
+
+
   Assert (restriction_is_additive_flags.size() == this->dofs_per_cell,
          ExcDimensionMismatch(restriction_is_additive_flags.size(),
                               this->dofs_per_cell));
@@ -179,9 +179,9 @@ FiniteElement<dim,spacedim>::FiniteElement (
       Assert (n_nonzero_components_table[i] >= 1,
              ExcInternalError());
       Assert (n_nonzero_components_table[i] <= this->n_components(),
-             ExcInternalError());      
+             ExcInternalError());
     };
-  
+
                                    // initialize some tables in the
                                   // default way, i.e. if there is
                                   // only one (vector-)component; if
@@ -194,12 +194,12 @@ FiniteElement<dim,spacedim>::FiniteElement (
       for (unsigned int j=0 ; j<this->dofs_per_cell ; ++j)
        {
          system_to_component_table[j] = std::pair<unsigned,unsigned>(0,j);
-         system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);      
+         system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);
        }
       for (unsigned int j=0 ; j<this->dofs_per_face ; ++j)
        {
          face_system_to_component_table[j] = std::pair<unsigned,unsigned>(0,j);
-         face_system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);      
+         face_system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);
        }
     }
                                   // Fill with default value; may be
@@ -229,14 +229,14 @@ FiniteElement<dim,spacedim>::FiniteElement (
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 FiniteElement<dim,spacedim>::~FiniteElement ()
 {}
 
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 double
 FiniteElement<dim,spacedim>::shape_value (const unsigned int,
                                     const Point<dim> &) const
@@ -247,7 +247,7 @@ FiniteElement<dim,spacedim>::shape_value (const unsigned int,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 double
 FiniteElement<dim,spacedim>::shape_value_component (const unsigned int,
                                               const Point<dim> &,
@@ -259,7 +259,7 @@ FiniteElement<dim,spacedim>::shape_value_component (const unsigned int,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<1,dim>
 FiniteElement<dim,spacedim>::shape_grad (const unsigned int,
                                    const Point<dim> &) const
@@ -270,7 +270,7 @@ FiniteElement<dim,spacedim>::shape_grad (const unsigned int,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<1,dim>
 FiniteElement<dim,spacedim>::shape_grad_component (const unsigned int,
                                              const Point<dim> &,
@@ -282,7 +282,7 @@ FiniteElement<dim,spacedim>::shape_grad_component (const unsigned int,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<2,dim>
 FiniteElement<dim,spacedim>::shape_grad_grad (const unsigned int,
                                         const Point<dim> &) const
@@ -293,7 +293,7 @@ FiniteElement<dim,spacedim>::shape_grad_grad (const unsigned int,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<2,dim>
 FiniteElement<dim,spacedim>::shape_grad_grad_component (const unsigned int,
                                                   const Point<dim> &,
@@ -304,7 +304,7 @@ FiniteElement<dim,spacedim>::shape_grad_grad_component (const unsigned int,
 }
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::reinit_restriction_and_prolongation_matrices (
   const bool isotropic_restriction_only,
@@ -314,7 +314,7 @@ FiniteElement<dim,spacedim>::reinit_restriction_and_prolongation_matrices (
        ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
     {
       const unsigned int nc = GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
-      
+
       for (unsigned int i=0; i<nc; ++i)
        {
          if (!isotropic_restriction_only || ref_case==RefinementCase<dim>::isotropic_refinement)
@@ -350,7 +350,7 @@ FiniteElement<dim,spacedim>::get_restriction_matrix (const unsigned int child,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const FullMatrix<double> &
 FiniteElement<dim,spacedim>::get_prolongation_matrix (const unsigned int child,
                                                      const RefinementCase<dim> &refinement_case) const
@@ -372,7 +372,7 @@ FiniteElement<dim,spacedim>::get_prolongation_matrix (const unsigned int child,
 
 
 //TODO:[GK] This is probably not the most efficient way of doing this.
-template <int dim, int spacedim>    
+template <int dim, int spacedim>
 unsigned int
 FiniteElement<dim,spacedim>::component_to_block_index (const unsigned int index) const
 {
@@ -384,30 +384,21 @@ FiniteElement<dim,spacedim>::component_to_block_index (const unsigned int index)
 }
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 unsigned int
 FiniteElement<dim,spacedim>::adjust_quad_dof_index_for_face_orientation (const unsigned int index,
-                                                               const bool,
-                                                               const bool,
-                                                               const bool) const
+                                                                        const bool face_orientation,
+                                                                        const bool face_flip,
+                                                                        const bool face_rotation) const
 {
                                   // general template for 1D and 2D: not
                                   // implemented. in fact, the function
                                   // shouldn't even be called unless we are
                                   // in 3d, so throw an internal error
-  Assert (false, ExcInternalError());
-  return index;
-}
-
-#if deal_II_dimension == 3
+  Assert (dim==3, ExcInternalError());
+  if (dim < 3)
+    return index;
 
-template <>
-unsigned int
-FiniteElement<3>::adjust_quad_dof_index_for_face_orientation (const unsigned int index,
-                                                             const bool face_orientation,
-                                                             const bool face_flip,
-                                                             const bool face_rotation) const
-{
                                   // adjust dofs on 3d faces if the face is
                                   // flipped. note that we query a table that
                                   // derived elements need to have set up
@@ -423,29 +414,20 @@ FiniteElement<3>::adjust_quad_dof_index_for_face_orientation (const unsigned int
   return index+adjust_quad_dof_index_for_face_orientation_table(index,4*face_orientation+2*face_flip+face_rotation);
 }
 
-#endif
-
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 unsigned int
 FiniteElement<dim,spacedim>::adjust_line_dof_index_for_line_orientation (const unsigned int index,
-                                                               const bool) const
+                                                                        const bool line_orientation) const
 {
                                   // general template for 1D and 2D: do
                                   // nothing. Do not throw an Assertion,
                                   // however, in order to allow to call this
                                   // function in 2D as well
-  return index;
-}
-
-#if deal_II_dimension == 3
+  if (dim<3)
+    return index;
 
-template <>
-unsigned int
-FiniteElement<3>::adjust_line_dof_index_for_line_orientation (const unsigned int index,
-                                                             const bool line_orientation) const
-{
   Assert (index<this->dofs_per_line, ExcIndexRange(index,0,this->dofs_per_line));
   Assert (adjust_line_dof_index_for_line_orientation_table.size()==this->dofs_per_line,
          ExcInternalError());
@@ -455,11 +437,9 @@ FiniteElement<3>::adjust_line_dof_index_for_line_orientation (const unsigned int
     return index+adjust_line_dof_index_for_line_orientation_table[index];
 }
 
-#endif
 
 
-
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::prolongation_is_implemented () const
 {
@@ -512,7 +492,7 @@ bool
 FiniteElement<dim,spacedim>::isotropic_prolongation_is_implemented () const
 {
   const RefinementCase<dim> ref_case=RefinementCase<dim>::isotropic_refinement;
-  
+
   for (unsigned int c=0;
        c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case)); ++c)
     {
@@ -531,7 +511,7 @@ FiniteElement<dim,spacedim>::isotropic_prolongation_is_implemented () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::isotropic_restriction_is_implemented () const
 {
@@ -555,7 +535,7 @@ FiniteElement<dim,spacedim>::isotropic_restriction_is_implemented () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::constraints_are_implemented (const internal::SubfaceCase<dim> &subface_case) const
 {
@@ -567,7 +547,7 @@ FiniteElement<dim,spacedim>::constraints_are_implemented (const internal::Subfac
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::hp_constraints_are_implemented () const
 {
@@ -576,27 +556,27 @@ FiniteElement<dim,spacedim>::hp_constraints_are_implemented () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const FullMatrix<double> &
 FiniteElement<dim,spacedim>::constraints (const internal::SubfaceCase<dim> &subface_case) const
 {
   Assert (subface_case==internal::SubfaceCase<dim>::case_isotropic, ExcConstraintsVoid());
   Assert ((this->dofs_per_face  == 0) || (interface_constraints.m() != 0),
           ExcConstraintsVoid());
-  
+
   if (dim==1)
     Assert ((interface_constraints.m()==0) && (interface_constraints.n()==0),
            ExcWrongInterfaceMatrixSize(interface_constraints.m(),
                                        interface_constraints.n()));
-  
+
   return interface_constraints;
 }
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 TableIndices<2>
-FiniteElement<dim,spacedim>::interface_constraints_size () const 
+FiniteElement<dim,spacedim>::interface_constraints_size () const
 {
   switch (dim)
     {
@@ -620,7 +600,7 @@ FiniteElement<dim,spacedim>::interface_constraints_size () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::
 get_interpolation_matrix (const FiniteElement<dim,spacedim> &,
@@ -637,7 +617,7 @@ get_interpolation_matrix (const FiniteElement<dim,spacedim> &,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::
 get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &,
@@ -651,10 +631,10 @@ get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &,
                typename FEE::
                ExcInterpolationNotImplemented());
 }
-                                   
 
-                                   
-template <int dim, int spacedim>  
+
+
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::
 get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &,
@@ -668,10 +648,10 @@ get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &,
   AssertThrow (false,
                typename FEE::ExcInterpolationNotImplemented());
 }
-                                   
 
 
-template <int dim, int spacedim>  
+
+template <int dim, int spacedim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FiniteElement<dim,spacedim>::
 hp_vertex_dof_identities (const FiniteElement<dim,spacedim> &) const
@@ -682,7 +662,7 @@ hp_vertex_dof_identities (const FiniteElement<dim,spacedim> &) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FiniteElement<dim,spacedim>::
 hp_line_dof_identities (const FiniteElement<dim,spacedim> &) const
@@ -693,7 +673,7 @@ hp_line_dof_identities (const FiniteElement<dim,spacedim> &) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FiniteElement<dim,spacedim>::
 hp_quad_dof_identities (const FiniteElement<dim,spacedim> &) const
@@ -704,7 +684,7 @@ hp_quad_dof_identities (const FiniteElement<dim,spacedim> &) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 FiniteElementDomination::Domination
 FiniteElement<dim,spacedim>::
 compare_for_face_domination (const FiniteElement<dim,spacedim> &) const
@@ -715,7 +695,7 @@ compare_for_face_domination (const FiniteElement<dim,spacedim> &) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::operator == (const FiniteElement<dim,spacedim> &f) const
 {
@@ -726,7 +706,7 @@ FiniteElement<dim,spacedim>::operator == (const FiniteElement<dim,spacedim> &f)
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const std::vector<Point<dim> > &
 FiniteElement<dim,spacedim>::get_unit_support_points () const
 {
@@ -742,7 +722,7 @@ FiniteElement<dim,spacedim>::get_unit_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::has_support_points () const
 {
@@ -751,7 +731,7 @@ FiniteElement<dim,spacedim>::has_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const std::vector<Point<dim> > &
 FiniteElement<dim,spacedim>::get_generalized_support_points () const
 {
@@ -766,7 +746,7 @@ FiniteElement<dim,spacedim>::get_generalized_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::has_generalized_support_points () const
 {
@@ -775,7 +755,7 @@ FiniteElement<dim,spacedim>::has_generalized_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Point<dim>
 FiniteElement<dim,spacedim>::unit_support_point (const unsigned index) const
 {
@@ -788,7 +768,7 @@ FiniteElement<dim,spacedim>::unit_support_point (const unsigned index) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const std::vector<Point<dim-1> > &
 FiniteElement<dim,spacedim>::get_unit_face_support_points () const
 {
@@ -804,7 +784,7 @@ FiniteElement<dim,spacedim>::get_unit_face_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::has_face_support_points () const
 {
@@ -813,7 +793,7 @@ FiniteElement<dim,spacedim>::has_face_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const std::vector<Point<dim-1> > &
 FiniteElement<dim,spacedim>::get_generalized_face_support_points () const
 {
@@ -828,7 +808,7 @@ FiniteElement<dim,spacedim>::get_generalized_face_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::has_generalized_face_support_points () const
 {
@@ -837,7 +817,7 @@ FiniteElement<dim,spacedim>::has_generalized_face_support_points () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Point<dim-1>
 FiniteElement<dim,spacedim>::unit_face_support_point (const unsigned index) const
 {
@@ -849,7 +829,7 @@ FiniteElement<dim,spacedim>::unit_face_support_point (const unsigned index) cons
 }
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FiniteElement<dim,spacedim>::has_support_on_face (
   const unsigned int,
@@ -859,7 +839,7 @@ FiniteElement<dim,spacedim>::has_support_on_face (
 }
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::interpolate(
   std::vector<double>&       local_dofs,
@@ -872,14 +852,14 @@ FiniteElement<dim,spacedim>::interpolate(
          ExcDimensionMismatch(local_dofs.size(),this->dofs_per_cell));
   Assert (this->n_components() == 1,
          ExcDimensionMismatch(this->n_components(), 1));
-  
+
   std::copy(values.begin(), values.end(), local_dofs.begin());
 }
 
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::interpolate(
   std::vector<double>&    local_dofs,
@@ -893,7 +873,7 @@ FiniteElement<dim,spacedim>::interpolate(
          ExcDimensionMismatch(local_dofs.size(),this->dofs_per_cell));
   Assert (values[0].size() >= offset+this->n_components(),
          ExcDimensionMismatch(values[0].size(),offset+this->n_components()));
-  
+
   for (unsigned int i=0;i<this->dofs_per_cell;++i)
     {
       const std::pair<unsigned int, unsigned int> index
@@ -905,7 +885,7 @@ FiniteElement<dim,spacedim>::interpolate(
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::interpolate(
   std::vector<double>& local_dofs,
@@ -918,7 +898,7 @@ FiniteElement<dim,spacedim>::interpolate(
          ExcDimensionMismatch(local_dofs.size(),this->dofs_per_cell));
   Assert (values.size() == this->n_components(),
          ExcDimensionMismatch(values.size(), this->n_components()));
-  
+
   for (unsigned int i=0;i<this->dofs_per_cell;++i)
     {
       const std::pair<unsigned int, unsigned int> index
@@ -929,8 +909,7 @@ FiniteElement<dim,spacedim>::interpolate(
 
 
 
-
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 unsigned int
 FiniteElement<dim,spacedim>::memory_consumption () const
 {
@@ -941,7 +920,7 @@ FiniteElement<dim,spacedim>::memory_consumption () const
          MemoryConsumption::memory_consumption (system_to_component_table) +
          MemoryConsumption::memory_consumption (face_system_to_component_table) +
          MemoryConsumption::memory_consumption (system_to_base_table) +
-         MemoryConsumption::memory_consumption (face_system_to_base_table) +     
+         MemoryConsumption::memory_consumption (face_system_to_base_table) +
          MemoryConsumption::memory_consumption (component_to_base_table) +
          MemoryConsumption::memory_consumption (restriction_is_additive_flags) +
          MemoryConsumption::memory_consumption (nonzero_components) +
@@ -949,8 +928,6 @@ FiniteElement<dim,spacedim>::memory_consumption () const
 }
 
 
-#if deal_II_dimension == 1
-
 template<>
 void
 FiniteElement<1,2>::compute_2nd (
@@ -965,9 +942,7 @@ FiniteElement<1,2>::compute_2nd (
        Assert(false, ExcNotImplemented());
 }
 
-#endif
 
-#if deal_II_dimension == 2
 
 template<>
 void
@@ -983,9 +958,9 @@ FiniteElement<2,3>::compute_2nd (
        Assert(false, ExcNotImplemented());
 }
 
-#endif
 
-template <int dim, int spacedim>  
+
+template <int dim, int spacedim>
 void
 FiniteElement<dim,spacedim>::compute_2nd (
   const Mapping<dim,spacedim>                   &mapping,
@@ -999,7 +974,7 @@ FiniteElement<dim,spacedim>::compute_2nd (
          & update_hessians,
          ExcInternalError());
 
-// make sure we have as many entries as there are nonzero components  
+// make sure we have as many entries as there are nonzero components
 //  Assert (data.shape_hessians.size() ==
 //         std::accumulate (n_nonzero_components_table.begin(),
 //                        n_nonzero_components_table.end(),
@@ -1098,7 +1073,7 @@ FiniteElement<dim,spacedim>::compute_2nd (
                   left  = fe_internal.differences[d1+dim]
                           ->shape_grad_component(shape_index, q+offset, component);
                 };
-              
+
                                                // compute the second
                                                // derivative from a
                                                // symmetric difference
@@ -1106,7 +1081,7 @@ FiniteElement<dim,spacedim>::compute_2nd (
               for (unsigned int d=0; d<dim; ++d)
                 diff_quot[d][q][d1] = 1./(2*fd_step_length) * (right[d]-left[d]);
             }
-        
+
                                          // up to now we still have
                                          // difference quotients on the
                                          // unit cell, so transform it
@@ -1119,7 +1094,7 @@ FiniteElement<dim,spacedim>::compute_2nd (
                     ExcInternalError());
             mapping.transform (diff_quot[d], diff_quot2,
                               mapping_internal, mapping_covariant);
-            
+
             for (unsigned int q=0; q<n_q_points; ++q)
               for (unsigned int d1=0; d1<dim; ++d1)
                 data.shape_hessians[total_index][q][d][d1]
@@ -1130,7 +1105,7 @@ FiniteElement<dim,spacedim>::compute_2nd (
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::vector<unsigned int>
 FiniteElement<dim,spacedim>::compute_n_nonzero_components (
   const std::vector<std::vector<bool> > &nonzero_components)
@@ -1147,7 +1122,7 @@ FiniteElement<dim,spacedim>::compute_n_nonzero_components (
 
 /*------------------------------- FiniteElement ----------------------*/
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 typename Mapping<dim,spacedim>::InternalDataBase *
 FiniteElement<dim,spacedim>::get_face_data (const UpdateFlags       flags,
                                   const Mapping<dim,spacedim>      &mapping,
@@ -1159,7 +1134,7 @@ FiniteElement<dim,spacedim>::get_face_data (const UpdateFlags       flags,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 typename Mapping<dim,spacedim>::InternalDataBase *
 FiniteElement<dim,spacedim>::get_subface_data (const UpdateFlags        flags,
                                      const Mapping<dim,spacedim>      &mapping,
@@ -1171,7 +1146,7 @@ FiniteElement<dim,spacedim>::get_subface_data (const UpdateFlags        flags,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const FiniteElement<dim,spacedim>&
 FiniteElement<dim,spacedim>::base_element(const unsigned index) const
 {
@@ -1179,16 +1154,10 @@ FiniteElement<dim,spacedim>::base_element(const unsigned index) const
   return *this;
 }
 
-/*------------------------------- Explicit Instantiations -------------*/
-
-template class FiniteElement<deal_II_dimension>;
-
-
-#if deal_II_dimension != 3
-template class FiniteElement<deal_II_dimension,deal_II_dimension+1>;
-#endif
 
 
+/*------------------------------- Explicit Instantiations -------------*/
+#include "fe.inst"
 
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe.inst.in b/deal.II/source/fe/fe.inst.in
new file mode 100644 (file)
index 0000000..656bd44
--- /dev/null
@@ -0,0 +1,23 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FiniteElement<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+    template class FiniteElement<deal_II_dimension,deal_II_dimension+1>;
+#endif
+  }
+
index ea2c3a1ca904804bcb8de5fbecc48c8d0ac828bb..6c14d14e8fe787ec57993aef3af15b592f58abab 100644 (file)
@@ -55,7 +55,7 @@ FE_ABF<dim>::FE_ABF (const unsigned int deg)
 {
   Assert (dim >= 2, ExcImpossibleInDim(dim));
   const unsigned int n_dofs = this->dofs_per_cell;
-  
+
   this->mapping_type = mapping_piola;
                                   // First, initialize the
                                   // generalized support points and
@@ -74,7 +74,7 @@ FE_ABF<dim>::FE_ABF (const unsigned int deg)
                                   // From now on, the shape functions
                                   // will be the correct ones, not
                                   // the raw shape functions anymore.
-  
+
                                   // Reinit the vectors of
                                   // restriction and prolongation
                                   // matrices to the right sizes.
@@ -123,7 +123,7 @@ FE_ABF<dim>::get_name () const
 #else
   std::ostrstream namebuf;
 #endif
-  
+
   namebuf << "FE_ABF<" << dim << ">(" << rt_order << ")";
 
 #ifndef HAVE_STD_STRINGSTREAM
@@ -147,38 +147,6 @@ FE_ABF<dim>::clone() const
 //---------------------------------------------------------------------------
 
 
-#if deal_II_dimension == 1
-
-template <int dim>
-void
-FE_ABF<dim>::initialize_support_points (const unsigned int deg)
-{
-  return;
-  
-  Assert (false, ExcNotImplemented());
-  
-  QGauss<dim> cell_quadrature(deg+1);
-  const unsigned int n_interior_points
-    = (deg>0) ? cell_quadrature.size() : 0;
-  
-  this->generalized_support_points.resize (2 + n_interior_points);
-  
-                                  // Number of the point being entered
-  unsigned int current = 0;
-
-  
-  if (deg==0) return;
-
-  interior_weights.reinit(TableIndices<3>(2+n_interior_points, 0, dim));
-  
-  for (unsigned int k=0;k<cell_quadrature.size();++k)
-    this->generalized_support_points[current++] = cell_quadrature.point(k);
-  
-  Assert (current == this->generalized_support_points.size(),
-         ExcInternalError());
-}
-
-#else
 
 // Version for 2d and higher. See above for 1d version
 template <int dim>
@@ -219,14 +187,14 @@ FE_ABF<dim>::initialize_support_points (const unsigned int deg)
   if (dim>1)
     {
       QGauss<dim-1> face_points (deg+1);
-      TensorProductPolynomials<dim-1> legendre
-       Polynomials::Legendre::generate_complete_basis(deg);
+      TensorProductPolynomials<dim-1> legendre =
+       Polynomials::Legendre::generate_complete_basis(deg);
 
       boundary_weights.reinit(n_face_points, legendre.n());
-      
+
 //       Assert (face_points.size() == this->dofs_per_face,
 //           ExcInternalError());
-      
+
       for (unsigned int k=0;k<n_face_points;++k)
        {
          this->generalized_face_support_points[k] = face_points.point(k);
@@ -266,13 +234,13 @@ FE_ABF<dim>::initialize_support_points (const unsigned int deg)
            }
        }
     }
-  
+
   // Create Legendre basis for the
   // space D_xi Q_k
   if (deg>0)
     {
       std::vector<AnisotropicPolynomials<dim>* > polynomials(dim);
-      
+
       for (unsigned int dd=0;dd<dim;++dd)
        {
          std::vector<std::vector<Polynomials::Polynomial<double> > > poly(dim);
@@ -282,9 +250,9 @@ FE_ABF<dim>::initialize_support_points (const unsigned int deg)
 
          polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
        }
-      
+
       interior_weights.reinit(TableIndices<3>(n_interior_points, polynomials[0]->n(), dim));
-      
+
       for (unsigned int k=0;k<cell_quadrature.size();++k)
        {
          for (unsigned int i=0;i<polynomials[0]->n();++i)
@@ -292,13 +260,13 @@ FE_ABF<dim>::initialize_support_points (const unsigned int deg)
              interior_weights(k,i,d) = cell_quadrature.weight(k)
                * polynomials[d]->compute_value(i,cell_quadrature.point(k));
        }
-      
+
       for (unsigned int d=0;d<dim;++d)
        delete polynomials[d];
     }
-  
 
-  // Decouple the creation of the generalized support points 
+
+  // Decouple the creation of the generalized support points
   // from computation of interior weights.
   for (unsigned int k=0;k<cell_quadrature.size();++k)
     this->generalized_support_points[current++] = cell_quadrature.point(k);
@@ -307,7 +275,7 @@ FE_ABF<dim>::initialize_support_points (const unsigned int deg)
   // TODO: Here the canonical extension of the principle
   // behind the ABF elements is implemented. It is unclear,
   // if this really leads to the ABF spaces in 3D!
-  interior_weights_abf.reinit(TableIndices<3>(cell_quadrature.size(), 
+  interior_weights_abf.reinit(TableIndices<3>(cell_quadrature.size(),
                                              polynomials_abf[0]->n() * dim, dim));
   Tensor<1, dim> poly_grad;
 
@@ -330,21 +298,7 @@ FE_ABF<dim>::initialize_support_points (const unsigned int deg)
          ExcInternalError());
 }
 
-#endif
-
 
-#if deal_II_dimension == 1
-
-template <int dim>
-void
-FE_ABF<dim>::initialize_restriction()
-{
-  unsigned int iso=RefinementCase<dim>::isotropic_refinement-1;
-  for (unsigned int i=0;i<GeometryInfo<dim>::max_children_per_cell;++i)
-    this->restriction[iso][i].reinit(0,0);
-}
-
-#else
 
 // This function is the same Raviart-Thomas interpolation performed by
 // interpolate. Still, we cannot use interpolate, since it was written
@@ -360,6 +314,13 @@ template <int dim>
 void
 FE_ABF<dim>::initialize_restriction()
 {
+  if (dim==1)
+    {
+      unsigned int iso=RefinementCase<dim>::isotropic_refinement-1;
+      for (unsigned int i=0;i<GeometryInfo<dim>::max_children_per_cell;++i)
+       this->restriction[iso][i].reinit(0,0);
+      return;
+    }
   unsigned int iso=RefinementCase<dim>::isotropic_refinement-1;
   QGauss<dim-1> q_base (rt_order+1);
   const unsigned int n_face_points = q_base.size();
@@ -394,7 +355,7 @@ FE_ABF<dim>::initialize_restriction()
          const unsigned int child
            = GeometryInfo<dim>::child_cell_on_face(
              RefinementCase<dim>::isotropic_refinement, face, sub);
-         
+
                                           // On a certain face, we must
                                           // compute the moments of ALL
                                           // fine level functions with
@@ -426,9 +387,9 @@ FE_ABF<dim>::initialize_restriction()
                }
        }
     }
-  
+
   if (rt_order==0) return;
-  
+
                                   // Create Legendre basis for the
                                   // space D_xi Q_k. Here, we cannot
                                   // use the shape functions
@@ -442,7 +403,7 @@ FE_ABF<dim>::initialize_restriction()
 
       polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
     }
-  
+
   QGauss<dim> q_cell(rt_order+1);
   const unsigned int start_cell_dofs
     = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
@@ -455,11 +416,11 @@ FE_ABF<dim>::initialize_restriction()
     for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
       for (unsigned int d=0;d<dim;++d)
        cached_values(i,k,d) = this->shape_value_component(i, q_cell.point(k), d);
-  
+
   for (unsigned int child=0;child<GeometryInfo<dim>::max_children_per_cell;++child)
     {
       Quadrature<dim> q_sub = QProjector<dim>::project_to_child(q_cell, child);
-      
+
       for (unsigned int k=0;k<q_sub.size();++k)
        for (unsigned int i_child = 0; i_child < this->dofs_per_cell; ++i_child)
          for (unsigned int d=0;d<dim;++d)
@@ -472,30 +433,23 @@ FE_ABF<dim>::initialize_restriction()
                  * polynomials[d]->compute_value(i_weight, q_sub.point(k));
              }
     }
-  
+
   for (unsigned int d=0;d<dim;++d)
     delete polynomials[d];
 }
 
-#endif
-
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_ABF<1>::get_dpo_vector (const unsigned int)
-{
-  Assert (false, ExcImpossibleInDim(1));
-  return std::vector<unsigned int>();
-}
-
-#endif
 
 
 template <int dim>
 std::vector<unsigned int>
 FE_ABF<dim>::get_dpo_vector (const unsigned int rt_order)
 {
+  if (dim == 1)
+    {
+      Assert (false, ExcImpossibleInDim(1));
+      return std::vector<unsigned int>();
+    }
+
                                    // the element is face-based (not
                                    // to be confused with George
                                    // W. Bush's Faith Based
@@ -508,11 +462,11 @@ FE_ABF<dim>::get_dpo_vector (const unsigned int rt_order)
                                    // and then there are interior dofs
   const unsigned int
     interior_dofs = dim*(rt_order+1)*dofs_per_face;
-  
+
   std::vector<unsigned int> dpo(dim+1);
   dpo[dim-1] = dofs_per_face;
   dpo[dim]   = interior_dofs;
-  
+
   return dpo;
 }
 
@@ -542,7 +496,7 @@ FE_ABF<dim>::update_each (const UpdateFlags flags) const
                                      | update_piola
                                      | update_JxW_values;
   if (flags & update_gradients)
-    out |= update_gradients          | update_covariant_transformation 
+    out |= update_gradients          | update_covariant_transformation
                                      | update_piola
                                      | update_JxW_values;
   //TODO: Set update flags appropriately and figure out, how the second
@@ -617,16 +571,16 @@ FE_ABF<dim>::has_support_on_face (const unsigned int shape_index,
                                                // these in a table
               return (face_index != GeometryInfo<dim>::opposite_face[shape_index]);
             }
-            
+
             default:
              return true;
           };
       };
-      
+
       default:  // other rt_order
        return true;
     };
-  
+
   return true;
 }
 
@@ -667,10 +621,10 @@ FE_ABF<dim>::interpolate(
        local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
                         * values[face*n_face_points+k](GeometryInfo<dim>::unit_normal_direction[face]+offset);
       }
-  
+
   const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
   const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
-  
+
   for (unsigned int k=0;k<interior_weights.size(0);++k)
     for (unsigned int i=0;i<interior_weights.size(1);++i)
       for (unsigned int d=0;d<dim;++d)
@@ -693,7 +647,7 @@ FE_ABF<dim>::interpolate(
          // TODO: Check what the face_orientation, face_flip and face_rotation  have to be in 3D
          unsigned int k = QProjector<dim>::DataSetDescriptor::face (face, false, false, false, n_face_points);
          for (unsigned int i=0; i<boundary_weights_abf.size(1); ++i)
-           local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i) 
+           local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i)
              * values[k + fp](GeometryInfo<dim>::unit_normal_direction[face]+offset);
        }
     }
@@ -727,7 +681,7 @@ FE_ABF<dim>::interpolate(
        local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
                         * values[GeometryInfo<dim>::unit_normal_direction[face]][face*n_face_points+k];
       }
-  
+
   const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
   const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
 
@@ -753,7 +707,7 @@ FE_ABF<dim>::interpolate(
          // TODO: Check what the face_orientation, face_flip and face_rotation have to be in 3D
          unsigned int k = QProjector<dim>::DataSetDescriptor::face (face, false, false, false, n_face_points);
          for (unsigned int i=0; i<boundary_weights_abf.size(1); ++i)
-           local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i) 
+           local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i)
              * values[GeometryInfo<dim>::unit_normal_direction[face]][k + fp];
        }
     }
@@ -774,6 +728,8 @@ FE_ABF<dim>::memory_consumption () const
 }
 
 
-template class FE_ABF<deal_II_dimension>;
+
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "fe_abf.inst"
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_abf.inst.in b/deal.II/source/fe/fe_abf.inst.in
new file mode 100644 (file)
index 0000000..39c7426
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_ABF<deal_II_dimension>;
+  }
+
index 724e3779fe395a8bc6bc4234e9b2f22e56ff5ea8..be985b7cf4ad5e89f49cd09abd8c0aedf7f380b7 100644 (file)
@@ -27,6 +27,9 @@
 #include <iostream>
 #include <sstream>
 
+
+DEAL_II_NAMESPACE_OPEN
+
 template <int dim>
 FE_BDM<dim>::FE_BDM (const unsigned int deg)
                :
@@ -206,21 +209,6 @@ FE_BDM<dim>::interpolate(
 
 
 
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_BDM<1>::get_dpo_vector (const unsigned int deg)
-{
-  std::vector<unsigned int> dpo(2);
-  dpo[0] = 1;
-  dpo[1] = deg;
-  return dpo;
-}
-
-#endif
-
-
 template <int dim>
 std::vector<unsigned int>
 FE_BDM<dim>::get_dpo_vector (const unsigned int deg)
@@ -233,7 +221,7 @@ FE_BDM<dim>::get_dpo_vector (const unsigned int deg)
 
                                    // and then there are interior dofs
   unsigned int
-    interior_dofs = dim*deg*(deg-1)/2;
+    interior_dofs = dim==1?deg:dim*deg*(deg-1)/2;
   if (dim>2)
     {
       interior_dofs *= deg-2;
@@ -249,23 +237,16 @@ FE_BDM<dim>::get_dpo_vector (const unsigned int deg)
 
 
 
-#if deal_II_dimension == 1
-
-template <>
-std::vector<bool>
-FE_BDM<1>::get_ria_vector (const unsigned int)
-{
-  Assert (false, ExcImpossibleInDim(1));
-  return std::vector<bool>();
-}
-
-#endif
-
-
 template <int dim>
 std::vector<bool>
 FE_BDM<dim>::get_ria_vector (const unsigned int deg)
 {
+  if (dim==1)
+    {
+      Assert (false, ExcImpossibleInDim(1));
+      return std::vector<bool>();
+    }
+
   Assert(dim==2, ExcNotImplemented());
   const unsigned int dofs_per_cell = PolynomialsBDM<dim>::compute_n_pols(deg);
   const unsigned int dofs_per_face = deg+1;
@@ -374,5 +355,8 @@ FE_BDM<dim>::initialize_support_points (const unsigned int deg)
 }
 
 
-template class FE_BDM<deal_II_dimension>;
 
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "fe_bdm.inst"
+
+DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_bdm.inst.in b/deal.II/source/fe/fe_bdm.inst.in
new file mode 100644 (file)
index 0000000..314d27c
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_BDM<deal_II_dimension>;
+  }
+
index 9c2c7d8f81ef518824eb5b0653de02b93a5a3041..3cc8624b4c9d97f7265c4b9e71dc701d0ebd2945 100644 (file)
 
 DEAL_II_NAMESPACE_OPEN
 
-template class FE_DGVector<PolynomialsABF<deal_II_dimension>, deal_II_dimension>;
-template class FE_DGVector<PolynomialsBDM<deal_II_dimension>, deal_II_dimension>;
-template class FE_DGVector<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
-template class FE_DGVector<PolynomialsRaviartThomas<deal_II_dimension>, deal_II_dimension>;
+#include "fe_dg_vector.inst"
 
 DEAL_II_NAMESPACE_CLOSE
 
diff --git a/deal.II/source/fe/fe_dg_vector.inst.in b/deal.II/source/fe/fe_dg_vector.inst.in
new file mode 100644 (file)
index 0000000..7fbb81a
--- /dev/null
@@ -0,0 +1,22 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_DGVector<PolynomialsABF<deal_II_dimension>, deal_II_dimension>;
+    template class FE_DGVector<PolynomialsBDM<deal_II_dimension>, deal_II_dimension>;
+    template class FE_DGVector<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
+    template class FE_DGVector<PolynomialsRaviartThomas<deal_II_dimension>, deal_II_dimension>;
+  }
+
index 9470a0bb6547a45863f777ca51128753d4cb97ef..802c3cd3c69c6467b9670a94343817c2b6d11086 100644 (file)
@@ -53,7 +53,7 @@ FE_DGP<dim,spacedim>::get_name () const
                                   // this function returns, so they
                                   // have to be kept in synch
 
-  std::ostringstream namebuf;  
+  std::ostringstream namebuf;
   namebuf << "FE_DGP<" << dim << ">(" << this->degree << ")";
 
   return namebuf.str();
@@ -110,7 +110,7 @@ get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
                (dynamic_cast<const FEDGP*>(&x_source_fe) != 0),
                typename FE::
                ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.m() == 0,
          ExcDimensionMismatch (interpolation_matrix.m(),
                                0));
@@ -141,7 +141,7 @@ get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe
                (dynamic_cast<const FEDGP*>(&x_source_fe) != 0),
                typename FE::
                ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.m() == 0,
          ExcDimensionMismatch (interpolation_matrix.m(),
                                0));
@@ -257,10 +257,8 @@ FE_DGP<dim,spacedim>::memory_consumption () const
 
 
 
-template class FE_DGP<deal_II_dimension>;
+// explicit instantiations
+#include "fe_dgp.inst"
 
-#if deal_II_dimension != 3
-template class FE_DGP<deal_II_dimension, deal_II_dimension+1>;
-#endif
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_dgp.inst.in b/deal.II/source/fe/fe_dgp.inst.in
new file mode 100644 (file)
index 0000000..053e3a3
--- /dev/null
@@ -0,0 +1,23 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_DGP<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+    template class FE_DGP<deal_II_dimension, deal_II_dimension+1>;
+#endif
+  }
+
index 03c88b2729653f98da04ac458b857f57e3640adf..d7af3c4a8d2eb3d19abb74defd3cfc0ac80ba6d6 100644 (file)
 DEAL_II_NAMESPACE_OPEN
 
 // namespace for some functions that are used in this file.
-namespace 
+namespace
 {
                                   // storage of hand-chosen support
                                   // points
                                   //
-#if deal_II_dimension == 2
                                   // For dim=2, dofs_per_cell of
                                   // FE_DGPMonomial(k) is given by
                                   // 0.5(k+1)(k+2), i.e.
-                                  // 
+                                  //
                                   // k    0  1  2  3  4  5  6  7
                                   // dofs 1  3  6 10 15 21 28 36
-                                  // 
+                                  //
                                   // indirect access of unit points:
                                   // the points for degree k are
                                   // located at
@@ -45,13 +44,11 @@ namespace
    {0,0},{1,0},{0,1},{1,1},{1./3.,0},{2./3.,0},{0,1./3.},{0,2./3.},{0.5,1},{1,0.5},
    {0,0},{1,0},{0,1},{1,1},{0.25,0},{0.5,0},{0.75,0},{0,0.25},{0,0.5},{0,0.75},{1./3.,1},{2./3.,1},{1,1./3.},{1,2./3.},{0.5,0.5}
   };
-#endif
 
-#if deal_II_dimension == 3
                                   // For dim=3, dofs_per_cell of
                                   // FE_DGPMonomial(k) is given by
                                   // 1./6.(k+1)(k+2)(k+3), i.e.
-                                  // 
+                                  //
                                   // k    0  1  2  3  4  5  6   7
                                   // dofs 1  4 10 20 35 56 84 120
   const unsigned int start_index3d[6]={0,1,5,15/*,35*/};
@@ -60,14 +57,12 @@ namespace
    {0,0,0},{1,0,0},{0,1,0},{0,0,1},
    {0,0,0},{1,0,0},{0,1,0},{0,0,1},{0.5,0,0},{0,0.5,0},{0,0,0.5},{1,1,0},{1,0,1},{0,1,1}
   };
-#endif
 
-  
+
   template<int dim>
   void generate_unit_points (const unsigned int,
                             std::vector<Point<dim> > &);
 
-#if deal_II_dimension == 1
   template <>
   void generate_unit_points (const unsigned int k,
                             std::vector<Point<1> > &p)
@@ -77,9 +72,7 @@ namespace
     for (unsigned int i=0; i<p.size(); ++i)
       p[i](0)=i*h;
   }
-#endif
-  
-#if deal_II_dimension == 2
+
   template <>
   void generate_unit_points (const unsigned int k,
                             std::vector<Point<2> > &p)
@@ -92,9 +85,7 @@ namespace
        p[i](1)=points2d[start_index2d[k]+i][1];
       }
   }
-#endif
-  
-#if deal_II_dimension == 3
+
   template <>
   void generate_unit_points (const unsigned int k,
                             std::vector<Point<3> > &p)
@@ -108,7 +99,6 @@ namespace
        p[i](2)=points3d[start_index3d[k]+i][2];
       }
   }
-#endif
 }
 
 
@@ -125,7 +115,7 @@ FE_DGPMonomial<dim>::FE_DGPMonomial (const unsigned int degree)
 {
   Assert(this->poly_space.n()==this->dofs_per_cell, ExcInternalError());
   Assert(this->poly_space.degree()==this->degree, ExcInternalError());
-  
+
                                   // DG doesn't have constraints, so
                                   // leave them empty
 
@@ -175,7 +165,7 @@ void
 FE_DGPMonomial<dim>::
 get_interpolation_matrix (const FiniteElement<dim> &source_fe,
                          FullMatrix<double>           &interpolation_matrix) const
-{  
+{
   const FE_DGPMonomial<dim> *source_dgp_monomial
     = dynamic_cast<const FE_DGPMonomial<dim> *>(&source_fe);
 
@@ -189,11 +179,11 @@ get_interpolation_matrix (const FiniteElement<dim> &source_fe,
       Assert (m == this->dofs_per_cell, ExcDimensionMismatch (m, this->dofs_per_cell));
       Assert (n == source_dgp_monomial->dofs_per_cell,
              ExcDimensionMismatch (n, source_dgp_monomial->dofs_per_cell));
-      
+
       const unsigned int min_mn=
        interpolation_matrix.m()<interpolation_matrix.n() ?
        interpolation_matrix.m() : interpolation_matrix.n();
-      
+
       for (unsigned int i=0; i<min_mn; ++i)
        interpolation_matrix(i,i)=1.;
     }
@@ -213,7 +203,7 @@ get_interpolation_matrix (const FiniteElement<dim> &source_fe,
          this_matrix(k,j)=this->poly_space.compute_value (j, unit_points[k]);
 
       this_matrix.gauss_jordan();
-      
+
       this_matrix.mmult(interpolation_matrix, source_fe_matrix);
     }
 }
@@ -265,7 +255,7 @@ get_face_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
                typename FiniteElement<dim>::
                ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.m() == 0,
          ExcDimensionMismatch (interpolation_matrix.m(),
                                0));
@@ -294,7 +284,7 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                (dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
                typename FiniteElement<dim>::
                ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.m() == 0,
          ExcDimensionMismatch (interpolation_matrix.m(),
                                0));
@@ -389,8 +379,6 @@ compare_for_face_domination (const FiniteElement<dim> &fe_other) const
 
 
 
-#if deal_II_dimension == 1
-
 template <>
 bool
 FE_DGPMonomial<1>::has_support_on_face (const unsigned int,
@@ -399,9 +387,7 @@ FE_DGPMonomial<1>::has_support_on_face (const unsigned int,
   return face_index==1 || (face_index==0 && this->degree==0);
 }
 
-#endif
 
-#if deal_II_dimension == 2
 
 template <>
 bool
@@ -422,9 +408,7 @@ FE_DGPMonomial<2>::has_support_on_face (const unsigned int shape_index,
   return support_on_face;
 }
 
-#endif
 
-#if deal_II_dimension == 3
 
 template <>
 bool
@@ -446,7 +430,6 @@ FE_DGPMonomial<3>::has_support_on_face (const unsigned int shape_index,
   return support_on_face;
 }
 
-#endif
 
 
 template <int dim>
@@ -459,6 +442,8 @@ FE_DGPMonomial<dim>::memory_consumption () const
 
 
 
-template class FE_DGPMonomial<deal_II_dimension>;
+// explicit instantiations
+#include "fe_dgp_monomial.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_dgp_monomial.inst.in b/deal.II/source/fe/fe_dgp_monomial.inst.in
new file mode 100644 (file)
index 0000000..401fe4d
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_DGPMonomial<deal_II_dimension>;
+  }
+
index 369d8ba1c684e431d580f0c2a77530c12f87fe8a..1c2a80173a227f6b5d5c669edce3d947a76769cf 100644 (file)
@@ -24,7 +24,7 @@
 
 DEAL_II_NAMESPACE_OPEN
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 FE_DGPNonparametric<dim,spacedim>::FE_DGPNonparametric (const unsigned int degree)
                :
                FiniteElement<dim,spacedim> (
@@ -47,7 +47,7 @@ FE_DGPNonparametric<dim,spacedim>::FE_DGPNonparametric (const unsigned int degre
                                         // refinement is not
                                         // implemented so far
        continue;
-      
+
       const unsigned int nc = GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
       for (unsigned int i=0;i<nc;++i)
        {
@@ -90,7 +90,7 @@ FE_DGPNonparametric<dim,spacedim>::FE_DGPNonparametric (const unsigned int degre
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::string
 FE_DGPNonparametric<dim,spacedim>::get_name () const
 {
@@ -109,7 +109,7 @@ FE_DGPNonparametric<dim,spacedim>::get_name () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 FiniteElement<dim,spacedim> *
 FE_DGPNonparametric<dim,spacedim>::clone() const
 {
@@ -118,7 +118,7 @@ FE_DGPNonparametric<dim,spacedim>::clone() const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 double
 FE_DGPNonparametric<dim,spacedim>::shape_value (const unsigned int i,
                          const Point<dim> &p) const
@@ -129,7 +129,7 @@ FE_DGPNonparametric<dim,spacedim>::shape_value (const unsigned int i,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 double
 FE_DGPNonparametric<dim,spacedim>::shape_value_component (const unsigned int i,
                                    const Point<dim> &p,
@@ -142,7 +142,7 @@ FE_DGPNonparametric<dim,spacedim>::shape_value_component (const unsigned int i,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<1,dim>
 FE_DGPNonparametric<dim,spacedim>::shape_grad (const unsigned int i,
                         const Point<dim> &p) const
@@ -152,7 +152,7 @@ FE_DGPNonparametric<dim,spacedim>::shape_grad (const unsigned int i,
 }
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<1,dim>
 FE_DGPNonparametric<dim,spacedim>::shape_grad_component (const unsigned int i,
                                   const Point<dim> &p,
@@ -165,7 +165,7 @@ FE_DGPNonparametric<dim,spacedim>::shape_grad_component (const unsigned int i,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<2,dim>
 FE_DGPNonparametric<dim,spacedim>::shape_grad_grad (const unsigned int i,
                              const Point<dim> &p) const
@@ -176,7 +176,7 @@ FE_DGPNonparametric<dim,spacedim>::shape_grad_grad (const unsigned int i,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 Tensor<2,dim>
 FE_DGPNonparametric<dim,spacedim>::shape_grad_grad_component (const unsigned int i,
                                        const Point<dim> &p,
@@ -193,7 +193,7 @@ FE_DGPNonparametric<dim,spacedim>::shape_grad_grad_component (const unsigned int
 //---------------------------------------------------------------------------
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::vector<unsigned int>
 FE_DGPNonparametric<dim,spacedim>::get_dpo_vector (const unsigned int deg)
 {
@@ -208,7 +208,7 @@ FE_DGPNonparametric<dim,spacedim>::get_dpo_vector (const unsigned int deg)
 }
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 UpdateFlags
 FE_DGPNonparametric<dim,spacedim>::update_once (const UpdateFlags) const
 {
@@ -221,7 +221,7 @@ FE_DGPNonparametric<dim,spacedim>::update_once (const UpdateFlags) const
 }
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 UpdateFlags
 FE_DGPNonparametric<dim,spacedim>::update_each (const UpdateFlags flags) const
 {
@@ -238,7 +238,7 @@ FE_DGPNonparametric<dim,spacedim>::update_each (const UpdateFlags flags) const
 // Data field initialization
 //---------------------------------------------------------------------------
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 typename Mapping<dim,spacedim>::InternalDataBase *
 FE_DGPNonparametric<dim,spacedim>::get_data (
   const UpdateFlags      update_flags,
@@ -283,7 +283,7 @@ FE_DGPNonparametric<dim,spacedim>::get_data (
 // Fill data of FEValues
 //---------------------------------------------------------------------------
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FE_DGPNonparametric<dim,spacedim>::fill_fe_values (
   const Mapping<dim,spacedim>&,
@@ -326,7 +326,7 @@ FE_DGPNonparametric<dim,spacedim>::fill_fe_values (
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FE_DGPNonparametric<dim,spacedim>::fill_fe_face_values (
   const Mapping<dim,spacedim>&,
@@ -349,7 +349,7 @@ FE_DGPNonparametric<dim,spacedim>::fill_fe_face_values (
   Assert (flags & update_quadrature_points, ExcInternalError());
 
   const unsigned int n_q_points = data.quadrature_points.size();
-  
+
   if (flags & (update_values | update_gradients))
     for (unsigned int i=0; i<n_q_points; ++i)
       {
@@ -369,7 +369,7 @@ FE_DGPNonparametric<dim,spacedim>::fill_fe_face_values (
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FE_DGPNonparametric<dim,spacedim>::fill_fe_subface_values (
   const Mapping<dim,spacedim>&,
@@ -388,12 +388,12 @@ FE_DGPNonparametric<dim,spacedim>::fill_fe_subface_values (
   Assert (dynamic_cast<InternalData *> (&fedata) != 0,
          ExcInternalError());
   InternalData &fe_data = static_cast<InternalData &> (fedata);
-  
+
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
   Assert (flags & update_quadrature_points, ExcInternalError());
 
   const unsigned int n_q_points = data.quadrature_points.size();
-  
+
   if (flags & (update_values | update_gradients))
     for (unsigned int i=0; i<n_q_points; ++i)
       {
@@ -413,7 +413,7 @@ FE_DGPNonparametric<dim,spacedim>::fill_fe_subface_values (
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 unsigned int
 FE_DGPNonparametric<dim,spacedim>::n_base_elements () const
 {
@@ -422,7 +422,7 @@ FE_DGPNonparametric<dim,spacedim>::n_base_elements () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 const FiniteElement<dim,spacedim> &
 FE_DGPNonparametric<dim,spacedim>::base_element (const unsigned int index) const
 {
@@ -432,7 +432,7 @@ FE_DGPNonparametric<dim,spacedim>::base_element (const unsigned int index) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 unsigned int
 FE_DGPNonparametric<dim,spacedim>::element_multiplicity (const unsigned int index) const
 {
@@ -442,7 +442,7 @@ FE_DGPNonparametric<dim,spacedim>::element_multiplicity (const unsigned int inde
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FE_DGPNonparametric<dim,spacedim>::
 get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
@@ -460,7 +460,7 @@ get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
                (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != 0),
                typename FEE::
                ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.m() == 0,
          ExcDimensionMismatch (interpolation_matrix.m(),
                                0));
@@ -471,7 +471,7 @@ get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 void
 FE_DGPNonparametric<dim,spacedim>::
 get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
@@ -490,7 +490,7 @@ get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe
                (dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != 0),
                typename FEE::
               ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.m() == 0,
          ExcDimensionMismatch (interpolation_matrix.m(),
                                0));
@@ -501,7 +501,7 @@ get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FE_DGPNonparametric<dim,spacedim>::hp_constraints_are_implemented () const
 {
@@ -510,7 +510,7 @@ FE_DGPNonparametric<dim,spacedim>::hp_constraints_are_implemented () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FE_DGPNonparametric<dim,spacedim>::
 hp_vertex_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
@@ -529,7 +529,7 @@ hp_vertex_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FE_DGPNonparametric<dim,spacedim>::
 hp_line_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
@@ -548,7 +548,7 @@ hp_line_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FE_DGPNonparametric<dim,spacedim>::
 hp_quad_dof_identities (const FiniteElement<dim,spacedim>        &fe_other) const
@@ -567,7 +567,7 @@ hp_quad_dof_identities (const FiniteElement<dim,spacedim>        &fe_other) cons
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 FiniteElementDomination::Domination
 FE_DGPNonparametric<dim,spacedim>::
 compare_for_face_domination (const FiniteElement<dim,spacedim> &fe_other) const
@@ -585,7 +585,7 @@ compare_for_face_domination (const FiniteElement<dim,spacedim> &fe_other) const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 bool
 FE_DGPNonparametric<dim,spacedim>::has_support_on_face (const unsigned int,
                                  const unsigned int) const
@@ -595,7 +595,7 @@ FE_DGPNonparametric<dim,spacedim>::has_support_on_face (const unsigned int,
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 unsigned int
 FE_DGPNonparametric<dim,spacedim>::memory_consumption () const
 {
@@ -605,7 +605,7 @@ FE_DGPNonparametric<dim,spacedim>::memory_consumption () const
 
 
 
-template <int dim, int spacedim>  
+template <int dim, int spacedim>
 unsigned int
 FE_DGPNonparametric<dim,spacedim>::get_degree () const
 {
@@ -614,7 +614,8 @@ FE_DGPNonparametric<dim,spacedim>::get_degree () const
 
 
 
+// explicit instantiations
+#include "fe_dgp_nonparametric.inst"
 
-template class FE_DGPNonparametric<deal_II_dimension>;
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_dgp_nonparametric.inst.in b/deal.II/source/fe/fe_dgp_nonparametric.inst.in
new file mode 100644 (file)
index 0000000..7e6cfe9
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_DGPNonparametric<deal_II_dimension>;
+  }
+
index 6afd3a0832ace2dabf2b6a56efe4b4002865cdd0..4a5c3192ef369c50f42492271bbc08469d32663e 100644 (file)
@@ -752,14 +752,8 @@ FE_DGQArbitraryNodes<dim>::clone() const
 
 
 
-template class FE_DGQ<deal_II_dimension>;
+// explicit instantiations
+#include "fe_dgq.inst"
 
-//codimension 1
-
-#if deal_II_dimension != 3
-template class FE_DGQ<deal_II_dimension, deal_II_dimension+1>;
-#endif
-
-template class FE_DGQArbitraryNodes<deal_II_dimension>;
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_dgq.inst.in b/deal.II/source/fe/fe_dgq.inst.in
new file mode 100644 (file)
index 0000000..00c3243
--- /dev/null
@@ -0,0 +1,25 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_DGQ<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+    template class FE_DGQ<deal_II_dimension, deal_II_dimension+1>;
+#endif
+
+    template class FE_DGQArbitraryNodes<deal_II_dimension>;
+  }
+
index 2d293c27edf31aa37b8c83363cc8d8a83859f014..011c9dfe3ac20c6fc71ea9f2ea28aad9f6a70354 100644 (file)
@@ -46,7 +46,7 @@ FE_FaceQ<dim,spacedim>::get_name () const
                                   // this function returns, so they
                                   // have to be kept in synch
 
-  std::ostringstream namebuf;  
+  std::ostringstream namebuf;
   namebuf << "FE_FaceQ<" << dim << ">(" << this->degree << ")";
 
   return namebuf.str();
@@ -62,8 +62,8 @@ FE_FaceQ<dim,spacedim>::has_support_on_face (
 {
   return (face_index == (shape_index/this->dofs_per_face));
 }
-                 
-                 
+
+
 template <int dim, int spacedim>
 std::vector<unsigned int>
 FE_FaceQ<dim,spacedim>::get_dpo_vector (const unsigned int deg)
@@ -76,13 +76,9 @@ FE_FaceQ<dim,spacedim>::get_dpo_vector (const unsigned int deg)
 }
 
 
-                 
 
-#if deal_II_dimension > 1
-                 template class FE_PolyFace<TensorProductPolynomials<deal_II_dimension-1> >;
-//template class FE_PolyFace<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
-//template class FE_PolyFace<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
-                 template class FE_FaceQ<deal_II_dimension>;
-#endif
-                 
+// explicit instantiations
+#include "fe_face.inst"
+
+
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_face.inst.in b/deal.II/source/fe/fe_face.inst.in
new file mode 100644 (file)
index 0000000..631a8f5
--- /dev/null
@@ -0,0 +1,24 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+#if deal_II_dimension > 1
+    template class FE_PolyFace<TensorProductPolynomials<deal_II_dimension-1> >;
+    //template class FE_PolyFace<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
+    //template class FE_PolyFace<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
+    template class FE_FaceQ<deal_II_dimension>;
+#endif
+  }
+
index 47b4c721f5cc94a9ccfc0f8a4828ee075227e36c..e904eb39c016945955113f0c3bff67779dcc8549 100644 (file)
@@ -173,7 +173,6 @@ FiniteElement<dim>
 //---------------------------------------------------------------------------
 
 
-#if deal_II_dimension == 1
 
                    // Set the generalized support
                    // points and precompute the
@@ -188,14 +187,14 @@ FE_Nedelec<1>::initialize_support_points (const unsigned int)
   Assert (false, ExcNotImplemented ());
 }
 
-#elif deal_II_dimension == 2
+
 
 template <>
 void
 FE_Nedelec<2>::initialize_support_points (const unsigned int degree)
 {
   const int dim = 2;
-  
+
                       // Create polynomial basis.
   const std::vector<Polynomials::Polynomial<double> >& lobatto_polynomials
     = Polynomials::Lobatto::generate_complete_basis (degree + 1);
@@ -280,14 +279,14 @@ FE_Nedelec<2>::initialize_support_points (const unsigned int degree)
     }
 }
 
-#else
+
 
 template <>
 void
 FE_Nedelec<3>::initialize_support_points (const unsigned int degree)
 {
   const int dim = 3;
-  
+
                       // Create polynomial basis.
   const std::vector<Polynomials::Polynomial<double> >& lobatto_polynomials
     = Polynomials::Lobatto::generate_complete_basis (degree + 1);
@@ -460,11 +459,8 @@ FE_Nedelec<3>::initialize_support_points (const unsigned int degree)
     }
 }
 
-#endif
 
 
-#if deal_II_dimension == 1
-
                    // Set the restriction matrices.
 template <>
 void
@@ -476,7 +472,7 @@ FE_Nedelec<1>::initialize_restriction ()
     this->restriction[0][i].reinit(0, 0);
 }
 
-#endif
+
 
                    // Restriction operator
 template <int dim>
@@ -496,7 +492,7 @@ FE_Nedelec<dim>::initialize_restriction ()
     n_edge_quadrature_points = edge_quadrature.size ();
   const unsigned int
     index = RefinementCase<dim>::isotropic_refinement - 1;
-  
+
   switch (dim)
     {
       case 2:
@@ -510,12 +506,12 @@ FE_Nedelec<dim>::initialize_restriction ()
                  ++q_point)
               {
                 const double weight = 2.0 * edge_quadrature.weight (q_point);
-                
+
                 if (edge_quadrature_points[q_point] (0) < 0.5)
                   {
                     Point<dim> quadrature_point (0.0,
                                                  2.0 * edge_quadrature_points[q_point] (0));
-                    
+
                     this->restriction[index][0] (0, dof) += weight
                                                          * this->shape_value_component
                                                            (dof,
@@ -538,13 +534,13 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                quadrature_point,
                                                                0);
                   }
-                
+
                 else
                   {
                     Point<dim> quadrature_point (0.0,
                                                 2.0 * edge_quadrature_points[q_point] (0)
                                                     - 1.0);
-                    
+
                     this->restriction[index][2] (0, dof) += weight
                                                          * this->shape_value_component
                                                            (dof,
@@ -568,7 +564,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                0);
                   }
               }
-          
+
                         // Then project the shape functions
                         // of the child cells to the higher
                         // order shape functions of the
@@ -579,38 +575,38 @@ FE_Nedelec<dim>::initialize_restriction ()
                 legendre_polynomials
                   = Polynomials::Legendre::generate_complete_basis (deg);
               FullMatrix<double> system_matrix_inv (deg, deg);
-              
+
               {
                 FullMatrix<double> assembling_matrix (deg,
                                                       n_edge_quadrature_points);
-                
+
                 for (unsigned int q_point = 0;
                      q_point < n_edge_quadrature_points; ++q_point)
                   {
                     const double weight
                       = std::sqrt (edge_quadrature.weight (q_point));
-                    
+
                     for (unsigned int i = 0; i < deg; ++i)
                       assembling_matrix (i, q_point) = weight
                                                        * legendre_polynomials[i + 1].value
                                                         (edge_quadrature_points[q_point] (0));
                   }
-                
+
                 FullMatrix<double> system_matrix (deg, deg);
-                
+
                 assembling_matrix.mTmult (system_matrix, assembling_matrix);
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               FullMatrix<double> solution (deg, 4);
               FullMatrix<double> system_rhs (deg, 4);
               Vector<double> tmp (4);
-              
+
               for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
                 for (unsigned int i = 0; i < 2; ++i)
                   {
                     system_rhs = 0.0;
-                    
+
                     for (unsigned int q_point = 0;
                          q_point < n_edge_quadrature_points; ++q_point)
                       {
@@ -621,12 +617,12 @@ FE_Nedelec<dim>::initialize_restriction ()
                         const Point<dim> quadrature_point_1
                                             (edge_quadrature_points[q_point] (0),
                                              i);
-                        
+
                         if (edge_quadrature_points[q_point] (0) < 0.5)
                           {
                             Point<dim> quadrature_point_2 (i,
                                                                   2.0 * edge_quadrature_points[q_point] (0));
-                            
+
                             tmp (0) = weight
                                       * (2.0 * this->shape_value_component
                                                   (dof, quadrature_point_2, 1)
@@ -659,7 +655,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                 ((i + 2) * this->degree,
                                                  quadrature_point_1, 0);
                           }
-                        
+
                         else
                           {
                             tmp (0) = -1.0 * weight
@@ -668,11 +664,11 @@ FE_Nedelec<dim>::initialize_restriction ()
                                               * this->shape_value_component
                                                 (i * this->degree,
                                                  quadrature_point_0, 1);
-                            
+
                             Point<dim> quadrature_point_2 (i,
                                                                   2.0 * edge_quadrature_points[q_point] (0)
                                                                       - 1.0);
-                            
+
                             tmp (1) = weight
                                          * (2.0 * this->shape_value_component
                                                   (dof, quadrature_point_2, 1)
@@ -699,20 +695,20 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                   ((i + 2) * this->degree,
                                                    quadrature_point_1, 0));
                           }
-                        
+
                         for (unsigned int j = 0; j < deg; ++j)
                           {
                             const double L_j
                               = legendre_polynomials[j + 1].value
                                 (edge_quadrature_points[q_point] (0));
-                            
+
                             for (unsigned int k = 0; k < tmp.size (); ++k)
                               system_rhs (j, k) += tmp (k) * L_j;
                           }
                       }
-                    
+
                     system_matrix_inv.mmult (solution, system_rhs);
-                    
+
                     for (unsigned int j = 0; j < deg; ++j)
                       for (unsigned int k = 0; k < 2; ++k)
                         {
@@ -720,14 +716,14 @@ FE_Nedelec<dim>::initialize_restriction ()
                             this->restriction[index][i + 2 * k]
                             (i * this->degree + j + 1, dof)
                               = solution (j, k);
-                          
+
                           if (std::abs (solution (j, k + 2)) > 1e-14)
                             this->restriction[index][2 * i + k]
                             ((i + 2) * this->degree + j + 1, dof)
                               = solution (j, k + 2);
                         }
                   }
-              
+
               const QGauss<dim> quadrature (2 * this->degree);
               const std::vector<Point<dim> >&
                 quadrature_points = quadrature.get_points ();
@@ -738,51 +734,51 @@ FE_Nedelec<dim>::initialize_restriction ()
               const unsigned int n_boundary_dofs
                 = GeometryInfo<dim>::faces_per_cell * this->degree;
               const unsigned int& n_quadrature_points = quadrature.size ();
-              
+
               {
                 FullMatrix<double> assembling_matrix (deg * this->degree,
                                                       n_quadrature_points);
-                
+
                 for (unsigned int q_point = 0; q_point < n_quadrature_points;
                      ++q_point)
                   {
                     const double weight
                       = std::sqrt (quadrature.weight (q_point));
-                    
+
                     for (unsigned int i = 0; i <= deg; ++i)
                       {
                         const double L_i = weight
                                            * legendre_polynomials[i].value
                                              (quadrature_points[q_point] (0));
-                        
+
                         for (unsigned int j = 0; j < deg; ++j)
                           assembling_matrix (i * deg + j, q_point)
                             = L_i * lobatto_polynomials[j + 2].value
                                     (quadrature_points[q_point] (1));
                       }
                   }
-                
+
                 FullMatrix<double> system_matrix (assembling_matrix.m (),
                                                   assembling_matrix.m ());
-                
+
                 assembling_matrix.mTmult (system_matrix, assembling_matrix);
                 system_matrix_inv.reinit (system_matrix.m (), system_matrix.m ());
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               solution.reinit (system_matrix_inv.m (), 8);
               system_rhs.reinit (system_matrix_inv.m (), 8);
               tmp.reinit (8);
-              
+
               for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
                 {
                   system_rhs = 0.0;
-                  
+
                   for (unsigned int q_point = 0;
                        q_point < n_quadrature_points; ++q_point)
                     {
                       tmp = 0.0;
-                      
+
                       if (quadrature_points[q_point] (0) < 0.5)
                         {
                           if (quadrature_points[q_point] (1) < 0.5)
@@ -790,27 +786,27 @@ FE_Nedelec<dim>::initialize_restriction ()
                               const Point<dim> quadrature_point
                                                (2.0 * quadrature_points[q_point] (0),
                                                 2.0 * quadrature_points[q_point] (1));
-                              
+
                               tmp (0) += 2.0 * this->shape_value_component
                                                (dof, quadrature_point, 0);
                               tmp (1) += 2.0 * this->shape_value_component
                                                (dof, quadrature_point, 1);
                             }
-                          
+
                           else
                             {
                               const Point<dim> quadrature_point
                                                (2.0 * quadrature_points[q_point] (0),
                                                 2.0 * quadrature_points[q_point] (1)
                                                     - 1.0);
-                              
+
                               tmp (4) += 2.0 * this->shape_value_component
                                                (dof, quadrature_point, 0);
                               tmp (5) += 2.0 * this->shape_value_component
                                                (dof, quadrature_point, 1);
                             }
                         }
-                      
+
                       else
                         if (quadrature_points[q_point] (1) < 0.5)
                           {
@@ -818,13 +814,13 @@ FE_Nedelec<dim>::initialize_restriction ()
                                              (2.0 * quadrature_points[q_point] (0)
                                                   - 1.0,
                                               2.0 * quadrature_points[q_point] (1));
-                            
+
                             tmp (2) += 2.0 * this->shape_value_component
                                              (dof, quadrature_point, 0);
                             tmp (3) += 2.0 * this->shape_value_component
                                              (dof, quadrature_point, 1);
                           }
-                        
+
                         else
                           {
                             const Point<dim> quadrature_point
@@ -832,13 +828,13 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                   - 1.0,
                                               2.0 * quadrature_points[q_point] (1)
                                                   - 1.0);
-                            
+
                             tmp (6) += 2.0 * this->shape_value_component
                                              (dof, quadrature_point, 0);
                             tmp (7) += 2.0 * this->shape_value_component
                                              (dof, quadrature_point, 1);
                           }
-                      
+
                       for (unsigned int i = 0; i < 2; ++i)
                         for (unsigned int j = 0; j <= deg; ++j)
                           {
@@ -864,9 +860,9 @@ FE_Nedelec<dim>::initialize_restriction ()
                                               (i * this->degree + j,
                                                quadrature_points[q_point], 1);
                           }
-                      
+
                       tmp *= quadrature.weight (q_point);
-                      
+
                       for (unsigned int i = 0; i <= deg; ++i)
                         {
                           const double L_i_0
@@ -875,7 +871,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                           const double L_i_1
                             = legendre_polynomials[i].value
                               (quadrature_points[q_point] (1));
-                          
+
                           for (unsigned int j = 0; j < deg; ++j)
                             {
                               const double l_j_0
@@ -884,7 +880,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                               const double l_j_1
                                 = L_i_1 * lobatto_polynomials[j + 2].value
                                           (quadrature_points[q_point] (0));
-                              
+
                               for (unsigned int k = 0; k < 4; ++k)
                                 {
                                   system_rhs (i * deg + j, 2 * k)
@@ -895,9 +891,9 @@ FE_Nedelec<dim>::initialize_restriction ()
                             }
                         }
                     }
-                  
+
                   system_matrix_inv.mmult (solution, system_rhs);
-                  
+
                   for (unsigned int i = 0; i <= deg; ++i)
                     for (unsigned int j = 0; j < deg; ++j)
                       for (unsigned int k = 0; k < 4; ++k)
@@ -907,7 +903,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                             this->restriction[index][k]
                             (i * deg + j + n_boundary_dofs, dof)
                               = solution (i * deg + j, 2 * k);
-                          
+
                           if (std::abs (solution (i * deg + j, 2 * k + 1))
                                 > 1e-14)
                             this->restriction[index][k]
@@ -932,7 +928,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                  ++q_point)
               {
                 const double weight = 2.0 * edge_quadrature.weight (q_point);
-                
+
                 if (edge_quadrature_points[q_point] (0) < 0.5)
                   for (unsigned int i = 0; i < 2; ++i)
                     for (unsigned int j = 0; j < 2; ++j)
@@ -940,7 +936,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                         Point<dim> quadrature_point (i,
                                                      2.0 * edge_quadrature_points[q_point] (0),
                                                      j);
-                        
+
                         this->restriction[index][i + 4 * j]
                         ((i + 4 * j) * this->degree, dof)
                           += weight * this->shape_value_component (dof,
@@ -962,7 +958,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                    quadrature_point,
                                                                    2);
                       }
-                    
+
                     else
                       for (unsigned int i = 0; i < 2; ++i)
                         for (unsigned int j = 0; j < 2; ++j)
@@ -970,7 +966,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                             Point<dim> quadrature_point (i,
                                                          2.0 * edge_quadrature_points[q_point] (0)
                                                              - 1.0, j);
-                            
+
                             this->restriction[index][i + 4 * j + 2]
                             ((i + 4 * j) * this->degree, dof)
                               += weight * this->shape_value_component (dof,
@@ -994,7 +990,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                        2);
                           }
               }
-                      
+
                         // Then project the shape functions
                         // of the child cells to the higher
                         // order shape functions of the
@@ -1005,39 +1001,39 @@ FE_Nedelec<dim>::initialize_restriction ()
                 legendre_polynomials
                   = Polynomials::Legendre::generate_complete_basis (deg);
               FullMatrix<double> system_matrix_inv (deg, deg);
-              
+
               {
                 FullMatrix<double> assembling_matrix (deg,
                                                       n_edge_quadrature_points);
-                
+
                 for (unsigned int q_point = 0;
                      q_point < n_edge_quadrature_points; ++q_point)
                   {
                     const double weight = std::sqrt (edge_quadrature.weight
                                                      (q_point));
-                    
+
                     for (unsigned int i = 0; i < deg; ++i)
                       assembling_matrix (i, q_point) = weight
                                                       * legendre_polynomials[i + 1].value
                                                         (edge_quadrature_points[q_point] (0));
                   }
-                
+
                 FullMatrix<double> system_matrix (deg, deg);
-                
+
                 assembling_matrix.mTmult (system_matrix, assembling_matrix);
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               FullMatrix<double> solution (deg, 6);
               FullMatrix<double> system_rhs (deg, 6);
               Vector<double> tmp (6);
-              
+
               for (unsigned int i = 0; i < 2; ++i)
                 for (unsigned int j = 0; j < 2; ++j)
                   for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
                     {
                       system_rhs = 0.0;
-                      
+
                       for (unsigned int q_point = 0;
                            q_point < n_edge_quadrature_points; ++q_point)
                         {
@@ -1051,13 +1047,13 @@ FE_Nedelec<dim>::initialize_restriction ()
                             (edge_quadrature_points[q_point] (0), i, j);
                           const Point<dim> quadrature_point_2 (i, j,
                                                                edge_quadrature_points[q_point] (0));
-                          
+
                           if (edge_quadrature_points[q_point] (0) < 0.5)
                             {
                               Point<dim> quadrature_point_3 (i,
                                                              2.0 * edge_quadrature_points[q_point] (0),
                                                              j);
-                              
+
                               tmp (0) = weight
                                         * (2.0 * this->shape_value_component
                                                  (dof, quadrature_point_3, 1)
@@ -1112,7 +1108,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                ((i + 2 * (j + 4)) * this->degree,
                                                 quadrature_point_2, 2);
                             }
-                          
+
                           else
                             {
                               tmp (0) = -1.0 * weight
@@ -1122,11 +1118,11 @@ FE_Nedelec<dim>::initialize_restriction ()
                                              * this->shape_value_component
                                                ((i + 4 * j) * this->degree,
                                                 quadrature_point_0, 1);
-                              
+
                               Point<dim> quadrature_point_3 (i,
                                                              2.0 * edge_quadrature_points[q_point] (0)
                                                                  - 1.0, j);
-                              
+
                               tmp (1) = weight
                                         * (2.0 * this->shape_value_component
                                                  (dof, quadrature_point_3, 1)
@@ -1175,20 +1171,20 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                  ((i + 2 * (j + 4)) * this->degree,
                                                   quadrature_point_2, 2));
                             }
-                          
+
                           for (unsigned int k = 0; k < deg; ++k)
                             {
                               const double L_k
                                 = legendre_polynomials[k + 1].value
                                   (edge_quadrature_points[q_point] (0));
-                              
+
                               for (unsigned int l = 0; l < tmp.size (); ++l)
                                 system_rhs (k, l) += tmp (l) * L_k;
                             }
                         }
-                      
+
                       system_matrix_inv.mmult (solution, system_rhs);
-                      
+
                       for (unsigned int k = 0; k < 2; ++k)
                         for (unsigned int l = 0; l < deg; ++l)
                           {
@@ -1196,12 +1192,12 @@ FE_Nedelec<dim>::initialize_restriction ()
                               this->restriction[index][i + 2 * (2 * j + k)]
                               ((i + 4 * j) * this->degree + l + 1, dof)
                                 = solution (l, k);
-                            
+
                             if (std::abs (solution (l, k + 2)) > 1e-14)
                               this->restriction[index][2 * (i + 2 * j) + k]
                               ((i + 4 * j + 2) * this->degree + l + 1, dof)
                                 = solution (l, k + 2);
-                            
+
                             if (std::abs (solution (l, k + 4)) > 1e-14)
                               this->restriction[index][i + 2 * (j + 2 * k)]
                               ((i + 2 * (j + 4)) * this->degree + l + 1,
@@ -1209,7 +1205,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                 = solution (l, k + 4);
                           }
                     }
-              
+
               const QGauss<2> face_quadrature (2 * this->degree);
               const std::vector<Point<2> >& face_quadrature_points
                 = face_quadrature.get_points ();
@@ -1221,55 +1217,55 @@ FE_Nedelec<dim>::initialize_restriction ()
                 = GeometryInfo<dim>::lines_per_cell * this->degree;
               const unsigned int& n_face_quadrature_points
                 = face_quadrature.size ();
-              
+
               {
                 FullMatrix<double> assembling_matrix
                                    (deg * this->degree,
                                     n_face_quadrature_points);
-                
+
                 for (unsigned int q_point = 0;
                      q_point < n_face_quadrature_points; ++q_point)
                   {
                     const double weight
                       = std::sqrt (face_quadrature.weight (q_point));
-                    
+
                     for (unsigned int i = 0; i <= deg; ++i)
                       {
                         const double L_i = weight
                                            * legendre_polynomials[i].value
                                              (face_quadrature_points[q_point] (0));
-                        
+
                         for (unsigned int j = 0; j < deg; ++j)
                           assembling_matrix (i * deg + j, q_point)
                             = L_i * lobatto_polynomials[j + 2].value
                                     (face_quadrature_points[q_point] (1));
                       }
                   }
-                
+
                 FullMatrix<double> system_matrix (assembling_matrix.m (),
                                                   assembling_matrix.m ());
-                
+
                 assembling_matrix.mTmult (system_matrix,
                                           assembling_matrix);
                 system_matrix_inv.reinit (system_matrix.m (),
                                           system_matrix.m ());
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               solution.reinit (system_matrix_inv.m (), 24);
               system_rhs.reinit (system_matrix_inv.m (), 24);
               tmp.reinit (24);
-              
+
               for (unsigned int i = 0; i < 2; ++i)
                 for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
                   {
                     system_rhs = 0.0;
-                    
+
                     for (unsigned int q_point = 0;
                          q_point < n_face_quadrature_points; ++q_point)
                       {
                         tmp = 0.0;
-                        
+
                         if (face_quadrature_points[q_point] (0) < 0.5)
                           {
                             if (face_quadrature_points[q_point] (1) < 0.5)
@@ -1277,7 +1273,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                 Point<dim> quadrature_point_0 (i,
                                                                   2.0 * face_quadrature_points[q_point] (0),
                                                                   2.0 * face_quadrature_points[q_point] (1));
-                                
+
                                 tmp (0) += 2.0 * this->shape_value_component
                                                  (dof, quadrature_point_0, 1);
                                 tmp (1) += 2.0 * this->shape_value_component
@@ -1299,14 +1295,14 @@ FE_Nedelec<dim>::initialize_restriction ()
                                 tmp (17) += 2.0 * this->shape_value_component
                                                   (dof, quadrature_point_0, 1);
                               }
-                            
+
                             else
                               {
                                 Point<dim> quadrature_point_0 (i,
                                                                   2.0 * face_quadrature_points[q_point] (0),
                                                                   2.0 * face_quadrature_points[q_point] (1)
                                                                       - 1.0);
-                                
+
                                 tmp (2) += 2.0 * this->shape_value_component
                                                  (dof, quadrature_point_0, 1);
                                 tmp (3) += 2.0 * this->shape_value_component
@@ -1330,7 +1326,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                   (dof, quadrature_point_0, 1);
                               }
                           }
-                        
+
                         else
                           if (face_quadrature_points[q_point] (1) < 0.5)
                             {
@@ -1338,7 +1334,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                              2.0 * face_quadrature_points[q_point] (0)
                                                                  - 1.0,
                                                              2.0 * face_quadrature_points[q_point] (1));
-                              
+
                               tmp (4) += 2.0 * this->shape_value_component
                                                (dof, quadrature_point_0, 1);
                               tmp (5) += 2.0 * this->shape_value_component
@@ -1361,7 +1357,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                               tmp (21) += 2.0 * this->shape_value_component
                                                 (dof, quadrature_point_0, 1);
                             }
-                          
+
                           else
                             {
                               Point<dim> quadrature_point_0 (i,
@@ -1369,7 +1365,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                  - 1.0,
                                                              2.0 * face_quadrature_points[q_point] (1)
                                                                  - 1.0);
-                              
+
                               tmp (6) += 2.0 * this->shape_value_component
                                                (dof, quadrature_point_0, 1);
                               tmp (7) += 2.0 * this->shape_value_component
@@ -1393,7 +1389,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                               tmp (23) += 2.0 * this->shape_value_component
                                                 (dof, quadrature_point_0, 1);
                             }
-                        
+
                         const Point<dim> quadrature_point_0 (i,
                                                              face_quadrature_points[q_point] (0),
                                                              face_quadrature_points[q_point] (1));
@@ -1405,7 +1401,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                          (face_quadrature_points[q_point] (0),
                                           face_quadrature_points[q_point] (1),
                                           i);
-                        
+
                         for (unsigned int j = 0; j < 2; ++j)
                           for (unsigned int k = 0; k < 2; ++k)
                             for (unsigned int l = 0; l <= deg; ++l)
@@ -1451,9 +1447,9 @@ FE_Nedelec<dim>::initialize_restriction ()
                                     ((4 * i + k) * this->degree + l,
                                      quadrature_point_2, 1);
                               }
-                        
+
                         tmp *= face_quadrature.weight (q_point);
-                        
+
                         for (unsigned int j = 0; j <= deg; ++j)
                           {
                             const double L_j_0
@@ -1462,7 +1458,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                             const double L_j_1
                               = legendre_polynomials[j].value
                                 (face_quadrature_points[q_point] (1));
-                            
+
                             for (unsigned int k = 0; k < deg; ++k)
                               {
                                 const double l_k_0
@@ -1471,7 +1467,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                 const double l_k_1
                                   = L_j_1 * lobatto_polynomials[k + 2].value
                                             (face_quadrature_points[q_point] (0));
-                                
+
                                 for (unsigned int l = 0; l < 4; ++l)
                                   {
                                     system_rhs (j * deg + k, 2 * l)
@@ -1490,9 +1486,9 @@ FE_Nedelec<dim>::initialize_restriction ()
                               }
                           }
                       }
-                    
+
                     system_matrix_inv.mmult (solution, system_rhs);
-                    
+
                     for (unsigned int j = 0; j < 2; ++j)
                       for (unsigned int k = 0; k < 2; ++k)
                         for (unsigned int l = 0; l <= deg; ++l)
@@ -1503,10 +1499,10 @@ FE_Nedelec<dim>::initialize_restriction ()
                                     > 1e-14)
                                 this->restriction[index][i + 2 * (2 * j + k)]
                                 ((2 * i * this->degree + l) * deg + m
-                                                            + n_edge_dofs, 
+                                                            + n_edge_dofs,
                                  dof) = solution (l * deg + m,
                                                   2 * (j + 2 * k));
-                              
+
                                if (std::abs (solution (l * deg + m,
                                                        2 * (j + 2 * k) + 1))
                                      > 1e-14)
@@ -1515,7 +1511,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                           + n_edge_dofs, dof)
                                    = solution (l * deg + m,
                                                2 * (j + 2 * k) + 1);
-                               
+
                                if (std::abs (solution (l * deg + m,
                                                        2 * (j + 2 * (k + 2))))
                                      > 1e-14)
@@ -1524,7 +1520,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                    + n_edge_dofs,
                                   dof) = solution (l * deg + m,
                                                    2 * (j + 2 * (k + 2)));
-                               
+
                                if (std::abs (solution (l * deg + m,
                                                        2 * (j + 2 * k) + 9))
                                      > 1e-14)
@@ -1533,7 +1529,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                           + n_edge_dofs, dof)
                                    = solution (l * deg + m,
                                                2 * (j + 2 * k) + 9);
-                               
+
                                if (std::abs (solution (l * deg + m,
                                                        2 * (j + 2 * (k + 4))))
                                      > 1e-14)
@@ -1542,7 +1538,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                    + n_edge_dofs,
                                   dof) = solution (l * deg + m,
                                                    2 * (j + 2 * (k + 4)));
-                               
+
                                if (std::abs (solution (l * deg + m,
                                                        2 * (j + 2 * k) + 17))
                                      > 1e-14)
@@ -1553,7 +1549,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                2 * (j + 2 * k) + 17);
                              }
                   }
-              
+
               const QGauss<dim> quadrature (2 * this->degree);
               const std::vector<Point<dim> >&
                 quadrature_points = quadrature.get_points ();
@@ -1561,30 +1557,30 @@ FE_Nedelec<dim>::initialize_restriction ()
                 = 2 * GeometryInfo<dim>::faces_per_cell * deg * this->degree
                     + n_edge_dofs;
               const unsigned int& n_quadrature_points = quadrature.size ();
-              
+
               {
                 FullMatrix<double>
                   assembling_matrix (deg * deg * this->degree,
                                      n_quadrature_points);
-                
+
                 for (unsigned int q_point = 0; q_point < n_quadrature_points;
                      ++q_point)
                   {
                     const double weight = std::sqrt (quadrature.weight
                                                      (q_point));
-                    
+
                     for (unsigned int i = 0; i <= deg; ++i)
                       {
                         const double L_i = weight
                                            * legendre_polynomials[i].value
                                              (quadrature_points[q_point] (0));
-                        
+
                         for (unsigned int j = 0; j < deg; ++j)
                           {
                             const double l_j
                               = L_i * lobatto_polynomials[j + 2].value
                                       (quadrature_points[q_point] (1));
-                            
+
                             for (unsigned int k = 0; k < deg; ++k)
                               assembling_matrix ((i * deg + j) * deg + k,
                                                  q_point)
@@ -1593,29 +1589,29 @@ FE_Nedelec<dim>::initialize_restriction ()
                           }
                       }
                   }
-                
+
                 FullMatrix<double> system_matrix (assembling_matrix.m (),
                                                   assembling_matrix.m ());
-                
+
                 assembling_matrix.mTmult (system_matrix, assembling_matrix);
                 system_matrix_inv.reinit (system_matrix.m (),
                                           system_matrix.m ());
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               solution.reinit (system_matrix_inv.m (), 24);
               system_rhs.reinit (system_matrix_inv.m (), 24);
               tmp.reinit (24);
-              
+
               for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
                 {
                   system_rhs = 0.0;
-                  
+
                   for (unsigned int q_point = 0;
                        q_point < n_quadrature_points; ++q_point)
                     {
                       tmp = 0.0;
-                      
+
                       if (quadrature_points[q_point] (0) < 0.5)
                         {
                           if (quadrature_points[q_point] (1) < 0.5)
@@ -1626,7 +1622,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                    (2.0 * quadrature_points[q_point] (0),
                                                     2.0 * quadrature_points[q_point] (1),
                                                     2.0 * quadrature_points[q_point] (2));
-                                  
+
                                   tmp (0) += 2.0 * this->shape_value_component
                                                    (dof, quadrature_point, 0);
                                   tmp (1) += 2.0 * this->shape_value_component
@@ -1634,7 +1630,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                   tmp (2) += 2.0 * this->shape_value_component
                                                    (dof, quadrature_point, 2);
                                 }
-                              
+
                               else
                                 {
                                   const Point<dim> quadrature_point
@@ -1642,7 +1638,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                     2.0 * quadrature_points[q_point] (1),
                                                     2.0 * quadrature_points[q_point] (2)
                                                         - 1.0);
-                                  
+
                                   tmp (3) += 2.0 * this->shape_value_component
                                                    (dof, quadrature_point, 0);
                                   tmp (4) += 2.0 * this->shape_value_component
@@ -1651,7 +1647,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                    (dof, quadrature_point, 2);
                                 }
                             }
-                          
+
                           else
                             if (quadrature_points[q_point] (2) < 0.5)
                               {
@@ -1660,7 +1656,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                   2.0 * quadrature_points[q_point] (1)
                                                       - 1.0,
                                                   2.0 * quadrature_points[q_point] (2));
-                                
+
                                 tmp (6) += 2.0 * this->shape_value_component
                                                  (dof, quadrature_point, 0);
                                 tmp (7) += 2.0 * this->shape_value_component
@@ -1668,7 +1664,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                 tmp (8) += 2.0 * this->shape_value_component
                                                  (dof, quadrature_point, 2);
                               }
-                            
+
                             else
                               {
                                 const Point<dim> quadrature_point
@@ -1677,7 +1673,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                       - 1.0,
                                                   2.0 * quadrature_points[q_point] (2)
                                                       - 1.0);
-                                
+
                                 tmp (9) += 2.0 * this->shape_value_component
                                                  (dof, quadrature_point, 0);
                                 tmp (10) += 2.0 * this->shape_value_component
@@ -1686,7 +1682,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                   (dof, quadrature_point, 2);
                               }
                         }
-                      
+
                       else
                         if (quadrature_points[q_point] (1) < 0.5)
                           {
@@ -1697,7 +1693,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                       - 1.0,
                                                   2.0 * quadrature_points[q_point] (1),
                                                   2.0 * quadrature_points[q_point] (2));
-                                
+
                                 tmp (12) += 2.0 * this->shape_value_component
                                                   (dof, quadrature_point, 0);
                                 tmp (13) += 2.0 * this->shape_value_component
@@ -1705,7 +1701,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                 tmp (14) += 2.0 * this->shape_value_component
                                                   (dof, quadrature_point, 2);
                               }
-                            
+
                             else
                               {
                                 const Point<dim> quadrature_point
@@ -1714,7 +1710,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                   2.0 * quadrature_points[q_point] (1),
                                                   2.0 * quadrature_points[q_point] (2)
                                                       - 1.0);
-                                
+
                                 tmp (15) += 2.0 * this->shape_value_component
                                                   (dof, quadrature_point, 0);
                                 tmp (16) += 2.0 * this->shape_value_component
@@ -1723,7 +1719,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                   (dof, quadrature_point, 2);
                               }
                           }
-                        
+
                         else
                           if (quadrature_points[q_point] (2) < 0.5)
                             {
@@ -1733,7 +1729,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                 2.0 * quadrature_points[q_point] (1)
                                                     - 1.0,
                                                 2.0 * quadrature_points[q_point] (2));
-                              
+
                               tmp (18) += 2.0 * this->shape_value_component
                                                 (dof, quadrature_point, 0);
                               tmp (19) += 2.0 * this->shape_value_component
@@ -1741,7 +1737,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                               tmp (20) += 2.0 * this->shape_value_component
                                                 (dof, quadrature_point, 2);
                             }
-                          
+
                           else
                             {
                               const Point<dim> quadrature_point
@@ -1751,7 +1747,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                     - 1.0,
                                                 2.0 * quadrature_points[q_point] (2)
                                                     - 1.0);
-                              
+
                               tmp (21) += 2.0 * this->shape_value_component
                                                 (dof, quadrature_point, 0);
                               tmp (22) += 2.0 * this->shape_value_component
@@ -1759,7 +1755,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                               tmp (23) += 2.0 * this->shape_value_component
                                                 (dof, quadrature_point, 2);
                             }
-                      
+
                       for (unsigned int i = 0; i < 2; ++i)
                         for (unsigned int j = 0; j < 2; ++j)
                           for (unsigned int k = 0; k < 2; ++k)
@@ -1784,7 +1780,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                   * this->shape_value_component
                                     ((2 * (j + 4) + k) * this->degree + l,
                                      quadrature_points[q_point], 2);
-                                
+
                                 for (unsigned int m = 0; m < deg; ++m)
                                   {
                                     tmp (3 * (i + 2 * (j + 2 * k)))
@@ -1841,9 +1837,9 @@ FE_Nedelec<dim>::initialize_restriction ()
                                          quadrature_points[q_point], 2);
                                   }
                               }
-                      
+
                       tmp *= quadrature.weight (q_point);
-                      
+
                       for (unsigned int i = 0; i <= deg; ++i)
                         {
                           const double L_i_0
@@ -1855,7 +1851,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                           const double L_i_2
                             = legendre_polynomials[i].value
                               (quadrature_points[q_point] (2));
-                          
+
                           for (unsigned int j = 0; j < deg; ++j)
                             {
                               const double l_j_0
@@ -1867,7 +1863,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                               const double l_j_2
                                 = L_i_2 * lobatto_polynomials[j + 2].value
                                           (quadrature_points[q_point] (0));
-                              
+
                               for (unsigned int k = 0; k < deg; ++k)
                                 {
                                   const double l_k_0
@@ -1879,7 +1875,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                   const double l_k_2
                                     = l_j_2 * lobatto_polynomials[k + 2].value
                                               (quadrature_points[q_point] (1));
-                                  
+
                                   for (unsigned int l = 0; l < 8; ++l)
                                     {
                                       system_rhs ((i * deg + j) * deg + k,
@@ -1896,9 +1892,9 @@ FE_Nedelec<dim>::initialize_restriction ()
                             }
                         }
                     }
-                  
+
                   system_matrix_inv.mmult (solution, system_rhs);
-                  
+
                   for (unsigned int i = 0; i < 2; ++i)
                     for (unsigned int j = 0; j < 2; ++j)
                       for (unsigned int k = 0; k < 2; ++k)
@@ -1914,7 +1910,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                   ((l * deg + m) * deg + n + n_boundary_dofs,
                                    dof) = solution ((l * deg + m) * deg + n,
                                                        3 * (i + 2 * (j + 2 * k)));
-                                
+
                                 if (std::abs (solution
                                               ((l * deg + m) * deg + n,
                                                   3 * (i + 2 * (j + 2 * k)) + 1))
@@ -1924,7 +1920,7 @@ FE_Nedelec<dim>::initialize_restriction ()
                                                                   + n_boundary_dofs,
                                    dof) = solution ((l * deg + m) * deg + n,
                                                        3 * (i + 2 * (j + 2 * k)) + 1);
-                                
+
                                 if (std::abs (solution
                                               ((l * deg + m) * deg + n,
                                                   3 * (i + 2 * (j + 2 * k)) + 2))
@@ -1947,21 +1943,6 @@ FE_Nedelec<dim>::initialize_restriction ()
 }
 
 
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_Nedelec<1>::get_dpo_vector (const unsigned int degree)
-{
-  std::vector<unsigned int> dpo (2);
-
-  dpo[0] = 1;
-  dpo[1] = degree;
-  return dpo;
-}
-
-#endif
-
 
 template <int dim>
 std::vector<unsigned int>
@@ -2511,19 +2492,19 @@ const
       }
 }
 
-#if deal_II_dimension == 1
 
-template <int dim>
+
+template <>
 void
-FE_Nedelec<dim>::get_subface_interpolation_matrix(
-  const FiniteElement<dim>&,
+FE_Nedelec<1>::get_subface_interpolation_matrix(
+  const FiniteElement<1>&,
   const unsigned int,
   FullMatrix<double>&) const
 {
   Assert (false, ExcNotImplemented ());
 }
 
-#else
+
 
                    // In this function we compute the
                    // subface interpolation matrix.
@@ -2589,7 +2570,7 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
   const std::vector<Point<1> >&
     edge_quadrature_points = edge_quadrature.get_points ();
   const unsigned int& n_edge_quadrature_points = edge_quadrature.size ();
-  
+
   switch (dim)
     {
       case 2:
@@ -2601,49 +2582,49 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                const Point<dim> quadrature_point (0.0,
                                                   0.5 * (edge_quadrature_points[q_point] (0)
                                                          + subface));
-               
+
                 interpolation_matrix (0, dof) += 0.5
                                               * edge_quadrature.weight (q_point)
                                               * this->shape_value_component
                                                 (dof, quadrature_point, 1);
               }
-          
+
           if (deg > 0)
             {
               const std::vector<Polynomials::Polynomial<double> >&
                 legendre_polynomials
                   = Polynomials::Legendre::generate_complete_basis (deg);
               FullMatrix<double> system_matrix_inv (deg, deg);
-              
+
               {
                 FullMatrix<double> assembling_matrix (deg,
                                                       n_edge_quadrature_points);
-                
+
                 for (unsigned int q_point = 0;
                      q_point < n_edge_quadrature_points; ++q_point)
                   {
                     const double weight
                       = std::sqrt (edge_quadrature.weight (q_point));
-                    
+
                     for (unsigned int i = 0; i < deg; ++i)
                       assembling_matrix (i, q_point) = weight
                                                        * legendre_polynomials[i + 1].value
                                                          (edge_quadrature_points[q_point] (0));
                   }
-                
+
                 FullMatrix<double> system_matrix (deg, deg);
-                
+
                 assembling_matrix.mTmult (system_matrix, assembling_matrix);
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               Vector<double> solution (deg);
               Vector<double> system_rhs (deg);
-              
+
               for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
                 {
                   system_rhs = 0.0;
-                  
+
                   for (unsigned int q_point = 0;
                        q_point < n_edge_quadrature_points; ++q_point)
                     {
@@ -2659,21 +2640,21 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                                                                         dof)
                                                 * source_fe.shape_value_component
                                                   (0, quadrature_point_1, 1));
-                      
+
                       for (unsigned int i = 0; i < deg; ++i)
                         system_rhs (i) += tmp
                                        * legendre_polynomials[i + 1].value
                                          (edge_quadrature_points[q_point] (0));
                     }
-                  
+
                   system_matrix_inv.vmult (solution, system_rhs);
-                  
+
                   for (unsigned int i = 0; i < deg; ++i)
                     if (std::abs (solution (i)) > 1e-14)
                       interpolation_matrix (i + 1, dof) = solution (i);
                 }
             }
-          
+
           break;
         }
 
@@ -2681,20 +2662,20 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
         {
           const double shifts[4][2] = { { 0.0, 0.0 }, { 1.0, 0.0 },
                                         { 0.0, 1.0 }, { 1.0, 1.0 } };
-          
+
           for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
             for (unsigned int q_point = 0; q_point < n_edge_quadrature_points;
                  ++q_point)
               {
                 const double weight = 0.5 * edge_quadrature.weight (q_point);
-                
+
                 for (unsigned int i = 0; i < 2; ++i)
                   {
                     Point<dim>
                       quadrature_point (0.5 * (i + shifts[subface][0]),
                                         0.5 * (edge_quadrature_points[q_point] (0)
                                                + shifts[subface][1]), 0.0);
-                    
+
                     interpolation_matrix (i * source_fe.degree, dof) += weight
                                                                      * this->shape_value_component
                                                                        (this->face_to_cell_index (dof, 4),
@@ -2710,51 +2691,51 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                                    quadrature_point, 0);
                   }
               }
-          
+
           if (deg > 0)
             {
               const std::vector<Polynomials::Polynomial<double> >&
                 legendre_polynomials
                   = Polynomials::Legendre::generate_complete_basis (deg);
               FullMatrix<double> system_matrix_inv (deg, deg);
-              
+
               {
                 FullMatrix<double> assembling_matrix (deg,
                                                       n_edge_quadrature_points);
-                
+
                 for (unsigned int q_point = 0;
                      q_point < n_edge_quadrature_points; ++q_point)
                   {
                     const double weight
                       = std::sqrt (edge_quadrature.weight (q_point));
-                    
+
                     for (unsigned int i = 0; i < deg; ++i)
                       assembling_matrix (i, q_point) = weight
                                                        * legendre_polynomials[i + 1].value
                                                          (edge_quadrature_points[q_point] (0));
                   }
-                
+
                 FullMatrix<double> system_matrix (deg, deg);
-                
+
                 assembling_matrix.mTmult (system_matrix, assembling_matrix);
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               FullMatrix<double> solution (deg,
                                            GeometryInfo<dim>::lines_per_face);
               FullMatrix<double> system_rhs (deg,
                                              GeometryInfo<dim>::lines_per_face);
               Vector<double> tmp (GeometryInfo<dim>::lines_per_face);
-              
+
               for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
                 {
                   system_rhs = 0.0;
-                  
+
                   for (unsigned int q_point = 0;
                        q_point < n_edge_quadrature_points; ++q_point)
                     {
                       const double weight = edge_quadrature.weight (q_point);
-                      
+
                       for (unsigned int i = 0; i < 2; ++i)
                         {
                           Point<dim>
@@ -2765,7 +2746,7 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                           Point<dim> quadrature_point_1 (i,
                                                          edge_quadrature_points[q_point] (0),
                                                          0.0);
-                          
+
                           tmp (i) = weight
                                     * (0.5 * this->shape_value_component
                                              (this->face_to_cell_index (dof, 4),
@@ -2794,21 +2775,21 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                                                  ((i + 2) * source_fe.degree,
                                                   quadrature_point_1, 0));
                         }
-                      
+
                       for (unsigned int i = 0; i < deg; ++i)
                         {
                           const double L_i
                             = legendre_polynomials[i + 1].value
                               (edge_quadrature_points[q_point] (0));
-                          
+
                           for (unsigned int j = 0;
                                j < GeometryInfo<dim>::lines_per_face; ++j)
                             system_rhs (i, j) += tmp (j) * L_i;
                         }
                     }
-                  
+
                   system_matrix_inv.mmult (solution, system_rhs);
-                  
+
                   for (unsigned int i = 0;
                        i < GeometryInfo<dim>::lines_per_face; ++i)
                     for (unsigned int j = 0; j < deg; ++j)
@@ -2816,7 +2797,7 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                         interpolation_matrix (i * source_fe.degree + j + 1,
                                               dof) = solution (j, i);
                 }
-              
+
               const QGauss<2> quadrature (source_fe.degree);
               const std::vector<Point<2> >&
                 quadrature_points = quadrature.get_points ();
@@ -2827,46 +2808,46 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
               const unsigned int n_boundary_dofs
                 = GeometryInfo<dim>::lines_per_face * source_fe.degree;
               const unsigned int& n_quadrature_points = quadrature.size ();
-              
+
               {
                 FullMatrix<double> assembling_matrix (deg * this->degree,
                                                       n_quadrature_points);
-                
+
                 for (unsigned int q_point = 0; q_point < n_quadrature_points;
                      ++q_point)
                   {
                     const double weight = quadrature.weight (q_point);
-                    
+
                     for (unsigned int i = 0; i <= deg; ++i)
                       {
                         const double L_i = weight
                                            * legendre_polynomials[i].value
                                              (quadrature_points[q_point] (0));
-                        
+
                         for (unsigned int j = 0; j < deg; ++j)
                           assembling_matrix (i * deg + j, q_point)
                             = L_i * lobatto_polynomials[j + 2].value
                                     (quadrature_points[q_point] (1));
                       }
                   }
-                
+
                 FullMatrix<double> system_matrix (assembling_matrix.m (),
                                                   assembling_matrix.m ());
-                
+
                 assembling_matrix.mTmult (system_matrix, assembling_matrix);
                 system_matrix_inv.reinit (system_matrix.m (),
                                           system_matrix.m ());
                 system_matrix_inv.invert (system_matrix);
               }
-              
+
               solution.reinit (system_matrix_inv.m (), 2);
               system_rhs.reinit (system_matrix_inv.m (), 2);
               tmp.reinit (2);
-              
+
               for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
                 {
                   system_rhs = 0.0;
-                  
+
                   for (unsigned int q_point = 0;
                        q_point < n_quadrature_points; ++q_point)
                     {
@@ -2885,7 +2866,7 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                       quadrature_point
                         = Point<dim> (quadrature_points[q_point] (0),
                                       quadrature_points[q_point] (1), 0.0);
-                      
+
                       for (unsigned int i = 0; i < 2; ++i)
                         for (unsigned int j = 0; j <= deg; ++j)
                           {
@@ -2900,16 +2881,16 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                                       (i * source_fe.degree + j,
                                        quadrature_point, 1);
                           }
-                      
+
                       tmp *= quadrature.weight (q_point);
-                      
+
                       for (unsigned int i = 0; i <= deg; ++i)
                         {
                           const double L_i_0 = legendre_polynomials[i].value
                                                (quadrature_points[q_point] (0));
                           const double L_i_1 = legendre_polynomials[i].value
                                                (quadrature_points[q_point] (1));
-                          
+
                           for (unsigned int j = 0; j < deg; ++j)
                             {
                               system_rhs (i * deg + j, 0) += tmp (0) * L_i_0
@@ -2921,9 +2902,9 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                             }
                         }
                     }
-                  
+
                   system_matrix_inv.mmult (solution, system_rhs);
-                  
+
                   for (unsigned int i = 0; i <= deg; ++i)
                     for (unsigned int j = 0; j < deg; ++j)
                       {
@@ -2931,7 +2912,7 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                           interpolation_matrix (i * deg + j + n_boundary_dofs,
                                                 dof) = solution (i * deg + j,
                                                                  0);
-                        
+
                         if (std::abs (solution (i * deg + j, 1)) > 1e-14)
                           interpolation_matrix (i + (j + deg)
                                                   * source_fe.degree
@@ -2940,7 +2921,7 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
                       }
                 }
             }
-          
+
           break;
         }
 
@@ -2949,7 +2930,7 @@ FE_Nedelec<dim>::get_subface_interpolation_matrix(
     }
 }
 
-#endif
+
 
                    // Since this is a vector valued element,
                    // we cannot interpolate a scalar function.
@@ -3811,7 +3792,7 @@ FE_Nedelec<dim>::interpolate (std::vector<double>& local_dofs,
                                   // for the horizontal shape
                                   // functions.
                                 system_rhs = 0;
-                                
+
                                 for (unsigned int q_point = 0;
                                      q_point < n_face_points; ++q_point)
                                   {
@@ -5447,6 +5428,9 @@ FE_Nedelec<dim>::memory_consumption () const
 }
 
 
-template class FE_Nedelec<deal_II_dimension>;
+
+// explicit instantiations
+#include "fe_nedelec.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_nedelec.inst.in b/deal.II/source/fe/fe_nedelec.inst.in
new file mode 100644 (file)
index 0000000..72a5fe8
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_Nedelec<deal_II_dimension>;
+  }
+
index 795e054e4c84fbb5bb89e4707fbbf6d370275ee1..debdf705d27760a959a3ff1429cbb6a4de3bc730 100644 (file)
@@ -185,8 +185,8 @@ compare_for_face_domination (const FiniteElement<dim> & fe_other) const
   else
     return FiniteElementDomination::this_element_dominates;
 }
-   
-   
+
+
 template <int dim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FE_Nothing<dim> ::
@@ -212,7 +212,7 @@ hp_line_dof_identities (const FiniteElement<dim> &/*fe_other*/) const
       return std::vector<std::pair<unsigned int, unsigned int> > ();
 }
 
-   
+
 template <int dim>
 std::vector<std::pair<unsigned int, unsigned int> >
 FE_Nothing<dim> ::
@@ -225,7 +225,7 @@ hp_quad_dof_identities (const FiniteElement<dim> &/*fe_other*/) const
       return std::vector<std::pair<unsigned int, unsigned int> > ();
 }
 
-    
+
 template <int dim>
 bool
 FE_Nothing<dim> ::
@@ -233,8 +233,8 @@ hp_constraints_are_implemented () const
 {
   return true;
 }
-  
-        
+
+
 template <int dim>
 void
 FE_Nothing<dim>::
@@ -243,7 +243,7 @@ get_face_interpolation_matrix (const FiniteElement<dim> &/*source_fe*/,
 {
                                    // since this element has no face dofs, the
                                    // interpolation matrix is necessarily empty
-                                   
+
   Assert (interpolation_matrix.m() == 0,
           ExcDimensionMismatch (interpolation_matrix.m(),
                                 0));
@@ -271,9 +271,11 @@ get_subface_interpolation_matrix (const FiniteElement<dim> & /*source_fe*/,
                                 0));
 }
 
-       
 
-template class FE_Nothing<deal_II_dimension>;
+
+// explicit instantiations
+#include "fe_nothing.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
 
diff --git a/deal.II/source/fe/fe_nothing.inst.in b/deal.II/source/fe/fe_nothing.inst.in
new file mode 100644 (file)
index 0000000..b2eb93e
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_Nothing<deal_II_dimension>;
+  }
+
index d74db073ef98fee52e674a8a2fb3436783215282..d4ae8dd54f84743a20dd488ded58b698597dba70 100644 (file)
 
 DEAL_II_NAMESPACE_OPEN
 
-template class FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension>;
-template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
-template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
+#include "fe_poly.inst"
 
-#if deal_II_dimension != 3
-
-template class FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
-template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
-//template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
-
-#endif
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_poly.inst.in b/deal.II/source/fe/fe_poly.inst.in
new file mode 100644 (file)
index 0000000..2a384ac
--- /dev/null
@@ -0,0 +1,29 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension>;
+    template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
+    template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
+
+#if deal_II_dimension != 3
+
+    template class FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
+    template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
+    //template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
+
+#endif
+  }
+
index 7a313ba53d2cc2b49e2b08f6302cba78d1145ae1..0f58ad232d2d36640e276c976dec6e022fd59d68 100644 (file)
@@ -35,7 +35,6 @@ namespace
  * algorithm, which determines the DoFs, which need this sign change for a
  * given cell.
  */
-#if deal_II_dimension == 1
   void
   get_face_sign_change (const Triangulation<1>::cell_iterator &,
                        const unsigned int                     ,
@@ -44,9 +43,9 @@ namespace
                                     // nothing to do in 1d
     std::fill (face_sign.begin (), face_sign.end (), 1.0);
   }
-#endif  
 
-#if deal_II_dimension == 2
+
+
   void
   get_face_sign_change (const Triangulation<2>::cell_iterator &cell,
                        const unsigned int                     dofs_per_face,
@@ -54,19 +53,19 @@ namespace
   {
     const unsigned int dim = 2;
     const unsigned int spacedim = 2;
-    
+
                                     // Default is no sign
                                     // change. I.e. multiply by one.
     std::fill (face_sign.begin (), face_sign.end (), 1.0);
-    
-    for (unsigned int f = GeometryInfo<dim>::faces_per_cell / 2; 
+
+    for (unsigned int f = GeometryInfo<dim>::faces_per_cell / 2;
         f < GeometryInfo<dim>::faces_per_cell; ++f)
       {
        Triangulation<dim,spacedim>::face_iterator face = cell->face (f);
        if (!face->at_boundary ())
          {
            const unsigned int nn = cell->neighbor_face_no(f);
-             
+
            if (nn < GeometryInfo<dim>::faces_per_cell / 2)
              for (unsigned int j = 0; j < dofs_per_face; ++j)
                {
@@ -79,19 +78,17 @@ namespace
          }
       }
   }
-#endif
 
 
-#if deal_II_dimension == 3
+
   void
   get_face_sign_change (const Triangulation<3>::cell_iterator &/*cell*/,
                        const unsigned int                     /*dofs_per_face*/,
                        std::vector<double>                   &face_sign)
   {
     std::fill (face_sign.begin (), face_sign.end (), 1.0);
-//TODO: think about what it would take here    
+//TODO: think about what it would take here
   }
-#endif
 }
 
 
@@ -141,14 +138,14 @@ FE_PolyTensor<POLY,dim,spacedim>::shape_value_component (const unsigned int i,
 {
   Assert (i<this->dofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell));
   Assert (component < dim, ExcIndexRange (component, 0, dim));
-  
+
   if (cached_point != p || cached_values.size() == 0)
     {
       cached_point = p;
       cached_values.resize(poly_space.n());
       poly_space.compute(p, cached_values, cached_grads, cached_grad_grads);
     }
-  
+
   double s = 0;
   if (inverse_node_matrix.n_cols() == 0)
     return cached_values[i][component];
@@ -180,21 +177,21 @@ FE_PolyTensor<POLY,dim,spacedim>::shape_grad_component (const unsigned int i,
 {
   Assert (i<this->dofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell));
   Assert (component < dim, ExcIndexRange (component, 0, dim));
-  
+
   if (cached_point != p || cached_grads.size() == 0)
     {
       cached_point = p;
       cached_grads.resize(poly_space.n());
       poly_space.compute(p, cached_values, cached_grads, cached_grad_grads);
     }
-  
+
   Tensor<1,dim> s;
   if (inverse_node_matrix.n_cols() == 0)
     return cached_grads[i][component];
   else
     for (unsigned int j=0;j<inverse_node_matrix.n_cols();++j)
       s += inverse_node_matrix(j,i) * cached_grads[j][component];
-  
+
   return s;
 }
 
@@ -219,21 +216,21 @@ FE_PolyTensor<POLY,dim,spacedim>::shape_grad_grad_component (const unsigned int
 {
   Assert (i<this->dofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell));
   Assert (component < dim, ExcIndexRange (component, 0, dim));
-  
+
   if (cached_point != p || cached_grad_grads.size() == 0)
     {
       cached_point = p;
       cached_grad_grads.resize(poly_space.n());
       poly_space.compute(p, cached_values, cached_grads, cached_grad_grads);
     }
-  
+
   Tensor<2,dim> s;
   if (inverse_node_matrix.n_cols() == 0)
     return cached_grad_grads[i][component];
   else
     for (unsigned int j=0;j<inverse_node_matrix.n_cols();++j)
       s += inverse_node_matrix(i,j) * cached_grad_grads[j][component];
-  
+
   return s;
 }
 
@@ -264,7 +261,7 @@ FE_PolyTensor<POLY,dim,spacedim>::get_data (
 
   const UpdateFlags flags(data->update_flags);
   const unsigned int n_q_points = quadrature.size();
-  
+
                                   // some scratch arrays
   std::vector<Tensor<1,dim> > values(0);
   std::vector<Tensor<2,dim> > grads(0);
@@ -295,7 +292,7 @@ FE_PolyTensor<POLY,dim,spacedim>::get_data (
                                   // that
   if (flags & update_hessians)
     {
-//      grad_grads.resize (this->dofs_per_cell);      
+//      grad_grads.resize (this->dofs_per_cell);
       data->initialize_2nd (this, mapping, quadrature);
     }
 
@@ -310,7 +307,7 @@ FE_PolyTensor<POLY,dim,spacedim>::get_data (
       {
        poly_space.compute(quadrature.point(k),
                           values, grads, grad_grads);
-       
+
        if (flags & update_values)
          {
            if (inverse_node_matrix.n_cols() == 0)
@@ -325,7 +322,7 @@ FE_PolyTensor<POLY,dim,spacedim>::get_data (
                  data->shape_values[i][k] = add_values;
                }
          }
-       
+
        if (flags & update_gradients)
          {
            if (inverse_node_matrix.n_cols() == 0)
@@ -340,7 +337,7 @@ FE_PolyTensor<POLY,dim,spacedim>::get_data (
                  data->shape_grads[i][k] = add_grads;
                }
          }
-       
+
       }
   return data;
 }
@@ -373,7 +370,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
 
   const unsigned int n_q_points = quadrature.size();
   const UpdateFlags flags(fe_data.current_update_flags());
-  
+
   Assert(!(flags & update_values) || fe_data.shape_values.size() == this->dofs_per_cell,
         ExcDimensionMismatch(fe_data.shape_values.size(), this->dofs_per_cell));
   Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points,
@@ -394,11 +391,11 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
   if (mapping_type == mapping_piola)
     if (cell_similarity == CellSimilarity::translation)
       cell_similarity = CellSimilarity::none;
-  
+
   for (unsigned int i=0; i<this->dofs_per_cell; ++i)
     {
       const unsigned int first = data.shape_function_to_row_table[i];
-      
+
       if (flags & update_values && cell_similarity != CellSimilarity::translation)
        switch (mapping_type)
          {
@@ -409,7 +406,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
                  data.shape_values(first+d,k) = fe_data.shape_values[i][k][d];
              break;
            }
+
          case mapping_covariant:
          case mapping_contravariant:
            {
@@ -434,24 +431,24 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
                    = sign_change[i] * shape_values[k][d];
              break;
            }
-         
+
          case mapping_nedelec:
          {
             std::vector<Tensor<1,dim> > shape_values (n_q_points);
             mapping.transform (fe_data.shape_values[i], shape_values,
               mapping_data, mapping_covariant);
-                
+
             for (unsigned int k = 0; k < n_q_points; ++k)
                for (unsigned int d = 0; d < dim; ++d)
                   data.shape_values(first+d,k) = shape_values[k][d];
-             
+
             break;
          }
 
          default:
            Assert(false, ExcNotImplemented());
          }
-      
+
       if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
        {
          std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
@@ -472,36 +469,36 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
              {
                mapping.transform(fe_data.shape_grads[i], shape_grads1,
                                  mapping_data, mapping_covariant_gradient);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = shape_grads1[k][d];
-               
+
                break;
              }
              case mapping_contravariant:
              {
                mapping.transform(fe_data.shape_grads[i], shape_grads1,
                                  mapping_data, mapping_contravariant_gradient);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = shape_grads2[k][d];
-               
+
                break;
              }
              case mapping_piola:
              {
                mapping.transform(fe_data.shape_grads[i], shape_grads1,
                                  mapping_data, mapping_piola);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = sign_change[i] * shape_grads1[k][d];
-               
+
                break;
              }
-             
+
              case mapping_nedelec: {
                                            // treat the gradients of
                                            // this particular shape
@@ -521,33 +518,33 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_values (
                                            // (J^-1) from the right,
                                            // we have to trick a
                                            // little in between
-                                           
+
                                            // do first transformation
                 mapping.transform (fe_data.shape_grads[i], shape_grads1,
                   mapping_data, mapping_covariant);
-                                           // transpose matrix          
+                                           // transpose matrix
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    shape_grads2[k] = transpose (shape_grads1[k]);
-                                           // do second transformation          
+                                           // do second transformation
                 mapping.transform (shape_grads2, shape_grads1,
                   mapping_data, mapping_covariant);
-                                           // transpose back            
+                                           // transpose back
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    shape_grads2[k] = transpose (shape_grads1[k]);
-                   
+
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    for (unsigned int d = 0; d < dim; ++d)
-                      data.shape_gradients[first + d][k] = shape_grads2[k][d];          
+                      data.shape_gradients[first + d][k] = shape_grads2[k][d];
                                           // then copy over to target:
                 break;
              }
-                   
+
              default:
                Assert(false, ExcNotImplemented());
            }
        }
     }
-  
+
   if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
     this->compute_2nd (mapping, cell,
                       typename QProjector<dim>::DataSetDescriptor().cell(),
@@ -579,7 +576,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                                   // offset determines which data set
                                   // to take (all data sets for all
                                   // faces are stored contiguously)
-  
+
   const typename QProjector<dim>::DataSetDescriptor dsd;
   const typename QProjector<dim>::DataSetDescriptor offset
     = dsd.face (face,
@@ -587,7 +584,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                cell->face_flip(face),
                cell->face_rotation(face),
                n_q_points);
-  
+
   const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
 
 //TODO: Size assertions
@@ -599,11 +596,11 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                                   // on the neighborhood between two faces.
   std::vector<double> sign_change (this->dofs_per_cell, 1.0);
   get_face_sign_change (cell, this->dofs_per_face, sign_change);
-  
+
   for (unsigned int i=0; i<this->dofs_per_cell; ++i)
     {
       const unsigned int first = data.shape_function_to_row_table[i];
-      
+
       if (flags & update_values)
        {
          switch (mapping_type)
@@ -615,7 +612,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                    data.shape_values(first+d,k) = fe_data.shape_values[i][k+offset][d];
                break;
              }
-             
+
              case mapping_covariant:
              case mapping_contravariant:
              {
@@ -624,11 +621,11 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                std::vector<Tensor<1,dim> > shape_values (n_q_points);
                mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points),
                                  shape_values, mapping_data, mapping_type);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_values(first+d,k) = shape_values[k][d];
-               
+
                break;
              }
              case mapping_piola:
@@ -642,24 +639,24 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                      = sign_change[i] * shape_values[k][d];
                break;
              }
-             
+
              case mapping_nedelec: {
                 std::vector<Tensor<1,dim> > shape_values (n_q_points);
                   mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points),
                 shape_values, mapping_data, mapping_covariant);
-                
+
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    for (unsigned int d = 0; d < dim; ++d)
                       data.shape_values(first+d,k) = shape_values[k][d];
-             
+
                 break;
              }
-         
+
              default:
                Assert(false, ExcNotImplemented());
-           }     
+           }
        }
-      
+
       if (flags & update_gradients)
        {
          std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
@@ -676,12 +673,12 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                    data.shape_gradients[first+d][k] = shape_grads1[k][d];
                break;
              }
-             
+
              case mapping_covariant:
              {
                mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
                                  shape_grads1, mapping_data, mapping_covariant_gradient);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = shape_grads1[k][d];
@@ -695,21 +692,21 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = shape_grads1[k][d];
-               
+
                break;
              }
              case mapping_piola:
              {
                mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
                                  shape_grads1, mapping_data, mapping_piola);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = sign_change[i] * shape_grads1[k][d];
-               
+
                break;
              }
-             
+
              case mapping_nedelec: {
                                            // treat the gradients of
                                            // this particular shape
@@ -729,33 +726,33 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_face_values (
                                            // (J^-1) from the right,
                                            // we have to trick a
                                            // little in between
-                                           
+
                                            // do first transformation
                 mapping.transform (make_slice (fe_data.shape_grads[i], offset, n_q_points),
                   shape_grads1, mapping_data, mapping_covariant);
-                                           // transpose matrix          
+                                           // transpose matrix
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    shape_grads2[k] = transpose (shape_grads1[k]);
-                                           // do second transformation          
+                                           // do second transformation
                 mapping.transform (shape_grads2, shape_grads1,
                   mapping_data, mapping_covariant);
-                                           // transpose back            
+                                           // transpose back
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    shape_grads2[k] = transpose (shape_grads1[k]);
-                   
+
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    for (unsigned int d = 0; d < dim; ++d)
-                      data.shape_gradients[first + d][k] = shape_grads2[k][d];          
+                      data.shape_gradients[first + d][k] = shape_grads2[k][d];
                                           // then copy over to target:
                 break;
              }
-             
+
              default:
                Assert(false, ExcNotImplemented());
            }
        }
     }
-  
+
   if (flags & update_hessians)
     this->compute_2nd (mapping, cell, offset, mapping_data, fe_data, data);
 }
@@ -810,11 +807,11 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
                                   // on the neighborhood between two faces.
   std::vector<double> sign_change (this->dofs_per_cell, 1.0);
   get_face_sign_change (cell, this->dofs_per_face, sign_change);
-  
+
   for (unsigned int i=0; i<this->dofs_per_cell; ++i)
     {
       const unsigned int first = data.shape_function_to_row_table[i];
-      
+
       if (flags & update_values)
        {
          switch (mapping_type)
@@ -826,7 +823,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
                    data.shape_values(first+d,k) = fe_data.shape_values[i][k+offset][d];
                break;
              }
-             
+
              case mapping_covariant:
              case mapping_contravariant:
              {
@@ -835,11 +832,11 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
                std::vector<Tensor<1,dim> > shape_values (n_q_points);
                mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points),
                                  shape_values, mapping_data, mapping_type);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                    for (unsigned int d=0; d<dim; ++d)
                      data.shape_values(first+d,k) = shape_values[k][d];
-               
+
                break;
              }
              case mapping_piola:
@@ -857,18 +854,18 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
                 std::vector<Tensor<1,dim> > shape_values (n_q_points);
                   mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points),
                 shape_values, mapping_data, mapping_covariant);
-                
+
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    for (unsigned int d = 0; d < dim; ++d)
                       data.shape_values(first+d,k) = shape_values[k][d];
-             
+
                 break;
              }
              default:
                    Assert(false, ExcNotImplemented());
            }
        }
-      
+
       if (flags & update_gradients)
        {
          std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
@@ -885,7 +882,7 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
                    data.shape_gradients[first+d][k] = shape_grads1[k][d];
                break;
              }
-             
+
              case mapping_covariant:
              {
                mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
@@ -901,11 +898,11 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
              {
                mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
                                  shape_grads1, mapping_data, mapping_contravariant_gradient);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = shape_grads1[k][d];
-               
+
                break;
              }
 
@@ -914,14 +911,14 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
                mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
                                  shape_grads1,
                                  mapping_data, mapping_piola);
-               
+
                for (unsigned int k=0; k<n_q_points; ++k)
                  for (unsigned int d=0; d<dim; ++d)
                    data.shape_gradients[first+d][k] = sign_change[i] * shape_grads1[k][d];
-               
+
                break;
              }
-             
+
              case mapping_nedelec: {
                                            // treat the gradients of
                                            // this particular shape
@@ -941,33 +938,33 @@ FE_PolyTensor<POLY,dim,spacedim>::fill_fe_subface_values (
                                            // (J^-1) from the right,
                                            // we have to trick a
                                            // little in between
-                                           
+
                                            // do first transformation
                 mapping.transform (make_slice (fe_data.shape_grads[i], offset, n_q_points),
                   shape_grads1, mapping_data, mapping_covariant);
-                                           // transpose matrix          
+                                           // transpose matrix
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    shape_grads2[k] = transpose (shape_grads1[k]);
-                                           // do second transformation          
+                                           // do second transformation
                 mapping.transform (shape_grads2, shape_grads1,
                   mapping_data, mapping_covariant);
-                                           // transpose back            
+                                           // transpose back
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    shape_grads2[k] = transpose (shape_grads1[k]);
-                   
+
                 for (unsigned int k = 0; k < n_q_points; ++k)
                    for (unsigned int d = 0; d < dim; ++d)
-                      data.shape_gradients[first + d][k] = shape_grads2[k][d];          
+                      data.shape_gradients[first + d][k] = shape_grads2[k][d];
                                           // then copy over to target:
                 break;
              }
-             
+
              default:
                    Assert(false, ExcNotImplemented());
            }
        }
     }
-  
+
   if (flags & update_hessians)
     this->compute_2nd (mapping, cell, offset, mapping_data, fe_data, data);
 }
@@ -1007,7 +1004,7 @@ UpdateFlags
 FE_PolyTensor<POLY,dim,spacedim>::update_once (const UpdateFlags flags) const
 {
   const bool values_once = (mapping_type == mapping_none);
-  
+
   UpdateFlags out = update_default;
 
   if (values_once && (flags & update_values))
@@ -1029,26 +1026,26 @@ FE_PolyTensor<POLY,dim,spacedim>::update_each (const UpdateFlags flags) const
       {
        if (flags & update_values)
          out |= update_values | update_piola;
-       
+
        if (flags & update_gradients)
          out |= update_gradients | update_piola | update_covariant_transformation;
-       
+
        if (flags & update_hessians)
          out |= update_hessians | update_piola | update_covariant_transformation;
-       
+
        break;
       }
-      
+
       case mapping_nedelec: {
         if (flags & update_values)
            out |= update_values | update_covariant_transformation;
-        
+
         if (flags & update_gradients)
            out |= update_gradients | update_covariant_transformation;
-        
+
         if (flags & update_hessians)
            out |= update_hessians | update_covariant_transformation;
-       
+
          break;
       }
 
@@ -1057,16 +1054,14 @@ FE_PolyTensor<POLY,dim,spacedim>::update_each (const UpdateFlags flags) const
        Assert (false, ExcNotImplemented());
       }
     }
-  
+
   return out;
 }
 
 
 
-template class FE_PolyTensor<PolynomialsRaviartThomas<deal_II_dimension>,deal_II_dimension>;
-template class FE_PolyTensor<PolynomialsABF<deal_II_dimension>,deal_II_dimension>;
-template class FE_PolyTensor<PolynomialsBDM<deal_II_dimension>,deal_II_dimension>;
-template class FE_PolyTensor<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
+// explicit instantiations
+#include "fe_poly_tensor.inst"
 
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_poly_tensor.inst.in b/deal.II/source/fe/fe_poly_tensor.inst.in
new file mode 100644 (file)
index 0000000..945f467
--- /dev/null
@@ -0,0 +1,22 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_PolyTensor<PolynomialsRaviartThomas<deal_II_dimension>,deal_II_dimension>;
+    template class FE_PolyTensor<PolynomialsABF<deal_II_dimension>,deal_II_dimension>;
+    template class FE_PolyTensor<PolynomialsBDM<deal_II_dimension>,deal_II_dimension>;
+    template class FE_PolyTensor<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
+  }
+
index e924afe60c21755d1ab2c4715c84a8f784c08814..c1d4f0ddfad3b42941254215aca54946535c4a08 100644 (file)
@@ -627,7 +627,7 @@ FE_Q<dim,spacedim>::FE_Q (const Quadrature<1> &points)
                                   // embedding operators
   FETools::compute_embedding_matrices (*this, this->prolongation);
 
-                                  // Fill restriction matrices 
+                                  // Fill restriction matrices
   initialize_restriction();
 
   initialize_quad_dof_index_permutation();
@@ -802,7 +802,6 @@ get_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
 }
 
 
-#if deal_II_dimension == 1
 
 template <>
 void
@@ -856,10 +855,7 @@ get_subface_interpolation_matrix (const FiniteElement<1,2> &/*x_source_fe*/,
          ExcInterpolationNotImplemented ());
 }
 
-#endif
-
 
-#if deal_II_dimension > 1
 
 template <int dim, int spacedim>
 void
@@ -1076,7 +1072,6 @@ get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe
     }
 }
 
-#endif
 
 
 template <int dim, int spacedim>
@@ -1329,7 +1324,6 @@ void FE_Q<dim,spacedim>::initialize_unit_support_points (const Quadrature<1> &po
 }
 
 
-#if deal_II_dimension == 1
 
 template <>
 void FE_Q<1>::initialize_unit_face_support_points ()
@@ -1355,7 +1349,6 @@ void FE_Q<1,2>::initialize_unit_face_support_points (const Quadrature<1> &/*poin
                                   // no faces in 1d, so nothing to do
 }
 
-#endif
 
 
 template <int dim, int spacedim>
@@ -1437,7 +1430,6 @@ FE_Q<dim,spacedim>::initialize_quad_dof_index_permutation ()
 }
 
 
-#if deal_II_dimension == 3
 
 template <>
 void
@@ -1505,7 +1497,6 @@ FE_Q<3>::initialize_quad_dof_index_permutation ()
     this->adjust_line_dof_index_for_line_orientation_table[i]=this->dofs_per_line-1-i - i;
 }
 
-#endif
 
 
 
@@ -1531,7 +1522,6 @@ FE_Q<dim,spacedim>::face_lexicographic_to_hierarchic_numbering (const unsigned i
 }
 
 
-#if deal_II_dimension == 1
 
 template <>
 std::vector<unsigned int>
@@ -1547,7 +1537,7 @@ FE_Q<1,2>::face_lexicographic_to_hierarchic_numbering (const unsigned int)
   return std::vector<unsigned int>();
 }
 
-#endif
+
 
 template <int dim, int spacedim>
 void
@@ -1811,7 +1801,7 @@ FE_Q<dim,spacedim>::initialize_restriction ()
                                                 // value per row. Still, the
                                                 // values should sum up to 1
                double sum_check = 0;
-               for (unsigned int child_dof = 0; child_dof<this->dofs_per_cell; 
+               for (unsigned int child_dof = 0; child_dof<this->dofs_per_cell;
                     ++child_dof)
                  {
                    const double val
@@ -1823,7 +1813,7 @@ FE_Q<dim,spacedim>::initialize_restriction ()
 
                    sum_check += val;
                  }
-               Assert (std::fabs(sum_check-1) < this->degree*eps, 
+               Assert (std::fabs(sum_check-1) < this->degree*eps,
                        ExcInternalError());
              }
          }
@@ -1831,11 +1821,11 @@ FE_Q<dim,spacedim>::initialize_restriction ()
 }
 
 
+
 //---------------------------------------------------------------------------
 // Data field initialization
 //---------------------------------------------------------------------------
 
-#if deal_II_dimension == 1
 
 template <>
 bool
@@ -1882,10 +1872,6 @@ FE_Q<1,2>::has_support_on_face (const unsigned int shape_index,
 
 
 
-
-#else
-
-
 template <int dim, int spacedim>
 bool
 FE_Q<dim,spacedim>::has_support_on_face (const unsigned int shape_index,
@@ -1992,7 +1978,6 @@ FE_Q<dim,spacedim>::has_support_on_face (const unsigned int shape_index,
   return false;
 }
 
-#endif
 
 
 template <int dim, int spacedim>
@@ -2005,12 +1990,7 @@ FE_Q<dim,spacedim>::memory_consumption () const
 
 
 
-template class FE_Q<deal_II_dimension>;
-
-#if deal_II_dimension !=3
-template class FE_Q<deal_II_dimension,deal_II_dimension+1>;
-#endif
-
-
+// explicit instantiations
+#include "fe_q.inst"
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_q.inst.in b/deal.II/source/fe/fe_q.inst.in
new file mode 100644 (file)
index 0000000..d72cebf
--- /dev/null
@@ -0,0 +1,23 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_Q<deal_II_dimension>;
+
+#if deal_II_dimension !=3
+    template class FE_Q<deal_II_dimension,deal_II_dimension+1>;
+#endif
+  }
+
index f3b21f913444b1507b4440ddca1adc8e71db03b4..64cebd601b426a619d74d7036838ae7c7a93bb41 100644 (file)
@@ -24,7 +24,7 @@
 
 DEAL_II_NAMESPACE_OPEN
 
-namespace 
+namespace
 {
   inline
   std::vector<unsigned int>
@@ -53,20 +53,20 @@ FE_Q_Hierarchical<dim>::FE_Q_Hierarchical (const unsigned int degree)
 {
   this->poly_space.set_numbering(
     hierarchic_to_fe_q_hierarchical_numbering(*this));
-  
-                                  // The matrix @p{dofs_cell} contains the 
-                                  // values of the linear functionals of 
-                                  // the master 1d cell applied to the 
+
+                                  // The matrix @p{dofs_cell} contains the
+                                  // values of the linear functionals of
+                                  // the master 1d cell applied to the
                                   // shape functions of the two 1d subcells.
                                   // The matrix @p{dofs_subcell} constains
-                                  // the values of the linear functionals 
-                                  // on each 1d subcell applied to the 
-                                  // shape functions on the master 1d 
-                                  // subcell. 
-                                  // We use @p{dofs_cell} and 
-                                  // @p{dofs_subcell} to compute the 
-                                  // @p{prolongation}, @p{restriction} and 
-                                  // @p{interface_constraints} matrices 
+                                  // the values of the linear functionals
+                                  // on each 1d subcell applied to the
+                                  // shape functions on the master 1d
+                                  // subcell.
+                                  // We use @p{dofs_cell} and
+                                  // @p{dofs_subcell} to compute the
+                                  // @p{prolongation}, @p{restriction} and
+                                  // @p{interface_constraints} matrices
                                   // for all dimensions.
   std::vector<FullMatrix<double> >
     dofs_cell (GeometryInfo<1>::max_children_per_cell,
@@ -105,7 +105,7 @@ FE_Q_Hierarchical<dim>::get_name () const
                                   // this function returns, so they
                                   // have to be kept in synch
 
-  std::ostringstream namebuf;  
+  std::ostringstream namebuf;
   namebuf << "FE_Q_Hierarchical<" << dim << ">(" << this->degree << ")";
 
   return namebuf.str();
@@ -183,12 +183,12 @@ FE_Q_Hierarchical<dim>::build_dofs_cell (std::vector<FullMatrix<double> > &dofs_
                                           // upper diagonal block
          if ((j<=1) && (k<=1))
            {
-             if (((c==0) && (j==0) && (k==0)) || 
+             if (((c==0) && (j==0) && (k==0)) ||
                  ((c==1) && (j==1) && (k==1)))
                dofs_cell[c](j,k) = 1.;
-             else 
+             else
                dofs_cell[c](j,k) = 0.;
-             
+
              if      (((c==0) && (j==1)) || ((c==1) && (j==0)))
                dofs_subcell[c](j,k) = .5;
              else if (((c==0) && (k==0)) || ((c==1) && (k==1)))
@@ -211,7 +211,7 @@ FE_Q_Hierarchical<dim>::build_dofs_cell (std::vector<FullMatrix<double> > &dofs_
                factor *= ((double) (k-i+1))/((double) i);
              if (c==0)
                {
-                 dofs_subcell[c](j,k) = ((k+j) % 2 == 0) ? 
+                 dofs_subcell[c](j,k) = ((k+j) % 2 == 0) ?
                                         std::pow(.5,static_cast<double>(k))*factor :
                                         -std::pow(.5,static_cast<double>(k))*factor;
                  dofs_cell[c](j,k) = std::pow(2.,static_cast<double>(j))*factor;
@@ -219,7 +219,7 @@ FE_Q_Hierarchical<dim>::build_dofs_cell (std::vector<FullMatrix<double> > &dofs_
              else
                {
                  dofs_subcell[c](j,k) = std::pow(.5,static_cast<double>(k))*factor;
-                 dofs_cell[c](j,k) = ((k+j) % 2 == 0) ? 
+                 dofs_cell[c](j,k) = ((k+j) % 2 == 0) ?
                                      std::pow(2.,static_cast<double>(j))*factor :
                                      -std::pow(2.,static_cast<double>(j))*factor;
                }
@@ -247,58 +247,58 @@ initialize_constraints (const std::vector<FullMatrix<double> > &dofs_subcell)
                                         // no constraints in 1d
        break;
       }
-       
+
       case 2:
       {
                                         // vertex node
        for (unsigned int i=0; i<dofs_1d; ++i)
-         this->interface_constraints(0,i) = dofs_subcell[0](1,i); 
+         this->interface_constraints(0,i) = dofs_subcell[0](1,i);
                                         // edge nodes
        for (unsigned int c=0; c<GeometryInfo<1>::max_children_per_cell; ++c)
          for (unsigned int i=0; i<dofs_1d; ++i)
            for (unsigned int j=2; j<dofs_1d; ++j)
-             this->interface_constraints(1 + c*(degree-1) + j - 2,i) = 
+             this->interface_constraints(1 + c*(degree-1) + j - 2,i) =
                dofs_subcell[c](j,i);
        break;
       }
-       
+
       case 3:
       {
        for (unsigned int i=0; i<dofs_1d * dofs_1d; i++)
          {
-                                            // center vertex node        
-           this->interface_constraints(0,face_renumber[i]) = 
-             dofs_subcell[0](1,i % dofs_1d) * 
+                                            // center vertex node
+           this->interface_constraints(0,face_renumber[i]) =
+             dofs_subcell[0](1,i % dofs_1d) *
              dofs_subcell[0](1,(i - (i % dofs_1d)) / dofs_1d);
 
                                             // boundary vertex nodes
-           this->interface_constraints(1,face_renumber[i]) = 
-             dofs_subcell[0](0, i % dofs_1d) * 
+           this->interface_constraints(1,face_renumber[i]) =
+             dofs_subcell[0](0, i % dofs_1d) *
              dofs_subcell[0](1, (i - (i % dofs_1d)) / dofs_1d);
-           this->interface_constraints(2,face_renumber[i]) = 
-             dofs_subcell[1](1, i % dofs_1d) * 
+           this->interface_constraints(2,face_renumber[i]) =
+             dofs_subcell[1](1, i % dofs_1d) *
              dofs_subcell[0](1, (i - (i % dofs_1d)) / dofs_1d);
-           this->interface_constraints(3,face_renumber[i]) = 
-             dofs_subcell[0](1, i % dofs_1d) * 
+           this->interface_constraints(3,face_renumber[i]) =
+             dofs_subcell[0](1, i % dofs_1d) *
              dofs_subcell[0](0, (i - (i % dofs_1d)) / dofs_1d);
-           this->interface_constraints(4,face_renumber[i]) = 
-             dofs_subcell[1](0, i % dofs_1d) * 
+           this->interface_constraints(4,face_renumber[i]) =
+             dofs_subcell[1](0, i % dofs_1d) *
              dofs_subcell[1](1, (i - (i % dofs_1d)) / dofs_1d);
-         
+
                                             // interior edges
            for (unsigned int j=0; j<(degree-1); j++)
              {
-               this->interface_constraints(5 + j,face_renumber[i]) = 
-                 dofs_subcell[0](1, i % dofs_1d) * 
+               this->interface_constraints(5 + j,face_renumber[i]) =
+                 dofs_subcell[0](1, i % dofs_1d) *
                  dofs_subcell[0](2 + j, (i - (i % dofs_1d)) / dofs_1d);
-               this->interface_constraints(5 + (degree-1) + j,face_renumber[i]) = 
-                 dofs_subcell[0](1,i % dofs_1d) * 
+               this->interface_constraints(5 + (degree-1) + j,face_renumber[i]) =
+                 dofs_subcell[0](1,i % dofs_1d) *
                  dofs_subcell[1](2 + j, (i - (i % dofs_1d)) / dofs_1d);
-               this->interface_constraints(5 + 2*(degree-1) + j,face_renumber[i]) = 
-                 dofs_subcell[0](2 + j,i % dofs_1d) * 
+               this->interface_constraints(5 + 2*(degree-1) + j,face_renumber[i]) =
+                 dofs_subcell[0](2 + j,i % dofs_1d) *
                  dofs_subcell[1](0, (i - (i % dofs_1d)) / dofs_1d);
-               this->interface_constraints(5 + 3*(degree-1) + j,face_renumber[i]) = 
-                 dofs_subcell[1](2 + j, i % dofs_1d) * 
+               this->interface_constraints(5 + 3*(degree-1) + j,face_renumber[i]) =
+                 dofs_subcell[1](2 + j, i % dofs_1d) *
                  dofs_subcell[0](1, (i - (i % dofs_1d)) / dofs_1d);
              }
 
@@ -307,31 +307,31 @@ initialize_constraints (const std::vector<FullMatrix<double> > &dofs_subcell)
              {
                                                 // left edge
                this->interface_constraints(5 + 4*(degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[0](0,     i % dofs_1d) * 
+                 dofs_subcell[0](0,     i % dofs_1d) *
                  dofs_subcell[0](2 + j, (i - (i % dofs_1d)) / dofs_1d);
                this->interface_constraints(5 + 4*(degree-1) + (degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[0](0,     i % dofs_1d) * 
+                 dofs_subcell[0](0,     i % dofs_1d) *
                  dofs_subcell[1](2 + j, (i - (i % dofs_1d)) / dofs_1d);
                                                 // right edge
                this->interface_constraints(5 + 4*(degree-1) + 2*(degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[1](1,     i % dofs_1d) * 
+                 dofs_subcell[1](1,     i % dofs_1d) *
                  dofs_subcell[0](2 + j, (i - (i % dofs_1d)) / dofs_1d);
                this->interface_constraints(5 + 4*(degree-1) + 3*(degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[1](1,     i % dofs_1d) * 
+                 dofs_subcell[1](1,     i % dofs_1d) *
                  dofs_subcell[1](2 + j, (i - (i % dofs_1d)) / dofs_1d);
-                                                // bottom edge 
+                                                // bottom edge
                this->interface_constraints(5 + 4*(degree-1) + 4*(degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[0](2 + j, i % dofs_1d) * 
+                 dofs_subcell[0](2 + j, i % dofs_1d) *
                  dofs_subcell[0](0,     (i - (i % dofs_1d)) / dofs_1d);
                this->interface_constraints(5 + 4*(degree-1) + 5*(degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[1](2 + j, i % dofs_1d) * 
+                 dofs_subcell[1](2 + j, i % dofs_1d) *
                  dofs_subcell[0](0,     (i - (i % dofs_1d)) / dofs_1d);
                                                 // top edge
                this->interface_constraints(5 + 4*(degree-1) + 6*(degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[0](2 + j, i % dofs_1d) * 
+                 dofs_subcell[0](2 + j, i % dofs_1d) *
                  dofs_subcell[1](1,     (i - (i % dofs_1d)) / dofs_1d);
                this->interface_constraints(5 + 4*(degree-1) + 7*(degree-1) + j,face_renumber[i]) =
-                 dofs_subcell[1](2 + j, i % dofs_1d) * 
+                 dofs_subcell[1](2 + j, i % dofs_1d) *
                  dofs_subcell[1](1,     (i - (i % dofs_1d)) / dofs_1d);
              }
 
@@ -341,25 +341,25 @@ initialize_constraints (const std::vector<FullMatrix<double> > &dofs_subcell)
                {
                                                   // subcell 0
                  this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1),face_renumber[i]) =
-                   dofs_subcell[0](2 + j, i % dofs_1d) * 
+                   dofs_subcell[0](2 + j, i % dofs_1d) *
                    dofs_subcell[0](2 + k, (i - (i % dofs_1d)) / dofs_1d);
                                                   // subcell 1
                  this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1) + (degree-1)*(degree-1),face_renumber[i]) =
-                   dofs_subcell[1](2 + j, i % dofs_1d) * 
+                   dofs_subcell[1](2 + j, i % dofs_1d) *
                    dofs_subcell[0](2 + k, (i - (i % dofs_1d)) / dofs_1d);
                                                   // subcell 2
                  this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1) + 2*(degree-1)*(degree-1),face_renumber[i]) =
-                   dofs_subcell[0](2 + j, i % dofs_1d) * 
+                   dofs_subcell[0](2 + j, i % dofs_1d) *
                    dofs_subcell[1](2 + k, (i - (i % dofs_1d)) / dofs_1d);
                                                   // subcell 3
                  this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1) + 3*(degree-1)*(degree-1),face_renumber[i]) =
-                   dofs_subcell[1](2 + j, i % dofs_1d) * 
+                   dofs_subcell[1](2 + j, i % dofs_1d) *
                    dofs_subcell[1](2 + k, (i - (i % dofs_1d)) / dofs_1d);
                }
          }
        break;
       }
-       
+
       default:
            Assert (false, ExcNotImplemented());
     }
@@ -378,7 +378,7 @@ initialize_embedding_and_restriction (const std::vector<FullMatrix<double> > &do
   const unsigned int dofs_1d = 2*this->dofs_per_vertex + this->dofs_per_line;
   const std::vector<unsigned int> &renumber=
     this->poly_space.get_numbering();
-  
+
   for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
     {
       this->prolongation[iso][c].reinit (this->dofs_per_cell, this->dofs_per_cell);
@@ -399,7 +399,7 @@ initialize_embedding_and_restriction (const std::vector<FullMatrix<double> > &do
 
                                   // for higher dimensions, things
                                   // are a little more tricky:
-  
+
                                   // j loops over dofs in the
                                   // subcell.  These are the rows in
                                   // the embedding matrix.
@@ -420,13 +420,13 @@ initialize_embedding_and_restriction (const std::vector<FullMatrix<double> > &do
                                                 // bottom/top line: 0/1
                const unsigned int c1 = c/2;
 
-               this->prolongation[iso][c](j,i) = 
+               this->prolongation[iso][c](j,i) =
                  dofs_subcell[c0](renumber[j] % dofs_1d,
                                   renumber[i] % dofs_1d) *
                  dofs_subcell[c1]((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d,
                                   (renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d);
 
-               this->restriction[iso][c](j,i) = 
+               this->restriction[iso][c](j,i) =
                  dofs_cell[c0](renumber[j] % dofs_1d,
                                renumber[i] % dofs_1d) *
                  dofs_cell[c1]((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d,
@@ -434,7 +434,7 @@ initialize_embedding_and_restriction (const std::vector<FullMatrix<double> > &do
              }
            break;
          }
-            
+
          case 3:
          {
            for (unsigned int c=0; c<GeometryInfo<3>::max_children_per_cell; ++c)
@@ -446,7 +446,7 @@ initialize_embedding_and_restriction (const std::vector<FullMatrix<double> > &do
                                                 // bottom/top face: 0/1
                const unsigned int c2 = c/4;
 
-               this->prolongation[iso][c](j,i) = 
+               this->prolongation[iso][c](j,i) =
                  dofs_subcell[c0](renumber[j] % dofs_1d,
                                   renumber[i] % dofs_1d) *
                  dofs_subcell[c1](((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d) % dofs_1d,
@@ -454,7 +454,7 @@ initialize_embedding_and_restriction (const std::vector<FullMatrix<double> > &do
                  dofs_subcell[c2](((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d - (((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d ) % dofs_1d)) / dofs_1d,
                                   ((renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d - (((renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d ) % dofs_1d)) / dofs_1d);
 
-               this->restriction[iso][c](j,i) = 
+               this->restriction[iso][c](j,i) =
                  dofs_cell[c0](renumber[j] % dofs_1d,
                                renumber[i] % dofs_1d) *
                  dofs_cell[c1](((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d) % dofs_1d,
@@ -479,12 +479,12 @@ void FE_Q_Hierarchical<dim>::initialize_unit_support_points ()
   unsigned int n = this->degree+1;
   for (unsigned int i=1; i<dim; ++i)
     n *= this->degree+1;
-  
+
   this->unit_support_points.resize(n);
 
   const std::vector<unsigned int> &index_map_inverse=
     this->poly_space.get_numbering_inverse();
-  
+
   Point<dim> p;
                                    // the method of numbering allows
                                    // each dof to be associated with a
@@ -544,7 +544,6 @@ void FE_Q_Hierarchical<dim>::initialize_unit_support_points ()
 }
 
 
-#if deal_II_dimension == 1
 
 template <>
 void FE_Q_Hierarchical<1>::initialize_unit_face_support_points ()
@@ -576,11 +575,8 @@ get_subface_interpolation_matrix (const FiniteElement<1> &/*x_source_fe*/,
          ExcInterpolationNotImplemented ());
 }
 
-#endif
 
 
-#if deal_II_dimension > 1
-
 template <int dim>
 void
 FE_Q_Hierarchical<dim>::
@@ -625,25 +621,25 @@ get_face_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
          typename FEL::
          ExcInterpolationNotImplemented ());
   interpolation_matrix = 0;
-  
+
   switch (dim) {
     case 2: {
       for (unsigned int i = 0; i < this->dofs_per_face; ++i)
        interpolation_matrix (i, i) = 1;
-        
+
       break;
     }
-     
+
     case 3: {
       for (unsigned int i = 0; i < GeometryInfo<3>::vertices_per_face; ++i)
        interpolation_matrix (i, i) = 1;
-        
+
       for (unsigned int i = 0; i < this->degree - 1; ++i) {
        for (unsigned int j = 0; j < GeometryInfo<3>::lines_per_face; ++j)
          interpolation_matrix (
            i + j * (x_source_fe.degree - 1) + GeometryInfo<3>::vertices_per_face,
            i + j * (this->degree - 1) + GeometryInfo<3>::vertices_per_face) = 1;
-        
+
        for (unsigned int j = 0; j < this->degree - 1; ++j)
          interpolation_matrix (
            (i + GeometryInfo<3>::lines_per_face) * (x_source_fe.degree - 1) + j
@@ -701,7 +697,7 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
   Assert (this->dofs_per_face <= source_fe.dofs_per_face,
          typename FEL::
          ExcInterpolationNotImplemented ());
-  
+
   switch (dim)
     {
       case 2:
@@ -713,68 +709,68 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
              interpolation_matrix (0, 0) = 1.0;
              interpolation_matrix (1, 0) = 0.5;
              interpolation_matrix (1, 1) = 0.5;
-                 
+
              for (unsigned int dof = 2; dof < this->dofs_per_face;)
                {
                  interpolation_matrix (1, dof) = -1.0;
                  dof = dof + 2;
                }
-                 
+
              int factorial_i = 1;
              int factorial_ij;
              int factorial_j;
-                 
+
              for (int i = 2; i < (int) this->dofs_per_face; ++i)
                {
                  interpolation_matrix (i, i) = std::pow (0.5, i);
                  factorial_i *= i;
                  factorial_j = factorial_i;
                  factorial_ij = 1;
-                    
+
                  for (int j = i + 1; j < (int) this->dofs_per_face; ++j)
                    {
                      factorial_ij *= j - i;
                      factorial_j *= j;
-                       
+
                      if ((i + j) & 1)
                        interpolation_matrix (i, j)
                          = -1.0 * std::pow (0.5, j) *
                          factorial_j / (factorial_i * factorial_ij);
-                       
+
                      else
                        interpolation_matrix (i, j)
                          = std::pow (0.5, j) *
                          factorial_j / (factorial_i * factorial_ij);
                    }
                }
-       
+
              break;
            }
-          
+
            case 1:
            {
              interpolation_matrix (0, 0) = 0.5;
              interpolation_matrix (0, 1) = 0.5;
-                 
+
              for (unsigned int dof = 2; dof < this->dofs_per_face;)
                {
                  interpolation_matrix (0, dof) = -1.0;
                  dof = dof + 2;
                }
-                 
+
              interpolation_matrix (1, 1) = 1.0;
-                 
+
              int factorial_i = 1;
              int factorial_ij;
              int factorial_j;
-                 
+
              for (int i = 2; i < (int) this->dofs_per_face; ++i)
                {
                  interpolation_matrix (i, i) = std::pow (0.5, i);
                  factorial_i *= i;
                  factorial_j = factorial_i;
                  factorial_ij = 1;
-                    
+
                  for (int j = i + 1; j < (int) this->dofs_per_face; ++j)
                    {
                      factorial_ij *= j - i;
@@ -785,10 +781,10 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                }
            }
          }
-       
+
         break;
       }
-     
+
       case 3:
       {
         switch (subface)
@@ -800,33 +796,33 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
               interpolation_matrix (1, 1) = 0.5;
               interpolation_matrix (2, 0) = 0.5;
               interpolation_matrix (2, 2) = 0.5;
-                 
+
              for (unsigned int i = 0; i < this->degree - 1;)
                {
                  for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
                    interpolation_matrix (3, i + line * (this->degree - 1) + 4) = -0.5;
-                    
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (3, i + (j + 4) * this->degree - j) = 1.0;
                      j = j + 2;
                    }
-                    
+
                  interpolation_matrix (1, i + 2 * (this->degree + 1)) = -1.0;
                  interpolation_matrix (2, i + 4) = -1.0;
                  i = i + 2;
                }
-                 
+
              for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
                interpolation_matrix (3, vertex) = 0.25;
-                 
+
              int factorial_i = 1;
              int factorial_ij;
              int factorial_j;
              int factorial_k;
              int factorial_kl;
              int factorial_l;
-                 
+
              for (int i = 2; i <= (int) this->degree; ++i)
                {
                  double tmp = std::pow (0.5, i);
@@ -838,78 +834,78 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                  interpolation_matrix (i + 3 * source_fe.degree - 1, i + 2 * this->degree) = tmp;
                  interpolation_matrix (i + 3 * source_fe.degree - 1, i + 3 * this->degree - 1) = tmp;
                  tmp *= -2.0;
-                    
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (i + source_fe.degree + 1, (i + 2) * this->degree + j + 2 - i) = tmp;
                      interpolation_matrix (i + 3 * source_fe.degree - 1, i + (j + 4) * this->degree - j - 2) = tmp;
                      j = j + 2;
                    }
-                    
+
                  factorial_k = 1;
-                    
+
                  for (int j = 2; j <= (int) this->degree; ++j)
                    {
                      interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
                      factorial_k *= j;
                      factorial_kl = 1;
                      factorial_l = factorial_k;
-                       
+
                      for (int k = j + 1; k < (int) this->degree; ++k)
                        {
                          factorial_kl *= k - j;
                          factorial_l *= k;
-                          
+
                          if ((j + k) & 1)
                            interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = -1.0 * std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
-                          
+
                          else
                            interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
                        }
                    }
-                    
+
                  factorial_i *= i;
                  factorial_j = factorial_i;
                  factorial_ij = 1;
-                    
+
                  for (int j = i + 1; j <= (int) this->degree; ++j)
                    {
                      factorial_ij *= j - i;
                      factorial_j *= j;
-                       
+
                      if ((i + j) & 1)
                        {
                          tmp = -1.0 * std::pow (0.5, j) * factorial_j / (factorial_i * factorial_ij);
                          interpolation_matrix (i + 2, j + 2) = tmp;
                          interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
                          factorial_k = 1;
-                          
+
                          for (int k = 2; k <= (int) this->degree; ++k)
                            {
                              interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
                              factorial_k *= k;
                              factorial_l = factorial_k;
                              factorial_kl = 1;
-                             
+
                              for (int l = k + 1; l <= (int) this->degree; ++l) {
                                factorial_kl *= l - k;
                                factorial_l *= l;
-                                
+
                                if ((k + l) & 1)
                                  interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = -1.0 * tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
-                                
+
                                else
                                  interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
                              }
                            }
-                          
+
                          tmp *= 0.5;
                          interpolation_matrix (i + source_fe.degree + 1, j + 2) = tmp;
                          interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
                          interpolation_matrix (i + 3 * source_fe.degree - 1, j + 2 * this->degree) = tmp;
                          interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
                          tmp *= -2.0;
-                          
+
                          for (unsigned int k = 0; k < this->degree - 1;)
                            {
                              interpolation_matrix (i + source_fe.degree + 1, (j + 2) * this->degree + k + 2 - j) = tmp;
@@ -923,34 +919,34 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                          interpolation_matrix (i + 2, j + 2) = tmp;
                          interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
                          factorial_k = 1;
-                          
+
                          for (int k = 2; k <= (int) this->degree; ++k)
                            {
                              interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
                              factorial_k *= k;
                              factorial_l = factorial_k;
                              factorial_kl = 1;
-                             
+
                              for (int l = k + 1; l <= (int) this->degree; ++l)
                                {
                                  factorial_kl *= l - k;
                                  factorial_l *= l;
-                                
+
                                  if ((k + l) & 1)
                                    interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = -1.0 * tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
-                                
+
                                  else
                                    interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
                                }
                            }
-                          
+
                          tmp *= 0.5;
                          interpolation_matrix (i + source_fe.degree + 1, j + 2) = tmp;
                          interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
                          interpolation_matrix (i + 3 * source_fe.degree - 1, j + 2 * this->degree) = tmp;
                          interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
                          tmp *= -2.0;
-                          
+
                          for (unsigned int k = 0; k < this->degree - 1;)
                            {
                              interpolation_matrix (i + source_fe.degree + 1, (j + 2) * this->degree + k + 2 - j) = tmp;
@@ -960,10 +956,10 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                        }
                    }
                }
-                 
+
               break;
            }
-           
+
            case 1:
            {
              interpolation_matrix (0, 0) = 0.5;
@@ -971,33 +967,33 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
              interpolation_matrix (1, 1) = 1.0;
              interpolation_matrix (3, 1) = 0.5;
              interpolation_matrix (3, 3) = 0.5;
-                 
+
              for (unsigned int i = 0; i < this->degree - 1;)
                {
                  for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
                    interpolation_matrix (2, i + line * (this->degree - 1) + 4) = -0.5;
-                        
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (2, i + (j + 4) * this->degree - j) = 1.0;
                      j = j + 2;
                    }
-                        
+
                  interpolation_matrix (0, i + 2 * (this->degree + 1)) = -1.0;
                  interpolation_matrix (3, i + this->degree + 3) = -1.0;
                  i = i + 2;
                }
-                 
+
              for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
                interpolation_matrix (2, vertex) = 0.25;
-                 
+
              int factorial_i = 1;
              int factorial_ij;
              int factorial_j;
              int factorial_k;
              int factorial_kl;
              int factorial_l;
-                 
+
              for (int i = 2; i <= (int) this->degree; ++i)
                {
                  double tmp = std::pow (0.5, i + 1);
@@ -1006,21 +1002,21 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                  interpolation_matrix (i + 3 * source_fe.degree - 1, i + 2 * this->degree) = tmp;
                  interpolation_matrix (i + 3 * source_fe.degree - 1, i + 3 * this->degree - 1) = tmp;
                  tmp *= -2.0;
-                    
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (i + 2, j + (i + 2) * this->degree + 2 - i) = tmp;
                      interpolation_matrix (i + 3 * source_fe.degree - 1, i + (j + 4) * this->degree - j - 2) = tmp;
                      j = j + 2;
                    }
-                        
+
                  tmp *= - 1.0;
                  interpolation_matrix (i + source_fe.degree + 1, i + this->degree + 1) = tmp;
                  interpolation_matrix (i + 2 * source_fe.degree, i + 2 * this->degree) = tmp;
                  factorial_i *= i;
                  factorial_j = factorial_i;
                  factorial_ij = 1;
-                    
+
                  for (int j = i + 1; j <= (int) this->degree; ++j)
                    {
                      factorial_ij *= j - i;
@@ -1028,80 +1024,80 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                      tmp = std::pow (0.5, j) * factorial_j / (factorial_i * factorial_ij);
                      interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
                      factorial_k = 1;
-                       
+
                      for (int k = 2; k <= (int) this->degree; ++k)
                        {
                          interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
                          factorial_k *= k;
                          factorial_l = factorial_k;
                          factorial_kl = 1;
-                          
+
                          for (int l = k + 1; l <= (int) this->degree; ++l)
                            {
                              factorial_kl *= l - k;
                              factorial_l *= l;
-                             
+
                              if ((k + l) & 1)
                                interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = -1.0 * tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
-                             
+
                              else
                                interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
                            }
                        }
-                       
+
                      tmp *= -1.0;
-                       
+
                      for (unsigned int k = 0; k < this->degree - 1;)
                        {
                          interpolation_matrix (i + 3 * source_fe.degree - 1, j + (k + 4) * this->degree - k - 2) = tmp;
                          k = k + 2;
                        }
-                       
+
                      tmp *= -0.5;
                      interpolation_matrix (i + 3 * source_fe.degree - 1, j + 2 * this->degree) = tmp;
                      interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
-                       
+
                      if ((i + j) & 1)
                        tmp *= -1.0;
-                          
+
                      interpolation_matrix (i + 2, j + 2) = tmp;
                      interpolation_matrix (i + 2, j + this->degree + 1) = tmp;
                      interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = 2.0 * tmp;
                      tmp *= -2.0;
-                       
+
                      for (unsigned int k = 0; k < this->degree - 1;)
                        {
                          interpolation_matrix (i + 2, k + (j + 2) * this->degree + 2 - j) = tmp;
                          k = k + 2;
                        }
                    }
-                    
+
                  factorial_k = 1;
-                    
+
                  for (int j = 2; j <= (int) this->degree; ++j)
                    {
                      interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
                      factorial_k *= j;
                      factorial_l = factorial_k;
                      factorial_kl = 1;
-                       
+
                      for (int k = j + 1; k <= (int) this->degree; ++k)
                        {
                          factorial_kl *= k - j;
                          factorial_l *= k;
-                          
+
                          if ((j + k) & 1)
                            interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = -1.0 * std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
-                          
+
                          else
                            interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
                        }
                    }
                }
-                 
+
               break;
            }
-           
+
            case 2:
            {
               interpolation_matrix (0, 0) = 0.5;
@@ -1109,33 +1105,33 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
               interpolation_matrix (2, 2) = 1.0;
               interpolation_matrix (3, 2) = 0.5;
               interpolation_matrix (3, 3) = 0.5;
-              
+
               for (unsigned int i = 0; i < this->degree - 1;)
                {
                  for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
                     interpolation_matrix (1, i + line * (this->degree - 1) + 4) = -0.5;
-                 
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (1, i + (j + 4) * this->degree - j) = 1.0;
                      j = j + 2;
                    }
-                 
+
                  interpolation_matrix (0, i + 4) = -1.0;
                  interpolation_matrix (3, i + 3 * this->degree + 1) = -1.0;
                  i = i + 2;
                }
-              
+
               for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
                interpolation_matrix (1, vertex) = 0.25;
-              
+
               int factorial_i = 1;
               int factorial_ij;
               int factorial_j;
               int factorial_k;
               int factorial_kl;
               int factorial_l;
-              
+
               for (int i = 2; i <= (int) this->degree; ++i)
                {
                  double tmp = std::pow (0.5, i);
@@ -1147,23 +1143,23 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                  interpolation_matrix (i + 2 * source_fe.degree, i + 2 * this->degree) = tmp;
                  interpolation_matrix (i + 2 * source_fe.degree, i + 3 * this->degree - 1) = tmp;
                  tmp *= -2.0;
-                 
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (i + source_fe.degree + 1, j + (i + 2) * this->degree + 2 - i) = tmp;
                      interpolation_matrix (i + 2 * source_fe.degree, i + (j + 4) * this->degree - j - 2) = tmp;
                      j = j + 2;
                    }
-                 
+
                  factorial_k = 1;
-                 
+
                  for (int j = 2; j <= (int) this->degree; ++j)
                    {
                      interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
                      factorial_k *= j;
                      factorial_l = factorial_k;
                      factorial_kl = 1;
-                    
+
                      for (int k = j + 1; k <= (int) this->degree; ++k)
                        {
                          factorial_kl *= k - j;
@@ -1171,11 +1167,11 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                          interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
                        }
                    }
-                 
+
                  factorial_i *= i;
                  factorial_j = factorial_i;
                  factorial_ij = 1;
-                 
+
                  for (int j = i + 1; j <= (int) this->degree; ++j)
                    {
                      factorial_ij *= j - i;
@@ -1183,33 +1179,33 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                      tmp = std::pow (0.5, j) * factorial_j / (factorial_i * factorial_ij);
                      interpolation_matrix (i + 2, j + 2) = tmp;
                      tmp *= -1.0;
-                    
+
                      for (unsigned int k = 0; k < this->degree - 1;)
                        {
                          interpolation_matrix (i + source_fe.degree + 1, k + (j + 2) * this->degree + 2 - j) = tmp;
                          k = k + 2;
                        }
-                    
+
                      tmp *= -0.5;
                      interpolation_matrix (i + source_fe.degree + 1, j + 2) = tmp;
                      interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
-                    
+
                      if ((i + j) & 1)
                        tmp *= -1.0;
-                       
+
                      interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
                      interpolation_matrix (i + 2 * source_fe.degree, j + 3 * this->degree - 1) = tmp;
                      tmp *= 2.0;
                      interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
                      factorial_k = 1;
-                    
+
                      for (int k = 2; k <= (int) this->degree; ++k)
                        {
                          interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
                          factorial_k *= k;
                          factorial_l = factorial_k;
                          factorial_kl = 1;
-                       
+
                          for (int l = k + 1; l <= (int) this->degree; ++l)
                            {
                              factorial_kl *= l - k;
@@ -1217,9 +1213,9 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                              interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
                            }
                        }
-                    
+
                      tmp *= -1.0;
-                       
+
                      for (unsigned int k = 0; k < this->degree - 1;)
                        {
                          interpolation_matrix (i + 2 * source_fe.degree, j + (k + 4) * this->degree - k - 2) = tmp;
@@ -1227,44 +1223,44 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                        }
                    }
                }
-              
+
               break;
            }
-           
+
            case 3:
            {
               for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
                interpolation_matrix (0, vertex) = 0.25;
-              
+
               for (unsigned int i = 0; i < this->degree - 1;)
                {
                  for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
                     interpolation_matrix (0, i + line * (this->degree - 1) + 4) = -0.5;
-                 
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (0, i + (j + 4) * this->degree - j) = 1.0;
                      j = j + 2;
                    }
-                 
+
                  interpolation_matrix (1, i + 4) = -1.0;
                  interpolation_matrix (2, i + 3 * this->degree + 1) = -1.0;
                  i = i + 2;
                }
-              
+
               interpolation_matrix (1, 0) = 0.5;
               interpolation_matrix (1, 1) = 0.5;
               interpolation_matrix (2, 2) = 0.5;
               interpolation_matrix (2, 3) = 0.5;
               interpolation_matrix (3, 3) = 1.0;
-              
+
               int factorial_i = 1;
               int factorial_ij;
               int factorial_j;
               int factorial_k;
               int factorial_kl;
               int factorial_l;
-              
+
               for (int i = 2; i <= (int) this->degree; ++i)
                {
                  double tmp = std::pow (0.5, i + 1);
@@ -1273,26 +1269,26 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                  interpolation_matrix (i + 2 * source_fe.degree, i + 2 * this->degree) = tmp;
                  interpolation_matrix (i + 2 * source_fe.degree, i + 3 * this->degree - 1) = tmp;
                  tmp *= -2.0;
-                 
+
                  for (unsigned int j = 0; j < this->degree - 1;)
                    {
                      interpolation_matrix (i + 2, j + (i + 2) * this->degree + 2 - i) = tmp;
                      interpolation_matrix (i + 2 * source_fe.degree, i + (j + 4) * this->degree - 2) = tmp;
                      j = j + 2;
                    }
-                 
+
                  tmp *= -1.0;
                  interpolation_matrix (i + source_fe.degree + 1, i + this->degree + 1) = tmp;
                  interpolation_matrix (i + 3 * source_fe.degree - 1, i + 3 * this->degree - 1) = tmp;
                  factorial_k = 1;
-                 
+
                  for (int j = 2; j <= (int) this->degree; ++j)
                    {
                      interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
                      factorial_k *= j;
                      factorial_l = factorial_k;
                      factorial_kl = 1;
-                    
+
                      for (int k = j + 1; k <= (int) this->degree; ++k)
                        {
                          factorial_kl *= k - j;
@@ -1300,11 +1296,11 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                          interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
                        }
                    }
-                 
+
                  factorial_i *= i;
                  factorial_j = factorial_i;
                  factorial_ij = 1;
-                 
+
                  for (int j = i + 1; j <= (int) this->degree; ++j)
                    {
                      factorial_ij *= j - i;
@@ -1318,14 +1314,14 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                      interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
                      interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
                      factorial_k = 1;
-                    
+
                      for (int k = 2; k <= (int) this->degree; ++k)
                        {
                          interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
                          factorial_k *= k;
                          factorial_l = factorial_k;
                          factorial_kl = 1;
-                       
+
                          for (int l = k + 1; l <= (int) this->degree; ++l)
                            {
                              factorial_kl *= l - k;
@@ -1333,15 +1329,15 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
                              interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
                            }
                        }
-                    
+
                      tmp *= -1.0;
-                    
+
                      for (unsigned int k = 0; k < this->degree - 1;)
                        {
                          interpolation_matrix (i + 2, k + (j + 2) * this->degree + 2 - j) = tmp;
                          interpolation_matrix (i + 2 * source_fe.degree, j + (k + 4) * this->degree - 2) = tmp;
                          k = k + 2;
-                       }                    
+                       }
                    }
                }
            }
@@ -1350,23 +1346,22 @@ get_subface_interpolation_matrix (const FiniteElement<dim> &x_source_fe,
     }
 }
 
-#endif
 
 
 template <int dim>
 void FE_Q_Hierarchical<dim>::initialize_unit_face_support_points ()
 {
   const unsigned int codim = dim-1;
-  
+
                                   // number of points: (degree+1)^codim
   unsigned int n = this->degree+1;
   for (unsigned int i=1; i<codim; ++i)
     n *= this->degree+1;
-  
+
   this->unit_face_support_points.resize(n);
-  
+
   Point<codim> p;
-  
+
   unsigned int k=0;
   for (unsigned int iz=0; iz <= ((codim>2) ? this->degree : 0) ; ++iz)
     for (unsigned int iy=0; iy <= ((codim>1) ? this->degree : 0) ; ++iy)
@@ -1577,9 +1572,9 @@ hierarchic_to_fe_q_hierarchical_numbering (const FiniteElementData<dim> &fe)
              h2l[next_index++] = (2+i)*n2+(2+j)*n+2+k;
 
        Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-       
+
        break;
-      }       
+      }
 
       default:
            Assert (false, ExcNotImplemented());
@@ -1599,7 +1594,6 @@ face_fe_q_hierarchical_to_hierarchic_numbering (const unsigned int degree)
 }
 
 
-#if (deal_II_dimension == 1)
 
 template <>
 std::vector<unsigned int>
@@ -1630,7 +1624,6 @@ FE_Q_Hierarchical<1>::has_support_on_face (const unsigned int shape_index,
           ((shape_index == 1) && (face_index == 1)));
 }
 
-#endif
 
 
 
@@ -1652,10 +1645,10 @@ FE_Q_Hierarchical<dim>::has_support_on_face (const unsigned int shape_index,
       ||
       ((dim==3) && (shape_index>=this->first_hex_index)))
     return false;
-  
+
                                   // let's see whether this is a
                                   // vertex
-  if (shape_index < this->first_line_index) 
+  if (shape_index < this->first_line_index)
     {
                                       // for Q elements, there is
                                       // one dof per vertex, so
@@ -1677,7 +1670,7 @@ FE_Q_Hierarchical<dim>::has_support_on_face (const unsigned int shape_index,
        = (shape_index - this->first_line_index) / this->dofs_per_line;
       Assert (line_index < GeometryInfo<dim>::lines_per_cell,
              ExcInternalError());
-      
+
       for (unsigned int i=0; i<GeometryInfo<dim>::lines_per_face; ++i)
        if (GeometryInfo<dim>::face_to_cell_lines(face_index,i) == line_index)
          return true;
@@ -1686,18 +1679,18 @@ FE_Q_Hierarchical<dim>::has_support_on_face (const unsigned int shape_index,
   else if (shape_index < this->first_hex_index)
                                     // dof is on a quad
     {
-      const unsigned int quad_index 
+      const unsigned int quad_index
        = (shape_index - this->first_quad_index) / this->dofs_per_quad;
       Assert (static_cast<signed int>(quad_index) <
              static_cast<signed int>(GeometryInfo<dim>::quads_per_cell),
              ExcInternalError());
-      
+
                                       // in 2d, cell bubble are
                                       // zero on all faces. but
                                       // we have treated this
                                       // case above already
       Assert (dim != 2, ExcInternalError());
-      
+
                                       // in 3d,
                                       // quad_index=face_index
       if (dim == 3)
@@ -1723,7 +1716,7 @@ FE_Q_Hierarchical<dim>::has_support_on_face (const unsigned int shape_index,
 
 
 template <int dim>
-std::vector<unsigned int> 
+std::vector<unsigned int>
 FE_Q_Hierarchical<dim>::get_embedding_dofs (const unsigned int sub_degree) const
 {
   Assert ((sub_degree>0) && (sub_degree<=this->degree),
@@ -1737,7 +1730,7 @@ FE_Q_Hierarchical<dim>::get_embedding_dofs (const unsigned int sub_degree) const
 
       return embedding_dofs;
     }
-  
+
   if (sub_degree==1)
     {
       std::vector<unsigned int> embedding_dofs (GeometryInfo<dim>::vertices_per_cell);
@@ -1757,11 +1750,11 @@ FE_Q_Hierarchical<dim>::get_embedding_dofs (const unsigned int sub_degree) const
 
   if ((dim==2) || (dim==3))
     {
-      std::vector<unsigned int> embedding_dofs ( (dim==2) ? 
+      std::vector<unsigned int> embedding_dofs ( (dim==2) ?
                                                 (sub_degree+1) * (sub_degree+1) :
                                                 (sub_degree+1) * (sub_degree+1) * (sub_degree+1) );
 
-      for (unsigned int i=0; i<( (dim==2) ? 
+      for (unsigned int i=0; i<( (dim==2) ?
                                 (sub_degree+1) * (sub_degree+1) :
                                 (sub_degree+1) * (sub_degree+1) * (sub_degree+1) ); ++i)
        {
@@ -1769,36 +1762,36 @@ FE_Q_Hierarchical<dim>::get_embedding_dofs (const unsigned int sub_degree) const
          if (i<GeometryInfo<dim>::vertices_per_cell)
            embedding_dofs[i] = i;
                                           // line
-         else if (i<(GeometryInfo<dim>::vertices_per_cell + 
+         else if (i<(GeometryInfo<dim>::vertices_per_cell +
                      GeometryInfo<dim>::lines_per_cell * (sub_degree-1)))
            {
              const unsigned int j = (i - GeometryInfo<dim>::vertices_per_cell) %
                                     (sub_degree-1);
              const unsigned int line = (i - GeometryInfo<dim>::vertices_per_cell - j) / (sub_degree-1);
 
-             embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell + 
+             embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
                                  line * (this->degree-1) + j;
            }
                                           // quad
-         else if (i<(GeometryInfo<dim>::vertices_per_cell + 
-                     GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) + 
+         else if (i<(GeometryInfo<dim>::vertices_per_cell +
+                     GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) +
                   GeometryInfo<dim>::quads_per_cell * (sub_degree-1) * (sub_degree-1))
            {
              const unsigned int j = (i - GeometryInfo<dim>::vertices_per_cell -
                                      GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) % (sub_degree-1);
              const unsigned int k = ( (i - GeometryInfo<dim>::vertices_per_cell -
                                        GeometryInfo<dim>::lines_per_cell * (sub_degree-1) - j) / (sub_degree-1) ) % (sub_degree-1);
-             const unsigned int face = (i - GeometryInfo<dim>::vertices_per_cell - 
+             const unsigned int face = (i - GeometryInfo<dim>::vertices_per_cell -
                                         GeometryInfo<dim>::lines_per_cell * (sub_degree-1) - k * (sub_degree-1) - j) / ( (sub_degree-1) * (sub_degree-1) );
 
-             embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell + 
+             embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
                                  GeometryInfo<dim>::lines_per_cell * (this->degree-1) +
                                  face * (this->degree-1) * (this->degree-1) +
                                  k * (this->degree-1) + j;
            }
                                           // hex
-         else if (i<(GeometryInfo<dim>::vertices_per_cell + 
-                     GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) + 
+         else if (i<(GeometryInfo<dim>::vertices_per_cell +
+                     GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) +
                   GeometryInfo<dim>::quads_per_cell * (sub_degree-1) * (sub_degree-1) +
                   GeometryInfo<dim>::hexes_per_cell * (sub_degree-1) * (sub_degree-1) * (sub_degree-1))
            {
@@ -1811,8 +1804,8 @@ FE_Q_Hierarchical<dim>::get_embedding_dofs (const unsigned int sub_degree) const
              const unsigned int l = (i - GeometryInfo<dim>::vertices_per_cell -
                                      GeometryInfo<dim>::lines_per_cell * (sub_degree-1) -
                                      GeometryInfo<dim>::quads_per_cell * (sub_degree-1) * (sub_degree-1) - j - k * (sub_degree-1)) / ( (sub_degree-1) * (sub_degree-1) );
-        
-             embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell + 
+
+             embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
                                  GeometryInfo<dim>::lines_per_cell * (this->degree-1) +
                                  GeometryInfo<dim>::quads_per_cell * (this->degree-1) * (this->degree-1) +
                                  l * (this->degree-1) * (this->degree-1) + k * (this->degree-1) + j;
@@ -1840,6 +1833,8 @@ FE_Q_Hierarchical<dim>::memory_consumption () const
 
 
 
-template class FE_Q_Hierarchical<deal_II_dimension>;
+// explicit instantiations
+#include "fe_q_hierarchical.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_q_hierarchical.inst.in b/deal.II/source/fe/fe_q_hierarchical.inst.in
new file mode 100644 (file)
index 0000000..0350400
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_Q_Hierarchical<deal_II_dimension>;
+  }
+
index d9a6f3dfdf1304e8bb904f75c1f37dd43442423d..71162802a8e06f277dac1f89d64bc42ffdb54ed3 100644 (file)
@@ -49,7 +49,7 @@ FE_RaviartThomas<dim>::FE_RaviartThomas (const unsigned int deg)
 {
   Assert (dim >= 2, ExcImpossibleInDim(dim));
   const unsigned int n_dofs = this->dofs_per_cell;
-  
+
   this->mapping_type = mapping_raviart_thomas;
                                   // First, initialize the
                                   // generalized support points and
@@ -60,7 +60,7 @@ FE_RaviartThomas<dim>::FE_RaviartThomas (const unsigned int deg)
                                   //matrix, generating the correct
                                   //basis functions from the raw
                                   //ones.
-  
+
                                   // We use an auxiliary matrix in
                                   // this function. Therefore,
                                   // inverse_node_matrix is still
@@ -73,7 +73,7 @@ FE_RaviartThomas<dim>::FE_RaviartThomas (const unsigned int deg)
                                   // From now on, the shape functions
                                   // will be the correct ones, not
                                   // the raw shape functions anymore.
-  
+
                                   // Reinit the vectors of
                                   // restriction and prolongation
                                   // matrices to the right sizes.
@@ -118,7 +118,7 @@ FE_RaviartThomas<dim>::get_name () const
                                   // polynomial degree and is thus one higher
                                   // than the argument given to the
                                   // constructor
-  std::ostringstream namebuf;  
+  std::ostringstream namebuf;
   namebuf << "FE_RaviartThomas<" << dim << ">(" << this->degree-1 << ")";
 
   return namebuf.str();
@@ -138,58 +138,24 @@ FE_RaviartThomas<dim>::clone() const
 //---------------------------------------------------------------------------
 
 
-#if deal_II_dimension == 1
-
 template <int dim>
 void
 FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
 {
-  return;
-  
-  Assert (false, ExcNotImplemented());
-  
   QGauss<dim> cell_quadrature(deg+1);
   const unsigned int n_interior_points
     = (deg>0) ? cell_quadrature.size() : 0;
-  
-  this->generalized_support_points.resize (2 + n_interior_points);
-  
-                                  // Number of the point being entered
-  unsigned int current = 0;
-
-  
-  if (deg==0) return;
 
-  interior_weights.reinit(TableIndices<3>(2+n_interior_points, 0, dim));
-  
-  for (unsigned int k=0;k<cell_quadrature.size();++k)
-    this->generalized_support_points[current++] = cell_quadrature.point(k);
-  
-  Assert (current == this->generalized_support_points.size(),
-         ExcInternalError());
-}
-
-#else
-
-// Version for 2d and higher. See above for 1d version
-template <int dim>
-void
-FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
-{
-  QGauss<dim> cell_quadrature(deg+1);
-  const unsigned int n_interior_points
-    = (deg>0) ? cell_quadrature.size() : 0;
-  
   unsigned int n_face_points = (dim>1) ? 1 : 0;
                                   // compute (deg+1)^(dim-1)
   for (unsigned int d=1;d<dim;++d)
     n_face_points *= deg+1;
 
-  
+
   this->generalized_support_points.resize (GeometryInfo<dim>::faces_per_cell*n_face_points
                                           + n_interior_points);
   this->generalized_face_support_points.resize (n_face_points);
-  
+
                                   // Number of the point being entered
   unsigned int current = 0;
 
@@ -200,10 +166,10 @@ FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
        = Polynomials::Legendre::generate_complete_basis(deg);
 
       boundary_weights.reinit(n_face_points, legendre.n());
-      
+
 //       Assert (face_points.size() == this->dofs_per_face,
 //           ExcInternalError());
-      
+
       for (unsigned int k=0;k<n_face_points;++k)
        {
          this->generalized_face_support_points[k] = face_points.point(k);
@@ -227,9 +193,9 @@ FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
          this->generalized_support_points[current] = faces.point(current+QProjector<dim>::DataSetDescriptor::face(0,true,false,false,n_face_points));
        }
     }
-  
+
   if (deg==0) return;
-  
+
                                   // Create Legendre basis for the
                                   // space D_xi Q_k
   std::vector<AnisotropicPolynomials<dim>* > polynomials(dim);
@@ -242,9 +208,9 @@ FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
 
       polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
     }
-  
+
   interior_weights.reinit(TableIndices<3>(n_interior_points, polynomials[0]->n(), dim));
-  
+
   for (unsigned int k=0;k<cell_quadrature.size();++k)
     {
       this->generalized_support_points[current++] = cell_quadrature.point(k);
@@ -256,15 +222,12 @@ FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
 
   for (unsigned int d=0;d<dim;++d)
     delete polynomials[d];
-  
+
   Assert (current == this->generalized_support_points.size(),
          ExcInternalError());
 }
 
-#endif
-
 
-#if deal_II_dimension == 1
 
 template <>
 void
@@ -277,7 +240,7 @@ FE_RaviartThomas<1>::initialize_restriction()
     this->restriction[0][i].reinit(0,0);
 }
 
-#endif
+
 
 // This function is the same Raviart-Thomas interpolation performed by
 // interpolate. Still, we cannot use interpolate, since it was written
@@ -328,7 +291,7 @@ FE_RaviartThomas<dim>::initialize_restriction()
          const unsigned int child
            = GeometryInfo<dim>::child_cell_on_face(
              RefinementCase<dim>::isotropic_refinement, face, sub);
-         
+
                                           // On a certain face, we must
                                           // compute the moments of ALL
                                           // fine level functions with
@@ -360,9 +323,9 @@ FE_RaviartThomas<dim>::initialize_restriction()
                }
        }
     }
-  
+
   if (this->degree == 1) return;
-  
+
                                   // Create Legendre basis for the
                                   // space D_xi Q_k. Here, we cannot
                                   // use the shape functions
@@ -376,7 +339,7 @@ FE_RaviartThomas<dim>::initialize_restriction()
 
       polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
     }
-  
+
   QGauss<dim> q_cell(this->degree);
   const unsigned int start_cell_dofs
     = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
@@ -389,11 +352,11 @@ FE_RaviartThomas<dim>::initialize_restriction()
     for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
       for (unsigned int d=0;d<dim;++d)
        cached_values(i,k,d) = this->shape_value_component(i, q_cell.point(k), d);
-  
+
   for (unsigned int child=0;child<GeometryInfo<dim>::max_children_per_cell;++child)
     {
       Quadrature<dim> q_sub = QProjector<dim>::project_to_child(q_cell, child);
-      
+
       for (unsigned int k=0;k<q_sub.size();++k)
        for (unsigned int i_child = 0; i_child < this->dofs_per_cell; ++i_child)
          for (unsigned int d=0;d<dim;++d)
@@ -406,26 +369,12 @@ FE_RaviartThomas<dim>::initialize_restriction()
                  * polynomials[d]->compute_value(i_weight, q_sub.point(k));
              }
     }
-  
+
   for (unsigned int d=0;d<dim;++d)
     delete polynomials[d];
 }
 
 
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_RaviartThomas<1>::get_dpo_vector (const unsigned int deg)
-{
-  std::vector<unsigned int> dpo(2);
-  dpo[0] = 1;
-  dpo[1] = deg;
-  return dpo;
-}
-
-#endif
-
 
 template <int dim>
 std::vector<unsigned int>
@@ -440,11 +389,11 @@ FE_RaviartThomas<dim>::get_dpo_vector (const unsigned int deg)
                                    // and then there are interior dofs
   const unsigned int
     interior_dofs = dim*deg*dofs_per_face;
-  
+
   std::vector<unsigned int> dpo(dim+1);
   dpo[dim-1] = dofs_per_face;
   dpo[dim]   = interior_dofs;
-  
+
   return dpo;
 }
 
@@ -484,16 +433,16 @@ FE_RaviartThomas<dim>::has_support_on_face (
                                                // these in a table
               return (face_index != GeometryInfo<dim>::opposite_face[shape_index]);
             }
-            
+
             default:
              return true;
           };
       };
-      
+
       default:  // other rt_order
        return true;
     };
-  
+
   return true;
 }
 
@@ -534,10 +483,10 @@ FE_RaviartThomas<dim>::interpolate(
        local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
                         * values[face*n_face_points+k](GeometryInfo<dim>::unit_normal_direction[face]+offset);
       }
-  
+
   const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
   const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
-  
+
   for (unsigned int k=0;k<interior_weights.size(0);++k)
     for (unsigned int i=0;i<interior_weights.size(1);++i)
       for (unsigned int d=0;d<dim;++d)
@@ -568,10 +517,10 @@ FE_RaviartThomas<dim>::interpolate(
        local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
                         * values[GeometryInfo<dim>::unit_normal_direction[face]][face*n_face_points+k];
       }
-  
+
   const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
   const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
-  
+
   for (unsigned int k=0;k<interior_weights.size(0);++k)
     for (unsigned int i=0;i<interior_weights.size(1);++i)
       for (unsigned int d=0;d<dim;++d)
@@ -588,6 +537,9 @@ FE_RaviartThomas<dim>::memory_consumption () const
 }
 
 
-template class FE_RaviartThomas<deal_II_dimension>;
+
+// explicit instantiations
+#include "fe_raviart_thomas.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_raviart_thomas.inst.in b/deal.II/source/fe/fe_raviart_thomas.inst.in
new file mode 100644 (file)
index 0000000..46eca9e
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_RaviartThomas<deal_II_dimension>;
+  }
+
index 10221ca74cb2c96b4027b599db4f3349ca331536..716d9965b0b16f5e98c0bed6eab478421d3ec9f1 100644 (file)
@@ -42,7 +42,7 @@ FE_RaviartThomasNodal<dim>::FE_RaviartThomasNodal (const unsigned int deg)
 {
   Assert (dim >= 2, ExcImpossibleInDim(dim));
   const unsigned int n_dofs = this->dofs_per_cell;
-  
+
   this->mapping_type = mapping_raviart_thomas;
                                   // First, initialize the
                                   // generalized support points and
@@ -53,7 +53,7 @@ FE_RaviartThomasNodal<dim>::FE_RaviartThomasNodal (const unsigned int deg)
                                   //matrix, generating the correct
                                   //basis functions from the raw
                                   //ones.
-  
+
                                   // We use an auxiliary matrix in
                                   // this function. Therefore,
                                   // inverse_node_matrix is still
@@ -66,7 +66,7 @@ FE_RaviartThomasNodal<dim>::FE_RaviartThomasNodal (const unsigned int deg)
                                   // From now on, the shape functions
                                   // will be the correct ones, not
                                   // the raw shape functions anymore.
-  
+
                                   // Reinit the vectors of
                                   // prolongation matrices to the
                                   // right sizes. There are no
@@ -115,7 +115,7 @@ FE_RaviartThomasNodal<dim>::get_name () const
                                   // polynomial degree and is thus one higher
                                   // than the argument given to the
                                   // constructor
-  std::ostringstream namebuf;  
+  std::ostringstream namebuf;
   namebuf << "FE_RaviartThomasNodal<" << dim << ">(" << this->degree-1 << ")";
 
   return namebuf.str();
@@ -172,7 +172,7 @@ FE_RaviartThomasNodal<dim>::initialize_support_points (const unsigned int deg)
 
       current = this->dofs_per_face*GeometryInfo<dim>::faces_per_cell;
     }
-  
+
   if (deg==0) return;
                                   // In the interior, we need
                                   // anisotropic Gauss quadratures,
@@ -190,7 +190,7 @@ FE_RaviartThomasNodal<dim>::initialize_support_points (const unsigned int deg)
                                                       ((d==1) ? low : high),
                                                       ((d==2) ? low : high));
       Assert(dim<=3, ExcNotImplemented());
-      
+
       for (unsigned int k=0;k<quadrature->size();++k)
        this->generalized_support_points[current++] = quadrature->point(k);
       delete quadrature;
@@ -199,20 +199,6 @@ FE_RaviartThomasNodal<dim>::initialize_support_points (const unsigned int deg)
 }
 
 
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_RaviartThomasNodal<1>::get_dpo_vector (const unsigned int deg)
-{
-  std::vector<unsigned int> dpo(2);
-  dpo[0] = 1;
-  dpo[1] = deg;
-  return dpo;
-}
-
-#endif
-
 
 template <int dim>
 std::vector<unsigned int>
@@ -227,18 +213,16 @@ FE_RaviartThomasNodal<dim>::get_dpo_vector (const unsigned int deg)
                                    // and then there are interior dofs
   const unsigned int
     interior_dofs = dim*deg*dofs_per_face;
-  
+
   std::vector<unsigned int> dpo(dim+1);
   dpo[dim-1] = dofs_per_face;
   dpo[dim]   = interior_dofs;
-  
+
   return dpo;
 }
 
 
 
-#if deal_II_dimension == 1
-
 template <>
 std::vector<bool>
 FE_RaviartThomasNodal<1>::get_ria_vector (const unsigned int)
@@ -247,7 +231,6 @@ FE_RaviartThomasNodal<1>::get_ria_vector (const unsigned int)
   return std::vector<bool>();
 }
 
-#endif
 
 
 template <int dim>
@@ -287,14 +270,14 @@ FE_RaviartThomasNodal<dim>::has_support_on_face (
                                   // on the faces and each face has
                                   // degree degrees.
   const unsigned int support_face = shape_index / this->degree;
-  
+
                                   // The only thing we know for sure
                                   // is that shape functions with
                                   // support on one face are zero on
                                   // the opposite face.
   if (support_face < GeometryInfo<dim>::faces_per_cell)
     return (face_index != GeometryInfo<dim>::opposite_face[support_face]);
-  
+
                                   // In all other cases, return true,
                                   // which is safe
   return true;
@@ -429,7 +412,7 @@ FE_RaviartThomasNodal<dim>::hp_vertex_dof_identities (
   else
     {
       Assert(false, ExcNotImplemented());
-      return std::vector<std::pair<unsigned int, unsigned int> > (); 
+      return std::vector<std::pair<unsigned int, unsigned int> > ();
     }
 }
 
@@ -450,7 +433,7 @@ hp_line_dof_identities (const FiniteElement<dim> &fe_other) const
                                       // only lines in 2d
       if (dim != 2)
        return std::vector<std::pair<unsigned int, unsigned int> >();
-      
+
                                       // dofs are located along lines, so two
                                       // dofs are identical only if in the
                                       // following two cases (remember that
@@ -472,7 +455,7 @@ hp_line_dof_identities (const FiniteElement<dim> &fe_other) const
                                       // the constructor
       const unsigned int p = this->degree-1;
       const unsigned int q = fe_q_other->degree-1;
-      
+
       std::vector<std::pair<unsigned int, unsigned int> > identities;
 
       if (p==q)
@@ -482,7 +465,7 @@ hp_line_dof_identities (const FiniteElement<dim> &fe_other) const
       else
        if (p%2==0 && q%2==0)
          identities.push_back(std::make_pair(p/2,q/2));
-      
+
       return identities;
     }
   else
@@ -513,7 +496,7 @@ FE_RaviartThomasNodal<dim>::hp_quad_dof_identities (
                                       // case above
       const unsigned int p = this->dofs_per_quad;
       const unsigned int q = fe_q_other->dofs_per_quad;
-      
+
       std::vector<std::pair<unsigned int, unsigned int> > identities;
 
       if (p==q)
@@ -549,13 +532,12 @@ FE_RaviartThomasNodal<dim>::compare_for_face_domination (
       else
        return FiniteElementDomination::other_element_dominates;
     }
-  
+
   Assert (false, ExcNotImplemented());
   return FiniteElementDomination::neither_element_dominates;
 }
 
 
-#if deal_II_dimension == 1
 
 template <>
 void
@@ -577,11 +559,8 @@ FE_RaviartThomasNodal<1>::get_subface_interpolation_matrix (
   Assert (false, ExcImpossibleInDim(1));
 }
 
-#endif
 
 
-#if deal_II_dimension > 1
-
 template <int dim>
 void
 FE_RaviartThomasNodal<dim>::get_face_interpolation_matrix (
@@ -596,7 +575,7 @@ FE_RaviartThomasNodal<dim>::get_face_interpolation_matrix (
               (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != 0),
               typename FiniteElement<dim>::
               ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.n() == this->dofs_per_face,
          ExcDimensionMismatch (interpolation_matrix.n(),
                                this->dofs_per_face));
@@ -623,7 +602,7 @@ FE_RaviartThomasNodal<dim>::get_face_interpolation_matrix (
   Assert (this->dofs_per_face <= source_fe.dofs_per_face,
          typename FiniteElement<dim>::
          ExcInterpolationNotImplemented ());
-  
+
                                   // generate a quadrature
                                   // with the generalized support points.
                                   // This is later based as a
@@ -631,26 +610,26 @@ FE_RaviartThomasNodal<dim>::get_face_interpolation_matrix (
                                   // which returns the support
                                   // points on the face.
   Quadrature<dim-1> quad_face_support (source_fe.get_generalized_face_support_points ());
-  
+
                                   // Rule of thumb for FP accuracy,
                                   // that can be expected for a
                                   // given polynomial degree.
                                   // This value is used to cut
                                   // off values close to zero.
   double eps = 2e-13*this->degree*(dim-1);
-  
+
                                   // compute the interpolation
                                   // matrix by simply taking the
                                   // value at the support points.
   const Quadrature<dim> face_projection
     = QProjector<dim>::project_to_face (quad_face_support, 0);
-  
+
   for (unsigned int i=0; i<source_fe.dofs_per_face; ++i)
     {
       const Point<dim> &p = face_projection.point (i);
 
       for (unsigned int j=0; j<this->dofs_per_face; ++j)
-       { 
+       {
          double matrix_entry
            = this->shape_value_component (this->face_to_cell_index(j, 0),
                                           p, 0);
@@ -667,7 +646,7 @@ FE_RaviartThomasNodal<dim>::get_face_interpolation_matrix (
            matrix_entry = 0.0;
 
          interpolation_matrix(i,j) = matrix_entry;
-       }  
+       }
     }
 
                                   // make sure that the row sum of
@@ -703,7 +682,7 @@ FE_RaviartThomasNodal<dim>::get_subface_interpolation_matrix (
               (dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != 0),
               typename FiniteElement<dim>::
               ExcInterpolationNotImplemented());
-  
+
   Assert (interpolation_matrix.n() == this->dofs_per_face,
          ExcDimensionMismatch (interpolation_matrix.n(),
                                this->dofs_per_face));
@@ -730,7 +709,7 @@ FE_RaviartThomasNodal<dim>::get_subface_interpolation_matrix (
   Assert (this->dofs_per_face <= source_fe.dofs_per_face,
          typename FiniteElement<dim>::
          ExcInterpolationNotImplemented ());
-  
+
                                   // generate a quadrature
                                   // with the generalized support points.
                                   // This is later based as a
@@ -738,14 +717,14 @@ FE_RaviartThomasNodal<dim>::get_subface_interpolation_matrix (
                                   // which returns the support
                                   // points on the face.
   Quadrature<dim-1> quad_face_support (source_fe.get_generalized_face_support_points ());
-  
+
                                   // Rule of thumb for FP accuracy,
                                   // that can be expected for a
                                   // given polynomial degree.
                                   // This value is used to cut
                                   // off values close to zero.
   double eps = 2e-13*this->degree*(dim-1);
-  
+
                                   // compute the interpolation
                                   // matrix by simply taking the
                                   // value at the support points.
@@ -758,7 +737,7 @@ FE_RaviartThomasNodal<dim>::get_subface_interpolation_matrix (
       const Point<dim> &p = subface_projection.point (i);
 
       for (unsigned int j=0; j<this->dofs_per_face; ++j)
-       { 
+       {
          double matrix_entry
            = this->shape_value_component (this->face_to_cell_index(j, 0), p, 0);
 
@@ -774,7 +753,7 @@ FE_RaviartThomasNodal<dim>::get_subface_interpolation_matrix (
            matrix_entry = 0.0;
 
          interpolation_matrix(i,j) = matrix_entry;
-       }  
+       }
     }
 
                                   // make sure that the row sum of
@@ -794,10 +773,10 @@ FE_RaviartThomasNodal<dim>::get_subface_interpolation_matrix (
     }
 }
 
-#endif
 
 
+// explicit instantiations
+#include "fe_raviart_thomas_nodal.inst"
 
-template class FE_RaviartThomasNodal<deal_II_dimension>;
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_raviart_thomas_nodal.inst.in b/deal.II/source/fe/fe_raviart_thomas_nodal.inst.in
new file mode 100644 (file)
index 0000000..951a219
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class FE_RaviartThomasNodal<deal_II_dimension>;
+  }
+
index 6090ca2a82ee370149305d4274510d61657d4966..098a75e02fb68bbe924daf199547119384f6af6a 100644 (file)
@@ -1950,33 +1950,16 @@ initialize_unit_support_points ()
 }
 
 
-#if deal_II_dimension == 1
-
-template <>
-void
-FESystem<1>::
-initialize_unit_face_support_points ()
-{
-                                  // no faces no work
-}
-
-
-template <>
-void
-FESystem<1,2>::
-initialize_unit_face_support_points ()
-{
-                                  // no faces no work
-}
-
-#endif
-
 
 template <int dim, int spacedim>
 void
 FESystem<dim,spacedim>::
 initialize_unit_face_support_points ()
 {
+                               // Nothing to do in 1D
+  if (dim == 1)
+    return;
+
                                   // if one of the base elements has
                                   // no support points, then it makes
                                   // no sense to define support
@@ -2018,21 +2001,15 @@ template <int dim, int spacedim>
 void
 FESystem<dim,spacedim>::initialize_quad_dof_index_permutation ()
 {
-                                  // general template for 1D and 2D, do nothing
-}
-
-
+                               // nothing to do in other dimensions than 3
+  if (dim < 3)
+    return;
 
-#if deal_II_dimension == 3
-
-template <>
-void
-FESystem<3>::initialize_quad_dof_index_permutation ()
-{
                                   // the array into which we want to write
                                   // should have the correct size already.
-  Assert (adjust_quad_dof_index_for_face_orientation_table.n_elements()==8*this->dofs_per_quad,
-         ExcInternalError());
+  Assert (this->adjust_quad_dof_index_for_face_orientation_table.n_elements()==
+         8*this->dofs_per_quad, ExcInternalError());
+
                                   // to obtain the shifts for this composed
                                   // element, copy the shift information of
                                   // the base elements
@@ -2045,7 +2022,8 @@ FESystem<3>::initialize_quad_dof_index_permutation ()
        {
          for (unsigned int i=0; i<temp.size(0); ++i)
            for (unsigned int j=0; j<8; ++j)
-             adjust_quad_dof_index_for_face_orientation_table(index+i,j)=temp(i,j);
+             this->adjust_quad_dof_index_for_face_orientation_table(index+i,j)=
+               temp(i,j);
          index += temp.size(0);
        }
     }
@@ -2054,8 +2032,8 @@ FESystem<3>::initialize_quad_dof_index_permutation ()
 
                                   // aditionally compose the permutation
                                   // information for lines
-  Assert (adjust_line_dof_index_for_line_orientation_table.size()==this->dofs_per_line,
-         ExcInternalError());
+  Assert (this->adjust_line_dof_index_for_line_orientation_table.size()==
+         this->dofs_per_line, ExcInternalError());
   index = 0;
   for (unsigned int b=0; b<n_base_elements();++b)
     {
@@ -2064,7 +2042,8 @@ FESystem<3>::initialize_quad_dof_index_permutation ()
       for (unsigned int c=0; c<element_multiplicity(b); ++c)
        {
          std::copy(temp2.begin(), temp2.end(),
-                   adjust_line_dof_index_for_line_orientation_table.begin()+index);
+                   this->adjust_line_dof_index_for_line_orientation_table.begin()
+                   +index);
          index += temp2.size();
        }
     }
@@ -2072,8 +2051,6 @@ FESystem<3>::initialize_quad_dof_index_permutation ()
          ExcInternalError());
 }
 
-#endif
-
 
 
 template <int dim, int spacedim>
@@ -3407,9 +3384,6 @@ FESystem<dim,spacedim>::memory_consumption () const
 
 
 // explicit instantiations
-template class FESystem<deal_II_dimension>;
-#if deal_II_dimension != 3
-template class FESystem<deal_II_dimension, deal_II_dimension+1>;
-#endif
+#include "fe_system.inst"
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/fe_system.inst.in b/deal.II/source/fe/fe_system.inst.in
new file mode 100644 (file)
index 0000000..97153d8
--- /dev/null
@@ -0,0 +1,22 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+  template class FESystem<deal_II_dimension>;
+#if deal_II_dimension != 3
+    template class FESystem<deal_II_dimension, deal_II_dimension+1>;
+#endif
+  }
+
diff --git a/deal.II/source/fe/fe_tools.all_dimensions.cc b/deal.II/source/fe/fe_tools.all_dimensions.cc
deleted file mode 100644 (file)
index 4c40c95..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-//---------------------------------------------------------------------------
-//    $Id$
-//    Version: $Name$
-//
-//    Copyright (C) 2005, 2006, 2008, 2010 by the deal.II authors
-//
-//    This file is subject to QPL and may not be  distributed
-//    without copyright and license information. Please refer
-//    to the file deal.II/doc/license.html for the  text  and
-//    further information on this license.
-//
-//---------------------------------------------------------------------------
-
-
-#include <base/utilities.h>
-#include <fe/fe.h>
-#include <fe/fe_tools.h>
-
-DEAL_II_NAMESPACE_OPEN
-
-namespace FETools
-{
-
-  template <int dim>
-  void
-  hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe,
-                                        std::vector<unsigned int> &h2l)
-  {
-    Assert (h2l.size() == fe.dofs_per_cell,
-           ExcDimensionMismatch (h2l.size(), fe.dofs_per_cell));
-    h2l = hierarchic_to_lexicographic_numbering (fe);
-  }
-
-
-
-  template <int dim>
-  std::vector<unsigned int>
-  hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe)
-  {
-    Assert (fe.n_components() == 1, ExcInvalidFE());
-
-    std::vector<unsigned int> h2l (fe.dofs_per_cell);
-
-    const unsigned int dofs_per_cell = fe.dofs_per_cell;
-                                    // polynomial degree
-    const unsigned int degree = fe.dofs_per_line+1;
-                                    // number of grid points in each
-                                    // direction
-    const unsigned int n = degree+1;
-
-                                    // the following lines of code are
-                                    // somewhat odd, due to the way the
-                                    // hierarchic numbering is
-                                    // organized. if someone would
-                                    // really want to understand these
-                                    // lines, you better draw some
-                                    // pictures where you indicate the
-                                    // indices and orders of vertices,
-                                    // lines, etc, along with the
-                                    // numbers of the degrees of
-                                    // freedom in hierarchical and
-                                    // lexicographical order
-    switch (dim)
-      {
-       case 1:
-       {
-         h2l[0] = 0;
-         h2l[1] = dofs_per_cell-1;
-         for (unsigned int i=2; i<dofs_per_cell; ++i)
-           h2l[i] = i-1;
-
-         break;
-       }
-
-       case 2:
-       {
-         unsigned int next_index = 0;
-                                          // first the four vertices
-         h2l[next_index++] = 0;
-         h2l[next_index++] = n-1;
-         h2l[next_index++] = n*(n-1);
-         h2l[next_index++] = n*n-1;
-
-                                          // left   line
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = (1+i)*n;
-
-                                          // right  line
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = (2+i)*n-1;
-
-                                          // bottom line
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = 1+i;
-
-                                          // top    line
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = n*(n-1)+i+1;
-
-                                          // inside quad
-         Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
-                 ExcInternalError());
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             h2l[next_index++] = n*(i+1)+j+1;
-
-         Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-
-         break;
-       }
-
-       case 3:
-       {
-         unsigned int next_index = 0;
-                                          // first the eight vertices
-         h2l[next_index++] = 0;                 // 0
-         h2l[next_index++] = (      1)*degree;  // 1
-         h2l[next_index++] = (    n  )*degree;  // 2
-         h2l[next_index++] = (    n+1)*degree;  // 3
-         h2l[next_index++] = (n*n    )*degree;  // 4
-         h2l[next_index++] = (n*n  +1)*degree;  // 5
-         h2l[next_index++] = (n*n+n  )*degree;  // 6
-         h2l[next_index++] = (n*n+n+1)*degree;  // 7
-
-                                          // line 0
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = (i+1)*n;
-                                          // line 1
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = n-1+(i+1)*n;
-                                          // line 2
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = 1+i;
-                                          // line 3
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = 1+i+n*(n-1);
-
-                                          // line 4
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = (n-1)*n*n+(i+1)*n;
-                                          // line 5
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
-                                          // line 6
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = n*n*(n-1)+i+1;
-                                          // line 7
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = n*n*(n-1)+i+1+n*(n-1);
-
-                                          // line 8
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = (i+1)*n*n;
-                                          // line 9
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = n-1+(i+1)*n*n;
-                                          // line 10
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = (i+1)*n*n+n*(n-1);
-                                          // line 11
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           h2l[next_index++] = n-1+(i+1)*n*n+n*(n-1);
-
-
-                                          // inside quads
-         Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
-                 ExcInternalError());
-                                          // face 0
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             h2l[next_index++] = (i+1)*n*n+n*(j+1);
-                                          // face 1
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             h2l[next_index++] = (i+1)*n*n+n-1+n*(j+1);
-                                          // face 2, note the orientation!
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             h2l[next_index++] = (j+1)*n*n+i+1;
-                                          // face 3, note the orientation!
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             h2l[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
-                                          // face 4
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             h2l[next_index++] = n*(i+1)+j+1;
-                                          // face 5
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             h2l[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
-
-                                          // inside hex
-         Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
-                 ExcInternalError());
-         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
-           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
-             for (unsigned int k=0; k<fe.dofs_per_line; ++k)
-               h2l[next_index++]       = n*n*(i+1)+n*(j+1)+k+1;
-
-         Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-
-         break;
-       }
-
-       default:
-             Assert (false, ExcNotImplemented());
-      }
-
-    return h2l;
-  }
-
-
-
-  template <int dim>
-  void
-  lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe,
-                                        std::vector<unsigned int>    &l2h)
-  {
-    l2h = lexicographic_to_hierarchic_numbering (fe);
-  }
-
-
-
-  template <int dim>
-  std::vector<unsigned int>
-  lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe)
-  {
-    return Utilities::invert_permutation(hierarchic_to_lexicographic_numbering (fe));
-  }
-
-}
-
-
-// explicit instantiations
-namespace FETools
-{
-  template
-  void
-  hierarchic_to_lexicographic_numbering<1>
-  (const FiniteElementData<1> &fe,
-   std::vector<unsigned int> &h2l);
-  template
-  void
-  hierarchic_to_lexicographic_numbering<2>
-  (const FiniteElementData<2> &fe,
-   std::vector<unsigned int> &h2l);
-  template
-  void
-  hierarchic_to_lexicographic_numbering<3>
-  (const FiniteElementData<3> &fe,
-   std::vector<unsigned int> &h2l);
-
-
-  template
-  void
-  lexicographic_to_hierarchic_numbering<1>
-  (const FiniteElementData<1> &fe,
-   std::vector<unsigned int> &l2h);
-  template
-  void
-  lexicographic_to_hierarchic_numbering<2>
-  (const FiniteElementData<2> &fe,
-   std::vector<unsigned int> &l2h);
-  template
-  void
-  lexicographic_to_hierarchic_numbering<3>
-  (const FiniteElementData<3> &fe,
-   std::vector<unsigned int> &l2h);
-
-
-
-  template
-  std::vector<unsigned int>
-  hierarchic_to_lexicographic_numbering<1>
-  (const FiniteElementData<1> &fe);
-  template
-  std::vector<unsigned int>
-  hierarchic_to_lexicographic_numbering<2>
-  (const FiniteElementData<2> &fe);
-  template
-  std::vector<unsigned int>
-  hierarchic_to_lexicographic_numbering<3>
-  (const FiniteElementData<3> &fe);
-
-
-  template
-  std::vector<unsigned int>
-  lexicographic_to_hierarchic_numbering<1>
-  (const FiniteElementData<1> &fe);
-  template
-  std::vector<unsigned int>
-  lexicographic_to_hierarchic_numbering<2>
-  (const FiniteElementData<2> &fe);
-  template
-  std::vector<unsigned int>
-  lexicographic_to_hierarchic_numbering<3>
-  (const FiniteElementData<3> &fe);
-}
-
-
-DEAL_II_NAMESPACE_CLOSE
index ec1298b4fc6ac542b29c565d44c09422801e7abc..ff5dfe551a2b889d855cb51355ecbad6f135f9e4 100644 (file)
@@ -53,51 +53,52 @@ DEAL_II_NAMESPACE_OPEN
 
 namespace
 {
-                                   // a shared pointer to factory
+                                   // use a shared pointer to factory
                                    // objects, to ensure that they get
                                    // deleted at the end of the
                                    // program run and don't end up as
                                    // apparent memory leaks to
-                                   // programs like valgrind
-  typedef
-  std_cxx1x::shared_ptr<const FETools::FEFactoryBase<deal_II_dimension> >
-  FEFactoryPointer;
-
+                                   // programs like valgrind.
                                    // a function that returns the
                                    // default set of finite element
                                    // names and factory objects for
                                    // them. used to initialize
                                    // fe_name_map below
+  template <int dim>
 #ifdef DEAL_II_ANON_NAMESPACE_BUG
     static
 #endif
-  std::map<std::string,FEFactoryPointer>
+  std::map<std::string,std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> > >
   get_default_fe_names ()
   {
-    std::map<std::string,FEFactoryPointer> default_map;
+    std::map<std::string,
+             std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> > > default_map;
+
+    typedef std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> >
+      FEFactoryPointer;
 
     default_map["FE_Q_Hierarchical"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_Q_Hierarchical<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_Q_Hierarchical<dim> >);
     default_map["FE_ABF"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<dim> >);
     default_map["FE_RaviartThomas"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<dim> >);
     default_map["FE_RaviartThomasNodal"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomasNodal<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomasNodal<dim> >);
     default_map["FE_Nedelec"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_Nedelec<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_Nedelec<dim> >);
     default_map["FE_DGPNonparametric"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_DGPNonparametric<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_DGPNonparametric<dim> >);
     default_map["FE_DGP"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_DGP<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_DGP<dim> >);
     default_map["FE_DGPMonomial"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_DGPMonomial<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_DGPMonomial<dim> >);
     default_map["FE_DGQ"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<dim> >);
     default_map["FE_DGQArbitraryNodes"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<dim> >);
     default_map["FE_Q"]
-      = FEFactoryPointer(new FETools::FEFactory<FE_Q<deal_II_dimension> >);
+      = FEFactoryPointer(new FETools::FEFactory<FE_Q<dim> >);
 
     return default_map;
   }
@@ -134,17 +135,29 @@ namespace
                                    // static so that we can link
                                    // several dimensions together.
                                    //
-                                   // it is initialized at program
-                                   // start time using the function
-                                   // above. because at this time
-                                   // there are no threads running,
-                                   // there are no thread-safety
-                                   // issues here
+                                   // it is initialized at program start time
+                                   // using the function above. because at
+                                   // this time there are no threads running,
+                                   // there are no thread-safety issues
+                                   // here. since this is compiled for all
+                                   // dimensions at once, need to create
+                                   // objects for each dimension and then
+                                   // separate between them further down
+  static
+  std::map<std::string,
+          std_cxx1x::shared_ptr<const FETools::FEFactoryBase<1> > >
+  fe_name_map_1d
+  = get_default_fe_names<1> ();
   static
   std::map<std::string,
-          std_cxx1x::shared_ptr<const FETools::FEFactoryBase<deal_II_dimension> > >
-  fe_name_map
-  = get_default_fe_names ();
+          std_cxx1x::shared_ptr<const FETools::FEFactoryBase<2> > >
+  fe_name_map_2d
+  = get_default_fe_names<2> ();
+  static
+  std::map<std::string,
+          std_cxx1x::shared_ptr<const FETools::FEFactoryBase<3> > >
+  fe_name_map_3d
+  = get_default_fe_names<3> ();
 }
 
 
@@ -577,7 +590,8 @@ namespace FETools
       }
   }
 
-#if deal_II_dimension == 1
+
+
   template<>
   void
   compute_embedding_matrices(const FiniteElement<1,2> &,
@@ -587,7 +601,8 @@ namespace FETools
     Assert(false, ExcNotImplemented());
   }
 
-#elif deal_II_dimension == 2
+
+
   template<>
   void
   compute_embedding_matrices(const FiniteElement<2,3>&,
@@ -597,7 +612,6 @@ namespace FETools
     Assert(false, ExcNotImplemented());
   }
 
-#endif
 
 
   namespace {
@@ -763,7 +777,7 @@ namespace FETools
   }
 
 
-// This function is tested by tests/fe/internals, since it produces the matrices printed there  
+// This function is tested by tests/fe/internals, since it produces the matrices printed there
   template <int dim, typename number, int spacedim>
   void
   compute_face_embedding_matrices(const FiniteElement<dim,spacedim>& fe,
@@ -773,21 +787,21 @@ namespace FETools
   {
     Assert(face_coarse==0, ExcNotImplemented());
     Assert(face_fine==0, ExcNotImplemented());
-    
+
     const unsigned int nc = GeometryInfo<dim>::max_children_per_face;
     const unsigned int n  = fe.dofs_per_face;
     const unsigned int nd = fe.n_components();
     const unsigned int degree = fe.degree;
-    
+
     const bool normal = fe.conforms(FiniteElementData<dim>::Hdiv);
     const bool tangential = fe.conforms(FiniteElementData<dim>::Hcurl);
-    
+
     for (unsigned int i=0;i<nc;++i)
       {
        Assert(matrices[i].n() == n, ExcDimensionMismatch(matrices[i].n(),n));
        Assert(matrices[i].m() == n, ExcDimensionMismatch(matrices[i].m(),n));
       }
-    
+
                                     // In order to make the loops below
                                     // simpler, we introduce vectors
                                     // containing for indices 0-n the
@@ -891,9 +905,9 @@ namespace FETools
              for (unsigned int d=1;d<dim;++d)
                A(k*nd+d,j) = fine.shape_value_component(face_f_dofs[j],k,d);
          }
-    
+
     Householder<double> H(A);
-    
+
     Vector<number> v_coarse(nq*nd);
     Vector<number> v_fine(n);
 
@@ -959,7 +973,8 @@ namespace FETools
       }
   }
 
-#if deal_II_dimension == 1
+
+
   template <>
   void
   compute_projection_matrices(const FiniteElement<1,2>&,
@@ -968,7 +983,8 @@ namespace FETools
     Assert(false, ExcNotImplemented());
   }
 
-#elif deal_II_dimension == 2
+
+
   template <>
   void
   compute_projection_matrices(const FiniteElement<2,3>&,
@@ -977,7 +993,6 @@ namespace FETools
     Assert(false, ExcNotImplemented());
   }
 
-#endif
 
 
   template <int dim, typename number, int spacedim>
@@ -1635,10 +1650,69 @@ for (; cell!=endc; ++cell)
   }
 
 
-  template <int dim, int spacedim>
+  template <>
+  void
+  add_fe_name(const std::string& parameter_name,
+             const FEFactoryBase<1,1>* factory)
+  {
+                                    // Erase everything after the
+                                    // actual class name
+    std::string name = parameter_name;
+    unsigned int name_end =
+      name.find_first_not_of(std::string("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
+    if (name_end < name.size())
+      name.erase(name_end);
+                                    // first make sure that no other
+                                    // thread intercepts the
+                                    // operation of this function;
+                                    // for this, acquire the lock
+                                    // until we quit this function
+    Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+
+    Assert(fe_name_map_1d.find(name) == fe_name_map_1d.end(),
+          ExcMessage("Cannot change existing element in finite element name list"));
+
+                                    // Insert the normalized name into
+                                    // the map
+    fe_name_map_1d[name] = 
+      std_cxx1x::shared_ptr<const FETools::FEFactoryBase<1> > (factory);
+  }
+
+
+
+  template <>
+  void
+  add_fe_name(const std::string& parameter_name,
+             const FEFactoryBase<2,2>* factory)
+  {
+                                    // Erase everything after the
+                                    // actual class name
+    std::string name = parameter_name;
+    unsigned int name_end =
+      name.find_first_not_of(std::string("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
+    if (name_end < name.size())
+      name.erase(name_end);
+                                    // first make sure that no other
+                                    // thread intercepts the
+                                    // operation of this function;
+                                    // for this, acquire the lock
+                                    // until we quit this function
+    Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+
+    Assert(fe_name_map_2d.find(name) == fe_name_map_2d.end(),
+          ExcMessage("Cannot change existing element in finite element name list"));
+
+                                    // Insert the normalized name into
+                                    // the map
+    fe_name_map_2d[name] = 
+      std_cxx1x::shared_ptr<const FETools::FEFactoryBase<2> > (factory);
+  }
+
+
+  template <>
   void
   add_fe_name(const std::string& parameter_name,
-             const FEFactoryBase<dim,spacedim>* factory)
+             const FEFactoryBase<3,3>* factory)
   {
                                     // Erase everything after the
                                     // actual class name
@@ -1654,12 +1728,13 @@ for (; cell!=endc; ++cell)
                                     // until we quit this function
     Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
 
-    Assert(fe_name_map.find(name) == fe_name_map.end(),
+    Assert(fe_name_map_3d.find(name) == fe_name_map_3d.end(),
           ExcMessage("Cannot change existing element in finite element name list"));
 
                                     // Insert the normalized name into
                                     // the map
-    fe_name_map[name] = FEFactoryPointer(factory);
+    fe_name_map_3d[name] = 
+      std_cxx1x::shared_ptr<const FETools::FEFactoryBase<3> > (factory);
   }
 
 
@@ -1667,9 +1742,16 @@ for (; cell!=endc; ++cell)
   {
     namespace
     {
+                               // TODO: this encapsulates the call to the
+                               // dimension-dependent fe_name_map so that we
+                               // have a unique interface. could be done
+                               // smarter?
       template <int dim, int spacedim>
       FiniteElement<dim,spacedim>*
-      get_fe_from_name (std::string &name)
+      get_fe_from_name_ext (std::string &name,
+                           const std::map<std::string,
+                           std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> > > 
+                           &fe_name_map)
       {
                                         // Extract the name of the
                                         // finite element class, which only
@@ -1713,7 +1795,8 @@ for (; cell!=endc; ++cell)
                                                     // Now, the name of the
                                                     // first base element is
                                                     // first... Let's get it
-                   base_fes.push_back (get_fe_from_name<dim,spacedim> (name));
+                   base_fes.push_back (get_fe_from_name_ext<dim,spacedim> (name,
+                                                                           fe_name_map));
                                                     // next check whether
                                                     // FESystem placed a
                                                     // multiplicity after
@@ -1892,6 +1975,35 @@ for (; cell!=endc; ++cell)
                                         // here after throwing
        return 0;
       }
+
+
+
+                               // need to work around problem with different
+                               // name map names for different dimensions
+                               // TODO: should be possible to do nicer!
+      template <int dim,int spacedim>
+      FiniteElement<dim,spacedim>* get_fe_from_name (std::string &name);
+
+      template <>
+      FiniteElement<1,1>*
+      get_fe_from_name<1> (std::string &name)
+      {
+       return get_fe_from_name_ext<1,1> (name, fe_name_map_1d);
+      }
+
+      template <>
+      FiniteElement<2,2>*
+      get_fe_from_name<2> (std::string &name)
+      {
+       return get_fe_from_name_ext<2,2> (name, fe_name_map_2d);
+      }
+
+      template <>
+      FiniteElement<3,3>*
+      get_fe_from_name<3> (std::string &name)
+      {
+       return get_fe_from_name_ext<3,3> (name, fe_name_map_3d);
+      }
     }
   }
 
@@ -2220,495 +2332,222 @@ for (; cell!=endc; ++cell)
     Assert (X.n() == rhs_quadrature.size(), ExcInternalError());
   }
 
-}
 
 
+  template <int dim>
+  void
+  hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe,
+                                        std::vector<unsigned int> &h2l)
+  {
+    Assert (h2l.size() == fe.dofs_per_cell,
+           ExcDimensionMismatch (h2l.size(), fe.dofs_per_cell));
+    h2l = hierarchic_to_lexicographic_numbering (fe);
+  }
 
-/*-------------- Explicit Instantiations -------------------------------*/
-
-namespace FETools
-{
-  template class FEFactoryBase<deal_II_dimension>;
-
-  template
-  void compute_node_matrix(
-    FullMatrix<double>&,
-    const FiniteElement<deal_II_dimension>&);
 
-  template
-  void compute_component_wise(
-    const FiniteElement<deal_II_dimension>& element,
-    std::vector<unsigned int>&, std::vector<std::vector<unsigned int> >&);
-  template
-  void compute_block_renumbering (
-    const FiniteElement<deal_II_dimension>& element,
-    std::vector<unsigned int>&, std::vector<unsigned int>&_indices, bool);
-  template
-  void get_interpolation_matrix<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &,
-   const FiniteElement<deal_II_dimension> &,
-   FullMatrix<double> &);
-  template
-  void get_back_interpolation_matrix<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &,
-   const FiniteElement<deal_II_dimension> &,
-   FullMatrix<double> &);
-  template
-  void get_interpolation_difference_matrix<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &,
-   const FiniteElement<deal_II_dimension> &,
-   FullMatrix<double> &);
-  template
-  void get_interpolation_matrix<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &,
-   const FiniteElement<deal_II_dimension> &,
-   FullMatrix<float> &);
-  template
-  void get_back_interpolation_matrix<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &,
-   const FiniteElement<deal_II_dimension> &,
-   FullMatrix<float> &);
-  template
-  void get_interpolation_difference_matrix<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &,
-   const FiniteElement<deal_II_dimension> &,
-   FullMatrix<float> &);
-
-  template
-  void get_projection_matrix<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &,
-   const FiniteElement<deal_II_dimension> &,
-   FullMatrix<double> &);
-
-  template
-  void compute_embedding_matrices<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&,bool);
-
-  template
-  void compute_face_embedding_matrices<deal_II_dimension,double>
-  (const FiniteElement<deal_II_dimension> &, FullMatrix<double> (&matrices)[GeometryInfo<deal_II_dimension>::max_children_per_face],
-   unsigned int, unsigned int);
-
-  template
-  void compute_projection_matrices<deal_II_dimension>
-  (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&, bool);
-
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const DoFHandler<deal_II_dimension> &, Vector<double> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<double> &);
-
-#if deal_II_dimension != 3
-  template
-  void compute_block_renumbering (
-    const FiniteElement<deal_II_dimension,deal_II_dimension+1>& element,
-    std::vector<unsigned int>&, std::vector<unsigned int>&_indices, bool);
-  template
-  void interpolate<deal_II_dimension,deal_II_dimension+1>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<double> &);
-  template
-  void interpolate<deal_II_dimension,deal_II_dimension+1>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
-   Vector<double> &);
-#endif
 
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const FiniteElement<deal_II_dimension> &, Vector<double> &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const Vector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<double> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const FiniteElement<deal_II_dimension> &, Vector<double> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const Vector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<double> &);
-  template
-  void project_dg<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const DoFHandler<deal_II_dimension> &, Vector<double> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const DoFHandler<deal_II_dimension> &, Vector<double> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<double> &);
-
-
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const DoFHandler<deal_II_dimension> &, Vector<float> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<float> &);
-
-#if deal_II_dimension != 3
-  template
-  void interpolate<deal_II_dimension,deal_II_dimension+1>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<float> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
-   Vector<float> &);
-#endif
-
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const FiniteElement<deal_II_dimension> &, Vector<float> &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const Vector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<float> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const FiniteElement<deal_II_dimension> &, Vector<float> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const Vector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<float> &);
-  template
-  void project_dg<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const DoFHandler<deal_II_dimension> &, Vector<float> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const DoFHandler<deal_II_dimension> &, Vector<float> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<float> &);
-
-
-#ifdef DEAL_II_USE_TRILINOS
-
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
-   const DoFHandler<deal_II_dimension> &,  TrilinosWrappers::Vector &);
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::Vector &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
-   const FiniteElement<deal_II_dimension> &,  TrilinosWrappers::Vector &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const TrilinosWrappers::Vector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::Vector &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
-   const FiniteElement<deal_II_dimension> &, TrilinosWrappers::Vector &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const TrilinosWrappers::Vector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::Vector &);
-  template
-  void project_dg<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
-   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
-   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::Vector &);
+  template <int dim>
+  std::vector<unsigned int>
+  hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe)
+  {
+    Assert (fe.n_components() == 1, ExcInvalidFE());
+
+    std::vector<unsigned int> h2l (fe.dofs_per_cell);
+
+    const unsigned int dofs_per_cell = fe.dofs_per_cell;
+                                    // polynomial degree
+    const unsigned int degree = fe.dofs_per_line+1;
+                                    // number of grid points in each
+                                    // direction
+    const unsigned int n = degree+1;
+
+                                    // the following lines of code are
+                                    // somewhat odd, due to the way the
+                                    // hierarchic numbering is
+                                    // organized. if someone would
+                                    // really want to understand these
+                                    // lines, you better draw some
+                                    // pictures where you indicate the
+                                    // indices and orders of vertices,
+                                    // lines, etc, along with the
+                                    // numbers of the degrees of
+                                    // freedom in hierarchical and
+                                    // lexicographical order
+    switch (dim)
+      {
+       case 1:
+       {
+         h2l[0] = 0;
+         h2l[1] = dofs_per_cell-1;
+         for (unsigned int i=2; i<dofs_per_cell; ++i)
+           h2l[i] = i-1;
 
-#endif
+         break;
+       }
 
+       case 2:
+       {
+         unsigned int next_index = 0;
+                                          // first the four vertices
+         h2l[next_index++] = 0;
+         h2l[next_index++] = n-1;
+         h2l[next_index++] = n*(n-1);
+         h2l[next_index++] = n*n-1;
+
+                                          // left   line
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = (1+i)*n;
+
+                                          // right  line
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = (2+i)*n-1;
+
+                                          // bottom line
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = 1+i;
+
+                                          // top    line
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = n*(n-1)+i+1;
+
+                                          // inside quad
+         Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
+                 ExcInternalError());
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             h2l[next_index++] = n*(i+1)+j+1;
+
+         Assert (next_index == fe.dofs_per_cell, ExcInternalError());
+
+         break;
+       }
 
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<double> &);
-
-#if deal_II_dimension != 3
-  template
-  void interpolate<deal_II_dimension,deal_II_dimension+1>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<double> &);
-  template
-  void interpolate<deal_II_dimension,deal_II_dimension+1>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
-   BlockVector<double> &);
-#endif
+       case 3:
+       {
+         unsigned int next_index = 0;
+                                          // first the eight vertices
+         h2l[next_index++] = 0;                 // 0
+         h2l[next_index++] = (      1)*degree;  // 1
+         h2l[next_index++] = (    n  )*degree;  // 2
+         h2l[next_index++] = (    n+1)*degree;  // 3
+         h2l[next_index++] = (n*n    )*degree;  // 4
+         h2l[next_index++] = (n*n  +1)*degree;  // 5
+         h2l[next_index++] = (n*n+n  )*degree;  // 6
+         h2l[next_index++] = (n*n+n+1)*degree;  // 7
+
+                                          // line 0
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = (i+1)*n;
+                                          // line 1
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = n-1+(i+1)*n;
+                                          // line 2
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = 1+i;
+                                          // line 3
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = 1+i+n*(n-1);
+
+                                          // line 4
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = (n-1)*n*n+(i+1)*n;
+                                          // line 5
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
+                                          // line 6
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = n*n*(n-1)+i+1;
+                                          // line 7
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = n*n*(n-1)+i+1+n*(n-1);
+
+                                          // line 8
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = (i+1)*n*n;
+                                          // line 9
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = n-1+(i+1)*n*n;
+                                          // line 10
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = (i+1)*n*n+n*(n-1);
+                                          // line 11
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           h2l[next_index++] = n-1+(i+1)*n*n+n*(n-1);
+
+
+                                          // inside quads
+         Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
+                 ExcInternalError());
+                                          // face 0
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             h2l[next_index++] = (i+1)*n*n+n*(j+1);
+                                          // face 1
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             h2l[next_index++] = (i+1)*n*n+n-1+n*(j+1);
+                                          // face 2, note the orientation!
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             h2l[next_index++] = (j+1)*n*n+i+1;
+                                          // face 3, note the orientation!
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             h2l[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
+                                          // face 4
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             h2l[next_index++] = n*(i+1)+j+1;
+                                          // face 5
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             h2l[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
+
+                                          // inside hex
+         Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
+                 ExcInternalError());
+         for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+           for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+             for (unsigned int k=0; k<fe.dofs_per_line; ++k)
+               h2l[next_index++]       = n*n*(i+1)+n*(j+1)+k+1;
+
+         Assert (next_index == fe.dofs_per_cell, ExcInternalError());
+
+         break;
+       }
 
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<double> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<double> &);
-  template
-  void project_dg<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<double> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, Vector<double> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<double> &);
-
-
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<float> &);
-
-#if deal_II_dimension != 3
-  template
-  void interpolate<deal_II_dimension,deal_II_dimension+1>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<float> &);
-  template
-  void interpolate<deal_II_dimension,deal_II_dimension+1>
-  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
-   BlockVector<float> &);
-#endif
+       default:
+             Assert (false, ExcNotImplemented());
+      }
 
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<float> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<float> &);
-  template
-  void project_dg<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   BlockVector<float> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, Vector<float> &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<float> &);
-
-
-#ifdef DEAL_II_USE_TRILINOS
-
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
-   const DoFHandler<deal_II_dimension> &,  TrilinosWrappers::BlockVector &);
-  template
-  void interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::BlockVector &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
-   const FiniteElement<deal_II_dimension> &,  TrilinosWrappers::BlockVector &);
-  template
-  void back_interpolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const TrilinosWrappers::BlockVector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::BlockVector &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
-   const FiniteElement<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
-  template
-  void interpolation_difference<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   const TrilinosWrappers::BlockVector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::BlockVector &);
-  template
-  void project_dg<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
-   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
-   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
-  template
-  void extrapolate<deal_II_dimension>
-  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
-   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   TrilinosWrappers::BlockVector &);
+    return h2l;
+  }
 
-#endif
 
 
-  template
-  void interpolate<deal_II_dimension>
-  (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const hp::DoFHandler<deal_II_dimension> &, Vector<double> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
-   const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<double> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const hp::DoFHandler<deal_II_dimension> &, Vector<float> &);
-  template
-  void interpolate<deal_II_dimension>
-  (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
-   const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
-   Vector<float> &);
-
-
-  template FiniteElement<deal_II_dimension,deal_II_dimension> *
-  get_fe_from_name<deal_II_dimension> (const std::string &);
-
-
-  template
-  void add_fe_name<deal_II_dimension>(
-    const std::string& name,
-    const FEFactoryBase<deal_II_dimension>* factory);
-
-  template
+  template <int dim>
   void
-  compute_projection_from_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &fe,
-                                                   const Quadrature<deal_II_dimension>    &lhs_quadrature,
-                                                   const Quadrature<deal_II_dimension>    &rhs_quadrature,
-                                                   FullMatrix<double>       &X);
+  lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe,
+                                        std::vector<unsigned int>    &l2h)
+  {
+    l2h = lexicographic_to_hierarchic_numbering (fe);
+  }
 
-  template
-  void
-  compute_projection_from_quadrature_points(
-    const FullMatrix<double>                &projection_matrix,
-    const std::vector< Tensor<1, deal_II_dimension > >    &vector_of_tensors_at_qp,
-    std::vector< Tensor<1, deal_II_dimension > >          &vector_of_tensors_at_nodes);
 
-  template
-  void
-  compute_projection_from_quadrature_points(
-    const FullMatrix<double>                      &projection_matrix,
-    const std::vector<SymmetricTensor<2, deal_II_dimension> > &vector_of_tensors_at_qp,
-    std::vector<SymmetricTensor<2, deal_II_dimension> >       &vector_of_tensors_at_nodes);
 
+  template <int dim>
+  std::vector<unsigned int>
+  lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe)
+  {
+    return Utilities::invert_permutation(hierarchic_to_lexicographic_numbering (fe));
+  }
 
-  template
-  void
-  compute_interpolation_to_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &fe,
-                                                    const Quadrature<deal_II_dimension>    &quadrature,
-                                                    FullMatrix<double>       &I_q);
+}
 
-#if deal_II_dimension != 1
-  template
-  void
-  compute_projection_from_face_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &fe,
-                                                        const Quadrature<deal_II_dimension-1>    &lhs_quadrature,
-                                                        const Quadrature<deal_II_dimension-1>    &rhs_quadrature,
-                                                        const DoFHandler<deal_II_dimension>::active_cell_iterator & cell,
-                                                        unsigned int face,
-                                                        FullMatrix<double>       &X);
-#endif
 
-}
 
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "fe_tools.inst"
 
 
 /*----------------------------   fe_tools.cc     ---------------------------*/
diff --git a/deal.II/source/fe/fe_tools.inst.in b/deal.II/source/fe/fe_tools.inst.in
new file mode 100644 (file)
index 0000000..16f9356
--- /dev/null
@@ -0,0 +1,522 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+
+  namespace FETools
+  \{
+  template class FEFactoryBase<deal_II_dimension>;
+
+  template
+  void compute_node_matrix(
+    FullMatrix<double>&,
+    const FiniteElement<deal_II_dimension>&);
+
+  template
+  void compute_component_wise(
+    const FiniteElement<deal_II_dimension>& ,
+    std::vector<unsigned int>&, std::vector<std::vector<unsigned int> >&);
+  template
+  void compute_block_renumbering (
+    const FiniteElement<deal_II_dimension>& ,
+    std::vector<unsigned int>&, std::vector<unsigned int>&, bool);
+  template
+  void get_interpolation_matrix<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &,
+   const FiniteElement<deal_II_dimension> &,
+   FullMatrix<double> &);
+  template
+  void get_back_interpolation_matrix<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &,
+   const FiniteElement<deal_II_dimension> &,
+   FullMatrix<double> &);
+  template
+  void get_interpolation_difference_matrix<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &,
+   const FiniteElement<deal_II_dimension> &,
+   FullMatrix<double> &);
+  template
+  void get_interpolation_matrix<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &,
+   const FiniteElement<deal_II_dimension> &,
+   FullMatrix<float> &);
+  template
+  void get_back_interpolation_matrix<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &,
+   const FiniteElement<deal_II_dimension> &,
+   FullMatrix<float> &);
+  template
+  void get_interpolation_difference_matrix<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &,
+   const FiniteElement<deal_II_dimension> &,
+   FullMatrix<float> &);
+
+  template
+  void get_projection_matrix<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &,
+   const FiniteElement<deal_II_dimension> &,
+   FullMatrix<double> &);
+
+  template
+  void compute_embedding_matrices<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&,bool);
+
+  template
+  void compute_face_embedding_matrices<deal_II_dimension,double>
+  (const FiniteElement<deal_II_dimension> &, FullMatrix<double> (&)[GeometryInfo<deal_II_dimension>::max_children_per_face],
+   unsigned int, unsigned int);
+
+  template
+  void compute_projection_matrices<deal_II_dimension>
+  (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&, bool);
+
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const DoFHandler<deal_II_dimension> &, Vector<double> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<double> &);
+
+#if deal_II_dimension != 3
+  template
+  void compute_block_renumbering (
+    const FiniteElement<deal_II_dimension,deal_II_dimension+1>& ,
+    std::vector<unsigned int>&, std::vector<unsigned int>&, bool);
+  template
+  void interpolate<deal_II_dimension,deal_II_dimension+1>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<double> &);
+  template
+  void interpolate<deal_II_dimension,deal_II_dimension+1>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+   Vector<double> &);
+#endif
+
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const FiniteElement<deal_II_dimension> &, Vector<double> &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const Vector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<double> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const FiniteElement<deal_II_dimension> &, Vector<double> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const Vector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<double> &);
+  template
+  void project_dg<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const DoFHandler<deal_II_dimension> &, Vector<double> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const DoFHandler<deal_II_dimension> &, Vector<double> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<double> &);
+
+
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const DoFHandler<deal_II_dimension> &, Vector<float> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<float> &);
+
+#if deal_II_dimension != 3
+  template
+  void interpolate<deal_II_dimension,deal_II_dimension+1>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<float> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+   Vector<float> &);
+#endif
+
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const FiniteElement<deal_II_dimension> &, Vector<float> &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const Vector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<float> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const FiniteElement<deal_II_dimension> &, Vector<float> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const Vector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<float> &);
+  template
+  void project_dg<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const DoFHandler<deal_II_dimension> &, Vector<float> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const DoFHandler<deal_II_dimension> &, Vector<float> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<float> &);
+
+
+#ifdef DEAL_II_USE_TRILINOS
+
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+   const DoFHandler<deal_II_dimension> &,  TrilinosWrappers::Vector &);
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::Vector &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+   const FiniteElement<deal_II_dimension> &,  TrilinosWrappers::Vector &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const TrilinosWrappers::Vector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::Vector &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+   const FiniteElement<deal_II_dimension> &, TrilinosWrappers::Vector &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const TrilinosWrappers::Vector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::Vector &);
+  template
+  void project_dg<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::Vector &);
+
+#endif
+
+
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<double> &);
+
+#if deal_II_dimension != 3
+  template
+  void interpolate<deal_II_dimension,deal_II_dimension+1>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<double> &);
+  template
+  void interpolate<deal_II_dimension,deal_II_dimension+1>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+   BlockVector<double> &);
+#endif
+
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<double> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<double> &);
+  template
+  void project_dg<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<double> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, Vector<double> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<double> &);
+
+
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<float> &);
+
+#if deal_II_dimension != 3
+  template
+  void interpolate<deal_II_dimension,deal_II_dimension+1>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<float> &);
+  template
+  void interpolate<deal_II_dimension,deal_II_dimension+1>
+  (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+   BlockVector<float> &);
+#endif
+
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<float> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<float> &);
+  template
+  void project_dg<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   BlockVector<float> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, Vector<float> &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<float> &);
+
+
+#ifdef DEAL_II_USE_TRILINOS
+
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+   const DoFHandler<deal_II_dimension> &,  TrilinosWrappers::BlockVector &);
+  template
+  void interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::BlockVector &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+   const FiniteElement<deal_II_dimension> &,  TrilinosWrappers::BlockVector &);
+  template
+  void back_interpolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const TrilinosWrappers::BlockVector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::BlockVector &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+   const FiniteElement<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+  template
+  void interpolation_difference<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   const TrilinosWrappers::BlockVector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::BlockVector &);
+  template
+  void project_dg<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+   const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+  template
+  void extrapolate<deal_II_dimension>
+  (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+   const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   TrilinosWrappers::BlockVector &);
+
+#endif
+
+
+  template
+  void interpolate<deal_II_dimension>
+  (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const hp::DoFHandler<deal_II_dimension> &, Vector<double> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
+   const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<double> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const hp::DoFHandler<deal_II_dimension> &, Vector<float> &);
+  template
+  void interpolate<deal_II_dimension>
+  (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
+   const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+   Vector<float> &);
+
+
+  template FiniteElement<deal_II_dimension,deal_II_dimension> *
+  get_fe_from_name<deal_II_dimension> (const std::string &);
+
+
+  template
+  void add_fe_name<deal_II_dimension>(
+    const std::string& ,
+    const FEFactoryBase<deal_II_dimension>* );
+
+  template
+  void
+  compute_projection_from_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &,
+                                                   const Quadrature<deal_II_dimension>    &,
+                                                   const Quadrature<deal_II_dimension>    &,
+                                                   FullMatrix<double>       &);
+
+  template
+  void
+  compute_projection_from_quadrature_points(
+    const FullMatrix<double>                &,
+    const std::vector< Tensor<1, deal_II_dimension > >    &,
+    std::vector< Tensor<1, deal_II_dimension > >          &);
+
+  template
+  void
+  compute_projection_from_quadrature_points(
+    const FullMatrix<double>                      &,
+    const std::vector<SymmetricTensor<2, deal_II_dimension> > &,
+    std::vector<SymmetricTensor<2, deal_II_dimension> >       &);
+
+
+  template
+  void
+  compute_interpolation_to_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &,
+                                                    const Quadrature<deal_II_dimension>    &,
+                                                    FullMatrix<double>       &);
+
+#if deal_II_dimension != 1
+  template
+  void
+  compute_projection_from_face_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &,
+                                                        const Quadrature<deal_II_dimension-1>    &,
+                                                        const Quadrature<deal_II_dimension-1>    &,
+                                                        const DoFHandler<deal_II_dimension>::active_cell_iterator & ,
+                                                        unsigned int,
+                                                        FullMatrix<double>       &);
+#endif
+
+  template
+  void
+  hierarchic_to_lexicographic_numbering<deal_II_dimension>
+  (const FiniteElementData<deal_II_dimension> &,
+   std::vector<unsigned int> &);
+
+  template
+  void
+  lexicographic_to_hierarchic_numbering<deal_II_dimension>
+  (const FiniteElementData<deal_II_dimension> &,
+   std::vector<unsigned int> &);
+
+  template
+  std::vector<unsigned int>
+  hierarchic_to_lexicographic_numbering<deal_II_dimension>
+  (const FiniteElementData<deal_II_dimension> &);
+
+  template
+  std::vector<unsigned int>
+  lexicographic_to_hierarchic_numbering<deal_II_dimension>
+  (const FiniteElementData<deal_II_dimension> &);
+  \}
+  }
+
index 8481733c2f609785e87758162f8ce6eb8dcd6b8e..6727e94170ee7796779816e451eb1c02b7571dea 100644 (file)
@@ -3412,32 +3412,16 @@ FEValues<dim,spacedim>::reinit (const typename hp::DoFHandler<dim,spacedim>::cel
 }
 
 
-#if deal_II_dimension == 1
-
-template <>
-void
-FEValues<1,2>::reinit (const MGDoFHandler<1,2>::cell_iterator &)
-{
-  Assert(false, ExcNotImplemented());
-}
-
-#endif
-
-#if deal_II_dimension == 2
-
-template <>
-void
-FEValues<2,3>::reinit (const MGDoFHandler<2,3>::cell_iterator &)
-{
-  Assert(false, ExcNotImplemented());
-}
-
-#endif
-
 template <int dim, int spacedim>
 void
 FEValues<dim,spacedim>::reinit (const typename MGDoFHandler<dim,spacedim>::cell_iterator &cell)
 {
+  if (spacedim > dim)
+    {
+      Assert(false, ExcNotImplemented());
+      return;
+    }
+
                                   // assert that the finite elements
                                   // passed to the constructor and
                                   // used by the DoFHandler used by
@@ -3704,32 +3688,16 @@ void FEFaceValues<dim,spacedim>::reinit (const typename hp::DoFHandler<dim,space
 }
 
 
-#if deal_II_dimension == 1
-
-template <>
-void FEFaceValues<1,2>::reinit (const MGDoFHandler<1,2>::cell_iterator &,
-                               const unsigned int)
-{
-  Assert(false,ExcNotImplemented());
-}
-
-#endif
-
-#if deal_II_dimension == 2
-
-template <>
-void FEFaceValues<2,3>::reinit (const MGDoFHandler<2,3>::cell_iterator &,
-                               const unsigned int)
-{
-  Assert(false,ExcNotImplemented());
-}
-
-#endif
 
 template <int dim, int spacedim>
 void FEFaceValues<dim,spacedim>::reinit (const typename MGDoFHandler<dim,spacedim>::cell_iterator &cell,
                                         const unsigned int              face_no)
 {
+  if (spacedim > dim)
+    {
+      Assert(false,ExcNotImplemented());
+      return;
+    }
                                   // assert that the finite elements
                                   // passed to the constructor and
                                   // used by the DoFHandler used by
@@ -4137,56 +4105,6 @@ void FESubfaceValues<dim,spacedim>::do_reinit (const unsigned int face_no,
 
 
 /*------------------------------- Explicit Instantiations -------------*/
-
-template class FEValuesData<deal_II_dimension>;
-template class FEValuesBase<deal_II_dimension>;
-template class FEValues<deal_II_dimension>;
-template class FEValuesBase<deal_II_dimension>::
-CellIterator<DoFHandler<deal_II_dimension>::cell_iterator>;
-template class FEValuesBase<deal_II_dimension>::
-CellIterator<MGDoFHandler<deal_II_dimension>::cell_iterator>;
-
-#if deal_II_dimension >= 2
-template class FEFaceValuesBase<deal_II_dimension>;
-template class FEFaceValues<deal_II_dimension>;
-template class FESubfaceValues<deal_II_dimension>;
-#endif
-
-#if deal_II_dimension != 3
-template class FEValuesData<deal_II_dimension,deal_II_dimension+1>;
-template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>;
-template class FEValues<deal_II_dimension,deal_II_dimension+1>;
-template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
-CellIterator<DoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
-template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
- CellIterator<MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
-
-#if deal_II_dimension == 2
-template class FEFaceValuesBase<deal_II_dimension,deal_II_dimension+1>;
-template class FEFaceValues<deal_II_dimension,deal_II_dimension+1>;
-template class FESubfaceValues<deal_II_dimension,deal_II_dimension+1>;
-#endif
-#endif
-
-
-namespace FEValuesViews
-{
-  template class Scalar<deal_II_dimension, deal_II_dimension>;
-  template class Vector<deal_II_dimension, deal_II_dimension>;
-  template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension>;
-
-#if deal_II_dimension != 3
-  template class Scalar<deal_II_dimension, deal_II_dimension+1>;
-  template class Vector<deal_II_dimension, deal_II_dimension+1>;
-  template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension+1>;
-#endif
-}
-
-
-//---------------------------------------------------------------------------
-// Instantiations are in a different file using the macro IN for the vector type.
-// This way, we avoid code reduplication
-
 #include "fe_values.inst"
 
 DEAL_II_NAMESPACE_CLOSE
index ca6dfc5e1a4bb46a770d733f196076dc74aa9256..502cd78f5b33536aed2bc12cddd5298b6e0abf8a 100644 (file)
 // Instantiations of functions in FEValuesViews (explicitly write
 // dealii:: namespace in order to not confuse the compiler with
 // FEValuesViews::Vector).
-for (VEC : SERIAL_VECTORS)
+for (deal_II_dimension : DIMENSIONS)
+{
+template class FEValuesData<deal_II_dimension>;
+template class FEValuesBase<deal_II_dimension>;
+template class FEValues<deal_II_dimension>;
+template class FEValuesBase<deal_II_dimension>::
+CellIterator<DoFHandler<deal_II_dimension>::cell_iterator>;
+template class FEValuesBase<deal_II_dimension>::
+CellIterator<MGDoFHandler<deal_II_dimension>::cell_iterator>;
+
+#if deal_II_dimension >= 2
+template class FEFaceValuesBase<deal_II_dimension>;
+template class FEFaceValues<deal_II_dimension>;
+template class FESubfaceValues<deal_II_dimension>;
+#endif
+
+#if deal_II_dimension != 3
+template class FEValuesData<deal_II_dimension,deal_II_dimension+1>;
+template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>;
+template class FEValues<deal_II_dimension,deal_II_dimension+1>;
+template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
+CellIterator<DoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
+template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
+ CellIterator<MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
+
+#if deal_II_dimension == 2
+template class FEFaceValuesBase<deal_II_dimension,deal_II_dimension+1>;
+template class FEFaceValues<deal_II_dimension,deal_II_dimension+1>;
+template class FESubfaceValues<deal_II_dimension,deal_II_dimension+1>;
+#endif
+#endif
+
+
+namespace FEValuesViews
+\{
+  template class Scalar<deal_II_dimension, deal_II_dimension>;
+  template class Vector<deal_II_dimension, deal_II_dimension>;
+  template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension>;
+
+#if deal_II_dimension != 3
+  template class Scalar<deal_II_dimension, deal_II_dimension+1>;
+  template class Vector<deal_II_dimension, deal_II_dimension+1>;
+  template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension+1>;
+#endif
+\}
+
+}
+
+for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS)
   {
     template
        void FEValuesViews::Scalar<deal_II_dimension>::get_function_values<dealii::VEC>
@@ -116,7 +164,7 @@ for (VEC : SERIAL_VECTORS)
 
 // Instantiations of functions in FEValuesBase
 
-for (VEC : SERIAL_VECTORS)
+for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS)
   {
     template
        void FEValuesBase<deal_II_dimension>::get_function_values<VEC>
@@ -341,3 +389,4 @@ for (VEC : SERIAL_VECTORS)
 #endif
 
   }
+
index e0d8290ede6eff94f81349eedbab9580111fc1a0..97b1fba103f71a090e3e98119afcf0785fd39aee 100644 (file)
@@ -48,8 +48,8 @@ Mapping<dim, spacedim>::transform_covariant (
     const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data) const
 {
   Assert (offset == 0, ExcInternalError());
-  
-  transform(input, output, mapping_data, mapping_covariant);  
+
+  transform(input, output, mapping_data, mapping_covariant);
 }
 
 
@@ -116,10 +116,8 @@ Mapping<dim, spacedim>::InternalDataBase::memory_consumption () const
 
 
 
-template class Mapping<deal_II_dimension>;
+// explicit instantiations
+#include "mapping.inst"
 
-#if deal_II_dimension != 3
-template class Mapping<deal_II_dimension,deal_II_dimension+1>;
-#endif
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/mapping.inst.in b/deal.II/source/fe/mapping.inst.in
new file mode 100644 (file)
index 0000000..4417789
--- /dev/null
@@ -0,0 +1,23 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class Mapping<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+    template class Mapping<deal_II_dimension,deal_II_dimension+1>;
+#endif
+  }
+
index 215d63c2216612746ea29996d5675ac46f4d7fe8..d946b1394a959b44a743e28b2da211bba0812e1c 100644 (file)
@@ -31,7 +31,6 @@ MappingC1<dim,spacedim>::MappingC1 ()
 }
 
 
-#if deal_II_dimension == 1
 
 template <>
 void
@@ -42,11 +41,8 @@ MappingC1<1>::add_line_support_points (const Triangulation<1>::cell_iterator &,
   Assert (dim > 1, ExcImpossibleInDim(dim));
 }
 
-#endif
 
 
-#if deal_II_dimension == 2
-
 template <>
 void
 MappingC1<2>::add_line_support_points (const Triangulation<2>::cell_iterator &cell,
@@ -54,7 +50,7 @@ MappingC1<2>::add_line_support_points (const Triangulation<2>::cell_iterator &ce
 {
   const unsigned int dim = 2;
   std::vector<Point<dim> > line_points (2);
-      
+
                                       // loop over each of the lines,
                                       // and if it is at the
                                       // boundary, then first get the
@@ -152,7 +148,7 @@ MappingC1<2>::add_line_support_points (const Triangulation<2>::cell_iterator &ce
                             (face_vertex_normals[1][1] * std::cos(alpha)
                              -face_vertex_normals[1][0] * std::sin(alpha)))
                           -2*c;
-                      
+
 
                                           // next evaluate the so
                                           // determined cubic
@@ -186,8 +182,6 @@ MappingC1<2>::add_line_support_points (const Triangulation<2>::cell_iterator &ce
     };
 }
 
-#endif
-
 
 
 template<int dim, int spacedim>
@@ -200,9 +194,6 @@ MappingC1<dim,spacedim>::add_line_support_points (const typename Triangulation<d
 
 
 
-
-#if deal_II_dimension == 1
-
 template <>
 void
 MappingC1<1>::add_quad_support_points (const Triangulation<1>::cell_iterator &,
@@ -212,12 +203,8 @@ MappingC1<1>::add_quad_support_points (const Triangulation<1>::cell_iterator &,
   Assert (dim > 2, ExcImpossibleInDim(dim));
 }
 
-#endif
 
 
-
-#if deal_II_dimension == 2
-
 template <>
 void
 MappingC1<2>::add_quad_support_points (const Triangulation<2>::cell_iterator &,
@@ -227,9 +214,6 @@ MappingC1<2>::add_quad_support_points (const Triangulation<2>::cell_iterator &,
   Assert (dim > 2, ExcImpossibleInDim(dim));
 }
 
-#endif
-
-
 
 
 template<int dim, int spacedim>
@@ -253,6 +237,7 @@ MappingC1<dim,spacedim>::clone () const
 
 
 // explicit instantiations
-template class MappingC1<deal_II_dimension>;
+#include "mapping_c1.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/mapping_c1.inst.in b/deal.II/source/fe/mapping_c1.inst.in
new file mode 100644 (file)
index 0000000..27a107a
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class MappingC1<deal_II_dimension>;
+  }
+
index 39196105ab70a1ead67bd71f470aae37fc438834..7a06067feb513c5007147e2b01b655a34cb3bc31 100644 (file)
@@ -70,7 +70,7 @@ MappingCartesian<dim, spacedim>::update_each (const UpdateFlags in) const
   UpdateFlags out = in;
   if (out & update_boundary_forms)
     out |= update_normal_vectors;
-  
+
   return out;
 }
 
@@ -86,7 +86,7 @@ MappingCartesian<dim, spacedim>::get_data (const UpdateFlags      update_flags,
   data->update_once = update_once(update_flags);
   data->update_each = update_each(update_flags);
   data->update_flags = data->update_once | data->update_each;
-  
+
   return data;
 }
 
@@ -103,7 +103,7 @@ MappingCartesian<dim, spacedim>::get_face_data (const UpdateFlags update_flags,
   data->update_once = update_once(update_flags);
   data->update_each = update_each(update_flags);
   data->update_flags = data->update_once | data->update_each;
-  
+
   return data;
 }
 
@@ -120,7 +120,7 @@ MappingCartesian<dim, spacedim>::get_subface_data (const UpdateFlags update_flag
   data->update_once = update_once(update_flags);
   data->update_each = update_each(update_flags);
   data->update_flags = data->update_once | data->update_each;
-  
+
   return data;
 }
 
@@ -157,7 +157,6 @@ MappingCartesian<dim, spacedim>::compute_fill (const typename Triangulation<dim,
                                   // tests/fe/mapping.cc). Therefore,
                                   // we must use following workaround
                                   // of two separate assertions
-#if deal_II_dimension != 1
       Assert ((sub_no == invalid_face_number) ||
               cell->face(face_no)->has_children() ||
               (sub_no+1 < GeometryInfo<dim>::max_children_per_face+1),
@@ -167,7 +166,6 @@ MappingCartesian<dim, spacedim>::compute_fill (const typename Triangulation<dim,
               !cell->face(face_no)->has_children() ||
               (sub_no < cell->face(face_no)->n_children()),
               ExcIndexRange (sub_no, 0, cell->face(face_no)->n_children()));
-#endif
     }
   else
                                     // invalid face number, so
@@ -180,7 +178,7 @@ MappingCartesian<dim, spacedim>::compute_fill (const typename Triangulation<dim,
                                   // chosen as the (lower) left
                                   // vertex
   const Point<dim> start = cell->vertex(0);
-  
+
                                   // Compute start point and sizes
                                   // along axes.  Strange vertex
                                   // numbering makes this complicated
@@ -205,7 +203,7 @@ MappingCartesian<dim, spacedim>::compute_fill (const typename Triangulation<dim,
          Assert(false, ExcNotImplemented());
        }
     }
-  
+
 
                                   // transform quadrature point. this
                                   // is obtained simply by scaling
@@ -257,7 +255,7 @@ MappingCartesian<dim, spacedim>::compute_fill (const typename Triangulation<dim,
     {
       Assert (face_no < GeometryInfo<dim>::faces_per_cell,
               ExcInternalError());
-      
+
       switch (dim)
         {
           case 2:
@@ -302,7 +300,7 @@ template<int dim, int spacedim>
 void
 MappingCartesian<dim, spacedim>::
 fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator& cell,
-                const Quadrature<dim>& q, 
+                const Quadrature<dim>& q,
                typename Mapping<dim,spacedim>::InternalDataBase& mapping_data,
                 std::vector<Point<spacedim> >& quadrature_points,
                 std::vector<double>& JxW_values,
@@ -320,7 +318,7 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator& cell,
   InternalData &data = static_cast<InternalData&> (mapping_data);
 
   std::vector<Point<dim> > dummy;
-  
+
   compute_fill (cell, invalid_face_number, invalid_face_number, cell_similarity,
                data,
                quadrature_points,
@@ -359,8 +357,8 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator& cell,
     if (cell_similarity != CellSimilarity::translation)
       for (unsigned int i=0; i<jacobian_grads.size();++i)
        jacobian_grads[i]=Tensor<3,dim>();
-                                  // "compute" inverse Jacobian at the 
-                                  // quadrature points, which are all 
+                                  // "compute" inverse Jacobian at the
+                                  // quadrature points, which are all
                                   // the same
   if (data.current_update_flags() & update_inverse_jacobians)
     if (cell_similarity != CellSimilarity::translation)
@@ -374,45 +372,77 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator& cell,
 
 
 
-#if (deal_II_dimension == 1)
+template <>
+void
+MappingCartesian<1,1>::fill_fe_face_values (
+  const typename Triangulation<1,1>::cell_iterator &,
+  const unsigned int,
+  const Quadrature<0>&,
+  typename Mapping<1,1>::InternalDataBase&,
+  std::vector<Point<1> >&,
+  std::vector<double>&,
+  std::vector<Tensor<1,1> >&,
+  std::vector<Point<1> >&) const
+{
+  Assert(false, ExcNotImplemented());
+}
+
 
-template <int dim, int spacedim>
+template <>
 void
-MappingCartesian<dim,spacedim>::fill_fe_face_values (
-  const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingCartesian<1,2>::fill_fe_face_values (
+  const typename Triangulation<1,2>::cell_iterator &,
   const unsigned int,
-  const Quadrature<dim-1>&,
-  typename Mapping<dim,spacedim>::InternalDataBase&,
-  std::vector<Point<dim> >&,
+  const Quadrature<0>&,
+  typename Mapping<1,2>::InternalDataBase&,
+  std::vector<Point<1> >&,
   std::vector<double>&,
-  std::vector<Tensor<1,dim> >&,
-  std::vector<Point<spacedim> >&) const
+  std::vector<Tensor<1,1> >&,
+  std::vector<Point<2> >&) const
 {
   Assert(false, ExcNotImplemented());
 }
 
 
-template <int dim, int spacedim>
+
+template <>
+void
+MappingCartesian<1,1>::fill_fe_subface_values (
+  const typename Triangulation<1,1>::cell_iterator &,
+  const unsigned int,
+  const unsigned int,
+  const Quadrature<0>&,
+  typename Mapping<1,1>::InternalDataBase&,
+  std::vector<Point<1> >&,
+  std::vector<double>&,
+  std::vector<Tensor<1,1> >&,
+  std::vector<Point<1> >&) const
+{
+  Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
 void
-MappingCartesian<dim,spacedim>::fill_fe_subface_values (
-  const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingCartesian<1,2>::fill_fe_subface_values (
+  const typename Triangulation<1,2>::cell_iterator &,
   const unsigned int,
   const unsigned int,
-  const Quadrature<dim-1>&,
-  typename Mapping<dim,spacedim>::InternalDataBase&,
-  std::vector<Point<dim> >&,
+  const Quadrature<0>&,
+  typename Mapping<1,2>::InternalDataBase&,
+  std::vector<Point<1> >&,
   std::vector<double>&,
-  std::vector<Tensor<1,dim> >&,
-  std::vector<Point<spacedim> >&) const
+  std::vector<Tensor<1,1> >&,
+  std::vector<Point<2> >&) const
 {
   Assert(false, ExcNotImplemented());
 }
 
 
-#else
 
 // Implementation for dim != 1
-  
+
 template<int dim, int spacedim>
 void
 MappingCartesian<dim, spacedim>::fill_fe_face_values (
@@ -433,7 +463,7 @@ MappingCartesian<dim, spacedim>::fill_fe_face_values (
          ExcInternalError());
   InternalData &data = static_cast<InternalData&> (mapping_data);
 
-  compute_fill (cell, face_no, invalid_face_number, 
+  compute_fill (cell, face_no, invalid_face_number,
                CellSimilarity::none,
                data,
                quadrature_points,
@@ -447,7 +477,7 @@ MappingCartesian<dim, spacedim>::fill_fe_face_values (
   for (unsigned int d=0; d<dim; ++d)
     if (d != GeometryInfo<dim>::unit_normal_direction[face_no])
       J *= data.length[d];
-  
+
   if (data.current_update_flags() & update_JxW_values)
     for (unsigned int i=0; i<JxW_values.size();++i)
       JxW_values[i] = J * q.weight(i);
@@ -500,7 +530,7 @@ MappingCartesian<dim, spacedim>::fill_fe_subface_values (
   for (unsigned int d=0; d<dim; ++d)
     if (d != GeometryInfo<dim>::unit_normal_direction[face_no])
       J *= data.length[d];
-  
+
   if (data.current_update_flags() & update_JxW_values)
     {
                                       // Here,
@@ -534,10 +564,8 @@ MappingCartesian<dim, spacedim>::fill_fe_subface_values (
     }
 }
 
-  
-#endif
 
-  
+
 template<int dim, int spacedim>
 void
 MappingCartesian<dim,spacedim>::transform (
@@ -547,28 +575,28 @@ MappingCartesian<dim,spacedim>::transform (
   const MappingType mapping_type) const
 {
   AssertDimension (input.size(), output.size());
-  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0, 
-         ExcInternalError());  
+  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+         ExcInternalError());
   const InternalData &data = static_cast<const InternalData&> (mapping_data);
-  
+
   switch (mapping_type)
     {
       case mapping_covariant:
       {
        Assert (data.update_flags & update_covariant_transformation,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d=0;d<dim;++d)
            output[i][d] = input[i][d]/data.length[d];
        return;
       }
-      
+
       case mapping_contravariant:
       {
        Assert (data.update_flags & update_contravariant_transformation,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d=0;d<dim;++d)
            output[i][d] = input[i][d]*data.length[d];
@@ -580,7 +608,7 @@ MappingCartesian<dim,spacedim>::transform (
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
        Assert (data.update_flags & update_volume_elements,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d=0;d<dim;++d)
            output[i][d] = input[i][d] * data.length[d] / data.volume_element;
@@ -591,6 +619,8 @@ MappingCartesian<dim,spacedim>::transform (
     }
 }
 
+
+
 template<int dim, int spacedim>
 void
 MappingCartesian<dim,spacedim>::transform (
@@ -600,29 +630,29 @@ MappingCartesian<dim,spacedim>::transform (
   const MappingType mapping_type) const
 {
   AssertDimension (input.size(), output.size());
-  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0, 
+  Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
          ExcInternalError());
   const InternalData &data = static_cast<const InternalData&>(mapping_data);
-  
+
   switch (mapping_type)
     {
       case mapping_covariant:
       {
        Assert (data.update_flags & update_covariant_transformation,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d1=0;d1<dim;++d1)
            for (unsigned int d2=0;d2<dim;++d2)
              output[i][d1][d2] = input[i][d1][d2] / data.length[d2];
        return;
       }
-      
+
       case mapping_contravariant:
       {
        Assert (data.update_flags & update_contravariant_transformation,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d1=0;d1<dim;++d1)
            for (unsigned int d2=0;d2<dim;++d2)
@@ -634,7 +664,7 @@ MappingCartesian<dim,spacedim>::transform (
       {
        Assert (data.update_flags & update_covariant_transformation,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d1=0;d1<dim;++d1)
            for (unsigned int d2=0;d2<dim;++d2)
@@ -646,7 +676,7 @@ MappingCartesian<dim,spacedim>::transform (
       {
        Assert (data.update_flags & update_contravariant_transformation,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d1=0;d1<dim;++d1)
            for (unsigned int d2=0;d2<dim;++d2)
@@ -660,7 +690,7 @@ MappingCartesian<dim,spacedim>::transform (
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
        Assert (data.update_flags & update_volume_elements,
                typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-       
+
        for (unsigned int i=0; i<output.size(); ++i)
          for (unsigned int d1=0;d1<dim;++d1)
            for (unsigned int d2=0;d2<dim;++d2)
@@ -668,7 +698,7 @@ MappingCartesian<dim,spacedim>::transform (
                                  / data.length[d1] / data.volume_element;
        return;
       }
-           
+
       default:
            Assert(false, ExcNotImplemented());
     }
@@ -755,7 +785,7 @@ MappingCartesian<dim, spacedim>::clone () const
 
 //---------------------------------------------------------------------------
 // explicit instantiations
+#include "mapping_cartesian.inst"
 
-template class MappingCartesian<deal_II_dimension>;
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/mapping_cartesian.inst.in b/deal.II/source/fe/mapping_cartesian.inst.in
new file mode 100644 (file)
index 0000000..ab9c3cf
--- /dev/null
@@ -0,0 +1,19 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class MappingCartesian<deal_II_dimension>;
+  }
+
index 33253296db93c9d1cd07aaeaed012ab299d1a444..e4e54d028817027a8170c5837460705b0a1f0ad8 100644 (file)
@@ -56,8 +56,6 @@ MappingQ<dim,spacedim>::InternalData::memory_consumption () const
 
 
 
-#if deal_II_dimension == 1
-
 // in 1d, it is irrelevant which polynomial degree to use, since all
 // cells are scaled linearly. Unless codimension is equal to two
 template<>
@@ -92,8 +90,6 @@ template<>
 MappingQ<1>::~MappingQ ()
 {}
 
-#endif
-
 
 
 namespace
@@ -182,8 +178,6 @@ MappingQ<dim,spacedim>::~MappingQ ()
 
 
 
-#if deal_II_dimension == 1
-
 template<>
 void
 MappingQ<1>::compute_shapes_virtual (const std::vector<Point<1> > &unit_points,
@@ -192,8 +186,6 @@ MappingQ<1>::compute_shapes_virtual (const std::vector<Point<1> > &unit_points,
   MappingQ1<1>::compute_shapes_virtual(unit_points, data);
 }
 
-#endif
-
 
 
 template<int dim, int spacedim>
@@ -489,7 +481,6 @@ MappingQ<dim,spacedim>::fill_fe_subface_values (const typename Triangulation<dim
 }
 
 
-#if deal_II_dimension==1
 
 template <>
 void
@@ -498,7 +489,7 @@ MappingQ<1>::set_laplace_on_quad_vector(Table<2,double> &) const
   Assert(false, ExcInternalError());
 }
 
-#else
+
 
 template<int dim, int spacedim>
 void
@@ -704,10 +695,7 @@ MappingQ<dim,spacedim>::set_laplace_on_quad_vector(Table<2,double> &loqvs) const
           ExcInternalError());
 }
 
-#endif
-
 
-#if deal_II_dimension==3
 
 template <>
 void
@@ -752,7 +740,6 @@ MappingQ<3>::set_laplace_on_hex_vector(Table<2,double> &lohvs) const
           ExcInternalError());
 }
 
-#endif
 
 
 template<int dim, int spacedim>
@@ -764,9 +751,6 @@ MappingQ<dim,spacedim>::set_laplace_on_hex_vector(Table<2,double> &) const
 
 
 
-
-#if deal_II_dimension==1
-
 template <>
 void
 MappingQ<1>::compute_laplace_vector(Table<2,double> &) const
@@ -774,7 +758,6 @@ MappingQ<1>::compute_laplace_vector(Table<2,double> &) const
   Assert(false, ExcInternalError());
 }
 
-#else
 
 
 template<int dim, int spacedim>
@@ -836,8 +819,6 @@ MappingQ<dim,spacedim>::compute_laplace_vector(Table<2,double> &lvs) const
       lvs(i,k) = -S_1_T(i,k);
 }
 
-#endif
-
 
 
 template<int dim, int spacedim>
@@ -959,10 +940,6 @@ MappingQ<dim,spacedim>::compute_support_points_laplace(const typename Triangulat
 
 
 
-
-
-#if deal_II_dimension==1
-
 template <>
 void
 MappingQ<1>::add_line_support_points (const Triangulation<1>::cell_iterator &,
@@ -975,6 +952,7 @@ MappingQ<1>::add_line_support_points (const Triangulation<1>::cell_iterator &,
 }
 
 
+
 template <>
 void
 MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator &cell,
@@ -1006,7 +984,6 @@ MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator
     }
 }
 
-#endif
 
 
 template<int dim, int spacedim>
@@ -1080,10 +1057,6 @@ MappingQ<dim,spacedim>::add_line_support_points (const typename Triangulation<di
 
 
 
-
-#if deal_II_dimension==3
-
-
 template<>
 void
 MappingQ<3>::
@@ -1250,9 +1223,7 @@ add_quad_support_points(const Triangulation<3>::cell_iterator &cell,
     }
 }
 
-#endif
 
-#if deal_II_dimension == 2
 
 template<>
 void
@@ -1268,7 +1239,6 @@ add_quad_support_points(const Triangulation<2,3>::cell_iterator &cell,
     a.push_back(quad_points[i]);
 }
 
-#endif
 
 
 template<int dim, int spacedim>
@@ -1281,6 +1251,7 @@ add_quad_support_points(const typename Triangulation<dim,spacedim>::cell_iterato
 }
 
 
+
 template<int dim, int spacedim>
 void
 MappingQ<dim,spacedim>::transform (
@@ -1319,6 +1290,7 @@ MappingQ<dim,spacedim>::transform (
 }
 
 
+
 template<int dim, int spacedim>
 void
 MappingQ<dim,spacedim>::transform (
@@ -1443,11 +1415,9 @@ MappingQ<dim,spacedim>::clone () const
 }
 
 
-// explicit instantiation
-template class MappingQ<deal_II_dimension>;
 
-#if deal_II_dimension < 3
-template class MappingQ<deal_II_dimension, deal_II_dimension+1>;
-#endif
+// explicit instantiations
+#include "mapping_q.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/mapping_q.inst.in b/deal.II/source/fe/mapping_q.inst.in
new file mode 100644 (file)
index 0000000..d21499b
--- /dev/null
@@ -0,0 +1,23 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class MappingQ<deal_II_dimension>;
+
+#if deal_II_dimension < 3
+    template class MappingQ<deal_II_dimension, deal_II_dimension+1>;
+#endif
+  }
+
index ee72c8f37b29a9ae96510efa6609d168f7084d34..2b66511b702700df1187dc1169d5800abf8122a1 100644 (file)
@@ -863,7 +863,6 @@ MappingQ1<dim,spacedim>::fill_fe_values (
 }
 
 
-#if deal_II_dimension == 2
 
 template<>
 void
@@ -882,64 +881,117 @@ MappingQ1<2,3>::compute_fill_face (const Triangulation<2,3>::cell_iterator &,
        Assert(false, ExcNotImplemented());
 }
 
-#endif
 
-#if (deal_II_dimension == 1)
 
-template <int dim, int spacedim>
+template <>
 void
-MappingQ1<dim,spacedim>::compute_fill_face (
-  const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingQ1<1,1>::compute_fill_face (
+  const typename Triangulation<1,1>::cell_iterator &,
+  const unsigned int,
+  const unsigned int,
+  const unsigned int,
+  const DataSetDescriptor,
+  const std::vector<double> &,
+  InternalData &,
+  std::vector<Point<1> > &,
+  std::vector<double> &,
+  std::vector<Tensor<1,1> > &,
+  std::vector<Point<1> > &) const
+{
+  Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MappingQ1<1,2>::compute_fill_face (
+  const typename Triangulation<1,2>::cell_iterator &,
   const unsigned int,
   const unsigned int,
   const unsigned int,
   const DataSetDescriptor,
   const std::vector<double> &,
   InternalData &,
-  std::vector<Point<spacedim> > &,
+  std::vector<Point<2> > &,
   std::vector<double> &,
-  std::vector<Tensor<1,spacedim> > &,
-  std::vector<Point<spacedim> > &) const
+  std::vector<Tensor<1,2> > &,
+  std::vector<Point<2> > &) const
 {
   Assert(false, ExcNotImplemented());
 }
 
 
-template <int dim,int spacedim>
+
+template <>
 void
-MappingQ1<dim,spacedim>::fill_fe_face_values (
-  const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingQ1<1,1>::fill_fe_face_values (
+  const typename Triangulation<1,1>::cell_iterator &,
   const unsigned,
-  const Quadrature<dim-1>&,
-  typename Mapping<dim,spacedim>::InternalDataBase&,
-  std::vector<Point<spacedim> >&,
+  const Quadrature<0>&,
+  typename Mapping<1,1>::InternalDataBase&,
+  std::vector<Point<1> >&,
   std::vector<double>&,
-  std::vector<Tensor<1,spacedim> >&,
-  std::vector<Point<spacedim> >&) const
+  std::vector<Tensor<1,1> >&,
+  std::vector<Point<1> >&) const
 {
   Assert(false, ExcNotImplemented());
 }
 
 
-template <int dim,int spacedim>
+
+template <>
 void
-MappingQ1<dim,spacedim>::fill_fe_subface_values (
-  const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingQ1<1,2>::fill_fe_face_values (
+  const typename Triangulation<1,2>::cell_iterator &,
+  const unsigned,
+  const Quadrature<0>&,
+  typename Mapping<1,2>::InternalDataBase&,
+  std::vector<Point<2> >&,
+  std::vector<double>&,
+  std::vector<Tensor<1,2> >&,
+  std::vector<Point<2> >&) const
+{
+  Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MappingQ1<1,1>::fill_fe_subface_values (
+  const typename Triangulation<1,1>::cell_iterator &,
   const unsigned,
   const unsigned,
-  const Quadrature<dim-1>&,
-  typename Mapping<dim,spacedim>::InternalDataBase&,
-  std::vector<Point<spacedim> >&,
+  const Quadrature<0>&,
+  typename Mapping<1,1>::InternalDataBase&,
+  std::vector<Point<1> >&,
   std::vector<double>&,
-  std::vector<Tensor<1,spacedim> >&,
-  std::vector<Point<spacedim> >&) const
+  std::vector<Tensor<1,1> >&,
+  std::vector<Point<1> >&) const
+{
+  Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MappingQ1<1,2>::fill_fe_subface_values (
+  const typename Triangulation<1,2>::cell_iterator &,
+  const unsigned,
+  const unsigned,
+  const Quadrature<0>&,
+  typename Mapping<1,2>::InternalDataBase&,
+  std::vector<Point<2> >&,
+  std::vector<double>&,
+  std::vector<Tensor<1,2> >&,
+  std::vector<Point<2> >&) const
 {
   Assert(false, ExcNotImplemented());
 }
 
 
-#else
-// Implementation for 2D and 3D
 
 template<int dim, int spacedim>
 void
@@ -1102,8 +1154,6 @@ MappingQ1<dim,spacedim>::fill_fe_subface_values (const typename Triangulation<di
 }
 
 
-#endif
-
 
 template<int dim, int spacedim>
 void
@@ -1369,7 +1419,6 @@ transform_real_to_unit_cell (const typename Triangulation<dim,spacedim>::cell_it
 }
 
 
-#if deal_II_dimension == 1
 
 template<>
 void
@@ -1383,9 +1432,7 @@ transform_real_to_unit_cell_internal
        Assert(false, ExcNotImplemented());
 }
 
-#endif
 
-#if deal_II_dimension == 2
 
 template<>
 void
@@ -1399,7 +1446,6 @@ transform_real_to_unit_cell_internal
        Assert(false, ExcNotImplemented());
 }
 
-#endif
 
 
 template<int dim, int spacedim>
@@ -1486,13 +1532,8 @@ MappingQ1<dim,spacedim> StaticMappingQ1<dim,spacedim>::mapping;
 
 
 
-//---------------------------------------------------------------------------
+//--------------------------- Explicit instantiations -----------------------
+#include "mapping_q1.inst"
 
-template class MappingQ1<deal_II_dimension>;
-template struct StaticMappingQ1<deal_II_dimension>;
 
-#if deal_II_dimension != 3
-template class MappingQ1<deal_II_dimension,deal_II_dimension+1>;
-template struct StaticMappingQ1<deal_II_dimension,deal_II_dimension+1>;
-#endif
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/mapping_q1.inst.in b/deal.II/source/fe/mapping_q1.inst.in
new file mode 100644 (file)
index 0000000..04e5255
--- /dev/null
@@ -0,0 +1,25 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class MappingQ1<deal_II_dimension>;
+    template struct StaticMappingQ1<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+    template class MappingQ1<deal_II_dimension,deal_II_dimension+1>;
+    template struct StaticMappingQ1<deal_II_dimension,deal_II_dimension+1>;
+#endif
+  }
+
index 3dd1292162955ba033cb0f205343ebe16dea9206..4c67d46f39a375a7d5b06d0549ef7830f203f71c 100644 (file)
@@ -139,19 +139,8 @@ MappingQ1Eulerian<dim,EulerVectorType,spacedim>::fill_fe_values (
 
 
 
-// explicit instantiation
-template class MappingQ1Eulerian<deal_II_dimension, Vector<double> >;
-template class MappingQ1Eulerian<deal_II_dimension, Vector<float> >;
-#ifdef DEAL_II_USE_PETSC
-template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector>;
-#endif
-
-// Explicit instantiation for codimension one problems.
-#if deal_II_dimension != 3
-template class MappingQ1Eulerian<deal_II_dimension, Vector<double>, deal_II_dimension+1 >;
-#      ifdef DEAL_II_USE_PETSC
-template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector, deal_II_dimension+1>;
-#      endif
-#endif
+// explicit instantiations
+#include "mapping_q1_eulerian.inst"
+
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/mapping_q1_eulerian.inst.in b/deal.II/source/fe/mapping_q1_eulerian.inst.in
new file mode 100644 (file)
index 0000000..3c822d1
--- /dev/null
@@ -0,0 +1,30 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class MappingQ1Eulerian<deal_II_dimension, Vector<double> >;
+    template class MappingQ1Eulerian<deal_II_dimension, Vector<float> >;
+#ifdef DEAL_II_USE_PETSC
+    template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector>;
+#endif
+
+#if deal_II_dimension != 3
+    template class MappingQ1Eulerian<deal_II_dimension, Vector<double>, deal_II_dimension+1 >;
+#      ifdef DEAL_II_USE_PETSC
+    template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector, deal_II_dimension+1>;
+#      endif
+#endif
+  }
+
index f0ded0c90b33a2c48a3236f9dc169fea3f84db5b..6a1e9010cdb2a86189451510584798733c732f59 100644 (file)
@@ -208,22 +208,8 @@ MappingQEulerian<dim,EulerVectorType,spacedim>::fill_fe_values (
 
 
 
-// explicit instantiation
-template class MappingQEulerian<deal_II_dimension, Vector<double> >;
-#ifdef DEAL_II_USE_PETSC
-template class MappingQEulerian<deal_II_dimension, PETScWrappers::Vector>;
-#endif
-
-#if deal_II_dimension != 3
-template class MappingQEulerian<deal_II_dimension, Vector<double>,
-                               deal_II_dimension+1>;
-
-#  ifdef DEAL_II_USE_PETSC
-template class MappingQEulerian<deal_II_dimension,
-                               PETScWrappers::Vector, deal_II_dimension+1>;
-#  endif
-
-#endif
+// explicit instantiations
+#include "mapping_q_eulerian.inst"
 
 
 DEAL_II_NAMESPACE_CLOSE
diff --git a/deal.II/source/fe/mapping_q_eulerian.inst.in b/deal.II/source/fe/mapping_q_eulerian.inst.in
new file mode 100644 (file)
index 0000000..b8e323c
--- /dev/null
@@ -0,0 +1,33 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+  {
+    template class MappingQEulerian<deal_II_dimension, Vector<double> >;
+#ifdef DEAL_II_USE_PETSC
+    template class MappingQEulerian<deal_II_dimension, PETScWrappers::Vector>;
+#endif
+
+#if deal_II_dimension != 3
+    template class MappingQEulerian<deal_II_dimension, Vector<double>,
+                                   deal_II_dimension+1>;
+
+#  ifdef DEAL_II_USE_PETSC
+    template class MappingQEulerian<deal_II_dimension,
+                                   PETScWrappers::Vector, deal_II_dimension+1>;
+#  endif
+
+#endif
+  }
+

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.