From 3c565b95218d02e62faa0d0dd421b45ce7051852 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 2 Sep 2016 17:36:13 +0200 Subject: [PATCH] Make C++03 conforming --- source/fe/fe_tools_interpolate.cc | 76 +++++++++++++------------ tests/mpi/fe_tools_extrapolate_common.h | 4 +- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/source/fe/fe_tools_interpolate.cc b/source/fe/fe_tools_interpolate.cc index 78aed6702c..f50176fdd9 100644 --- a/source/fe/fe_tools_interpolate.cc +++ b/source/fe/fe_tools_interpolate.cc @@ -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::forest forest; + const typename dealii::internal::p4est::types::tree tree; + const typename dealii::internal::p4est::types::locidx tree_index; + const typename DoFHandler::cell_iterator dealii_cell; + const typename dealii::internal::p4est::types::quadrant p4est_cell; + + WorkPackage(const typename dealii::internal::p4est::types::forest &forest_, + const typename dealii::internal::p4est::types::tree &tree_, + const typename dealii::internal::p4est::types::locidx &tree_index_, + const typename DoFHandler::cell_iterator &dealii_cell_, + const typename dealii::internal::p4est::types::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::iterator recv=std::begin (received_needs); - while (recv != std::end (received_needs)) + typename std::vector::iterator recv=received_needs.begin(); + while (recv != received_needs.end()) { if (dealii::internal::p4est::quadrant_is_equal(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::cell_iterator neighbor = cell->neighbor(face); if (neighbor->level() != cell->level()) - for (unsigned int i=0; ilevel(), dofs_on_refined_neighbors[index]) : - cell->level(); - dofs_on_refined_neighbors[index] = level; - } + for (unsigned int i=0; ilevel(), 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::forest forest; - const typename dealii::internal::p4est::types::tree tree; - const typename dealii::internal::p4est::types::locidx tree_index; - const typename DoFHandler::cell_iterator dealii_cell; - const typename dealii::internal::p4est::types::quadrant p4est_cell; - - WorkPackage(const typename dealii::internal::p4est::types::forest &forest_, - const typename dealii::internal::p4est::types::tree &tree_, - const typename dealii::internal::p4est::types::locidx &tree_index_, - const typename DoFHandler::cell_iterator &dealii_cell_, - const typename dealii::internal::p4est::types::quadrant &p4est_cell_) - : - forest(forest_), - tree(tree_), - tree_index(tree_index_), - dealii_cell(dealii_cell_), - p4est_cell(p4est_cell_) - {} - }; - std::queue queue; { typename DoFHandler::cell_iterator diff --git a/tests/mpi/fe_tools_extrapolate_common.h b/tests/mpi/fe_tools_extrapolate_common.h index efc3c83848..353fea4ac3 100644 --- a/tests/mpi/fe_tools_extrapolate_common.h +++ b/tests/mpi/fe_tools_extrapolate_common.h @@ -125,7 +125,7 @@ check_this (const FiniteElement &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 &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)) -- 2.39.5