IndexSet eigenfunction_index_set = dof_handler.locally_owned_dofs();
eigenfunctions.resize(
parameters.get_integer("Number of eigenvalues/eigenfunctions"));
- for (unsigned int i = 0; i < eigenfunctions.size(); ++i)
- eigenfunctions[i].reinit(eigenfunction_index_set, MPI_COMM_WORLD);
+ for (auto &eigenfunction : eigenfunctions)
+ eigenfunction.reinit(eigenfunction_index_set, MPI_COMM_WORLD);
eigenvalues.resize(eigenfunctions.size());
}
// does not necessarily have to be attained at a node, and so
// $\max_{\mathbf x}\phi_i(\mathbf x)\ge\max_j (\Phi_i)_j$ (although the
// equality is usually nearly true).
- for (unsigned int i = 0; i < eigenfunctions.size(); ++i)
- eigenfunctions[i] /= eigenfunctions[i].linfty_norm();
+ for (auto &eigenfunction : eigenfunctions)
+ eigenfunction /= eigenfunction.linfty_norm();
// Finally return the number of iterations it took to converge:
return solver_control.last_step();
Coupled_Magnetomechanical_Constitutive_Law_Base<dim>
&material_hand_calculated,
Coupled_Magnetomechanical_Constitutive_Law_Base<dim>
- & material_assisted_computation,
- TimerOutput & timer,
- const std::string filename)
+ & material_assisted_computation,
+ TimerOutput & timer,
+ const std::string &filename)
{
// We can take the hand-implemented constitutive law and compare the
// results that we attain with it to those that we get using AD or SD.
// ... followed by any intermediate evaluations due to the application
// of CSE. These are fed directly back into the substitution map...
- for (unsigned i = 0; i < intermediate_symbols_exprs.size(); ++i)
+ for (const auto &expression : intermediate_symbols_exprs)
{
const SymEngine::RCP<const SymEngine::Basic> &cse_symbol =
- intermediate_symbols_exprs[i].first;
+ expression.first;
const SymEngine::RCP<const SymEngine::Basic> &cse_expr =
- intermediate_symbols_exprs[i].second;
+ expression.second;
Assert(substitution_value_map.find(cse_symbol) ==
substitution_value_map.end(),
ExcMessage(
/**
* Move constructor.
*/
- BatchOptimizer(BatchOptimizer &&) = default;
+ BatchOptimizer(BatchOptimizer &&) noexcept = default;
/**
* Destructor.
{expression_otherwise.get_RCP(), SE::boolTrue});
// Initialize
- expression = SE::piecewise(std::move(piecewise_function));
+ expression = SE::piecewise(piecewise_function);
}
std::vector<std::pair<SD::Expression, SD::Expression>> symb_val_vec;
symb_val_vec.reserve(symbol_value_vector.size());
for (const auto &entry : symbol_value_vector)
- symb_val_vec.push_back(std::make_pair(SD::Expression(entry.first),
- SD::Expression(entry.second)));
+ symb_val_vec.emplace_back(SD::Expression(entry.first),
+ SD::Expression(entry.second));
return symb_val_vec;
}
TopoDS_Shape out_shape;
Tensor<1, spacedim> average_normal;
# ifdef DEBUG
- for (unsigned int i = 0; i < surrounding_points.size(); ++i)
+ for (const auto &point : surrounding_points)
{
- Assert(closest_point(sh, surrounding_points[i], tolerance)
- .distance(surrounding_points[i]) <
- std::max(tolerance * surrounding_points[i].norm(),
- tolerance),
- ExcPointNotOnManifold<spacedim>(surrounding_points[i]));
+ Assert(closest_point(sh, point, tolerance).distance(point) <
+ std::max(tolerance * point.norm(), tolerance),
+ ExcPointNotOnManifold<spacedim>(point));
}
# endif
{
case 2:
{
- for (unsigned int i = 0; i < surrounding_points.size(); ++i)
+ for (const auto &point : surrounding_points)
{
std::tuple<Point<3>, Tensor<1, 3>, double, double>
- p_and_diff_forms = closest_point_and_differential_forms(
- sh, surrounding_points[i], tolerance);
+ p_and_diff_forms =
+ closest_point_and_differential_forms(sh,
+ point,
+ tolerance);
average_normal += std::get<1>(p_and_diff_forms);
}
{
VectorType diff_comp_vector(solution);
diff_comp_vector = 0.0;
- auto dc = differential_components();
- for (auto i = dc.begin(); i != dc.end(); ++i)
- diff_comp_vector[*i] = 1.0;
+ for (const auto &component : differential_components())
+ diff_comp_vector[component] = 1.0;
diff_comp_vector.compress(VectorOperation::insert);
const auto diff_id = internal::make_nvector_view(diff_comp_vector