Skip to content

Commit

Permalink
Remove DEM warnings (#1267)
Browse files Browse the repository at this point in the history
Description
In my endless aim for no clang tidy warnings, this PR cleans the warning for the DEM part of the library. There should not be any changes to the tests (there are no changes)
  • Loading branch information
blaisb authored Aug 28, 2024
1 parent 55d3bbc commit 08fcd76
Show file tree
Hide file tree
Showing 28 changed files with 52 additions and 56 deletions.
4 changes: 2 additions & 2 deletions include/dem/output_force_torque_calculation.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int> boundary_index,
const std::vector<unsigned int> &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
Expand Down
4 changes: 2 additions & 2 deletions include/dem/particle_wall_dmt_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class ParticleWallDMTForce : public ParticleWallNonLinearForce<dim>

public:
ParticleWallDMTForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index = {});
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index = {});

/**
* @brief Carries out the calculation of the particle-wall contact force using
Expand Down
4 changes: 2 additions & 2 deletions include/dem/particle_wall_jkr_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class ParticleWallJKRForce : public ParticleWallContactForce<dim>

public:
ParticleWallJKRForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index = {});
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index = {});

/**
* @brief Carries out the calculation of the particle-wall contact force using
Expand Down
4 changes: 2 additions & 2 deletions include/dem/particle_wall_linear_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class ParticleWallLinearForce : public ParticleWallContactForce<dim>

public:
ParticleWallLinearForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index = {});
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index = {});

/**
* @brief Calculate the particle-wall contact force using
Expand Down
4 changes: 2 additions & 2 deletions include/dem/particle_wall_nonlinear_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class ParticleWallNonLinearForce : public ParticleWallContactForce<dim>

public:
ParticleWallNonLinearForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index = {});
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index = {});

/**
* @brief Calculate the particle-wall contact force using
Expand Down
6 changes: 3 additions & 3 deletions source/dem/dem_contact_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ DEMContactManager<dim>::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<dim>(triangulation,
Expand Down Expand Up @@ -228,7 +228,7 @@ DEMContactManager<dim>::execute_particle_particle_broad_search(
dealii::Particles::ParticleHandler<dim> &particle_handler,
const AdaptiveSparseContacts<dim> &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
Expand Down Expand Up @@ -267,7 +267,7 @@ DEMContactManager<dim>::execute_particle_wall_broad_search(
const double simulation_time,
const AdaptiveSparseContacts<dim> &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())
{
Expand Down
2 changes: 1 addition & 1 deletion source/dem/explicit_euler_integrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ExplicitEulerIntegrator<dim>::integrate(
const parallel::distributed::Triangulation<dim> & /* triangulation */,
AdaptiveSparseContacts<dim> & /* 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() ||
Expand Down
3 changes: 1 addition & 2 deletions source/dem/find_boundary_cells_information.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ using namespace dealii;

// The constructor of this class is empty
template <int dim>
BoundaryCellsInformation<dim>::BoundaryCellsInformation()
{}
BoundaryCellsInformation<dim>::BoundaryCellsInformation() = default;

template <int dim>
void
Expand Down
4 changes: 2 additions & 2 deletions source/dem/find_contact_detection_step.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -82,7 +82,7 @@ find_floating_mesh_mapping_step(
std::vector<std::shared_ptr<SerialSolid<dim - 1, dim>>> 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())
Expand Down
6 changes: 3 additions & 3 deletions source/dem/force_chains_visualization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ ParticlesForceChains<dim, contact_model, rolling_friction_model>::
{
/*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 <
Expand Down
2 changes: 1 addition & 1 deletion source/dem/grid_motion.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ GridMotion<dim, spacedim>::GridMotion(
const Parameters::Lagrangian::GridMotion<spacedim> &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)
{
Expand Down
4 changes: 2 additions & 2 deletions source/dem/output_force_torque_calculation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int> boundary_index,
const std::vector<unsigned int> &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)
Expand Down
3 changes: 1 addition & 2 deletions source/dem/particle_point_line_contact_force.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ using namespace dealii;

// Constructor
template <int dim>
ParticlePointLineForce<dim>::ParticlePointLineForce()
{}
ParticlePointLineForce<dim>::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
Expand Down
4 changes: 2 additions & 2 deletions source/dem/particle_wall_dmt_force.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ using namespace dealii;

template <int dim>
ParticleWallDMTForce<dim>::ParticleWallDMTForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index)
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index)
: ParticleWallNonLinearForce<dim>(dem_parameters)
, dmt_cut_off_threshold(dem_parameters.model_parameters.dmt_cut_off_threshold)
{
Expand Down
4 changes: 2 additions & 2 deletions source/dem/particle_wall_jkr_force.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ using namespace dealii;

template <int dim>
ParticleWallJKRForce<dim>::ParticleWallJKRForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index)
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index)
: ParticleWallContactForce<dim>(dem_parameters)
{
const double wall_youngs_modulus =
Expand Down
4 changes: 2 additions & 2 deletions source/dem/particle_wall_linear_force.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ using namespace dealii;

template <int dim>
ParticleWallLinearForce<dim>::ParticleWallLinearForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index)
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index)
: ParticleWallContactForce<dim>(dem_parameters)
{
const double wall_youngs_modulus =
Expand Down
4 changes: 2 additions & 2 deletions source/dem/particle_wall_nonlinear_force.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ using namespace dealii;

template <int dim>
ParticleWallNonLinearForce<dim>::ParticleWallNonLinearForce(
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> boundary_index)
const DEMSolverParameters<dim> &dem_parameters,
const std::vector<types::boundary_id> &boundary_index)
: ParticleWallContactForce<dim>(dem_parameters)
{
const double wall_youngs_modulus =
Expand Down
2 changes: 1 addition & 1 deletion source/dem/update_local_particle_containers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion source/dem/velocity_verlet_integrator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ VelocityVerletIntegrator<dim>::integrate(
const parallel::distributed::Triangulation<dim> &triangulation,
AdaptiveSparseContacts<dim> &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() ||
Expand Down
6 changes: 2 additions & 4 deletions source/dem/visualization.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
using namespace dealii;

template <int dim>
Visualization<dim>::Visualization()
{}
Visualization<dim>::Visualization() = default;

template <int dim>
void
Expand Down Expand Up @@ -210,8 +209,7 @@ Visualization<dim>::get_nonscalar_data_ranges() const
}

template <int dim>
Visualization<dim>::~Visualization()
{}
Visualization<dim>::~Visualization() = default;

template class Visualization<2>;
template class Visualization<3>;
4 changes: 2 additions & 2 deletions tests/dem/particle_particle_contact_force_linear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/dem/particle_particle_contact_force_nonlinear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions tests/dem/particle_particle_contact_on_two_processors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions tests/dem/particle_point_contact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions tests/dem/particle_wall_contact_force_linear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<dim> boundary_cells_object;
Expand Down
4 changes: 2 additions & 2 deletions tests/dem/particle_wall_contact_force_nonlinear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<dim> boundary_cells_object;
Expand Down
4 changes: 2 additions & 2 deletions tests/dem/post_collision_velocity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<dim> boundary_cells_object;
Expand Down
4 changes: 2 additions & 2 deletions tests/dem/two_particles_multiple_contacts_parallel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 08fcd76

Please sign in to comment.