Checks: >
-*,
cppcoreguidelines-pro-type-static-cast-downcast,
- google-readability-casting,
+ cppcoreguidelines-pro-type-cstyle-cast,
modernize-*,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-pass-by-value,
-modernize-raw-string-literal,
+ -modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-nodiscard,
# bundled/. Clang-tidy fails if nothing is chosen, so we just enable a single
# harmless warning:
-Checks: "-*,misc-sizeof-container"
+Checks: "-*,misc-definitions-in-headers"
// MPI deadlock. Abort with a reasonable error message instead.
try
{
- std::rethrow_exception(std::move(exception));
+ std::rethrow_exception(exception);
}
catch (ExceptionBase &exc)
{
std::vector<std::string> descriptions;
+ descriptions.reserve(patterns.size());
for (const auto &pattern : patterns)
descriptions.push_back(pattern->description());
ExcMessage("The DoF handler attached to the current output vector "
"does not have any degrees of freedom, so it is not "
"possible to output DoF data in this context."));
- const std::string name = names[0];
+ const std::string &name = names[0];
const unsigned int n_components = dof_handler->get_fe(0).n_components();
deduced_names.resize(n_components);
if (n_components > 1)
{
SubQuadrature mutation;
- const auto quadrature_f =
+ const auto &quadrature_f =
quadrature[quadrature.size() == 1 ? 0 : face];
switch (i)
{
// Utilities::MPI::compute_set_union)
std::vector<unsigned int> reference_cells_ui;
+ reference_cells_ui.reserve(this->reference_cells.size());
for (const auto &i : this->reference_cells)
reference_cells_ui.push_back(static_cast<unsigned int>(i));
// all duplicates are ignored
for (unsigned int i = 0; i < patch.size(); ++i)
{
- const typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell =
patch[i];
Assert(cell->is_artificial() == false,
ExcMessage("This function can not be called with cells that are "
// all duplicates are ignored
for (unsigned int i = 0; i < patch.size(); ++i)
{
- const typename DoFHandler<dim, spacedim>::active_cell_iterator cell =
+ const typename DoFHandler<dim, spacedim>::active_cell_iterator &cell =
patch[i];
Assert(cell->is_artificial() == false,
ExcMessage("This function can not be called with cells that are "
// in all directions
if (tensor_product_quadrature)
{
- const std::array<Quadrature<1>, dim> quad_array =
+ const std::array<Quadrature<1>, dim> &quad_array =
q.get_tensor_basis();
for (unsigned int i = 1; i < dim && tensor_product_quadrature; ++i)
{
{
const double height = initial_height + height_increment * rep;
- vertices.emplace_back(Point<3>(-d, height, -d));
- vertices.emplace_back(Point<3>(d, height, -d));
- vertices.emplace_back(Point<3>(-a, height, -a));
- vertices.emplace_back(Point<3>(a, height, -a));
- vertices.emplace_back(Point<3>(-a, height, a));
- vertices.emplace_back(Point<3>(a, height, a));
- vertices.emplace_back(Point<3>(-d, height, d));
- vertices.emplace_back(Point<3>(d, height, d));
+ vertices.emplace_back(-d, height, -d);
+ vertices.emplace_back(d, height, -d);
+ vertices.emplace_back(-a, height, -a);
+ vertices.emplace_back(a, height, -a);
+ vertices.emplace_back(-a, height, a);
+ vertices.emplace_back(a, height, a);
+ vertices.emplace_back(-d, height, d);
+ vertices.emplace_back(d, height, d);
}
// Turn cylinder such that y->x
cell_ptr != distorted_cells.distorted_cells.end();
++cell_ptr)
{
- const typename Triangulation<dim, spacedim>::cell_iterator cell =
+ const typename Triangulation<dim, spacedim>::cell_iterator &cell =
*cell_ptr;
Assert(!cell->is_active(),
DynamicSparsityPattern::size_type next_free_number = 0;
// enumerate the first round dofs
- for (DynamicSparsityPattern::size_type i = 0; i != last_round_dofs.size();
- ++i)
- new_indices[last_round_dofs[i]] = next_free_number++;
+ for (unsigned int last_round_dof : last_round_dofs)
+ new_indices[last_round_dof] = next_free_number++;
// now do as many steps as needed to renumber all dofs
while (true)
#include <deal.II/multigrid/mg_transfer_internal.h>
+#include <memory>
+
DEAL_II_NAMESPACE_OPEN
namespace internal
ghosted_dofs.index_within_set(
target_partitioner->local_to_global(
copy_indices_global_mine(1, i)));
- target_partitioner.reset(new Utilities::MPI::Partitioner(
- locally_owned, ghosted_dofs, communicator));
+ target_partitioner =
+ std::make_shared<Utilities::MPI::Partitioner>(locally_owned,
+ ghosted_dofs,
+ communicator);
}
}
(sweep_no >= refinement_flags.correction_relaxations.size() ?
refinement_flags.correction_relaxations.back() :
refinement_flags.correction_relaxations[sweep_no]);
- for (unsigned int r = 0; r != relaxations.size(); ++r)
- if (n_active_cells < relaxations[r].first)
+ for (const auto &relaxation : relaxations)
+ if (n_active_cells < relaxation.first)
{
- delta_up *= relaxations[r].second;
- delta_down *= relaxations[r].second;
+ delta_up *= relaxation.second;
+ delta_down *= relaxation.second;
break;
}