Skip to content

Commit

Permalink
Merge pull request #15282 from masterleinad/fix_clang_tidy
Browse files Browse the repository at this point in the history
Fix a couple clang-tidy warnings
  • Loading branch information
tjhei committed May 31, 2023
2 parents 4692a57 + 4e472ca commit 2896a7e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 23 deletions.
5 changes: 2 additions & 3 deletions include/deal.II/matrix_free/hanging_nodes_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,9 @@ namespace internal
{
const unsigned int line_idx = cell->line(line)->index();
if (cell->is_active())
line_to_cells[line_idx].push_back(std::make_pair(cell, line));
line_to_cells[line_idx].emplace_back(cell, line);
else
line_to_inactive_cells[line_idx].push_back(
std::make_pair(cell, line));
line_to_inactive_cells[line_idx].emplace_back(cell, line);
}
}

Expand Down
12 changes: 6 additions & 6 deletions include/deal.II/optimization/line_minimization.h
Original file line number Diff line number Diff line change
Expand Up @@ -480,12 +480,12 @@ namespace LineMinimization

template <typename NumberType>
NumberType
poly_fit_three_points(const NumberType x1,
const NumberType f1,
const NumberType g1,
const NumberType x2,
const NumberType f2,
const NumberType g2,
poly_fit_three_points(const NumberType x1,
const NumberType f1,
const NumberType g1,
const NumberType x2,
const NumberType f2,
const NumberType /*g2*/,
const FiniteSizeHistory<NumberType> &x_rec,
const FiniteSizeHistory<NumberType> &f_rec,
const FiniteSizeHistory<NumberType> & /*g_rec*/,
Expand Down
2 changes: 1 addition & 1 deletion include/deal.II/physics/notation.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ namespace Physics

template <int dim>
std::pair<unsigned int, unsigned int>
indices_from_component(const unsigned int component_n, const bool)
indices_from_component(const unsigned int /*component_n*/, const bool)
{
AssertThrow(false, ExcNotImplemented());
return std::make_pair(0u, 0u);
Expand Down
2 changes: 1 addition & 1 deletion source/base/logstream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ LogStream::LogStream()
, print_thread_id(false)
, at_newline(true)
{
get_prefixes().push("DEAL:");
get_prefixes().emplace("DEAL:");
}


Expand Down
8 changes: 4 additions & 4 deletions source/base/qprojector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,8 @@ QProjector<2>::project_to_all_faces(const ReferenceCell & reference_cell,
else
{
AssertDimension(quadrature.size(), GeometryInfo<dim>::faces_per_cell);
for (unsigned int i = 0; i < quadrature.size(); ++i)
n_points_total += quadrature[i].size();
for (const auto &q : quadrature)
n_points_total += q.size();
}

// first fix quadrature points
Expand Down Expand Up @@ -1011,8 +1011,8 @@ QProjector<3>::project_to_all_faces(const ReferenceCell & reference_cell,
else
{
AssertDimension(quadrature.size(), GeometryInfo<dim>::faces_per_cell);
for (unsigned int i = 0; i < quadrature.size(); ++i)
n_points_total += quadrature[i].size();
for (const auto &q : quadrature)
n_points_total += q.size();
}

n_points_total *= 8;
Expand Down
4 changes: 2 additions & 2 deletions source/hp/fe_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ namespace hp
if (fe_index_1 != fe_index_2)
for (const auto &identity :
query_identities(fe_index_1, fe_index_2))
identities_graph.emplace(Edge(Node(fe_index_1, identity.first),
Node(fe_index_2, identity.second)));
identities_graph.emplace(Node(fe_index_1, identity.first),
Node(fe_index_2, identity.second));

#ifdef DEBUG
// Now verify that indeed the graph is symmetric: If one element
Expand Down
8 changes: 4 additions & 4 deletions source/non_matching/fe_values.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ namespace NonMatching
// Tensor products of each quadrature in q_collection_1d. Used on the
// non-intersected cells.
hp::QCollection<dim> q_collection;
for (unsigned int i = 0; i < q_collection_1D.size(); ++i)
q_collection.push_back(Quadrature<dim>(q_collection_1D[i]));
for (const auto &quadrature : q_collection_1D)
q_collection.push_back(Quadrature<dim>(quadrature));

initialize(q_collection);
}
Expand Down Expand Up @@ -292,8 +292,8 @@ namespace NonMatching
// Tensor products of each quadrature in q_collection_1d. Used on the
// non-intersected cells.
hp::QCollection<dim - 1> q_collection;
for (unsigned int i = 0; i < q_collection_1D.size(); ++i)
q_collection.push_back(Quadrature<dim - 1>(q_collection_1D[i]));
for (const auto &quadrature : q_collection_1D)
q_collection.push_back(quadrature);

initialize(q_collection);
}
Expand Down
4 changes: 2 additions & 2 deletions source/non_matching/quadrature_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -861,8 +861,8 @@ namespace NonMatching
, low_dim_algorithm(q_collection1D, additional_data)
, up_through_dimension_creator(q_collection1D, additional_data)
{
for (unsigned int i = 0; i < q_collection1D.size(); ++i)
tensor_products.push_back(Quadrature<dim>(q_collection1D[i]));
for (const auto &quadrature : q_collection1D)
tensor_products.push_back(quadrature);
}


Expand Down

0 comments on commit 2896a7e

Please sign in to comment.