]> https://gitweb.dealii.org/ - dealii.git/commitdiff
new template structure for DataOut...
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 2 May 2006 06:18:17 +0000 (06:18 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Tue, 2 May 2006 06:18:17 +0000 (06:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@12960 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/data_out.h
deal.II/deal.II/include/numerics/data_out_faces.h
deal.II/deal.II/include/numerics/data_out_rotation.h
deal.II/deal.II/include/numerics/data_out_stack.h
deal.II/deal.II/source/numerics/data_out.cc
deal.II/deal.II/source/numerics/data_out_faces.cc
deal.II/deal.II/source/numerics/data_out_rotation.cc
deal.II/deal.II/source/numerics/data_out_stack.cc

index 21bed58878d62654da0c280f822f6100c47067d7..6daea8bc2c4515c3d5f1bb913d483d60f1a9d7ee 100644 (file)
@@ -25,7 +25,7 @@
 #include <boost/shared_ptr.hpp>
 
 
-template <int>      class FEValuesBase;
+template <int> class FEValuesBase;
 
 //TODO: Most of the documentation of DataOut_DoFData applies to DataOut.
 
@@ -162,13 +162,13 @@ template <int>      class FEValuesBase;
  * @ingroup output
  * @author Wolfgang Bangerth, 1999
  */
-template <int dof_handler_dim, template <int> class DH,
-         int patch_dim, int patch_space_dim=patch_dim>
+template <class DH, int patch_dim, int patch_space_dim=patch_dim>
 class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
 {
+//TODO: Do we still need this after changing the template argument?
 #ifdef DEAL_II_TEMPLATE_TEMPLATE_TYPEDEF_BUG
                                     // helper class
-    struct DH_dim : public DH<dof_handler_dim>
+    struct DH_dim : public DH
     {
                                         // constructor. will
                                         // not be implemented,
@@ -181,8 +181,8 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                          * Declare iterator type, for
                                          * access from outside.
                                          */
-       typedef typename DH<dof_handler_dim>::cell_iterator cell_iterator;
-       typedef typename DH<dof_handler_dim>::active_cell_iterator active_cell_iterator;
+       typedef typename DH::cell_iterator cell_iterator;
+       typedef typename DH::active_cell_iterator active_cell_iterator;
     };
   public:
     
@@ -202,8 +202,8 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                      * of the dof handler class under
                                      * consideration.
                                      */
-    typedef typename DH<dof_handler_dim>::cell_iterator cell_iterator;
-    typedef typename DH<dof_handler_dim>::active_cell_iterator active_cell_iterator;
+    typedef typename DH::cell_iterator cell_iterator;
+    typedef typename DH::active_cell_iterator active_cell_iterator;
 #endif
   public:
 
@@ -251,7 +251,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                      * and the mapping between nodes
                                      * and node values.
                                      */
-    void attach_dof_handler (const DH<dof_handler_dim> &);
+    void attach_dof_handler (const DH &);
 
                                     /**
                                      * Add a data vector together
@@ -456,8 +456,8 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                       * object did not yet set up any
                                       * patches.
                                       */
-    template <int dof_handler_dim2>
-    void merge_patches (const DataOut_DoFData<dof_handler_dim2,DH,patch_dim,patch_space_dim> &source,
+    template <class DH2>
+    void merge_patches (const DataOut_DoFData<DH2,patch_dim,patch_space_dim> &source,
                        const Point<patch_space_dim> &shift = Point<patch_space_dim>());
     
                                     /**
@@ -586,7 +586,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                           */
         virtual
         void
-        get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+        get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
                              std::vector<double>             &patch_values) const = 0;
         
                                          /**
@@ -599,7 +599,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                           */
         virtual
         void
-        get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+        get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
                              std::vector<Vector<double> >    &patch_values_system) const = 0;
 
                                          /**
@@ -660,7 +660,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                           */
         virtual
         void
-        get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+        get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
                              std::vector<double>             &patch_values) const;
         
                                          /**
@@ -673,7 +673,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                           */
         virtual
         void
-        get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+        get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
                              std::vector<Vector<double> >    &patch_values_system) const;
 
                                          /**
@@ -710,7 +710,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                     /**
                                      * Pointer to the dof handler object.
                                      */
-    SmartPointer<const DH<dof_handler_dim> > dofs;
+    SmartPointer<const DH> dofs;
 
                                     /**
                                      * List of data elements with vectors of
@@ -755,7 +755,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                      * friends. Needed for the
                                      * merge_patches() function.
                                      */
-    template <int,template <int> class, int,int>
+    template <class, int, int>
     friend class DataOut_DoFData;
 
 #ifdef DEAL_II_NESTED_CLASS_FRIEND_BUG
@@ -780,7 +780,7 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
 #  else
     template <int N1, template <int> class DH1, int N2, int N3>
     template <typename>
-    friend class DataOut_DoFData<N1,DH1,N2,N3>::DataEntry;
+    friend class DataOut_DoFData<DH1,N2,N3>::DataEntry;
 #  endif
 #endif
 };
@@ -861,8 +861,8 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
  * @ingroup output
  * @author Wolfgang Bangerth, 1999
  */
-template <int dim, template <int> class DH = DoFHandler>
-class DataOut : public DataOut_DoFData<dim,DH,dim
+template <int dim, class DH=DoFHandler<dim> >
+class DataOut : public DataOut_DoFData<DH, DH::dimension
 {
   public:
                                     /**
@@ -870,8 +870,8 @@ class DataOut : public DataOut_DoFData<dim,DH,dim>
                                      * of the dof handler class under
                                      * consideration.
                                      */
-    typedef typename DataOut_DoFData<dim,DH,dim>::cell_iterator cell_iterator;
-    typedef typename DataOut_DoFData<dim,DH,dim>::active_cell_iterator active_cell_iterator;
+    typedef typename DataOut_DoFData<DH,DH::dimension>::cell_iterator cell_iterator;
+    typedef typename DataOut_DoFData<DH,DH::dimension>::active_cell_iterator active_cell_iterator;
     
                                     /**
                                      * This is the central function
@@ -929,7 +929,7 @@ class DataOut : public DataOut_DoFData<dim,DH,dim>
                                      * vector that holds the
                                      * deformation of each vertex.
                                      */
-    virtual void build_patches (const Mapping<dim> &mapping,
+    virtual void build_patches (const Mapping<DH::dimension> &mapping,
                                const unsigned int n_subdivisions = 1,
                                const unsigned int n_threads      = multithread_info.n_default_threads);
     
@@ -1000,7 +1000,7 @@ class DataOut : public DataOut_DoFData<dim,DH,dim>
        unsigned int n_components;
        unsigned int n_datasets;
        unsigned int n_subdivisions;
-        SmartPointer<const Mapping<dim> > mapping;
+        SmartPointer<const Mapping<DH::dimension> > mapping;
        std::vector<double>          patch_values;
        std::vector<Vector<double> > patch_values_system;
 
@@ -1021,12 +1021,11 @@ class DataOut : public DataOut_DoFData<dim,DH,dim>
 
 // -------------------- template and inline functions ------------------------
 
-template <int dof_handler_dim, template <int> class DH,
-          int patch_dim, int patch_space_dim>
-template <int dof_handler_dim2>
+template <class DH, int patch_dim, int patch_space_dim>
+template <class DH2>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
-merge_patches (const DataOut_DoFData<dof_handler_dim2,DH,patch_dim,patch_space_dim> &source,
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
+merge_patches (const DataOut_DoFData<DH2,patch_dim,patch_space_dim> &source,
               const Point<patch_space_dim> &shift)
 {
   const std::vector<Patch> source_patches = source.get_patches ();
index 42689e63867ee8c4b0fda3acb8cf90a3ab584aab..bf7b8fb1507dd1693ae3ec84180e9b3ac9afeef5 100644 (file)
@@ -20,7 +20,6 @@
 #include <string>
 #include <vector>
 
-template <int dim> class DoFHandler;
 
 
 /**
@@ -78,8 +77,9 @@ template <int dim> class DoFHandler;
  * @ingroup output
  * @author Wolfgang Bangerth, 2000
  */
-template <int dim, template <int> class DH = DoFHandler>
-class DataOutFaces : public DataOut_DoFData<dim,DH,dim-1,dim>
+template <int dim, class DH=DoFHandler<dim> >
+class DataOutFaces : public DataOut_DoFData<DH,DH::dimension-1,
+                                           DH::dimension>
 {
   public:
                                     /**
@@ -87,7 +87,8 @@ class DataOutFaces : public DataOut_DoFData<dim,DH,dim-1,dim>
                                      * of the dof handler class under
                                      * consideration.
                                      */
-    typedef typename DataOut_DoFData<dim,DH,dim-1,dim>::cell_iterator cell_iterator;
+    typedef typename DataOut_DoFData<DH,DH::dimension-1,
+                                    DH::dimension>::cell_iterator cell_iterator;
 
                                      /**
                                      * This is the central function
index f419c548d17a5bb5371e4f40524becd350fb2525..ba036f17c5408447c1afd9125db039f253ee15fe 100644 (file)
@@ -20,7 +20,6 @@
 #include <string>
 #include <vector>
 
-template <int dim> class DoFHandler;
 
 
 /**
@@ -80,8 +79,8 @@ template <int dim> class DoFHandler;
  * @ingroup output
  * @author Wolfgang Bangerth, 2000
  */
-template <int dim, template <int> class DH = DoFHandler>
-class DataOutRotation : public DataOut_DoFData<dim,DH,dim+1>
+template <int dim, class DH=DoFHandler<dim> >
+class DataOutRotation : public DataOut_DoFData<DH,DH::dimension+1>
 {
   public:
                                     /**
@@ -89,7 +88,7 @@ class DataOutRotation : public DataOut_DoFData<dim,DH,dim+1>
                                      * of the dof handler class under
                                      * consideration.
                                      */
-    typedef typename DataOut_DoFData<dim,DH,dim+1>::cell_iterator cell_iterator;
+    typedef typename DataOut_DoFData<DH,DH::dimension+1>::cell_iterator cell_iterator;
 
                                      /**
                                      * This is the central function
@@ -202,9 +201,4 @@ class DataOutRotation : public DataOut_DoFData<dim,DH,dim+1>
 };
 
 
-/* -------------- declaration of explicit specializations ------------- */
-
-template <> void DataOutRotation<3,DoFHandler>::build_some_patches (Data &);
-
-
 #endif
index 34d96075513597e9ccd4738aa2a0cf60c994a255..9250f6e31b8f45c7921d1286788c77db3d7c6436 100644 (file)
@@ -101,7 +101,7 @@ template <int dim> class DoFHandler;
  * @ingroup output
  * @author Wolfgang Bangerth, 1999
  */
-template <int dim, template <int> class DH = DoFHandler>
+template <int dim, class DH = DoFHandler<dim> >
 class DataOutStack : public DataOutInterface<dim+1> 
 {
   public:
@@ -141,7 +141,7 @@ class DataOutStack : public DataOutInterface<dim+1>
                                      * data vectors for the present
                                      * parameter value.
                                      */
-    void attach_dof_handler (const DH<dim> &dof_handler);
+    void attach_dof_handler (const DHdof_handler);
 
                                     /**
                                      * Declare a data vector. The @p vector_type
@@ -370,7 +370,7 @@ class DataOutStack : public DataOutInterface<dim+1>
                                      * corresponding to the present parameter
                                      * value.
                                      */
-    SmartPointer<const DH<dim> > dof_handler;
+    SmartPointer<const DH> dof_handler;
 
                                     /**
                                      * List of patches of all past and
index 40b1ff5033a82b2fd48a2f1bbcd73caf6f048b07..28344091d193f921106fce2be760fefe5eb77733 100644 (file)
@@ -34,9 +34,8 @@
 
 
 
-template <int dof_handler_dim, template <int> class DH,
-         int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+template <class DH, int patch_dim, int patch_space_dim>
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntryBase::DataEntryBase (const std::vector<std::string> &names)
                :
                names(names)
@@ -44,18 +43,16 @@ DataEntryBase::DataEntryBase (const std::vector<std::string> &names)
 
 
 
-template <int dof_handler_dim, template <int> class DH,
-         int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+template <class DH, int patch_dim, int patch_space_dim>
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntryBase::~DataEntryBase ()
 {}
 
 
 
-template <int dof_handler_dim,  template <int> class DH,
-         int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
 template <typename VectorType>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntry<VectorType>::
 DataEntry (const VectorType               *data,
           const std::vector<std::string> &names)
@@ -65,11 +62,10 @@ DataEntry (const VectorType               *data,
 {}
 
 
-template <int dof_handler_dim, template <int> class DH,
-         int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
 template <typename VectorType>
 double
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntry<VectorType>::
 get_cell_data_value (const unsigned int cell_number) const
 {
@@ -78,13 +74,12 @@ get_cell_data_value (const unsigned int cell_number) const
 
 
 
-template <int dof_handler_dim, template <int> class DH,
-         int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
 template <typename VectorType>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntry<VectorType>::
-get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
                      std::vector<Vector<double> >    &patch_values_system) const
 {
   fe_patch_values.get_function_values (*vector, patch_values_system);
@@ -92,13 +87,13 @@ get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 template <typename VectorType>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntry<VectorType>::
-get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
+get_function_values (const FEValuesBase<DH::dimension> &fe_patch_values,
                      std::vector<double>             &patch_values) const
 {
   fe_patch_values.get_function_values (*vector, patch_values);
@@ -106,11 +101,11 @@ get_function_values (const FEValuesBase<dof_handler_dim> &fe_patch_values,
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 template <typename VectorType>
 unsigned int
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntry<VectorType>::memory_consumption () const
 {
   return (sizeof (vector) +
@@ -119,11 +114,10 @@ DataEntry<VectorType>::memory_consumption () const
 
 
 
-template <int dof_handler_dim,  template <int> class DH,
-         int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
 template <typename VectorType>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 DataEntry<VectorType>::clear ()
 {
   vector = 0;
@@ -132,29 +126,27 @@ DataEntry<VectorType>::clear ()
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::DataOut_DoFData ()
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::DataOut_DoFData ()
                 :
                dofs(0,typeid(*this).name())
 {}
 
 
 
-template <int dof_handler_dim, template <int> class DH,
-         int patch_dim, int patch_space_dim>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::~DataOut_DoFData ()
+template <class DH, int patch_dim, int patch_space_dim>
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::~DataOut_DoFData ()
 {
   clear ();
 }
 
 
 
-template <int dof_handler_dim, template <int> class DH,
-         int patch_dim, int patch_space_dim>
+template <class DH, int patch_dim, int patch_space_dim>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
-attach_dof_handler (const DH<dof_handler_dim> &d)
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
+attach_dof_handler (const DH &d)
 {
   Assert (dof_data.size() == 0, ExcOldDataStillPresent());
   Assert (cell_data.size() == 0, ExcOldDataStillPresent());
@@ -164,11 +156,11 @@ attach_dof_handler (const DH<dof_handler_dim> &d)
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 template <class VECTOR>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 add_data_vector (const VECTOR                   &vec,
                 const std::vector<std::string> &names,
                 const DataVectorType            type)
@@ -238,11 +230,11 @@ add_data_vector (const VECTOR                   &vec,
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 template <class VECTOR>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 add_data_vector (const VECTOR         &vec,
                 const std::string    &name,
                 const DataVectorType  type)
@@ -277,9 +269,9 @@ add_data_vector (const VECTOR         &vec,
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
-void DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear_data_vectors ()
+void DataOut_DoFData<DH,patch_dim,patch_space_dim>::clear_data_vectors ()
 {
   dof_data.erase (dof_data.begin(), dof_data.end());
   cell_data.erase (cell_data.begin(), cell_data.end());
@@ -291,10 +283,10 @@ void DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear_data_v
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 clear_input_data_references ()
 {
   for (unsigned int i=0; i<dof_data.size(); ++i)
@@ -309,10 +301,10 @@ clear_input_data_references ()
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
           int patch_dim, int patch_space_dim>
 void
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear ()
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::clear ()
 {
   dof_data.erase (dof_data.begin(), dof_data.end());
   cell_data.erase (cell_data.begin(), cell_data.end());
@@ -327,10 +319,10 @@ DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::clear ()
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 std::vector<std::string>
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::
 get_dataset_names () const 
 {
   std::vector<std::string> names;
@@ -355,20 +347,20 @@ get_dataset_names () const
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 const std::vector< ::DataOutBase::Patch<patch_dim, patch_space_dim> > &
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::get_patches () const
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::get_patches () const
 {
   return patches;
 }
 
 
 
-template <int dof_handler_dim, template <int> class DH,
+template <class DH,
          int patch_dim, int patch_space_dim>
 unsigned int
-DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::memory_consumption () const
+DataOut_DoFData<DH,patch_dim,patch_space_dim>::memory_consumption () const
 {
   return (DataOutInterface<patch_dim,patch_space_dim>::memory_consumption () +
          MemoryConsumption::memory_consumption (dofs) +
@@ -381,11 +373,15 @@ DataOut_DoFData<dof_handler_dim,DH,patch_dim,patch_space_dim>::memory_consumptio
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOut<dim,DH>::build_some_patches (Data &data)
 {
+                                  // Check consistency of redundant
+                                  // template parameter
+  Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+  
   QTrapez<1>     q_trapez;
-  QIterated<dim> patch_points (q_trapez, data.n_subdivisions);
+  QIterated<DH::dimension> patch_points (q_trapez, data.n_subdivisions);
 
 //TODO[?]: This is strange -- Data has a member 'mapping' that should
 //be used here, but it isn't. Rather, up until version 1.94, we were
@@ -402,15 +398,15 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
                                   // dof_handler.get_fe() returns a
                                   // collection of which we do a
                                   // shallow copy instead
-  const hp::QCollection<dim>       q_collection (patch_points);
-  const hp::FECollection<dim>      fe_collection(this->dofs->get_fe());
+  const hp::QCollection<DH::dimension>       q_collection (patch_points);
+  const hp::FECollection<DH::dimension>      fe_collection(this->dofs->get_fe());
   
-  hp::FEValues<dim> x_fe_patch_values (fe_collection, q_collection,
+  hp::FEValues<DH::dimension> x_fe_patch_values (fe_collection, q_collection,
                                        update_values);
 
   const unsigned int n_q_points = patch_points.n_quadrature_points;
   
-  typename std::vector< ::DataOutBase::Patch<dim> >::iterator patch = this->patches.begin();
+  typename std::vector< ::DataOutBase::Patch<DH::dimension> >::iterator patch = this->patches.begin();
   cell_iterator cell=first_cell();
   
                                   // get first cell in this thread
@@ -429,14 +425,14 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
                                       // use ucd_to_deal map as patch
                                       // vertices are in the old,
                                       // unnatural ordering
-      for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
+      for (unsigned int vertex=0; vertex<GeometryInfo<DH::dimension>::vertices_per_cell; ++vertex)
        patch->vertices[vertex] = data.mapping->transform_unit_to_real_cell
-                                 (cell, GeometryInfo<dim>::unit_cell_vertex (vertex));
+                                 (cell, GeometryInfo<DH::dimension>::unit_cell_vertex (vertex));
       
       if (data.n_datasets > 0)
        {
           x_fe_patch_values.reinit (cell);
-          const FEValues<dim> &fe_patch_values
+          const FEValues<DH::dimension> &fe_patch_values
             = x_fe_patch_values.get_present_fe_values ();
          
                                           // first fill dof_data
@@ -490,7 +486,7 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
        }
 
 
-      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+      for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
         {
                                            // let's look up whether
                                            // the neighbor behind that
@@ -533,7 +529,7 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
               ||
               ((*data.cell_to_patch_index_map)[neighbor->level()][neighbor->index()]
                ==
-               ::DataOutBase::Patch<dim>::no_neighbor))
+               ::DataOutBase::Patch<DH::dimension>::no_neighbor))
             continue;
 
                                            // now, there is a
@@ -557,23 +553,23 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOut<dim,DH>::build_patches (const unsigned int n_subdivisions,
                                     const unsigned int n_threads_) 
 {
-  build_patches (StaticMappingQ1<dim>::mapping, n_subdivisions, n_threads_);
+  build_patches (StaticMappingQ1<DH::dimension>::mapping, n_subdivisions, n_threads_);
 }
 
 
-template <int dim, template <int> class DH>
-void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
+template <int dim, class DH>
+void DataOut<dim,DH>::build_patches (const Mapping<DH::dimension> &mapping,
                                     const unsigned int n_subdivisions,
                                     const unsigned int n_threads_) 
 {
   Assert (n_subdivisions >= 1,
          ExcInvalidNumberOfSubdivisions(n_subdivisions));
 
-  typedef DataOut_DoFData<dim,DH,dim> BaseClass;
+  typedef DataOut_DoFData<DH, DH::dimension> BaseClass;
   Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
 
   const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
@@ -583,7 +579,7 @@ void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
                                   // actually has the points on this
                                   // patch
   QTrapez<1>     q_trapez;
-  QIterated<dim> patch_points (q_trapez, n_subdivisions);
+  QIterated<DH::dimension> patch_points (q_trapez, n_subdivisions);
   
   const unsigned int n_q_points     = patch_points.n_quadrature_points;
   const unsigned int n_components   = this->dofs->get_fe().n_components();
@@ -593,7 +589,7 @@ void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
                                   // clear the patches array
   if (true)
     {
-      std::vector< ::DataOutBase::Patch<dim> > dummy;
+      std::vector< ::DataOutBase::Patch<DH::dimension> > dummy;
       this->patches.swap (dummy);
     };
   
@@ -616,7 +612,7 @@ void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
                                 static_cast<unsigned int>(cell->index()));
       
       cell_to_patch_index_map[l].resize (max_index+1,
-                                         ::DataOutBase::Patch<dim>::no_neighbor);
+                                         ::DataOutBase::Patch<DH::dimension>::no_neighbor);
     };
                                   
   unsigned int n_patches = 0;
@@ -644,7 +640,7 @@ void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
                                    //
                                    // then number the patches
                                    // consecutively
-  ::DataOutBase::Patch<dim>  default_patch;
+  ::DataOutBase::Patch<DH::dimension>  default_patch;
   default_patch.n_subdivisions = n_subdivisions;
   default_patch.data.reinit (n_datasets, n_q_points);
   this->patches.insert (this->patches.end(), n_patches, default_patch);
@@ -680,7 +676,7 @@ void DataOut<dim,DH>::build_patches (const Mapping<dim> &mapping,
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 typename DataOut<dim,DH>::cell_iterator
 DataOut<dim,DH>::first_cell () 
 {
@@ -689,14 +685,14 @@ DataOut<dim,DH>::first_cell ()
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 typename DataOut<dim,DH>::cell_iterator
 DataOut<dim,DH>::next_cell (const typename DataOut<dim,DH>::cell_iterator &cell) 
 {
                                   // convert the iterator to an
                                   // active_iterator and advance
                                   // this to the next active cell
-  typename DH<dim>::active_cell_iterator active_cell = cell;
+  typename DH::active_cell_iterator active_cell = cell;
   ++active_cell;
   return active_cell;
 }
@@ -704,61 +700,59 @@ DataOut<dim,DH>::next_cell (const typename DataOut<dim,DH>::cell_iterator &cell)
 
 // explicit instantiations 
 
-#define INSTANTIATE(D1,DH,D2,D3,V) \
+#define INSTANTIATE(DH,D2,D3,V) \
 template void \
-DataOut_DoFData<D1,DH,D2,D3>:: \
+DataOut_DoFData<DH,D2,D3>:: \
 add_data_vector<V > (const V             &, \
                      const std::string   &, \
                      const DataVectorType); \
 \
 template void \
-DataOut_DoFData<D1,DH,D2,D3>:: \
+DataOut_DoFData<DH,D2,D3>:: \
 add_data_vector<V > (const V                        &, \
                      const std::vector<std::string> &, \
                      const DataVectorType)
 
 #ifndef DEAL_II_USE_PETSC
-# define INSTANTIATE_VECTORS(D1,DH,D2,D3) \
-    INSTANTIATE(D1,DH,D2,D3,Vector<double>); \
-    INSTANTIATE(D1,DH,D2,D3,Vector<float>); \
-    INSTANTIATE(D1,DH,D2,D3,BlockVector<double>) ; \
-    INSTANTIATE(D1,DH,D2,D3,BlockVector<float>)
+# define INSTANTIATE_VECTORS(DH,D2,D3) \
+    INSTANTIATE(DH,D2,D3,Vector<double>); \
+    INSTANTIATE(DH,D2,D3,Vector<float>); \
+    INSTANTIATE(DH,D2,D3,BlockVector<double>) ; \
+    INSTANTIATE(DH,D2,D3,BlockVector<float>)
 #else
-# define INSTANTIATE_VECTORS(D1,DH,D2,D3) \
-    INSTANTIATE(D1,DH,D2,D3,Vector<double>); \
-    INSTANTIATE(D1,DH,D2,D3,Vector<float>); \
-    INSTANTIATE(D1,DH,D2,D3,BlockVector<double>) ; \
-    INSTANTIATE(D1,DH,D2,D3,BlockVector<float>); \
-    INSTANTIATE(D1,DH,D2,D3,PETScWrappers::Vector); \
-    INSTANTIATE(D1,DH,D2,D3,PETScWrappers::BlockVector)
+# define INSTANTIATE_VECTORS(DH,D2,D3) \
+    INSTANTIATE(DH,D2,D3,Vector<double>); \
+    INSTANTIATE(DH,D2,D3,Vector<float>); \
+    INSTANTIATE(DH,D2,D3,BlockVector<double>) ; \
+    INSTANTIATE(DH,D2,D3,BlockVector<float>); \
+    INSTANTIATE(DH,D2,D3,PETScWrappers::Vector); \
+    INSTANTIATE(DH,D2,D3,PETScWrappers::BlockVector)
 #endif
 
 // now do actual instantiations, first for DoFHandler...
-template class DataOut_DoFData<deal_II_dimension,DoFHandler,deal_II_dimension>;
-template class DataOut_DoFData<deal_II_dimension,DoFHandler,deal_II_dimension+1>;
-INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension,deal_II_dimension);
-INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension+1,deal_II_dimension+1);
+template class DataOut_DoFData<DoFHandler<deal_II_dimension>,deal_II_dimension>;
+template class DataOut_DoFData<DoFHandler<deal_II_dimension>,deal_II_dimension+1>;
+INSTANTIATE_VECTORS(DoFHandler<deal_II_dimension>,deal_II_dimension,deal_II_dimension);
+INSTANTIATE_VECTORS(DoFHandler<deal_II_dimension>,deal_II_dimension+1,deal_II_dimension+1);
 
 // for 3d, also generate an extra class
 #if deal_II_dimension >= 2
-template class DataOut_DoFData<deal_II_dimension,DoFHandler,
-                              deal_II_dimension-1,deal_II_dimension>;
-INSTANTIATE_VECTORS(deal_II_dimension,DoFHandler,deal_II_dimension-1,deal_II_dimension);
+template class DataOut_DoFData<DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension>;
+INSTANTIATE_VECTORS(DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension);
 #endif
 
-template class DataOut<deal_II_dimension,DoFHandler>;
+template class DataOut<deal_II_dimension, DoFHandler<deal_II_dimension> >;
 
 
 // ...and now for hp::DoFHandler
-template class DataOut_DoFData<deal_II_dimension,hp::DoFHandler,deal_II_dimension>;
-template class DataOut_DoFData<deal_II_dimension,hp::DoFHandler,deal_II_dimension+1>;
-INSTANTIATE_VECTORS(deal_II_dimension,hp::DoFHandler,deal_II_dimension,deal_II_dimension);
-INSTANTIATE_VECTORS(deal_II_dimension,hp::DoFHandler,deal_II_dimension+1,deal_II_dimension+1);
+template class DataOut_DoFData<hp::DoFHandler<deal_II_dimension>,deal_II_dimension>;
+template class DataOut_DoFData<hp::DoFHandler<deal_II_dimension>,deal_II_dimension+1>;
+INSTANTIATE_VECTORS(hp::DoFHandler<deal_II_dimension>,deal_II_dimension,deal_II_dimension);
+INSTANTIATE_VECTORS(hp::DoFHandler<deal_II_dimension>,deal_II_dimension+1,deal_II_dimension+1);
 
 #if deal_II_dimension >= 2
-template class DataOut_DoFData<deal_II_dimension,hp::DoFHandler,
-                              deal_II_dimension-1,deal_II_dimension>;
-INSTANTIATE_VECTORS(deal_II_dimension,hp::DoFHandler,deal_II_dimension-1,deal_II_dimension);
+template class DataOut_DoFData<hp::DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension>;
+INSTANTIATE_VECTORS(hp::DoFHandler<deal_II_dimension>,deal_II_dimension-1,deal_II_dimension);
 #endif
 
-template class DataOut<deal_II_dimension,hp::DoFHandler>;
+template class DataOut<deal_II_dimension, hp::DoFHandler<deal_II_dimension> >;
index 31b2424b956c76ac53a4873e83d3e4dc473781f8..5e2903ffb91f91d65faa51587a589ca971b7fbe2 100644 (file)
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutFaces<dim,DH>::build_some_patches (Data &data)
 {
+                                  // Check consistency of redundant
+                                  // template parameter
+  Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+  
   QTrapez<1>        q_trapez;
-  QIterated<dim-1>  patch_points (q_trapez, data.n_subdivisions);
+  QIterated<DH::dimension-1>  patch_points (q_trapez, data.n_subdivisions);
   
 //TODO[?]: This is strange -- Data has a member 'mapping' that should
 //be used here, but it isn't. Rather, up until version 1.94, we were
@@ -49,15 +53,15 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
                                   // dof_handler.get_fe() returns a
                                   // collection of which we do a
                                   // shallow copy instead
-  const hp::QCollection<dim-1>     q_collection (patch_points);
-  const hp::FECollection<dim>      fe_collection(this->dofs->get_fe());
+  const hp::QCollection<DH::dimension-1>     q_collection (patch_points);
+  const hp::FECollection<DH::dimension>      fe_collection(this->dofs->get_fe());
   
-  hp::FEFaceValues<dim> x_fe_patch_values (fe_collection, q_collection,
+  hp::FEFaceValues<DH::dimension> x_fe_patch_values (fe_collection, q_collection,
                                            update_values);
 
   const unsigned int n_q_points = patch_points.n_quadrature_points;
   
-  typename std::vector< ::DataOutBase::Patch<dim-1,dim> >::iterator patch = this->patches.begin();
+  typename std::vector< ::DataOutBase::Patch<DH::dimension-1,DH::dimension> >::iterator patch = this->patches.begin();
   FaceDescriptor face=first_face();
 
                                   // get first face in this thread
@@ -73,13 +77,13 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
     {
       Assert (patch != this->patches.end(), ExcInternalError());
       
-      for (unsigned int vertex=0; vertex<GeometryInfo<dim-1>::vertices_per_cell; ++vertex)
+      for (unsigned int vertex=0; vertex<GeometryInfo<DH::dimension-1>::vertices_per_cell; ++vertex)
        patch->vertices[vertex] = face.first->face(face.second)->vertex(vertex);
       
       if (data.n_datasets > 0)
        {
          x_fe_patch_values.reinit (face.first, face.second);
-          const FEFaceValues<dim> &fe_patch_values
+          const FEFaceValues<DH::dimension> &fe_patch_values
             = x_fe_patch_values.get_present_fe_values ();
          
                                           // first fill dof_data
@@ -123,7 +127,7 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
              Assert (face.first->active(), ExcCellNotActiveForCellData());
              const unsigned int cell_number
                = std::distance (this->dofs->begin_active(),
-                                typename DH<dim>::active_cell_iterator(face.first));
+                                typename DH::active_cell_iterator(face.first));
 
               const double value
                 = this->cell_data[dataset]->get_cell_data_value (cell_number);
@@ -145,14 +149,14 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions,
                                          const unsigned int n_threads_) 
 {
   Assert (n_subdivisions >= 1,
          ExcInvalidNumberOfSubdivisions(n_subdivisions));
 
-  typedef DataOut_DoFData<dim,DH,dim+1> BaseClass;
+  typedef DataOut_DoFData<DH,DH::dimension+1> BaseClass;
   Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
 
   const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
@@ -162,7 +166,7 @@ void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions,
                                   // actually has the points on this
                                   // patch
   QTrapez<1>       q_trapez;
-  QIterated<dim-1> patch_points (q_trapez, n_subdivisions);
+  QIterated<DH::dimension-1> patch_points (q_trapez, n_subdivisions);
 
   const unsigned int n_q_points     = patch_points.n_quadrature_points;
   const unsigned int n_components   = this->dofs->get_fe().n_components();
@@ -172,7 +176,7 @@ void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions,
                                   // clear the patches array
   if (true)
     {
-      std::vector< ::DataOutBase::Patch<dim-1,dim> > dummy;
+      std::vector< ::DataOutBase::Patch<DH::dimension-1,DH::dimension> > dummy;
       this->patches.swap (dummy);
     };
   
@@ -206,7 +210,7 @@ void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions,
                                   // values. note that the evaluation
                                   // points on the face have to be
                                   // repeated in angular direction
-  ::DataOutBase::Patch<dim-1,dim>  default_patch;
+  ::DataOutBase::Patch<DH::dimension-1,DH::dimension>  default_patch;
   default_patch.n_subdivisions = n_subdivisions;
   default_patch.data.reinit (n_datasets, n_q_points);
   this->patches.insert (this->patches.end(), n_patches, default_patch);
@@ -225,15 +229,15 @@ void DataOutFaces<dim,DH>::build_patches (const unsigned int n_subdivisions,
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 typename DataOutFaces<dim,DH>::FaceDescriptor
 DataOutFaces<dim,DH>::first_face () 
 {
                                   // simply find first active cell
                                   // with a face on the boundary
-  typename DH<dim>::active_cell_iterator cell = this->dofs->begin_active();
+  typename DH::active_cell_iterator cell = this->dofs->begin_active();
   for (; cell != this->dofs->end(); ++cell)
-    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+    for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
       if (cell->face(f)->at_boundary())
        return FaceDescriptor(cell, f);
 
@@ -246,7 +250,7 @@ DataOutFaces<dim,DH>::first_face ()
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 typename DataOutFaces<dim,DH>::FaceDescriptor
 DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
 {
@@ -255,7 +259,7 @@ DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
                                   // first check whether the present
                                   // cell has more faces on the
                                   // boundary
-  for (unsigned int f=face.second+1; f<GeometryInfo<dim>::faces_per_cell; ++f)
+  for (unsigned int f=face.second+1; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
     if (face.first->face(f)->at_boundary())
                                       // yup, that is so, so return it
       {
@@ -270,7 +274,7 @@ DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
                                   // convert the iterator to an
                                   // active_iterator and advance
                                   // this to the next active cell
-  typename DH<dim>::active_cell_iterator active_cell = face.first;
+  typename DH::active_cell_iterator active_cell = face.first;
 
                                   // increase face pointer by one
   ++active_cell;
@@ -280,7 +284,7 @@ DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
     {
                                       // check all the faces of this
                                       // active cell
-      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+      for (unsigned int f=0; f<GeometryInfo<DH::dimension>::faces_per_cell; ++f)
        if (active_cell->face(f)->at_boundary())
          {
            face.first  = active_cell;
@@ -304,6 +308,6 @@ DataOutFaces<dim,DH>::next_face (const FaceDescriptor &old_face)
 // explicit instantiations
 // don't instantiate anything for the 1d and 2d cases
 #if deal_II_dimension >=2
-template class DataOutFaces<deal_II_dimension,DoFHandler>;
-template class DataOutFaces<deal_II_dimension,hp::DoFHandler>;
+template class DataOutFaces<deal_II_dimension, DoFHandler<deal_II_dimension> >;
+template class DataOutFaces<deal_II_dimension, hp::DoFHandler<deal_II_dimension> >;
 #endif
index 679f237a451bc1411925c3f0c80155c573de50b2..b1c602e120df96247d95329492a36c235170d46d 100644 (file)
 //TODO: Update documentation
 //TODO: Unify code for dimensions
 
-template <int dim, template <int> class DH>
+// Not implemented for 3D
+
+#if deal_II_dimension < 3
+template <int dim, class DH>
 void DataOutRotation<dim,DH>::build_some_patches (Data &data)
 {
   QTrapez<1>     q_trapez;
-  QIterated<dim> patch_points (q_trapez, data.n_subdivisions);
+  QIterated<DH::dimension> patch_points (q_trapez, data.n_subdivisions);
 
                                   // create collection objects from
                                   // single quadratures,
@@ -50,10 +53,10 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                                   // transformed using a Q1 mapping,
                                   // we don't support anything else
                                   // as well
-  const hp::QCollection<dim>       q_collection (patch_points);
-  const hp::FECollection<dim>      fe_collection(this->dofs->get_fe());
+  const hp::QCollection<DH::dimension>       q_collection (patch_points);
+  const hp::FECollection<DH::dimension>      fe_collection(this->dofs->get_fe());
   
-  hp::FEValues<dim> x_fe_patch_values (fe_collection, q_collection,
+  hp::FEValues<DH::dimension> x_fe_patch_values (fe_collection, q_collection,
                                        update_values);
 
   const unsigned int n_patches_per_circle = data.n_patches_per_circle;
@@ -72,18 +75,18 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                                   // place. for simplicity add the
                                   // initial direction at the end
                                   // again
-  std::vector<Point<dim+1> > angle_directions (n_patches_per_circle+1);
+  std::vector<Point<DH::dimension+1> > angle_directions (n_patches_per_circle+1);
   for (unsigned int i=0; i<=n_patches_per_circle; ++i)
     {
-      angle_directions[i][dim-1] = std::cos(2*deal_II_numbers::PI *
+      angle_directions[i][DH::dimension-1] = std::cos(2*deal_II_numbers::PI *
                                         i/n_patches_per_circle);
-      angle_directions[i][dim] = std::sin(2*deal_II_numbers::PI *
+      angle_directions[i][DH::dimension] = std::sin(2*deal_II_numbers::PI *
                                         i/n_patches_per_circle);
     };
   
   
   unsigned int cell_number = 0;
-  typename std::vector< ::DataOutBase::Patch<dim+1> >::iterator
+  typename std::vector< ::DataOutBase::Patch<DH::dimension+1> >::iterator
     patch = this->patches.begin();
   cell_iterator cell=first_cell();
 
@@ -111,7 +114,7 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                                           // from the vertices of the
                                           // cell, which has one
                                           // dimension less, however.
-         switch (dim)
+         switch (DH::dimension)
            {
              case 1:
              {
@@ -131,10 +134,10 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
              case 2:
              {
                for (unsigned int vertex=0;
-                    vertex<GeometryInfo<dim>::vertices_per_cell;
+                    vertex<GeometryInfo<DH::dimension>::vertices_per_cell;
                     ++vertex)
                  {
-                   const Point<dim> v = cell->vertex(vertex);
+                   const Point<DH::dimension> v = cell->vertex(vertex);
                    
                                                     // make sure that the
                                                     // radial variable does
@@ -147,9 +150,9 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                    patch->vertices[vertex] = v(0) * angle_directions[angle];
                    patch->vertices[vertex][0] = v(1);
                    
-                   patch->vertices[vertex+GeometryInfo<dim>::vertices_per_cell]
+                   patch->vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell]
                      = v(0) * angle_directions[angle+1];
-                   patch->vertices[vertex+GeometryInfo<dim>::vertices_per_cell][0]
+                   patch->vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell][0]
                      = v(1);
                  };
                
@@ -165,7 +168,7 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
          if (data.n_datasets > 0)
            {
              x_fe_patch_values.reinit (cell);
-              const FEValues<dim> &fe_patch_values
+              const FEValues<DH::dimension> &fe_patch_values
                 = x_fe_patch_values.get_present_fe_values ();
 
                                               // first fill dof_data
@@ -176,7 +179,7 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                       this->dof_data[dataset]->get_function_values (fe_patch_values,
                                                                     data.patch_values);
                      
-                     switch (dim)
+                     switch (DH::dimension)
                        {
                          case 1:
                            for (unsigned int x=0; x<n_points; ++x)
@@ -210,7 +213,7 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                      for (unsigned int component=0; component<data.n_components;
                           ++component)
                        {
-                         switch (dim)
+                         switch (DH::dimension)
                            {
                              case 1:
                                    for (unsigned int x=0; x<n_points; ++x)
@@ -243,7 +246,7 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                {
                  const double value
                     = this->cell_data[dataset]->get_cell_data_value (cell_number);
-                 switch (dim)
+                 switch (DH::dimension)
                    {
                      case 1:
                            for (unsigned int x=0; x<n_points; ++x)
@@ -297,10 +300,10 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
 
 
 
-#if deal_II_dimension == 3
+#else
 
-template <>
-void DataOutRotation<3,DoFHandler>::build_some_patches (Data &)
+template <int dim, class DH>
+void DataOutRotation<dim,DH>::build_some_patches (Data&)
 {
                                   // would this function make any
                                   // sense after all? who would want
@@ -313,15 +316,19 @@ void DataOutRotation<3,DoFHandler>::build_some_patches (Data &)
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_circle,
                                             const unsigned int n_subdivisions,
                                             const unsigned int n_threads_) 
 {
+                                  // Check consistency of redundant
+                                  // template parameter
+  Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+  
   Assert (n_subdivisions >= 1,
          ExcInvalidNumberOfSubdivisions(n_subdivisions));
 
-  typedef DataOut_DoFData<dim,DH,dim+1> BaseClass;
+  typedef DataOut_DoFData<DH,DH::dimension+1> BaseClass;
   Assert (this->dofs != 0, typename BaseClass::ExcNoDoFHandlerSelected());
 
   const unsigned int n_threads = (DEAL_II_USE_MT ? n_threads_ : 1);
@@ -331,7 +338,7 @@ void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_ci
                                   // actually has the points on this
                                   // patch
   QTrapez<1>     q_trapez;
-  QIterated<dim> patch_points (q_trapez, n_subdivisions);
+  QIterated<DH::dimension> patch_points (q_trapez, n_subdivisions);
 
   const unsigned int n_q_points     = patch_points.n_quadrature_points;
   const unsigned int n_components   = this->dofs->get_fe().n_components();
@@ -341,7 +348,7 @@ void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_ci
                                   // clear the patches array
   if (true)
     {
-      std::vector< ::DataOutBase::Patch<dim+1> > dummy;
+      std::vector< ::DataOutBase::Patch<DH::dimension+1> > dummy;
       this->patches.swap (dummy);
     };
   
@@ -381,7 +388,7 @@ void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_ci
                                   // values. note that the evaluation
                                   // points on the cell have to be
                                   // repeated in angular direction
-  ::DataOutBase::Patch<dim+1>  default_patch;
+  ::DataOutBase::Patch<DH::dimension+1>  default_patch;
   default_patch.n_subdivisions = n_subdivisions;
   default_patch.data.reinit (n_datasets,
                             n_q_points * (n_subdivisions+1));
@@ -404,7 +411,7 @@ void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_ci
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 typename DataOutRotation<dim,DH>::cell_iterator
 DataOutRotation<dim,DH>::first_cell () 
 {
@@ -412,18 +419,18 @@ DataOutRotation<dim,DH>::first_cell ()
 }
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 typename DataOutRotation<dim,DH>::cell_iterator
 DataOutRotation<dim,DH>::next_cell (const cell_iterator &cell) 
 {
                                   // convert the iterator to an
                                   // active_iterator and advance
                                   // this to the next active cell
-  typename DH<dim>::active_cell_iterator active_cell = cell;
+  typename DH::active_cell_iterator active_cell = cell;
   ++active_cell;
   return active_cell;
 }
 
 
 // explicit instantiations
-template class DataOutRotation<deal_II_dimension,DoFHandler>;
+template class DataOutRotation<deal_II_dimension, DoFHandler<deal_II_dimension> >;
index 851bb54a8c0e8575b27c3c6d012ae878be84d24c..a07d616250dd9ca8aded3cb520e776983f17c429 100644 (file)
@@ -28,7 +28,7 @@
 #include <sstream>
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 unsigned int
 DataOutStack<dim,DH>::DataVector::memory_consumption () const
 {
@@ -38,12 +38,12 @@ DataOutStack<dim,DH>::DataVector::memory_consumption () const
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 DataOutStack<dim,DH>::~DataOutStack ()
 {}
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutStack<dim,DH>::new_parameter_value (const double p,
                                                const double dp)
 {
@@ -67,14 +67,18 @@ void DataOutStack<dim,DH>::new_parameter_value (const double p,
 }
 
 
-template <int dim, template <int> class DH>
-void DataOutStack<dim,DH>::attach_dof_handler (const DH<dim> &dof) 
+template <int dim, class DH>
+void DataOutStack<dim,DH>::attach_dof_handler (const DHdof) 
 {
+                                  // Check consistency of redundant
+                                  // template parameter
+  Assert (dim==DH::dimension, ExcDimensionMismatch(dim, DH::dimension));
+  
   dof_handler = &dof;
 }
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutStack<dim,DH>::declare_data_vector (const std::string &name,
                                                const VectorType   vector_type)
 {
@@ -84,7 +88,7 @@ void DataOutStack<dim,DH>::declare_data_vector (const std::string &name,
 }
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutStack<dim,DH>::declare_data_vector (const std::vector<std::string> &names,
                                                const VectorType    vector_type)
 {
@@ -124,7 +128,7 @@ void DataOutStack<dim,DH>::declare_data_vector (const std::vector<std::string> &
 }
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 template <typename number>
 void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
                                            const std::string    &name)
@@ -157,7 +161,7 @@ void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
 }
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 template <typename number>
 void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
                                            const std::vector<std::string> &names)
@@ -224,7 +228,7 @@ void DataOutStack<dim,DH>::add_data_vector (const Vector<number> &vec,
 }
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutStack<dim,DH>::build_patches (const unsigned int n_subdivisions) 
 {
                                   // this is mostly copied from the
@@ -241,7 +245,7 @@ void DataOutStack<dim,DH>::build_patches (const unsigned int n_subdivisions)
                                   // create patches of and make sure
                                   // there is enough memory for that
   unsigned int n_patches = 0;
-  for (typename DH<dim>::active_cell_iterator
+  for (typename DH::active_cell_iterator
         cell=dof_handler->begin_active();
        cell != dof_handler->end(); ++cell)
     ++n_patches;
@@ -289,7 +293,7 @@ void DataOutStack<dim,DH>::build_patches (const unsigned int n_subdivisions)
   typename std::vector< ::DataOutBase::Patch<dim+1,dim+1> >::iterator
     patch = patches.begin() + (patches.size()-n_patches);
   unsigned int cell_number = 0;
-  for (typename DH<dim>::active_cell_iterator cell=dof_handler->begin_active();
+  for (typename DH::active_cell_iterator cell=dof_handler->begin_active();
        cell != dof_handler->end(); ++cell, ++patch, ++cell_number)
     {
       Assert (patch != patches.end(), ExcInternalError());
@@ -399,7 +403,7 @@ void DataOutStack<dim,DH>::build_patches (const unsigned int n_subdivisions)
 }
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 void DataOutStack<dim,DH>::finish_parameter_value ()
 {
                                   // release lock on dof handler
@@ -415,7 +419,7 @@ void DataOutStack<dim,DH>::finish_parameter_value ()
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 unsigned int
 DataOutStack<dim,DH>::memory_consumption () const
 {
@@ -430,7 +434,7 @@ DataOutStack<dim,DH>::memory_consumption () const
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 const std::vector< ::DataOutBase::Patch<dim+1,dim+1> > &
 DataOutStack<dim,DH>::get_patches () const
 {
@@ -439,7 +443,7 @@ DataOutStack<dim,DH>::get_patches () const
 
 
 
-template <int dim, template <int> class DH>
+template <int dim, class DH>
 std::vector<std::string> DataOutStack<dim,DH>::get_dataset_names () const
 {
   std::vector<std::string> names;
@@ -455,24 +459,20 @@ std::vector<std::string> DataOutStack<dim,DH>::get_dataset_names () const
 
 
 // explicit instantiations
-template class DataOutStack<deal_II_dimension,DoFHandler>;
+template class DataOutStack<deal_II_dimension,DoFHandler<deal_II_dimension> >;
 
-template void DataOutStack<deal_II_dimension,DoFHandler>::
+template void DataOutStack<deal_II_dimension,DoFHandler<deal_II_dimension> >::
 add_data_vector<double> (const Vector<double> &vec,
                         const std::string    &name);
 
-template void DataOutStack<deal_II_dimension,DoFHandler>::
+template void DataOutStack<deal_II_dimension,DoFHandler<deal_II_dimension> >::
 add_data_vector<float> (const Vector<float>  &vec,
                        const std::string    &name);
 
-template class DataOutStack<deal_II_dimension,hp::DoFHandler>;
-template void DataOutStack<deal_II_dimension,hp::DoFHandler>::
+template class DataOutStack<deal_II_dimension,hp::DoFHandler<deal_II_dimension> >;
+template void DataOutStack<deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
 add_data_vector<double> (const Vector<double> &vec,
                         const std::string    &name);
-template void DataOutStack<deal_II_dimension,hp::DoFHandler>::
+template void DataOutStack<deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
 add_data_vector<float> (const Vector<float>  &vec,
                        const std::string    &name);
-
-template void DataOutStack<deal_II_dimension>::
-add_data_vector<float> (const Vector<float> &vec,
-                        const std::vector<std::string> &names);

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.