From d54882b789fef2396453d2c571dee4930d7038de Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Tue, 29 Jan 2019 10:52:18 +0100 Subject: [PATCH] modernize-return-braced-init-list --- examples/step-33/step-33.cc | 8 ++-- examples/step-42/step-42.cc | 2 +- examples/step-49/step-49.cc | 2 +- examples/step-53/step-53.cc | 7 ++- include/deal.II/base/geometry_info.h | 6 ++- include/deal.II/base/index_set.h | 14 ++---- include/deal.II/base/symmetric_tensor.h | 46 +++++++++---------- include/deal.II/fe/fe_values.h | 22 ++++----- .../deal.II/grid/tria_accessor.templates.h | 4 +- include/deal.II/lac/block_indices.h | 2 +- include/deal.II/lac/chunk_sparsity_pattern.h | 10 ++-- .../deal.II/lac/dynamic_sparsity_pattern.h | 12 ++--- include/deal.II/lac/linear_operator.h | 4 +- include/deal.II/lac/sparsity_pattern.h | 10 ++-- include/deal.II/lac/trilinos_sparse_matrix.h | 2 +- include/deal.II/matrix_free/matrix_free.h | 5 +- source/base/data_out_base.cc | 2 +- source/base/function_lib.cc | 2 +- source/base/hdf5.cc | 8 ++-- source/dofs/dof_handler_policy.cc | 2 +- source/fe/fe.cc | 20 ++++---- source/fe/mapping_q_generic.cc | 10 ++-- source/grid/grid_tools.cc | 22 ++++----- source/grid/manifold.cc | 20 ++++---- source/grid/manifold_lib.cc | 12 ++--- source/grid/tria_accessor.cc | 6 +-- source/opencascade/manifold_lib.cc | 2 +- 27 files changed, 124 insertions(+), 138 deletions(-) diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index a3ce08eb58..917b51fcd3 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -2152,8 +2152,7 @@ namespace Step33 direct.solve(system_matrix, newton_update, right_hand_side); - return std::pair(solver_control.last_step(), - solver_control.last_value()); + return {solver_control.last_step(), solver_control.last_value()}; } // Likewise, if we are to use an iterative solver, we use Aztec's GMRES @@ -2215,13 +2214,12 @@ namespace Step33 solver.Iterate(parameters.max_iterations, parameters.linear_residual); - return std::pair(solver.NumIters(), - solver.TrueResidual()); + return {solver.NumIters(), solver.TrueResidual()}; } } Assert(false, ExcNotImplemented()); - return std::pair(0, 0); + return {0, 0}; } diff --git a/examples/step-42/step-42.cc b/examples/step-42/step-42.cc index 2006200602..94cc9e445a 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -897,7 +897,7 @@ namespace Step42 // indicator one. Point<3> rotate_half_sphere(const Point<3> &in) { - return Point<3>(in(2), in(1), -in(0)); + return {in(2), in(1), -in(0)}; } template diff --git a/examples/step-49/step-49.cc b/examples/step-49/step-49.cc index a40312e76b..c99e66a0e3 100644 --- a/examples/step-49/step-49.cc +++ b/examples/step-49/step-49.cc @@ -278,7 +278,7 @@ struct Grid6Func Point<2> operator()(const Point<2> &in) const { - return Point<2>(in(0), trans(in(1))); + return {in(0), trans(in(1))}; } }; diff --git a/examples/step-53/step-53.cc b/examples/step-53/step-53.cc index f60c0755e1..3e4eb436a5 100644 --- a/examples/step-53/step-53.cc +++ b/examples/step-53/step-53.cc @@ -277,10 +277,9 @@ namespace Step53 const double R_bar = R / std::sqrt(1 - (ellipticity * ellipticity * std::sin(theta) * std::sin(theta))); - return Point<3>((R_bar + d) * std::cos(phi) * std::cos(theta), - (R_bar + d) * std::sin(phi) * std::cos(theta), - ((1 - ellipticity * ellipticity) * R_bar + d) * - std::sin(theta)); + return {(R_bar + d) * std::cos(phi) * std::cos(theta), + (R_bar + d) * std::sin(phi) * std::cos(theta), + ((1 - ellipticity * ellipticity) * R_bar + d) * std::sin(theta)}; } Point<3> AfricaGeometry::pull_back_wgs84(const Point<3> &x) const diff --git a/include/deal.II/base/geometry_info.h b/include/deal.II/base/geometry_info.h index 31e75d1f0e..f5b35f8fdd 100644 --- a/include/deal.II/base/geometry_info.h +++ b/include/deal.II/base/geometry_info.h @@ -2519,7 +2519,7 @@ GeometryInfo<2>::unit_cell_vertex(const unsigned int vertex) Assert(vertex < vertices_per_cell, ExcIndexRange(vertex, 0, vertices_per_cell)); - return Point<2>(vertex % 2, vertex / 2); + return {static_cast(vertex % 2), static_cast(vertex / 2)}; } @@ -2531,7 +2531,9 @@ GeometryInfo<3>::unit_cell_vertex(const unsigned int vertex) Assert(vertex < vertices_per_cell, ExcIndexRange(vertex, 0, vertices_per_cell)); - return Point<3>(vertex % 2, vertex / 2 % 2, vertex / 4); + return {static_cast(vertex % 2), + static_cast(vertex / 2 % 2), + static_cast(vertex / 4)}; } diff --git a/include/deal.II/base/index_set.h b/include/deal.II/base/index_set.h index 439775a130..fec38b883f 100644 --- a/include/deal.II/base/index_set.h +++ b/include/deal.II/base/index_set.h @@ -1030,9 +1030,7 @@ inline IndexSet::ElementIterator IndexSet::IntervalAccessor::begin() const { Assert(is_valid(), ExcMessage("invalid iterator")); - return IndexSet::ElementIterator(index_set, - range_idx, - index_set->ranges[range_idx].begin); + return {index_set, range_idx, index_set->ranges[range_idx].begin}; } @@ -1044,9 +1042,7 @@ IndexSet::IntervalAccessor::end() const // point to first index in next interval unless we are the last interval. if (range_idx < index_set->ranges.size() - 1) - return IndexSet::ElementIterator(index_set, - range_idx + 1, - index_set->ranges[range_idx + 1].begin); + return {index_set, range_idx + 1, index_set->ranges[range_idx + 1].begin}; else return index_set->end(); } @@ -1479,7 +1475,7 @@ IndexSet::begin() const { compress(); if (ranges.size() > 0) - return IndexSet::ElementIterator(this, 0, ranges[0].begin); + return {this, 0, ranges[0].begin}; else return end(); } @@ -1530,9 +1526,9 @@ IndexSet::at(const size_type global_index) const // [a,b[ and we will return an iterator pointing directly at global_index // (else branch). if (global_index < p->begin) - return IndexSet::ElementIterator(this, p - ranges.begin(), p->begin); + return {this, static_cast(p - ranges.begin()), p->begin}; else - return IndexSet::ElementIterator(this, p - ranges.begin(), global_index); + return {this, static_cast(p - ranges.begin()), global_index}; } diff --git a/include/deal.II/base/symmetric_tensor.h b/include/deal.II/base/symmetric_tensor.h index f903c4078d..f164142472 100644 --- a/include/deal.II/base/symmetric_tensor.h +++ b/include/deal.II/base/symmetric_tensor.h @@ -101,9 +101,9 @@ namespace internal Assert(position < 2, ExcIndexRange(position, 0, 2)); if (position == 0) - return TableIndices<2>(new_index, numbers::invalid_unsigned_int); + return {new_index, numbers::invalid_unsigned_int}; else - return TableIndices<2>(previous_indices[0], new_index); + return {previous_indices[0], new_index}; } @@ -124,28 +124,28 @@ namespace internal switch (position) { case 0: - return TableIndices<4>(new_index, - numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int); + return {new_index, + numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int}; case 1: - return TableIndices<4>(previous_indices[0], - new_index, - numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int); + return {previous_indices[0], + new_index, + numbers::invalid_unsigned_int, + numbers::invalid_unsigned_int}; case 2: - return TableIndices<4>(previous_indices[0], - previous_indices[1], - new_index, - numbers::invalid_unsigned_int); + return {previous_indices[0], + previous_indices[1], + new_index, + numbers::invalid_unsigned_int}; case 3: - return TableIndices<4>(previous_indices[0], - previous_indices[1], - previous_indices[2], - new_index); + return {previous_indices[0], + previous_indices[1], + previous_indices[2], + new_index}; } Assert(false, ExcInternalError()); - return TableIndices<4>(); + return {}; } @@ -2463,7 +2463,7 @@ namespace internal { case 1: { - return TableIndices<2>(0, 0); + return {0, 0}; } case 2: @@ -2487,16 +2487,16 @@ namespace internal default: if (i < dim) - return TableIndices<2>(i, i); + return {i, i}; for (unsigned int d = 0, c = 0; d < dim; ++d) for (unsigned int e = d + 1; e < dim; ++e, ++c) if (c == i) - return TableIndices<2>(d, e); + return {d, e}; // should never get here: Assert(false, ExcInternalError()); - return TableIndices<2>(0, 0); + return {0, 0}; } } diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 311cbbd64e..3e03139485 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -4363,8 +4363,7 @@ namespace FEValuesViews Assert(n < 1, ExcIndexRange(n, 0, 1)); (void)n; - const double array[1] = {t[0]}; - return dealii::SymmetricTensor<2, 1>(array); + return {{t[0]}}; } @@ -4376,18 +4375,16 @@ namespace FEValuesViews { case 0: { - const double array[3] = {t[0], 0, t[1] / 2}; - return dealii::SymmetricTensor<2, 2>(array); + return {{t[0], 0, t[1] / 2}}; } case 1: { - const double array[3] = {0, t[1], t[0] / 2}; - return dealii::SymmetricTensor<2, 2>(array); + return {{0, t[1], t[0] / 2}}; } default: { Assert(false, ExcIndexRange(n, 0, 2)); - return dealii::SymmetricTensor<2, 2>(); + return {}; } } } @@ -4401,23 +4398,20 @@ namespace FEValuesViews { case 0: { - const double array[6] = {t[0], 0, 0, t[1] / 2, t[2] / 2, 0}; - return dealii::SymmetricTensor<2, 3>(array); + return {{t[0], 0, 0, t[1] / 2, t[2] / 2, 0}}; } case 1: { - const double array[6] = {0, t[1], 0, t[0] / 2, 0, t[2] / 2}; - return dealii::SymmetricTensor<2, 3>(array); + return {{0, t[1], 0, t[0] / 2, 0, t[2] / 2}}; } case 2: { - const double array[6] = {0, 0, t[2], 0, t[0] / 2, t[1] / 2}; - return dealii::SymmetricTensor<2, 3>(array); + return {{0, 0, t[2], 0, t[0] / 2, t[1] / 2}}; } default: { Assert(false, ExcIndexRange(n, 0, 3)); - return dealii::SymmetricTensor<2, 3>(); + return {}; } } } diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 03fa332247..bd9bc7b43c 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -2586,7 +2586,7 @@ template inline RefinementCase<0> TriaAccessor<0, dim, spacedim>::refinement_case() { - return RefinementCase<0>(RefinementPossibilities<0>::no_refinement); + return {RefinementPossibilities<0>::no_refinement}; } @@ -2998,7 +2998,7 @@ template inline RefinementCase<0> TriaAccessor<0, 1, spacedim>::refinement_case() { - return RefinementCase<0>(RefinementPossibilities<0>::no_refinement); + return {RefinementPossibilities<0>::no_refinement}; } template diff --git a/include/deal.II/lac/block_indices.h b/include/deal.II/lac/block_indices.h index 4860a039b9..6ada38375a 100644 --- a/include/deal.II/lac/block_indices.h +++ b/include/deal.II/lac/block_indices.h @@ -337,7 +337,7 @@ BlockIndices::global_to_local(const size_type i) const while (i < start_indices[block]) --block; - return std::pair(block, i - start_indices[block]); + return {block, i - start_indices[block]}; } diff --git a/include/deal.II/lac/chunk_sparsity_pattern.h b/include/deal.II/lac/chunk_sparsity_pattern.h index 261786b526..4a458f5982 100644 --- a/include/deal.II/lac/chunk_sparsity_pattern.h +++ b/include/deal.II/lac/chunk_sparsity_pattern.h @@ -1105,14 +1105,14 @@ namespace ChunkSparsityPatternIterators inline ChunkSparsityPattern::iterator ChunkSparsityPattern::begin() const { - return iterator(this, 0); + return {this, 0}; } inline ChunkSparsityPattern::iterator ChunkSparsityPattern::end() const { - return iterator(this, n_rows()); + return {this, n_rows()}; } @@ -1121,7 +1121,7 @@ inline ChunkSparsityPattern::iterator ChunkSparsityPattern::begin(const unsigned int r) const { Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows())); - return iterator(this, r); + return {this, r}; } @@ -1129,8 +1129,8 @@ ChunkSparsityPattern::begin(const unsigned int r) const inline ChunkSparsityPattern::iterator ChunkSparsityPattern::end(const unsigned int r) const { - Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows())) return iterator(this, - r + 1); + Assert(r < n_rows(), ExcIndexRange(r, 0, n_rows())); + return {this, r + 1}; } diff --git a/include/deal.II/lac/dynamic_sparsity_pattern.h b/include/deal.II/lac/dynamic_sparsity_pattern.h index 2feb05a52d..b5f1dd36a1 100644 --- a/include/deal.II/lac/dynamic_sparsity_pattern.h +++ b/include/deal.II/lac/dynamic_sparsity_pattern.h @@ -1089,7 +1089,7 @@ DynamicSparsityPattern::begin() const inline DynamicSparsityPattern::iterator DynamicSparsityPattern::end() const { - return iterator(this); + return {this}; } @@ -1100,7 +1100,7 @@ DynamicSparsityPattern::begin(const size_type r) const Assert(r < n_rows(), ExcIndexRangeType(r, 0, n_rows())); if (!have_entries) - return iterator(this); + return {this}; if (rowset.size() > 0) { @@ -1131,7 +1131,7 @@ DynamicSparsityPattern::begin(const size_type r) const if (it == rowset.end()) return end(); else - return iterator(this, *it, 0); + return {this, *it, 0}; } // Without an index set we have to do a linear search starting at @@ -1145,9 +1145,9 @@ DynamicSparsityPattern::begin(const size_type r) const } if (row == n_rows()) - return iterator(this); + return {this}; else - return iterator(this, row, 0); + return {this, row, 0}; } @@ -1159,7 +1159,7 @@ DynamicSparsityPattern::end(const size_type r) const unsigned int row = r + 1; if (row == n_rows()) - return iterator(this); + return {this}; else return begin(row); } diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index 5278b34ee6..e066190781 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -1022,7 +1022,7 @@ namespace internal inline EmptyPayload operator+(const EmptyPayload &, const EmptyPayload &) { - return EmptyPayload(); + return {}; } /** @@ -1031,7 +1031,7 @@ namespace internal */ inline EmptyPayload operator*(const EmptyPayload &, const EmptyPayload &) { - return EmptyPayload(); + return {}; } diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index 3f58fe1413..4182a1fd73 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -1254,7 +1254,7 @@ inline SparsityPattern::iterator SparsityPattern::begin() const { if (n_rows() > 0) - return iterator(this, rowstart[0]); + return {this, rowstart[0]}; else return end(); } @@ -1265,9 +1265,9 @@ inline SparsityPattern::iterator SparsityPattern::end() const { if (n_rows() > 0) - return iterator(this, rowstart[rows]); + return {this, rowstart[rows]}; else - return iterator(nullptr, 0); + return {nullptr, 0}; } @@ -1277,7 +1277,7 @@ SparsityPattern::begin(const size_type r) const { Assert(r < n_rows(), ExcIndexRangeType(r, 0, n_rows())); - return iterator(this, rowstart[r]); + return {this, rowstart[r]}; } @@ -1287,7 +1287,7 @@ SparsityPattern::end(const size_type r) const { Assert(r < n_rows(), ExcIndexRangeType(r, 0, n_rows())); - return iterator(this, rowstart[r + 1]); + return {this, rowstart[r + 1]}; } diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index ed9f193523..25478951f6 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -2745,7 +2745,7 @@ namespace TrilinosWrappers Accessor::value() const { Assert(a_row < matrix->m(), ExcBeyondEndOfMatrix()); - return Reference(*this); + return {*this}; } diff --git a/include/deal.II/matrix_free/matrix_free.h b/include/deal.II/matrix_free/matrix_free.h index d38ed5055f..15a1e5e32d 100644 --- a/include/deal.II/matrix_free/matrix_free.h +++ b/include/deal.II/matrix_free/matrix_free.h @@ -2032,14 +2032,13 @@ MatrixFree::create_cell_subrange_hp( if (dof_info[dof_handler_component].fe_index_conversion[0][0] == degree) return range; else - return std::pair(range.second, - range.second); + return {range.second, range.second}; } const unsigned int fe_index = dof_info[dof_handler_component].fe_index_from_degree(0, degree); if (fe_index >= dof_info[dof_handler_component].max_fe_index) - return std::pair(range.second, range.second); + return {range.second, range.second}; else return create_cell_subrange_hp_by_index(range, fe_index, diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 9983825260..65336ef191 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -7630,7 +7630,7 @@ DataOutInterface::create_xdmf_entry( } else { - return XDMFEntry(); + return {}; } } diff --git a/source/base/function_lib.cc b/source/base/function_lib.cc index 891cf67524..5ec40c4431 100644 --- a/source/base/function_lib.cc +++ b/source/base/function_lib.cc @@ -1435,7 +1435,7 @@ namespace Functions const unsigned int /*component*/) const { Assert(false, ExcNotImplemented()); - return Tensor<1, 2>(); + return {}; } diff --git a/source/base/hdf5.cc b/source/base/hdf5.cc index 2e4f3c02de..d8fe0dca80 100644 --- a/source/base/hdf5.cc +++ b/source/base/hdf5.cc @@ -1313,7 +1313,7 @@ namespace HDF5 Group Group::open_group(const std::string &name) const { - return Group(name, *this, mpi, GroupAccessMode::open); + return {name, *this, mpi, GroupAccessMode::open}; } @@ -1321,7 +1321,7 @@ namespace HDF5 Group Group::create_group(const std::string &name) const { - return Group(name, *this, mpi, GroupAccessMode::create); + return {name, *this, mpi, GroupAccessMode::create}; } @@ -1329,7 +1329,7 @@ namespace HDF5 DataSet Group::open_dataset(const std::string &name) const { - return DataSet(name, *hdf5_reference, mpi); + return {name, *hdf5_reference, mpi}; } @@ -1340,7 +1340,7 @@ namespace HDF5 const std::vector &dimensions) const { std::shared_ptr t_type = internal::get_hdf5_datatype(); - return DataSet(name, *hdf5_reference, dimensions, t_type, mpi); + return {name, *hdf5_reference, dimensions, t_type, mpi}; } diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc index bdb9b68d53..aa9b53c703 100644 --- a/source/dofs/dof_handler_policy.cc +++ b/source/dofs/dof_handler_policy.cc @@ -4206,7 +4206,7 @@ namespace internal // multigrid is not currently implemented for shared triangulations Assert(false, ExcNotImplemented()); - return NumberCache(); + return {}; } diff --git a/source/fe/fe.cc b/source/fe/fe.cc index a45d0b0fd3..861777b584 100644 --- a/source/fe/fe.cc +++ b/source/fe/fe.cc @@ -446,7 +446,7 @@ FiniteElement::component_mask(const BlockMask &block_mask) const // if we get a block mask that represents all blocks, then // do the same for the returned component mask if (block_mask.represents_the_all_selected_mask()) - return ComponentMask(); + return {}; AssertDimension(block_mask.size(), this->n_blocks()); @@ -502,7 +502,7 @@ FiniteElement::block_mask( // if we get a component mask that represents all component, then // do the same for the returned block mask if (component_mask.represents_the_all_selected_mask()) - return BlockMask(); + return {}; AssertDimension(component_mask.size(), this->n_components()); @@ -859,20 +859,18 @@ FiniteElement::interface_constraints_size() const switch (dim) { case 1: - return TableIndices<2>(0U, 0U); + return {0U, 0U}; case 2: - return TableIndices<2>(this->dofs_per_vertex + 2 * this->dofs_per_line, - this->dofs_per_face); + return {this->dofs_per_vertex + 2 * this->dofs_per_line, + this->dofs_per_face}; case 3: - return TableIndices<2>(5 * this->dofs_per_vertex + - 12 * this->dofs_per_line + - 4 * this->dofs_per_quad, - this->dofs_per_face); + return {5 * this->dofs_per_vertex + 12 * this->dofs_per_line + + 4 * this->dofs_per_quad, + this->dofs_per_face}; default: Assert(false, ExcNotImplemented()); } - return TableIndices<2>(numbers::invalid_unsigned_int, - numbers::invalid_unsigned_int); + return {numbers::invalid_unsigned_int, numbers::invalid_unsigned_int}; } diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index 44400569dd..4dfaf968dc 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -174,7 +174,7 @@ namespace internal if (std::abs(xi_denominator0) > 1e-10 * max_x) { const double xi = (x + subexpr0) / xi_denominator0; - return Point<2>(xi, eta); + return {xi, static_cast(eta)}; } else { @@ -187,7 +187,7 @@ namespace internal if (std::abs(xi_denominator1) > 1e-10 * max_y) { const double xi = (subexpr1 + y) / xi_denominator1; - return Point<2>(xi, eta); + return {xi, static_cast(eta)}; } else // give up and try Newton iteration { @@ -200,8 +200,8 @@ namespace internal // bogus return to placate compiler. It should not be possible to get // here. Assert(false, ExcInternalError()); - return Point<2>(std::numeric_limits::quiet_NaN(), - std::numeric_limits::quiet_NaN()); + return {std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}; } @@ -2517,7 +2517,7 @@ MappingQGeneric<1, 3>::transform_real_to_unit_cell_internal( const Point<1> &) const { Assert(false, ExcNotImplemented()); - return Point<1>(); + return {}; } diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 2b50ee5f40..201dfe03f9 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -815,8 +815,8 @@ namespace GridTools Point<2> operator()(const Point<2> &p) const { - return Point<2>(std::cos(angle) * p(0) - std::sin(angle) * p(1), - std::sin(angle) * p(0) + std::cos(angle) * p(1)); + return {std::cos(angle) * p(0) - std::sin(angle) * p(1), + std::sin(angle) * p(0) + std::cos(angle) * p(1)}; } private: @@ -836,17 +836,17 @@ namespace GridTools operator()(const Point<3> &p) const { if (axis == 0) - return Point<3>(p(0), - std::cos(angle) * p(1) - std::sin(angle) * p(2), - std::sin(angle) * p(1) + std::cos(angle) * p(2)); + return {p(0), + std::cos(angle) * p(1) - std::sin(angle) * p(2), + std::sin(angle) * p(1) + std::cos(angle) * p(2)}; else if (axis == 1) - return Point<3>(std::cos(angle) * p(0) + std::sin(angle) * p(2), - p(1), - -std::sin(angle) * p(0) + std::cos(angle) * p(2)); + return {std::cos(angle) * p(0) + std::sin(angle) * p(2), + p(1), + -std::sin(angle) * p(0) + std::cos(angle) * p(2)}; else - return Point<3>(std::cos(angle) * p(0) - std::sin(angle) * p(1), - std::sin(angle) * p(0) + std::cos(angle) * p(1), - p(2)); + return {std::cos(angle) * p(0) - std::sin(angle) * p(1), + std::sin(angle) * p(0) + std::cos(angle) * p(1), + p(2)}; } private: diff --git a/source/grid/manifold.cc b/source/grid/manifold.cc index 35d213df01..e668286c4a 100644 --- a/source/grid/manifold.cc +++ b/source/grid/manifold.cc @@ -379,7 +379,7 @@ Manifold<1, 1>::get_new_point_on_face( const Triangulation<1, 1>::face_iterator &) const { Assert(false, ExcImpossibleInDim(1)); - return Point<1>(); + return {}; } @@ -390,7 +390,7 @@ Manifold<1, 2>::get_new_point_on_face( const Triangulation<1, 2>::face_iterator &) const { Assert(false, ExcImpossibleInDim(1)); - return Point<2>(); + return {}; } @@ -401,7 +401,7 @@ Manifold<1, 3>::get_new_point_on_face( const Triangulation<1, 3>::face_iterator &) const { Assert(false, ExcImpossibleInDim(1)); - return Point<3>(); + return {}; } @@ -412,7 +412,7 @@ Manifold<1, 1>::get_new_point_on_quad( const Triangulation<1, 1>::quad_iterator &) const { Assert(false, ExcImpossibleInDim(1)); - return Point<1>(); + return {}; } @@ -423,7 +423,7 @@ Manifold<1, 2>::get_new_point_on_quad( const Triangulation<1, 2>::quad_iterator &) const { Assert(false, ExcImpossibleInDim(1)); - return Point<2>(); + return {}; } @@ -434,7 +434,7 @@ Manifold<1, 3>::get_new_point_on_quad( const Triangulation<1, 3>::quad_iterator &) const { Assert(false, ExcImpossibleInDim(1)); - return Point<3>(); + return {}; } @@ -492,7 +492,7 @@ namespace internal // the implementation below is bogus for this case anyway // (see the assert at the beginning of that function). Assert(false, ExcNotImplemented()); - return Tensor<1, 3>(); + return {}; } @@ -808,7 +808,7 @@ FlatManifold<1, 1>::normal_vector(const Triangulation<1, 1>::face_iterator &, const Point<1> &) const { Assert(false, ExcNotImplemented()); - return Tensor<1, 1>(); + return {}; } @@ -819,7 +819,7 @@ FlatManifold<1, 2>::normal_vector(const Triangulation<1, 2>::face_iterator &, const Point<2> &) const { Assert(false, ExcNotImplemented()); - return Tensor<1, 2>(); + return {}; } @@ -830,7 +830,7 @@ FlatManifold<1, 3>::normal_vector(const Triangulation<1, 3>::face_iterator &, const Point<3> &) const { Assert(false, ExcNotImplemented()); - return Tensor<1, 3>(); + return {}; } diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index c13d73f405..4dd1c9a31d 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -1268,7 +1268,7 @@ EllipticalManifold<2, 2>::pull_back(const Point<2> &space_point) const } const double eta = std::acos(cos_eta); const double pt1 = (std::signbit(y) ? 2.0 * numbers::PI - eta : eta); - return Point<2>(pt0, pt1); + return {pt0, pt1}; } @@ -1279,7 +1279,7 @@ EllipticalManifold::push_forward_gradient( const Point &) const { Assert(false, ExcNotImplemented()); - return DerivativeForm<1, spacedim, spacedim>(); + return {}; } @@ -1481,7 +1481,7 @@ TorusManifold::pull_back(const Point<3> &p) const double w = std::sqrt(std::pow(y - std::sin(phi) * R, 2.0) + std::pow(x - std::cos(phi) * R, 2.0) + z * z) / r; - return Point<3>(phi, theta, w); + return {phi, theta, w}; } @@ -1494,9 +1494,9 @@ TorusManifold::push_forward(const Point<3> &chart_point) const double theta = chart_point(1); double w = chart_point(2); - return Point<3>(std::cos(phi) * R + r * w * std::cos(theta) * std::cos(phi), - r * w * std::sin(theta), - std::sin(phi) * R + r * w * std::cos(theta) * std::sin(phi)); + return {std::cos(phi) * R + r * w * std::cos(theta) * std::cos(phi), + r * w * std::sin(theta), + std::sin(phi) * R + r * w * std::cos(theta) * std::sin(phi)}; } diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 4e62fde8de..c7a1bfdee3 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -210,7 +210,7 @@ namespace t9 * y[1] - t11 * y[0] + x[0] * t53 - t59 * x[2] + t59 * x[1] - t39 * x[0]; - return Point<2>(t27 * t37 / 3, t63 * t37 / 3); + return {t27 * t37 / 3, t63 * t37 / 3}; } @@ -1233,7 +1233,7 @@ namespace s2 = s3 * s4; const double unknown2 = s1 * s2; - return Point<3>(unknown0, unknown1, unknown2); + return {unknown0, unknown1, unknown2}; } @@ -2218,7 +2218,7 @@ CellAccessor::id() const Assert(ptr.level() == 0, ExcInternalError()); const unsigned int coarse_index = ptr.index(); - return CellId(coarse_index, n_child_indices, id.data()); + return {coarse_index, n_child_indices, id.data()}; } diff --git a/source/opencascade/manifold_lib.cc b/source/opencascade/manifold_lib.cc index c872b0d2fc..209043ef6b 100644 --- a/source/opencascade/manifold_lib.cc +++ b/source/opencascade/manifold_lib.cc @@ -404,7 +404,7 @@ namespace OpenCASCADE double u = proj_params.X(); double v = proj_params.Y(); - return Point<2>(u, v); + return {u, v}; } template -- 2.39.5