diff --git a/include/dem/output_force_torque_calculation.h b/include/dem/output_force_torque_calculation.h index 65e86400f2..1d724233d3 100644 --- a/include/dem/output_force_torque_calculation.h +++ b/include/dem/output_force_torque_calculation.h @@ -39,9 +39,9 @@ write_forces_torques_output_locally( */ void write_forces_torques_output_results( - const std::string filename, + const std::string &filename, const unsigned int output_frequency, - const std::vector boundary_index, + const std::vector &boundary_index, const double time_step, DEM::dem_data_structures<3>::vector_on_boundary &forces_boundary_information, DEM::dem_data_structures<3>::vector_on_boundary diff --git a/include/dem/particle_wall_dmt_force.h b/include/dem/particle_wall_dmt_force.h index 32eacfe309..6a0e44df5e 100644 --- a/include/dem/particle_wall_dmt_force.h +++ b/include/dem/particle_wall_dmt_force.h @@ -47,8 +47,8 @@ class ParticleWallDMTForce : public ParticleWallNonLinearForce public: ParticleWallDMTForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index = {}); + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index = {}); /** * @brief Carries out the calculation of the particle-wall contact force using diff --git a/include/dem/particle_wall_jkr_force.h b/include/dem/particle_wall_jkr_force.h index 1ef9c9c63f..272f678fe9 100644 --- a/include/dem/particle_wall_jkr_force.h +++ b/include/dem/particle_wall_jkr_force.h @@ -47,8 +47,8 @@ class ParticleWallJKRForce : public ParticleWallContactForce public: ParticleWallJKRForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index = {}); + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index = {}); /** * @brief Carries out the calculation of the particle-wall contact force using diff --git a/include/dem/particle_wall_linear_force.h b/include/dem/particle_wall_linear_force.h index 1244eaed39..725ed795c3 100644 --- a/include/dem/particle_wall_linear_force.h +++ b/include/dem/particle_wall_linear_force.h @@ -48,8 +48,8 @@ class ParticleWallLinearForce : public ParticleWallContactForce public: ParticleWallLinearForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index = {}); + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index = {}); /** * @brief Calculate the particle-wall contact force using diff --git a/include/dem/particle_wall_nonlinear_force.h b/include/dem/particle_wall_nonlinear_force.h index 11909fd76b..9a32b1499f 100644 --- a/include/dem/particle_wall_nonlinear_force.h +++ b/include/dem/particle_wall_nonlinear_force.h @@ -47,8 +47,8 @@ class ParticleWallNonLinearForce : public ParticleWallContactForce public: ParticleWallNonLinearForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index = {}); + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index = {}); /** * @brief Calculate the particle-wall contact force using diff --git a/source/dem/dem_contact_manager.cc b/source/dem/dem_contact_manager.cc index bc14a9264d..1dd689490b 100644 --- a/source/dem/dem_contact_manager.cc +++ b/source/dem/dem_contact_manager.cc @@ -11,7 +11,7 @@ DEMContactManager::execute_cell_neighbors_search( periodic_boundaries_cells_information) { // Get action manager - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); // Find cell neighbors find_cell_neighbors(triangulation, @@ -228,7 +228,7 @@ DEMContactManager::execute_particle_particle_broad_search( dealii::Particles::ParticleHandler &particle_handler, const AdaptiveSparseContacts &sparse_contacts_object) { - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); // Check if sparse contacts are enabled to use proper broad search functions // The first broad search is the default one for sparse contacts @@ -267,7 +267,7 @@ DEMContactManager::execute_particle_wall_broad_search( const double simulation_time, const AdaptiveSparseContacts &sparse_contacts_object) { - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); if (action_manager->use_default_broad_search_functions()) { diff --git a/source/dem/explicit_euler_integrator.cc b/source/dem/explicit_euler_integrator.cc index b87fab2ce1..f0dac6248f 100644 --- a/source/dem/explicit_euler_integrator.cc +++ b/source/dem/explicit_euler_integrator.cc @@ -97,7 +97,7 @@ ExplicitEulerIntegrator::integrate( const parallel::distributed::Triangulation & /* triangulation */, AdaptiveSparseContacts & /* sparse_contacts_object */) { - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); bool use_default_function = !action_manager->check_sparse_contacts_enabled() || diff --git a/source/dem/find_boundary_cells_information.cc b/source/dem/find_boundary_cells_information.cc index 4786f43c25..5443546f0e 100644 --- a/source/dem/find_boundary_cells_information.cc +++ b/source/dem/find_boundary_cells_information.cc @@ -19,8 +19,7 @@ using namespace dealii; // The constructor of this class is empty template -BoundaryCellsInformation::BoundaryCellsInformation() -{} +BoundaryCellsInformation::BoundaryCellsInformation() = default; template void diff --git a/source/dem/find_contact_detection_step.cc b/source/dem/find_contact_detection_step.cc index 50f34b3977..49c0b9c197 100644 --- a/source/dem/find_contact_detection_step.cc +++ b/source/dem/find_contact_detection_step.cc @@ -14,7 +14,7 @@ find_particle_contact_detection_step( const bool parallel_update) { // Get the action manager - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); // If something else has already triggered contact search, // no need to do it again if (action_manager->check_contact_search()) @@ -82,7 +82,7 @@ find_floating_mesh_mapping_step( std::vector>> solids) { // Get the action manager - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); // If there is no solid object, no need to do anything if (!action_manager->check_solid_objects_enabled()) diff --git a/source/dem/force_chains_visualization.cc b/source/dem/force_chains_visualization.cc index f27660cd40..ad641663b5 100644 --- a/source/dem/force_chains_visualization.cc +++ b/source/dem/force_chains_visualization.cc @@ -44,9 +44,9 @@ ParticlesForceChains:: { /*Initialize with a dummy normal force between two same points (0,0,0) to be sure every core have someting to write. */ - force_normal.push_back(0); - vertices.push_back(Point<3>(0, 0, 0)); - vertices.push_back(Point<3>(0, 0, 0)); + force_normal.emplace_back(0); + vertices.emplace_back(Point<3>(0, 0, 0)); + vertices.emplace_back(Point<3>(0, 0, 0)); } template < diff --git a/source/dem/grid_motion.cc b/source/dem/grid_motion.cc index 4d460f5828..0e724d6a63 100644 --- a/source/dem/grid_motion.cc +++ b/source/dem/grid_motion.cc @@ -12,7 +12,7 @@ GridMotion::GridMotion( const Parameters::Lagrangian::GridMotion &grid_motion_parameters, const double dem_time_step) { - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); switch (grid_motion_parameters.motion_type) { diff --git a/source/dem/output_force_torque_calculation.cc b/source/dem/output_force_torque_calculation.cc index 3975112f7c..bf7886c79c 100644 --- a/source/dem/output_force_torque_calculation.cc +++ b/source/dem/output_force_torque_calculation.cc @@ -29,9 +29,9 @@ write_forces_torques_output_locally( void write_forces_torques_output_results( - const std::string filename, + const std::string &filename, const unsigned int output_frequency, - const std::vector boundary_index, + const std::vector &boundary_index, const double time_step, DEM::dem_data_structures<3>::vector_on_boundary &forces_boundary_information, DEM::dem_data_structures<3>::vector_on_boundary &torques_boundary_information) diff --git a/source/dem/particle_point_line_contact_force.cc b/source/dem/particle_point_line_contact_force.cc index 18711eae4e..213f07a628 100644 --- a/source/dem/particle_point_line_contact_force.cc +++ b/source/dem/particle_point_line_contact_force.cc @@ -6,8 +6,7 @@ using namespace dealii; // Constructor template -ParticlePointLineForce::ParticlePointLineForce() -{} +ParticlePointLineForce::ParticlePointLineForce() = default; // In this function, the particle-point and particle-line contact forces are // calculated and the particle handler is updated based on this force diff --git a/source/dem/particle_wall_dmt_force.cc b/source/dem/particle_wall_dmt_force.cc index 412a9efad9..c7adb22d4e 100644 --- a/source/dem/particle_wall_dmt_force.cc +++ b/source/dem/particle_wall_dmt_force.cc @@ -7,8 +7,8 @@ using namespace dealii; template ParticleWallDMTForce::ParticleWallDMTForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index) + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index) : ParticleWallNonLinearForce(dem_parameters) , dmt_cut_off_threshold(dem_parameters.model_parameters.dmt_cut_off_threshold) { diff --git a/source/dem/particle_wall_jkr_force.cc b/source/dem/particle_wall_jkr_force.cc index 61da2e471d..cf3ec481ee 100644 --- a/source/dem/particle_wall_jkr_force.cc +++ b/source/dem/particle_wall_jkr_force.cc @@ -7,8 +7,8 @@ using namespace dealii; template ParticleWallJKRForce::ParticleWallJKRForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index) + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index) : ParticleWallContactForce(dem_parameters) { const double wall_youngs_modulus = diff --git a/source/dem/particle_wall_linear_force.cc b/source/dem/particle_wall_linear_force.cc index e133d47902..b77e7f88fe 100644 --- a/source/dem/particle_wall_linear_force.cc +++ b/source/dem/particle_wall_linear_force.cc @@ -7,8 +7,8 @@ using namespace dealii; template ParticleWallLinearForce::ParticleWallLinearForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index) + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index) : ParticleWallContactForce(dem_parameters) { const double wall_youngs_modulus = diff --git a/source/dem/particle_wall_nonlinear_force.cc b/source/dem/particle_wall_nonlinear_force.cc index 0c5d5108c3..d949d67e34 100644 --- a/source/dem/particle_wall_nonlinear_force.cc +++ b/source/dem/particle_wall_nonlinear_force.cc @@ -7,8 +7,8 @@ using namespace dealii; template ParticleWallNonLinearForce::ParticleWallNonLinearForce( - const DEMSolverParameters &dem_parameters, - const std::vector boundary_index) + const DEMSolverParameters &dem_parameters, + const std::vector &boundary_index) : ParticleWallContactForce(dem_parameters) { const double wall_youngs_modulus = diff --git a/source/dem/update_local_particle_containers.cc b/source/dem/update_local_particle_containers.cc index 273504cd98..d921de3fc4 100644 --- a/source/dem/update_local_particle_containers.cc +++ b/source/dem/update_local_particle_containers.cc @@ -40,7 +40,7 @@ update_contact_container_iterators( &particle_container) { // Get trigger for clearing contact structures - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); const bool clear_tangential_overlap = action_manager->check_clear_tangential_overlap(); diff --git a/source/dem/velocity_verlet_integrator.cc b/source/dem/velocity_verlet_integrator.cc index 24a7abdf12..3882fec611 100644 --- a/source/dem/velocity_verlet_integrator.cc +++ b/source/dem/velocity_verlet_integrator.cc @@ -143,7 +143,7 @@ VelocityVerletIntegrator::integrate( const parallel::distributed::Triangulation &triangulation, AdaptiveSparseContacts &sparse_contacts_object) { - auto action_manager = DEMActionManager::get_action_manager(); + auto *action_manager = DEMActionManager::get_action_manager(); bool use_default_function = !action_manager->check_sparse_contacts_enabled() || diff --git a/source/dem/visualization.cc b/source/dem/visualization.cc index 8284c65d39..4a32c6a743 100644 --- a/source/dem/visualization.cc +++ b/source/dem/visualization.cc @@ -5,8 +5,7 @@ using namespace dealii; template -Visualization::Visualization() -{} +Visualization::Visualization() = default; template void @@ -210,8 +209,7 @@ Visualization::get_nonscalar_data_ranges() const } template -Visualization::~Visualization() -{} +Visualization::~Visualization() = default; template class Visualization<2>; template class Visualization<3>; diff --git a/tests/dem/particle_particle_contact_force_linear.cc b/tests/dem/particle_particle_contact_force_linear.cc index 3f7373b762..b0a877387e 100644 --- a/tests/dem/particle_particle_contact_force_linear.cc +++ b/tests/dem/particle_particle_contact_force_linear.cc @@ -141,8 +141,8 @@ test() force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; // Calling broad search for (auto particle_iterator = particle_handler.begin(); diff --git a/tests/dem/particle_particle_contact_force_nonlinear.cc b/tests/dem/particle_particle_contact_force_nonlinear.cc index 17aa7322ab..516ea6bf6a 100644 --- a/tests/dem/particle_particle_contact_force_nonlinear.cc +++ b/tests/dem/particle_particle_contact_force_nonlinear.cc @@ -140,8 +140,8 @@ test() force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; // Calling broad search for (auto particle_iterator = particle_handler.begin(); diff --git a/tests/dem/particle_particle_contact_on_two_processors.cc b/tests/dem/particle_particle_contact_on_two_processors.cc index 33b34c08d3..71a2a02c65 100644 --- a/tests/dem/particle_particle_contact_on_two_processors.cc +++ b/tests/dem/particle_particle_contact_on_two_processors.cc @@ -192,8 +192,8 @@ test() force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; for (unsigned int iteration = 0; iteration < step_end; ++iteration) { diff --git a/tests/dem/particle_point_contact.cc b/tests/dem/particle_point_contact.cc index 82dd99a057..c710aa013b 100644 --- a/tests/dem/particle_point_contact.cc +++ b/tests/dem/particle_point_contact.cc @@ -143,8 +143,8 @@ test() force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; double time = 0.0; diff --git a/tests/dem/particle_wall_contact_force_linear.cc b/tests/dem/particle_wall_contact_force_linear.cc index da3603d9e3..8c295dc0f5 100644 --- a/tests/dem/particle_wall_contact_force_linear.cc +++ b/tests/dem/particle_wall_contact_force_linear.cc @@ -135,8 +135,8 @@ test() force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; // Finding boundary cells BoundaryCellsInformation boundary_cells_object; diff --git a/tests/dem/particle_wall_contact_force_nonlinear.cc b/tests/dem/particle_wall_contact_force_nonlinear.cc index 02dad5b8f7..075c1bada3 100644 --- a/tests/dem/particle_wall_contact_force_nonlinear.cc +++ b/tests/dem/particle_wall_contact_force_nonlinear.cc @@ -136,8 +136,8 @@ test() force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; // Finding boundary cells BoundaryCellsInformation boundary_cells_object; diff --git a/tests/dem/post_collision_velocity.cc b/tests/dem/post_collision_velocity.cc index 023e7057ef..556b26f291 100644 --- a/tests/dem/post_collision_velocity.cc +++ b/tests/dem/post_collision_velocity.cc @@ -140,8 +140,8 @@ test(double coefficient_of_restitution) force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; // Finding boundary cells BoundaryCellsInformation boundary_cells_object; diff --git a/tests/dem/two_particles_multiple_contacts_parallel.cc b/tests/dem/two_particles_multiple_contacts_parallel.cc index 1ab442137a..4e12825eae 100644 --- a/tests/dem/two_particles_multiple_contacts_parallel.cc +++ b/tests/dem/two_particles_multiple_contacts_parallel.cc @@ -166,8 +166,8 @@ test() force.resize(particle_handler.get_max_local_particle_index()); torque.resize(force.size()); MOI.resize(force.size()); - for (unsigned i = 0; i < MOI.size(); ++i) - MOI[i] = 1; + for (auto &moi_val : MOI) + moi_val = 1; double step_force;