]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Convert some unsigned ints to types::global_dof_index.
authorsharma <sharma@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 10 Aug 2012 10:20:12 +0000 (10:20 +0000)
committersharma <sharma@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 10 Aug 2012 10:20:12 +0000 (10:20 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_3@25872 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/base/index_set.h
deal.II/include/deal.II/hp/dof_objects.h
deal.II/source/base/index_set.cc

index aa21ea567de5d71e8b28fe40f23cda3365a098c2..46710d65b3a284e5c31a039d1e0700b497224bb1 100644 (file)
@@ -64,7 +64,7 @@ class IndexSet
                                       * overall size of the index
                                       * range.
                                       */
-    IndexSet (const unsigned int size);
+    IndexSet (const types::global_dof_index size);
 
                                      /**
                                       * Remove all indices from this
@@ -136,7 +136,7 @@ class IndexSet
                                       * index is an element of the
                                       * index set.
                                       */
-    bool is_element (const unsigned int index) const;
+    bool is_element (const types::global_dof_index index) const;
 
                                      /**
                                       * Return whether the index set
@@ -151,7 +151,7 @@ class IndexSet
                                       * Return the number of elements
                                       * stored in this index set.
                                       */
-    unsigned int n_elements () const;
+    types::global_dof_index n_elements () const;
 
                                      /**
                                       * Return the global index of the local
@@ -160,7 +160,7 @@ class IndexSet
                                       * local_index obviously needs to be less
                                       * than n_elements().
                                       */
-    unsigned int nth_index_in_set (const unsigned int local_index) const;
+    types::global_dof_index nth_index_in_set (const unsigned int local_index) const;
 
                                      /**
                                       * Return the how-manyth element of this
@@ -172,7 +172,7 @@ class IndexSet
                                       * a member of this index set, i.e. if
                                       * is_element(global_index) is false.
                                       */
-    unsigned int index_within_set (const unsigned int global_index) const;
+    unsigned int index_within_set (const types::global_dof_index global_index) const;
 
                                      /**
                                       * Each index set can be
@@ -245,8 +245,8 @@ class IndexSet
                                       * to the range <tt>[0,
                                       * end-begin)</tt>.
                                       */
-    IndexSet get_view (const unsigned int begin,
-                       const unsigned int end) const;
+    IndexSet get_view (const types::global_dof_index begin,
+                       const types::global_dof_index end) const;
 
 
                                      /**
@@ -263,7 +263,7 @@ class IndexSet
                                       * Fills the given vector with all
                                       * indices contained in this IndexSet.
                                       */
-    void fill_index_vector(std::vector<unsigned int> & indices) const;
+    void fill_index_vector(std::vector<types::global_dof_index> & indices) const;
 
                                      /**
                                       * Fill the given vector with either
@@ -427,10 +427,10 @@ class IndexSet
                                       */
     struct Range
     {
-        unsigned int begin;
-        unsigned int end;
+        types::global_dof_index begin;
+        types::global_dof_index end;
 
-        unsigned int nth_index_in_set;
+        types::global_dof_index nth_index_in_set;
 
         /**
          * Default constructor. Since there is no useful choice for
@@ -449,8 +449,8 @@ class IndexSet
          * @param i1 Left end point of the interval.
          * @param i2 First index greater than the last index of the indicated range.
          **/
-        Range (const unsigned int i1,
-               const unsigned int i2);
+        Range (const types::global_dof_index i1,
+               const types::global_dof_index i2);
 
         friend
         inline bool operator< (const Range &range_1,
@@ -572,8 +572,8 @@ IndexSet::Range::Range ()
 
 
 inline
-IndexSet::Range::Range (const unsigned int i1,
-                        const unsigned int i2)
+IndexSet::Range::Range (const types::global_dof_index i1,
+                        const types::global_dof_index i2)
                 :
                 begin(i1),
                 end(i2)
@@ -591,7 +591,7 @@ IndexSet::IndexSet ()
 
 
 inline
-IndexSet::IndexSet (const unsigned int size)
+IndexSet::IndexSet (const types::global_dof_index size)
                 :
                 is_compressed (true),
                 index_space_size (size),
@@ -646,8 +646,8 @@ IndexSet::compress () const
 
 inline
 void
-IndexSet::add_range (const unsigned int begin,
-                     const unsigned int end)
+IndexSet::add_range (const types::global_dof_index begin,
+                     const types::global_dof_index end)
 {
   Assert ((begin < index_space_size)
           ||
@@ -680,7 +680,7 @@ IndexSet::add_range (const unsigned int begin,
 
 inline
 void
-IndexSet::add_index (const unsigned int index)
+IndexSet::add_index (const types::global_dof_index index)
 {
   Assert (index < index_space_size,
           ExcIndexRange (index, 0, index_space_size));
@@ -712,8 +712,8 @@ IndexSet::add_indices (const ForwardIterator &begin,
                                    // range
   for (ForwardIterator p=begin; p!=end;)
     {
-      const unsigned int begin_index = *p;
-      unsigned int       end_index   = begin_index + 1;
+      const types::global_dof_index begin_index = *p;
+      types::global_dof_index       end_index   = begin_index + 1;
       ForwardIterator q = p;
       ++q;
       while ((q != end) && (*q == end_index))
@@ -750,7 +750,7 @@ IndexSet::add_indices(const IndexSet & other)
 
 inline
 bool
-IndexSet::is_element (const unsigned int index) const
+IndexSet::is_element (const types::global_dof_index index) const
 {
   if (ranges.empty() == false)
     {
@@ -828,7 +828,7 @@ IndexSet::is_contiguous () const
 
 
 inline
-unsigned int
+types::global_dof_index
 IndexSet::n_elements () const
 {
                                    // make sure we have
@@ -858,7 +858,7 @@ IndexSet::n_elements () const
 
 inline
 unsigned int
-IndexSet::nth_index_in_set (const unsigned int n) const
+IndexSet::nth_index_in_set (const types::global_dof_index n) const
 {
                                 // to make this call thread-safe, compress()
                                 // must not be called through this function
@@ -908,7 +908,7 @@ IndexSet::nth_index_in_set (const unsigned int n) const
 
 
 inline
-unsigned int
+types::global_dof_index
 IndexSet::index_within_set (const unsigned int n) const
 {
                                 // to make this call thread-safe, compress()
index e7c7dd4627320e3e44c5856b71261c23f24fb5ae..35c5e829fadfe9c28b12ce48a0653e3c5264a11e 100644 (file)
@@ -101,7 +101,7 @@ namespace internal
                                           * the degrees of freedom of each
                                           * hex in the @p hex_dofs array.
                                           */
-        std::vector<unsigned int> dof_offsets;
+        std::vector<types::global_dof_index> dof_offsets;
 
                                          /**
                                           * Store the global indices of
@@ -109,7 +109,7 @@ namespace internal
                                           * DoFLevel() for detailed
                                           * information.
                                           */
-        std::vector<unsigned int> dofs;
+        std::vector<types::global_dof_index > dofs;
 
                                          /**
                                           * Set the global index of
@@ -142,7 +142,7 @@ namespace internal
                        const unsigned int               obj_index,
                        const unsigned int               fe_index,
                        const unsigned int               local_index,
-                       const unsigned int               global_index,
+                       const types::global_dof_index    global_index,
                        const unsigned int               obj_level);
 
                                          /**
@@ -169,7 +169,7 @@ namespace internal
                                           * information.
                                           */
         template <int dimm, int spacedim>
-        unsigned int
+        types::global_dof_index
         get_dof_index (const dealii::hp::DoFHandler<dimm,spacedim> &dof_handler,
                        const unsigned int               obj_index,
                        const unsigned int               fe_index,
@@ -243,7 +243,7 @@ namespace internal
     template <int dim>
     template <int dimm, int spacedim>
     inline
-    unsigned int
+    types::global_dof_index
     DoFObjects<dim>::
     get_dof_index (const dealii::hp::DoFHandler<dimm,spacedim> &dof_handler,
                    const unsigned int                obj_index,
@@ -304,7 +304,7 @@ namespace internal
                                            // an exception if we can't
                                            // find a set for this
                                            // particular fe_index
-          const unsigned int starting_offset = dof_offsets[obj_index];
+                       const type::global_dof_index starting_offset = dof_offsets[obj_index];
           const unsigned int *pointer        = &dofs[starting_offset];
           while (true)
             {
@@ -330,7 +330,7 @@ namespace internal
                    const unsigned int                obj_index,
                    const unsigned int                fe_index,
                    const unsigned int                local_index,
-                   const unsigned int                global_index,
+                   const types::global_dof_index     global_index,
                    const unsigned int                obj_level)
     {
       Assert ((fe_index != dealii::hp::DoFHandler<dimm,spacedim>::default_fe_index),
@@ -386,7 +386,7 @@ namespace internal
                                            // an exception if we can't
                                            // find a set for this
                                            // particular fe_index
-          const unsigned int starting_offset = dof_offsets[obj_index];
+                       const types::global_dof_index starting_offset = dof_offsets[obj_index];
           unsigned int      *pointer         = &dofs[starting_offset];
           while (true)
             {
@@ -450,7 +450,7 @@ namespace internal
                                            // find a set for this
                                            // particular fe_index
           const unsigned int starting_offset = dof_offsets[obj_index];
-          const unsigned int *pointer        = &dofs[starting_offset];
+          const types::global_dof_index *pointer        = &dofs[starting_offset];
           unsigned int counter = 0;
           while (true)
             {
@@ -472,7 +472,7 @@ namespace internal
     template <int dim>
     template <int dimm, int spacedim>
     inline
-    unsigned int
+    types::global_dof_index
     DoFObjects<dim>::
     nth_active_fe_index (const dealii::hp::DoFHandler<dimm,spacedim> &dof_handler,
                          const unsigned int                obj_level,
@@ -525,7 +525,7 @@ namespace internal
                                            // find a set for this
                                            // particular fe_index
           const unsigned int starting_offset = dof_offsets[obj_index];
-          const unsigned int *pointer        = &dofs[starting_offset];
+          const types::global_dof_index *pointer = &dofs[starting_offset];
           unsigned int counter = 0;
           while (true)
             {
@@ -607,7 +607,7 @@ namespace internal
                                            // find a set for this
                                            // particular fe_index
           const unsigned int starting_offset = dof_offsets[obj_index];
-          const unsigned int *pointer        = &dofs[starting_offset];
+          const types::global_dof_index  *pointer = &dofs[starting_offset];
           while (true)
             {
               if (*pointer == numbers::invalid_unsigned_int)
index 8fc02d8530084cd8e4070726d3d9ab3968ef8323..bb38a154d5788ad235a2f3c1d57944232a8b0cb9 100644 (file)
@@ -174,8 +174,8 @@ IndexSet::n_intervals () const
 
 
 IndexSet
-IndexSet::get_view (const unsigned int begin,
-                    const unsigned int end) const
+IndexSet::get_view (const types::global_dof_index begin,
+                    const types::global_dof_index end) const
 {
   Assert (begin <= end,
           ExcMessage ("End index needs to be larger or equal to begin index!"));
@@ -394,7 +394,7 @@ IndexSet::make_trilinos_map (const MPI_Comm &communicator,
 #endif
   else
     {
-      std::vector<unsigned int> indices;
+               std::vector<types::global_dof_index> indices;
       fill_index_vector(indices);
 
       return Epetra_Map (-1,

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.