]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make C++03 conforming
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 2 Sep 2016 15:36:13 +0000 (17:36 +0200)
committerDaniel Arndt <d.arndt@math.uni-goettingen.de>
Mon, 3 Oct 2016 16:20:58 +0000 (18:20 +0200)
source/fe/fe_tools_interpolate.cc
tests/mpi/fe_tools_extrapolate_common.h

index 78aed6702c74a659c3ddc0852004ceca18af1765..f50176fdd9876b4ab94f5b691ad7c92328fb923e 100644 (file)
@@ -743,6 +743,32 @@ namespace FETools
 
     private:
 
+      /**
+       * A structure holding all data to
+       * set dofs recursively on cells of arbitrary level
+       */
+      struct WorkPackage
+      {
+        const typename dealii::internal::p4est::types<dim>::forest    forest;
+        const typename dealii::internal::p4est::types<dim>::tree      tree;
+        const typename dealii::internal::p4est::types<dim>::locidx    tree_index;
+        const typename DoFHandler<dim,spacedim>::cell_iterator        dealii_cell;
+        const typename dealii::internal::p4est::types<dim>::quadrant  p4est_cell;
+
+        WorkPackage(const typename dealii::internal::p4est::types<dim>::forest    &forest_,
+                    const typename dealii::internal::p4est::types<dim>::tree      &tree_,
+                    const typename dealii::internal::p4est::types<dim>::locidx    &tree_index_,
+                    const typename DoFHandler<dim,spacedim>::cell_iterator        &dealii_cell_,
+                    const typename dealii::internal::p4est::types<dim>::quadrant  &p4est_cell_)
+          :
+          forest(forest_),
+          tree(tree_),
+          tree_index(tree_index_),
+          dealii_cell(dealii_cell_),
+          p4est_cell(p4est_cell_)
+        {}
+      };
+
       /**
        * A structure holding all data
        * of cells needed from other processes
@@ -1337,7 +1363,7 @@ namespace FETools
                   const bool on_refined_neighbor
                     = (dofs_on_refined_neighbors.find(indices[j])!=dofs_on_refined_neighbors.end());
                   if (!(on_refined_neighbor && dofs_on_refined_neighbors[indices[j]]>dealii_cell->level()))
-                      u(indices[j]) = local_values(j);
+                    u(indices[j]) = local_values(j);
                 }
             }
         }
@@ -1902,15 +1928,15 @@ namespace FETools
               // correct receivers
               // then delete this received
               // need from the list
-              typename std::vector<CellData>::iterator recv=std::begin (received_needs);
-              while (recv != std::end (received_needs))
+              typename std::vector<CellData>::iterator recv=received_needs.begin();
+              while (recv != received_needs.end())
                 {
                   if (dealii::internal::p4est::quadrant_is_equal<dim>(recv->quadrant, comp->quadrant))
                     {
                       recv->dof_values = comp->dof_values;
                       cells_to_send.push_back (*recv);
                       received_needs.erase (recv);
-                      recv = std::begin (received_needs);
+                      recv = received_needs.begin();
                     }
                   else
                     ++recv;
@@ -1974,16 +2000,16 @@ namespace FETools
                     {
                       const typename DoFHandler<dim,spacedim>::cell_iterator neighbor = cell->neighbor(face);
                       if (neighbor->level() != cell->level())
-                          for (unsigned int i=0; i<dofs_per_face; ++i)
-                            {
-                              const types::global_dof_index index = indices[fe.face_to_cell_index(i,face)];;
-                              const bool index_stored
-                                = (dofs_on_refined_neighbors.find(index)!=dofs_on_refined_neighbors.end());
-                              const unsigned int level = index_stored ?
-                                                         std::max(cell->level(), dofs_on_refined_neighbors[index]) :
-                                                         cell->level();
-                              dofs_on_refined_neighbors[index] = level;
-                            }
+                        for (unsigned int i=0; i<dofs_per_face; ++i)
+                          {
+                            const types::global_dof_index index = indices[fe.face_to_cell_index(i,face)];;
+                            const bool index_stored
+                              = (dofs_on_refined_neighbors.find(index)!=dofs_on_refined_neighbors.end());
+                            const unsigned int level = index_stored ?
+                                                       std::max(cell->level(), dofs_on_refined_neighbors[index]) :
+                                                       cell->level();
+                            dofs_on_refined_neighbors[index] = level;
+                          }
                     }
               }
         }
@@ -1994,28 +2020,6 @@ namespace FETools
       // the interpolation
       u2 = 0;
 
-      struct WorkPackage
-      {
-        const typename dealii::internal::p4est::types<dim>::forest    forest;
-        const typename dealii::internal::p4est::types<dim>::tree      tree;
-        const typename dealii::internal::p4est::types<dim>::locidx    tree_index;
-        const typename DoFHandler<dim,spacedim>::cell_iterator        dealii_cell;
-        const typename dealii::internal::p4est::types<dim>::quadrant  p4est_cell;
-
-        WorkPackage(const typename dealii::internal::p4est::types<dim>::forest    &forest_,
-                    const typename dealii::internal::p4est::types<dim>::tree      &tree_,
-                    const typename dealii::internal::p4est::types<dim>::locidx    &tree_index_,
-                    const typename DoFHandler<dim,spacedim>::cell_iterator        &dealii_cell_,
-                    const typename dealii::internal::p4est::types<dim>::quadrant  &p4est_cell_)
-          :
-          forest(forest_),
-          tree(tree_),
-          tree_index(tree_index_),
-          dealii_cell(dealii_cell_),
-          p4est_cell(p4est_cell_)
-        {}
-      };
-
       std::queue<WorkPackage> queue;
       {
         typename DoFHandler<dim,spacedim>::cell_iterator
index efc3c838484d6baf65b18e30cab61016d3e08c0e..353fea4ac3ae84d6ed4c39aea32156a567465a17 100644 (file)
@@ -125,7 +125,7 @@ check_this (const FiniteElement<dim> &fe1,
 {
   deallog << std::setprecision (10);
 
-  // only check if both elements have support points. 
+  // only check if both elements have support points.
   // otherwise, interpolation doesn't really work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))
@@ -246,7 +246,7 @@ check_this_dealii (const FiniteElement<dim> &fe1,
 {
   deallog << std::setprecision (10);
 
-  // only check if both elements have support points. 
+  // only check if both elements have support points.
   // otherwise, interpolation doesn't really work
   if ((fe1.get_unit_support_points().size() == 0) ||
       (fe2.get_unit_support_points().size() == 0))

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.