From 9183bd405b5a5548753704c48f9cb0735aee1e9a Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 27 Jun 2018 15:12:23 +0200 Subject: [PATCH] Replace typedef by using in source --- source/base/data_out_base.cc | 15 ++--- source/base/polynomials_bdm.cc | 3 +- .../differentiation/ad/adolc_number_types.cc | 4 +- source/distributed/tria.cc | 14 ++-- source/dofs/dof_handler_policy.cc | 9 ++- source/dofs/dof_renumbering.cc | 25 ++++---- source/dofs/dof_tools.cc | 9 ++- source/dofs/dof_tools_constraints.cc | 9 ++- source/fe/fe_dgp.cc | 8 +-- source/fe/fe_dgq.cc | 6 +- source/fe/fe_nedelec_sz.cc | 6 +- source/fe/fe_q.cc | 2 +- source/fe/fe_q_base.cc | 2 +- source/fe/fe_q_bubbles.cc | 2 +- source/fe/fe_q_dg0.cc | 2 +- source/fe/fe_q_hierarchical.cc | 4 +- source/fe/fe_values.cc | 64 +++++++++---------- source/grid/grid_out.cc | 2 +- source/grid/grid_reordering.cc | 4 +- source/grid/grid_tools.cc | 4 +- source/grid/grid_tools_dof_handlers.cc | 41 ++++++------ source/grid/tria.cc | 22 +++---- source/grid/tria_accessor.cc | 20 +++--- source/lac/petsc_parallel_block_vector.cc | 2 +- source/lac/sparsity_tools.cc | 11 ++-- source/lac/trilinos_precondition_muelu.cc | 2 +- source/lac/trilinos_sparse_matrix.cc | 20 +++--- source/lac/trilinos_sparsity_pattern.cc | 2 +- source/multigrid/mg_transfer_component.cc | 4 +- source/numerics/derivative_approximation.cc | 29 ++++----- source/numerics/error_estimator_1d.cc | 2 +- source/numerics/histogram.cc | 3 +- source/numerics/point_value_history.cc | 2 +- source/particles/particle_handler.cc | 2 +- 34 files changed, 169 insertions(+), 187 deletions(-) diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index e9a578cf64..d064def0c3 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -85,18 +85,13 @@ namespace // domain namespace base64 { - typedef enum - { - step_A, - step_B, - step_C - } base64_encodestep; + using base64_encodestep = enum { step_A, step_B, step_C }; - typedef struct + using base64_encodestate = struct { base64_encodestep step; char result; - } base64_encodestate; + }; void base64_init_encodestate(base64_encodestate *state_in) @@ -5540,7 +5535,7 @@ namespace DataOutBase << ascii_or_binary << "\">\n"; { - // uint8_t might be a typedef to unsigned char which is then not printed + // uint8_t might be an alias to unsigned char which is then not printed // as ascii integers #ifdef DEAL_II_WITH_ZLIB std::vector cell_types(n_cells, @@ -8492,7 +8487,7 @@ template void DataOutReader::merge(const DataOutReader &source) { - typedef typename dealii::DataOutBase::Patch Patch; + using Patch = typename dealii::DataOutBase::Patch; const std::vector &source_patches = source.get_patches(); diff --git a/source/base/polynomials_bdm.cc b/source/base/polynomials_bdm.cc index d93fe476f6..bb14979d3b 100644 --- a/source/base/polynomials_bdm.cc +++ b/source/base/polynomials_bdm.cc @@ -400,8 +400,7 @@ PolynomialsBDM::compute_node_matrix (Table<2,double>& A) const } // std::cerr << p // << '\t' << moment_weight[0].value(x) -// << '\t' << moment_weight[1].value(x) -// ; +// << '\t' << moment_weight[1].value(x); compute (p, values, grads, grad_grads); diff --git a/source/differentiation/ad/adolc_number_types.cc b/source/differentiation/ad/adolc_number_types.cc index 6477862ba0..73dc9270f8 100644 --- a/source/differentiation/ad/adolc_number_types.cc +++ b/source/differentiation/ad/adolc_number_types.cc @@ -45,9 +45,9 @@ namespace numbers const std::function &comparator) { - typedef typename Differentiation::AD::NumberTraits< + using ad_type = typename Differentiation::AD::NumberTraits< double, - Differentiation::AD::NumberTypes::adolc_taped>::ad_type ad_type; + Differentiation::AD::NumberTypes::adolc_taped>::ad_type; static_assert( std::is_same::value, "The type of the AD number is not that which was expected."); diff --git a/source/distributed/tria.cc b/source/distributed/tria.cc index 8908700166..f725fbf043 100644 --- a/source/distributed/tria.cc +++ b/source/distributed/tria.cc @@ -2200,8 +2200,8 @@ namespace parallel // {6,7} belong together, respectively). If periodicity is set in x and // z direction, the output is {0,0,2,2,0,0,2,2}, and if periodicity is // in all directions, the output is simply {0,0,0,0,0,0,0,0}. - typedef - typename Triangulation::cell_iterator cell_iterator; + using cell_iterator = + typename Triangulation::cell_iterator; typename std::map, std::pair, std::bitset<3>>>::const_iterator it; @@ -3111,9 +3111,9 @@ namespace parallel // now collect cells and their vertices // for the interested neighbors - typedef std::map> - cellmap_t; + using cellmap_t = + std::map>; cellmap_t needs_to_get_cells; for (typename Triangulation::cell_iterator cell = @@ -3509,8 +3509,8 @@ namespace parallel Assert(this->n_levels() == 1, ExcMessage("The triangulation is refined!")); - typedef std::vector> - FaceVector; + using FaceVector = + std::vector>; typename FaceVector::const_iterator it, periodic_end; it = periodicity_vector.begin(); periodic_end = periodicity_vector.end(); diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index aa8d6e857b..71e6e5408e 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -147,8 +147,8 @@ namespace internal } - typedef std::vector> - DoFIdentities; + using DoFIdentities = + std::vector>; /** @@ -3625,9 +3625,8 @@ namespace internal // build list of cells to request for each neighbor std::set level_ghost_owners = tria.level_ghost_owners(); - typedef std::map> - cellmap_t; + using cellmap_t = + std::map>; cellmap_t neighbor_cell_list; for (std::set::iterator it = level_ghost_owners.begin(); diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index d9d8a2e626..698adb44b1 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -70,17 +70,16 @@ namespace DoFRenumbering using namespace ::boost; using namespace std; - typedef adjacency_list>> - Graph; - typedef graph_traits::vertex_descriptor Vertex; - typedef graph_traits::vertices_size_type size_type; - - typedef std::pair Pair; + using Graph = adjacency_list>>; + using Vertex = graph_traits::vertex_descriptor; + using size_type = graph_traits::vertices_size_type; + + using Pair = std::pair; } // namespace boosttypes @@ -281,7 +280,7 @@ namespace DoFRenumbering int delta = 0; // must be BGL directed graph now - typedef adjacency_list Graph; + using Graph = adjacency_list; int n = dof_handler.n_dofs(); @@ -310,7 +309,7 @@ namespace DoFRenumbering } - typedef std::vector Vector; + using Vector = std::vector; Vector inverse_perm(n, 0); diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 75075ab289..2979ae49ee 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -2319,12 +2319,11 @@ namespace DoFTools { AssertThrow(out, ExcIO()); - typedef std::map> dof_map_t; + using dof_map_t = std::map>; - typedef std::map, - std::vector, - typename internal::ComparisonHelper> - point_map_t; + using point_map_t = std::map, + std::vector, + typename internal::ComparisonHelper>; point_map_t point_map; diff --git a/source/dofs/dof_tools_constraints.cc b/source/dofs/dof_tools_constraints.cc index 0c2bfbd9e3..8bec7b6007 100644 --- a/source/dofs/dof_tools_constraints.cc +++ b/source/dofs/dof_tools_constraints.cc @@ -2245,7 +2245,7 @@ namespace DoFTools // have an array that stores the location of each vector-dof tuple we want // to rotate. - typedef std::array DoFTuple; + using DoFTuple = std::array; // start with a pristine interpolation matrix... FullMatrix transformation = IdentityMatrix(n_dofs_per_face); @@ -2544,9 +2544,8 @@ namespace DoFTools const ComponentMask & component_mask, const std::vector &first_vector_components) { - typedef std::vector< - GridTools::PeriodicFacePair> - FaceVector; + using FaceVector = std::vector< + GridTools::PeriodicFacePair>; typename FaceVector::const_iterator it, end_periodic; it = periodic_faces.begin(); end_periodic = periodic_faces.end(); @@ -2554,7 +2553,7 @@ namespace DoFTools // Loop over all periodic faces... for (; it != end_periodic; ++it) { - typedef typename DoFHandlerType::face_iterator FaceIterator; + using FaceIterator = typename DoFHandlerType::face_iterator; const FaceIterator face_1 = it->cell[0]->face(it->face_idx[0]); const FaceIterator face_2 = it->cell[1]->face(it->face_idx[1]); diff --git a/source/fe/fe_dgp.cc b/source/fe/fe_dgp.cc index c4e7593bcb..0fa056545a 100644 --- a/source/fe/fe_dgp.cc +++ b/source/fe/fe_dgp.cc @@ -111,8 +111,8 @@ FE_DGP::get_face_interpolation_matrix( // interpolation matrix is necessarily empty -- i.e. there isn't much we // need to do here. (void)interpolation_matrix; - typedef FiniteElement FE; - typedef FE_DGP FEDGP; + using FE = FiniteElement; + using FEDGP = FE_DGP; AssertThrow((x_source_fe.get_name().find("FE_DGP<") == 0) || (dynamic_cast(&x_source_fe) != nullptr), typename FE::ExcInterpolationNotImplemented()); @@ -137,8 +137,8 @@ FE_DGP::get_subface_interpolation_matrix( // interpolation matrix is necessarily empty -- i.e. there isn't much we // need to do here. (void)interpolation_matrix; - typedef FiniteElement FE; - typedef FE_DGP FEDGP; + using FE = FiniteElement; + using FEDGP = FE_DGP; AssertThrow((x_source_fe.get_name().find("FE_DGP<") == 0) || (dynamic_cast(&x_source_fe) != nullptr), typename FE::ExcInterpolationNotImplemented()); diff --git a/source/fe/fe_dgq.cc b/source/fe/fe_dgq.cc index 3f7d5c1e24..65bbd6f8d3 100644 --- a/source/fe/fe_dgq.cc +++ b/source/fe/fe_dgq.cc @@ -264,7 +264,7 @@ FE_DGQ::get_interpolation_matrix( // this is only implemented, if the // source FE is also a // DGQ element - typedef FiniteElement FE; + using FE = FiniteElement; AssertThrow((dynamic_cast *>(&x_source_fe) != nullptr), typename FE::ExcInterpolationNotImplemented()); @@ -347,7 +347,7 @@ FE_DGQ::get_face_interpolation_matrix( // is necessarily empty -- i.e. there isn't // much we need to do here. (void)interpolation_matrix; - typedef FiniteElement FE; + using FE = FiniteElement; AssertThrow((dynamic_cast *>(&x_source_fe) != nullptr), typename FE::ExcInterpolationNotImplemented()); @@ -374,7 +374,7 @@ FE_DGQ::get_subface_interpolation_matrix( // is necessarily empty -- i.e. there isn't // much we need to do here. (void)interpolation_matrix; - typedef FiniteElement FE; + using FE = FiniteElement; AssertThrow((dynamic_cast *>(&x_source_fe) != nullptr), typename FE::ExcInterpolationNotImplemented()); diff --git a/source/fe/fe_nedelec_sz.cc b/source/fe/fe_nedelec_sz.cc index a6ede02562..daae79ef21 100644 --- a/source/fe/fe_nedelec_sz.cc +++ b/source/fe/fe_nedelec_sz.cc @@ -52,7 +52,7 @@ double FE_NedelecSZ::shape_value(const unsigned int /*i*/, const Point & /*p*/) const { - typedef FiniteElement FEE; + using FEE = FiniteElement; Assert(false, typename FEE::ExcFENotPrimitive()); return 0.; } @@ -78,7 +78,7 @@ Tensor<1, dim> FE_NedelecSZ::shape_grad(const unsigned int /*i*/, const Point & /*p*/) const { - typedef FiniteElement FEE; + using FEE = FiniteElement; Assert(false, typename FEE::ExcFENotPrimitive()); return Tensor<1, dim>(); } @@ -103,7 +103,7 @@ Tensor<2, dim> FE_NedelecSZ::shape_grad_grad(const unsigned int /*i*/, const Point & /*p*/) const { - typedef FiniteElement FEE; + using FEE = FiniteElement; Assert(false, typename FEE::ExcFENotPrimitive()); return Tensor<2, dim>(); } diff --git a/source/fe/fe_q.cc b/source/fe/fe_q.cc index aee10ccede..e959cd1665 100644 --- a/source/fe/fe_q.cc +++ b/source/fe/fe_q.cc @@ -40,7 +40,7 @@ namespace internal return QGaussLobatto<1>(degree + 1).get_points(); else { - typedef dealii::FE_Q_Base, 1, 1> FEQ; + using FEQ = dealii::FE_Q_Base, 1, 1>; AssertThrow(false, FEQ::ExcFEQCannotHaveDegree0()); } return std::vector>(); diff --git a/source/fe/fe_q_base.cc b/source/fe/fe_q_base.cc index 1df3a4e9fc..274a5b3925 100644 --- a/source/fe/fe_q_base.cc +++ b/source/fe/fe_q_base.cc @@ -1191,7 +1191,7 @@ std::vector FE_Q_Base::get_dpo_vector( const unsigned int degree) { - typedef FE_Q_Base FEQ; + using FEQ = FE_Q_Base; AssertThrow(degree > 0, typename FEQ::ExcFEQCannotHaveDegree0()); std::vector dpo(dim + 1, 1U); for (unsigned int i = 1; i < dpo.size(); ++i) diff --git a/source/fe/fe_q_bubbles.cc b/source/fe/fe_q_bubbles.cc index 40111e707d..ce0ff54ef8 100644 --- a/source/fe/fe_q_bubbles.cc +++ b/source/fe/fe_q_bubbles.cc @@ -385,7 +385,7 @@ FE_Q_Bubbles::get_interpolation_matrix( // We don't know how to do this properly, yet. // However, for SolutionTransfer to work we need to provide an implementation // for the case that the x_source_fe is identical to this FE - typedef FE_Q_Bubbles FEQBUBBLES; + using FEQBUBBLES = FE_Q_Bubbles; AssertThrow( (x_source_fe.get_name().find("FE_Q_Bubbles<") == 0) || diff --git a/source/fe/fe_q_dg0.cc b/source/fe/fe_q_dg0.cc index 6b7569db4e..f582f5dfe7 100644 --- a/source/fe/fe_q_dg0.cc +++ b/source/fe/fe_q_dg0.cc @@ -212,7 +212,7 @@ FE_Q_DG0::get_interpolation_matrix( FullMatrix & interpolation_matrix) const { // this is only implemented, if the source FE is also a Q_DG0 element - typedef FE_Q_DG0 FEQDG0; + using FEQDG0 = FE_Q_DG0; AssertThrow( (x_source_fe.get_name().find("FE_Q_DG0<") == 0) || diff --git a/source/fe/fe_q_hierarchical.cc b/source/fe/fe_q_hierarchical.cc index 38940892e3..8968344213 100644 --- a/source/fe/fe_q_hierarchical.cc +++ b/source/fe/fe_q_hierarchical.cc @@ -908,7 +908,7 @@ FE_Q_Hierarchical::get_face_interpolation_matrix( // this is only implemented, if the // source FE is also a // Q_Hierarchical element - typedef FE_Q_Hierarchical FEQHierarchical; + using FEQHierarchical = FE_Q_Hierarchical; AssertThrow((x_source_fe.get_name().find("FE_Q_Hierarchical<") == 0) || (dynamic_cast(&x_source_fe) != nullptr), @@ -995,7 +995,7 @@ FE_Q_Hierarchical::get_subface_interpolation_matrix( // this is only implemented, if the // source FE is also a // Q_Hierarchical element - typedef FE_Q_Hierarchical FEQHierarchical; + using FEQHierarchical = FE_Q_Hierarchical; AssertThrow((x_source_fe.get_name().find("FE_Q_Hierarchical<") == 0) || (dynamic_cast(&x_source_fe) != nullptr), diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index f771601b65..ffcab279fb 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -2649,8 +2649,8 @@ namespace internal scalars.resize(n_scalars); for (unsigned int component = 0; component < n_scalars; ++component) { - // Use a typedef here to work around an issue with gcc-4.1: - typedef dealii::FEValuesViews::Scalar ScalarView; + // Use an alias here to work around an issue with gcc-4.1: + using ScalarView = dealii::FEValuesViews::Scalar; scalars[component].ScalarView::~ScalarView(); new (&scalars[component]) @@ -2665,8 +2665,8 @@ namespace internal vectors.resize(n_vectors); for (unsigned int component = 0; component < n_vectors; ++component) { - // Use a typedef here to work around an issue with gcc-4.1: - typedef dealii::FEValuesViews::Vector VectorView; + // Use an alias here to work around an issue with gcc-4.1: + using VectorView = dealii::FEValuesViews::Vector; vectors[component].VectorView::~VectorView(); new (&vectors[component]) @@ -2683,9 +2683,9 @@ namespace internal component < n_symmetric_second_order_tensors; ++component) { - // Use a typedef here to work around an issue with gcc-4.1: - typedef dealii::FEValuesViews::SymmetricTensor<2, dim, spacedim> - SymmetricTensorView; + // Use an alias here to work around an issue with gcc-4.1: + using SymmetricTensorView = + dealii::FEValuesViews::SymmetricTensor<2, dim, spacedim>; symmetric_second_order_tensors[component] .SymmetricTensorView::~SymmetricTensorView(); @@ -2703,8 +2703,8 @@ namespace internal for (unsigned int component = 0; component < n_second_order_tensors; ++component) { - // Use a typedef here to work around an issue with gcc-4.1: - typedef dealii::FEValuesViews::Tensor<2, dim, spacedim> TensorView; + // Use an alias here to work around an issue with gcc-4.1: + using TensorView = dealii::FEValuesViews::Tensor<2, dim, spacedim>; second_order_tensors[component].TensorView::~TensorView(); new (&second_order_tensors[component]) @@ -3251,7 +3251,7 @@ namespace internal const bool quadrature_points_fastest = false, const unsigned int component_multiple = 1) { - typedef typename VectorType::value_type Number; + using Number = typename VectorType::value_type; // initialize with zero for (unsigned int i = 0; i < values.size(); ++i) std::fill_n(values[i].begin(), @@ -3658,7 +3658,7 @@ FEValuesBase::get_function_values( const InputVector & fe_function, std::vector &values) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_values, ExcAccessToUninitializedField("update_values")); AssertDimension(fe->n_components(), 1); @@ -3684,7 +3684,7 @@ FEValuesBase::get_function_values( const VectorSlice> &indices, std::vector & values) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_values, ExcAccessToUninitializedField("update_values")); AssertDimension(fe->n_components(), 1); @@ -3707,7 +3707,7 @@ FEValuesBase::get_function_values( const InputVector & fe_function, std::vector> &values) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(present_cell.get() != nullptr, ExcMessage("FEValues object is not reinit'ed to any cell")); @@ -3736,7 +3736,7 @@ FEValuesBase::get_function_values( const VectorSlice> &indices, std::vector> & values) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; // Size of indices must be a multiple of dofs_per_cell such that an integer // number of function values is generated in each point. Assert(indices.size() % dofs_per_cell == 0, @@ -3769,7 +3769,7 @@ FEValuesBase::get_function_values( values, bool quadrature_points_fastest) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_values, ExcAccessToUninitializedField("update_values")); @@ -3801,7 +3801,7 @@ FEValuesBase::get_function_gradients( std::vector> &gradients) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_gradients, ExcAccessToUninitializedField("update_gradients")); AssertDimension(fe->n_components(), 1); @@ -3828,7 +3828,7 @@ FEValuesBase::get_function_gradients( std::vector> &gradients) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_gradients, ExcAccessToUninitializedField("update_gradients")); AssertDimension(fe->n_components(), 1); @@ -3853,7 +3853,7 @@ FEValuesBase::get_function_gradients( std::vector>> &gradients) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_gradients, ExcAccessToUninitializedField("update_gradients")); Assert(present_cell.get() != nullptr, @@ -3884,7 +3884,7 @@ FEValuesBase::get_function_gradients( gradients, bool quadrature_points_fastest) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; // Size of indices must be a multiple of dofs_per_cell such that an integer // number of function values is generated in each point. Assert(indices.size() % dofs_per_cell == 0, @@ -3915,7 +3915,7 @@ FEValuesBase::get_function_hessians( std::vector> &hessians) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; AssertDimension(fe->n_components(), 1); Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); @@ -3942,7 +3942,7 @@ FEValuesBase::get_function_hessians( std::vector> &hessians) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -3968,7 +3968,7 @@ FEValuesBase::get_function_hessians( & hessians, bool quadrature_points_fastest) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); Assert(present_cell.get() != nullptr, @@ -4000,7 +4000,7 @@ FEValuesBase::get_function_hessians( hessians, bool quadrature_points_fastest) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); Assert(indices.size() % dofs_per_cell == 0, @@ -4028,7 +4028,7 @@ FEValuesBase::get_function_laplacians( const InputVector & fe_function, std::vector &laplacians) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); AssertDimension(fe->n_components(), 1); @@ -4054,7 +4054,7 @@ FEValuesBase::get_function_laplacians( const VectorSlice> &indices, std::vector &laplacians) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_hessians, ExcAccessToUninitializedField("update_hessians")); AssertDimension(fe->n_components(), 1); @@ -4077,7 +4077,7 @@ FEValuesBase::get_function_laplacians( const InputVector & fe_function, std::vector> &laplacians) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(present_cell.get() != nullptr, ExcMessage("FEValues object is not reinit'ed to any cell")); Assert(this->update_flags & update_hessians, @@ -4105,7 +4105,7 @@ FEValuesBase::get_function_laplacians( const VectorSlice> &indices, std::vector> &laplacians) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; // Size of indices must be a multiple of dofs_per_cell such that an integer // number of function values is generated in each point. Assert(indices.size() % dofs_per_cell == 0, @@ -4137,7 +4137,7 @@ FEValuesBase::get_function_laplacians( std::vector> & laplacians, bool quadrature_points_fastest) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(indices.size() % dofs_per_cell == 0, ExcNotMultiple(indices.size(), dofs_per_cell)); Assert(this->update_flags & update_hessians, @@ -4166,7 +4166,7 @@ FEValuesBase::get_function_third_derivatives( std::vector> &third_derivatives) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; AssertDimension(fe->n_components(), 1); Assert(this->update_flags & update_3rd_derivatives, ExcAccessToUninitializedField("update_3rd_derivatives")); @@ -4194,7 +4194,7 @@ FEValuesBase::get_function_third_derivatives( std::vector> &third_derivatives) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_3rd_derivatives, ExcAccessToUninitializedField("update_3rd_derivatives")); AssertDimension(fe_function.size(), present_cell->n_dofs_for_dof_handler()); @@ -4221,7 +4221,7 @@ FEValuesBase::get_function_third_derivatives( & third_derivatives, bool quadrature_points_fastest) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_3rd_derivatives, ExcAccessToUninitializedField("update_3rd_derivatives")); Assert(present_cell.get() != nullptr, @@ -4253,7 +4253,7 @@ FEValuesBase::get_function_third_derivatives( third_derivatives, bool quadrature_points_fastest) const { - typedef typename InputVector::value_type Number; + using Number = typename InputVector::value_type; Assert(this->update_flags & update_3rd_derivatives, ExcAccessToUninitializedField("update_3rd_derivatives")); Assert(indices.size() % dofs_per_cell == 0, diff --git a/source/grid/grid_out.cc b/source/grid/grid_out.cc index a2b5356615..94d4b74088 100644 --- a/source/grid/grid_out.cc +++ b/source/grid/grid_out.cc @@ -4112,7 +4112,7 @@ namespace internal const GridOutFlags::Eps<2> & eps_flags_2, const GridOutFlags::Eps<3> & eps_flags_3) { - typedef std::list LineList; + using LineList = std::list; // We should never get here in 1D since this function is overloaded for // all dim == 1 cases. diff --git a/source/grid/grid_reordering.cc b/source/grid/grid_reordering.cc index 6d6215e99e..3030f6678a 100644 --- a/source/grid/grid_reordering.cc +++ b/source/grid/grid_reordering.cc @@ -209,7 +209,7 @@ namespace * An iterator that allows iterating over all cells adjacent * to the edge represented by the current object. */ - typedef const AdjacentCell *const_iterator; + using const_iterator = const AdjacentCell *; /** * Add the given cell to the collection of cells adjacent to @@ -435,7 +435,7 @@ namespace /** * Iterator type for the elements of the set. */ - typedef const unsigned int *const_iterator; + using const_iterator = const unsigned int *; /** * Default constructor. Initialize both slots as unused, corresponding diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 5f00abc06d..caca997698 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -1982,8 +1982,8 @@ namespace GridTools #else - typedef typename Triangulation::active_cell_iterator - active_cell_iterator; + using active_cell_iterator = + typename Triangulation::active_cell_iterator; const std::vector> vertex_to_cell = vertex_to_cell_map(triangulation); diff --git a/source/grid/grid_tools_dof_handlers.cc b/source/grid/grid_tools_dof_handlers.cc index 578353c464..4571319a2d 100644 --- a/source/grid/grid_tools_dof_handlers.cc +++ b/source/grid/grid_tools_dof_handlers.cc @@ -354,12 +354,11 @@ namespace GridTools #endif { #ifndef _MSC_VER - typedef - typename MeshType::active_cell_iterator cell_iterator; + using cell_iterator = + typename MeshType::active_cell_iterator; #else - typedef typename dealii::internal:: - ActiveCellIterator>::type - cell_iterator; + using cell_iterator = typename dealii::internal:: + ActiveCellIterator>::type; #endif // update the searched cells @@ -423,9 +422,8 @@ namespace GridTools const std::vector & marked_vertices, const double tolerance) { - typedef typename dealii::internal:: - ActiveCellIterator>::type - active_cell_iterator; + using active_cell_iterator = typename dealii::internal:: + ActiveCellIterator>::type; // The best distance is set to the // maximum allowable distance from @@ -1154,10 +1152,8 @@ namespace GridTools // non-active cells, we will get to // the later on for further // consideration - typedef std::list> - CellList; - + using CellList = std::list>; CellList cell_list; // first push the coarse level cells @@ -1275,8 +1271,8 @@ namespace GridTools "or size equal to the number of elements in " "the FECollection.")); - typedef typename hp::DoFHandler::active_cell_iterator - cell_iterator; + using cell_iterator = + typename hp::DoFHandler::active_cell_iterator; std::pair> best_cell; // If we have only one element in the MappingCollection, @@ -2056,9 +2052,8 @@ namespace GridTools // Match with a complexity of O(n^2). This could be improved... std::bitset<3> orientation; - typedef - typename std::set>::const_iterator - PairIterator; + using PairIterator = + typename std::set>::const_iterator; for (PairIterator it1 = pairs1.begin(); it1 != pairs1.end(); ++it1) { for (PairIterator it2 = pairs2.begin(); it2 != pairs2.end(); ++it2) @@ -2303,8 +2298,8 @@ namespace GridTools template <> struct OrientationLookupTable<1> { - typedef std::array::vertices_per_face> - MATCH_T; + using MATCH_T = + std::array::vertices_per_face>; static inline std::bitset<3> lookup(const MATCH_T &) { @@ -2316,8 +2311,8 @@ namespace GridTools template <> struct OrientationLookupTable<2> { - typedef std::array::vertices_per_face> - MATCH_T; + using MATCH_T = + std::array::vertices_per_face>; static inline std::bitset<3> lookup(const MATCH_T &matching) { @@ -2342,8 +2337,8 @@ namespace GridTools template <> struct OrientationLookupTable<3> { - typedef std::array::vertices_per_face> - MATCH_T; + using MATCH_T = + std::array::vertices_per_face>; static inline std::bitset<3> lookup(const MATCH_T &matching) { diff --git a/source/grid/tria.cc b/source/grid/tria.cc index e7dccc92a2..634de4fafb 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -927,7 +927,7 @@ namespace unsigned int>, std::bitset<3>>> &periodic_face_map) { - typedef typename Triangulation::face_iterator FaceIterator; + using FaceIterator = typename Triangulation::face_iterator; const FaceIterator face_1 = cell_1->face(n_face_1); const FaceIterator face_2 = cell_2->face(n_face_2); @@ -952,9 +952,9 @@ namespace ExcMessage("Periodic faces must be on the boundary")); // insert periodic face pair for both cells - typedef std::pair::cell_iterator, - unsigned int> - CellFace; + using CellFace = + std::pair::cell_iterator, + unsigned int>; const CellFace cell_face_1(cell_1, n_face_1); const CellFace cell_face_2(cell_2, n_face_2); const std::pair> cell_face_orientation_2( @@ -1312,7 +1312,7 @@ namespace internal * * Ideally, we would make this class a member class of the * Triangulation class, since then our implementation - * functions have immediate access to the typedefs and static functions of + * functions have immediate access to the alias and static functions of * the surrounding Triangulation class. I.e., we do not have to write * "typename Triangulation::active_cell_iterator" but can * write "active_cell_iterator" right away. This is, in fact, the way it was @@ -1374,8 +1374,8 @@ namespace internal const unsigned int level_objects, internal::TriangulationImplementation::NumberCache<1> &number_cache) { - typedef - typename Triangulation::line_iterator line_iterator; + using line_iterator = + typename Triangulation::line_iterator; number_cache.n_levels = 0; if (level_objects > 0) @@ -1475,8 +1475,8 @@ namespace internal static_cast &>( number_cache)); - typedef - typename Triangulation::quad_iterator quad_iterator; + using quad_iterator = + typename Triangulation::quad_iterator; /////////////////////////////////// // update the number of quads on the different levels in the @@ -1581,8 +1581,8 @@ namespace internal static_cast &>( number_cache)); - typedef - typename Triangulation::hex_iterator hex_iterator; + using hex_iterator = + typename Triangulation::hex_iterator; /////////////////////////////////// // update the number of hexes on the different levels in the diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index ac8f3b7456..5e58dc5ac6 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -2523,7 +2523,7 @@ CellAccessor::has_periodic_neighbor( * We decided to use the 2nd option. */ AssertIndexRange(i_face, GeometryInfo::faces_per_cell); - typedef TriaIterator> cell_iterator; + using cell_iterator = TriaIterator>; // my_it : is the iterator to the current cell. cell_iterator my_it(*this); if (this->tria->periodic_face_map.find( @@ -2548,8 +2548,8 @@ CellAccessor::periodic_neighbor(const unsigned int i_face) const * being the current cell_face. */ AssertIndexRange(i_face, GeometryInfo::faces_per_cell); - typedef TriaIterator> cell_iterator; - cell_iterator my_it(*this); + using cell_iterator = TriaIterator>; + cell_iterator my_it(*this); const typename std::map, std::pair, @@ -2600,8 +2600,8 @@ CellAccessor::periodic_neighbor_child_on_subface( * neighboring face. */ AssertIndexRange(i_face, GeometryInfo::faces_per_cell); - typedef TriaIterator> cell_iterator; - cell_iterator my_it(*this); + using cell_iterator = TriaIterator>; + cell_iterator my_it(*this); const typename std::map, std::pair, std::bitset<3>>>::const_iterator @@ -2653,7 +2653,7 @@ CellAccessor::periodic_neighbor_of_coarser_periodic_neighbor( * cell. */ AssertIndexRange(i_face, GeometryInfo::faces_per_cell); - typedef TriaIterator> cell_iterator; + using cell_iterator = TriaIterator>; const int my_face_index = this->face_index(i_face); cell_iterator my_it(*this); const typename std::map, @@ -2744,8 +2744,8 @@ CellAccessor::periodic_neighbor_face_no( * being the current cell_face. */ AssertIndexRange(i_face, GeometryInfo::faces_per_cell); - typedef TriaIterator> cell_iterator; - cell_iterator my_it(*this); + using cell_iterator = TriaIterator>; + cell_iterator my_it(*this); const typename std::map, std::pair, std::bitset<3>>>::const_iterator @@ -2786,8 +2786,8 @@ CellAccessor::periodic_neighbor_is_coarser( * first pair being the periodic neighbor cell_face. */ AssertIndexRange(i_face, GeometryInfo::faces_per_cell); - typedef TriaIterator> cell_iterator; - cell_iterator my_it(*this); + using cell_iterator = TriaIterator>; + cell_iterator my_it(*this); const typename std::map, std::pair, std::bitset<3>>>::const_iterator diff --git a/source/lac/petsc_parallel_block_vector.cc b/source/lac/petsc_parallel_block_vector.cc index 7d5675fe64..b4e6d9ed5f 100644 --- a/source/lac/petsc_parallel_block_vector.cc +++ b/source/lac/petsc_parallel_block_vector.cc @@ -23,7 +23,7 @@ namespace PETScWrappers { namespace MPI { - typedef types::global_dof_index size_type; + using size_type = types::global_dof_index; void BlockVector::reinit(const unsigned int num_blocks) diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index a968b3c01d..d060d882cd 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -929,9 +929,8 @@ namespace SparsityTools for (DynamicSparsityPattern::size_type i = 0; i < rows_per_cpu.size(); ++i) start_index[i + 1] = start_index[i] + rows_per_cpu[i]; - typedef std::map> - map_vec_t; + using map_vec_t = std::map>; map_vec_t send_data; @@ -1073,9 +1072,9 @@ namespace SparsityTools { const unsigned int myid = Utilities::MPI::this_mpi_process(mpi_comm); - typedef std::map> - map_vec_t; + using map_vec_t = + std::map>; map_vec_t send_data; { diff --git a/source/lac/trilinos_precondition_muelu.cc b/source/lac/trilinos_precondition_muelu.cc index 808a5a89e8..375a465e7e 100644 --- a/source/lac/trilinos_precondition_muelu.cc +++ b/source/lac/trilinos_precondition_muelu.cc @@ -210,7 +210,7 @@ namespace TrilinosWrappers // std::shared_ptr. // For now, just use serial node, i.e. no multithreaing or GPU. - typedef KokkosClassic::DefaultNode::DefaultNodeType node; + using node = KokkosClassic::DefaultNode::DefaultNodeType; preconditioner.reset(); // Cast matrix into a MueLu::Matrix. The constness needs to be cast away. diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index fe657772ef..decc2096a4 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -468,7 +468,7 @@ namespace TrilinosWrappers namespace { - typedef SparseMatrix::size_type size_type; + using size_type = SparseMatrix::size_type; template void @@ -2223,7 +2223,7 @@ namespace TrilinosWrappers namespace internals { - typedef dealii::types::global_dof_index size_type; + using size_type = dealii::types::global_dof_index; void perform_mmult(const SparseMatrix &inputleft, @@ -3219,10 +3219,10 @@ namespace TrilinosWrappers operator+(const TrilinosPayload &first_op, const TrilinosPayload &second_op) { - typedef typename TrilinosPayload::Domain Domain; - typedef typename TrilinosPayload::Range Range; - typedef typename TrilinosPayload::VectorType Intermediate; - typedef TrilinosWrappers::MPI::Vector GVMVectorType; + using Domain = typename TrilinosPayload::Domain; + using Range = typename TrilinosPayload::Range; + using Intermediate = typename TrilinosPayload::VectorType; + using GVMVectorType = TrilinosWrappers::MPI::Vector; Assert(first_op.locally_owned_domain_indices() == second_op.locally_owned_domain_indices(), @@ -3414,10 +3414,10 @@ namespace TrilinosWrappers TrilinosPayload operator*(const TrilinosPayload &first_op, const TrilinosPayload &second_op) { - typedef typename TrilinosPayload::Domain Domain; - typedef typename TrilinosPayload::Range Range; - typedef typename TrilinosPayload::VectorType Intermediate; - typedef TrilinosWrappers::MPI::Vector GVMVectorType; + using Domain = typename TrilinosPayload::Domain; + using Range = typename TrilinosPayload::Range; + using Intermediate = typename TrilinosPayload::VectorType; + using GVMVectorType = TrilinosWrappers::MPI::Vector; AssertThrow(first_op.locally_owned_domain_indices() == second_op.locally_owned_range_indices(), diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index 45a5c62ddb..6960fc94d7 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -270,7 +270,7 @@ namespace TrilinosWrappers namespace { - typedef SparsityPattern::size_type size_type; + using size_type = SparsityPattern::size_type; void reinit_sp(const Epetra_Map & row_map, diff --git a/source/multigrid/mg_transfer_component.cc b/source/multigrid/mg_transfer_component.cc index 015355c836..5d770bdf8b 100644 --- a/source/multigrid/mg_transfer_component.cc +++ b/source/multigrid/mg_transfer_component.cc @@ -243,8 +243,8 @@ MGTransferSelect::do_copy_to_mg( { --level; - typedef std::vector< - std::pair>::const_iterator IT; + using IT = std::vector< + std::pair>::const_iterator; for (IT i = copy_to_and_from_indices[level].begin(); i != copy_to_and_from_indices[level].end(); ++i) diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index a65f52d7d3..ac0086e2f4 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -88,13 +88,13 @@ namespace DerivativeApproximation * Declare the data type which holds the derivative described by this * class. */ - typedef Tensor<1, dim> Derivative; + using Derivative = Tensor<1, dim>; /** * Likewise declare the data type that holds the derivative projected to a * certain directions. */ - typedef Tensor<0, dim> ProjectedDerivative; + using ProjectedDerivative = Tensor<0, dim>; /** * Given an FEValues object initialized to a cell, and a solution vector, @@ -201,13 +201,13 @@ namespace DerivativeApproximation * Declare the data type which holds the derivative described by this * class. */ - typedef Tensor<2, dim> Derivative; + using Derivative = Tensor<2, dim>; /** * Likewise declare the data type that holds the derivative projected to a * certain directions. */ - typedef Tensor<1, dim> ProjectedDerivative; + using ProjectedDerivative = Tensor<1, dim>; /** * Given an FEValues object initialized to a cell, and a solution vector, @@ -538,13 +538,13 @@ namespace DerivativeApproximation * holds the derivative described * by this class. */ - typedef Tensor<3, dim> Derivative; + using Derivative = Tensor<3, dim>; /** * Likewise declare the data type that holds the derivative projected to a * certain directions. */ - typedef Tensor<2, dim> ProjectedDerivative; + using ProjectedDerivative = Tensor<2, dim>; /** * Given an FEValues object initialized to a cell, and a solution vector, @@ -676,32 +676,32 @@ namespace DerivativeApproximation { public: /** - * typedef to select the DerivativeDescription corresponding to the + * alias to select the DerivativeDescription corresponding to the * orderth derivative. In this general template we set an unvalid - * typedef to void, the real typedefs have to be specialized. + * alias to void, the real alias have to be specialized. */ - typedef void DerivDescr; + using DerivDescr = void; }; template class DerivativeSelector<1, dim> { public: - typedef Gradient DerivDescr; + using DerivDescr = Gradient; }; template class DerivativeSelector<2, dim> { public: - typedef SecondDerivative DerivDescr; + using DerivDescr = SecondDerivative; }; template class DerivativeSelector<3, dim> { public: - typedef ThirdDerivative DerivDescr; + using DerivDescr = ThirdDerivative; }; } // namespace internal } // namespace DerivativeApproximation @@ -986,11 +986,10 @@ namespace DerivativeApproximation Assert(component < dof_handler.get_fe(0).n_components(), ExcIndexRange(component, 0, dof_handler.get_fe(0).n_components())); - typedef std::tuple< + using Iterators = std::tuple< TriaActiveIterator< dealii::DoFCellAccessor, false>>, - Vector::iterator> - Iterators; + Vector::iterator>; SynchronousIterators begin( Iterators(dof_handler.begin_active(), derivative_norm.begin())), end(Iterators(dof_handler.end(), derivative_norm.end())); diff --git a/source/numerics/error_estimator_1d.cc b/source/numerics/error_estimator_1d.cc index f4aad3e062..ce3650a2d6 100644 --- a/source/numerics/error_estimator_1d.cc +++ b/source/numerics/error_estimator_1d.cc @@ -312,7 +312,7 @@ KellyErrorEstimator<1, spacedim>::estimate( const Strategy strategy) { AssertThrow(strategy == cell_diameter_over_24, ExcNotImplemented()); - typedef typename InputVector::value_type number; + using number = typename InputVector::value_type; #ifdef DEAL_II_WITH_P4EST if (dynamic_cast *>( &dof_handler.get_triangulation()) != nullptr) diff --git a/source/numerics/histogram.cc b/source/numerics/histogram.cc index d543657f39..b3ecbcf0de 100644 --- a/source/numerics/histogram.cc +++ b/source/numerics/histogram.cc @@ -96,8 +96,7 @@ Histogram::evaluate(const std::vector> &values, case logarithmic: { - typedef bool (*comparator)(const number, const number); - const comparator logarithmic_less_function = + const auto logarithmic_less_function = &Histogram::template logarithmic_less; min_value = *std::min_element(values[0].begin(), diff --git a/source/numerics/point_value_history.cc b/source/numerics/point_value_history.cc index 2c2cd70a1b..7055a47f76 100644 --- a/source/numerics/point_value_history.cc +++ b/source/numerics/point_value_history.cc @@ -902,7 +902,7 @@ PointValueHistory::evaluate_field_at_requested_location( const std::string &vector_name, const VectorType & solution) { - typedef typename VectorType::value_type number; + using number = typename VectorType::value_type; // must be closed to add data to internal // members. Assert(closed, ExcInvalidState()); diff --git a/source/particles/particle_handler.cc b/source/particles/particle_handler.cc index 618e349901..cd6f383331 100644 --- a/source/particles/particle_handler.cc +++ b/source/particles/particle_handler.cc @@ -540,7 +540,7 @@ namespace Particles // sizes for these vectors. If more space is needed an automatic and // relatively fast (compared to other parts of this algorithm) // re-allocation will happen. - typedef typename std::vector::size_type vector_size; + using vector_size = typename std::vector::size_type; sorted_particles.reserve( static_cast(particles_out_of_cell.size() * 1.25)); -- 2.39.5