Skip to content

Commit

Permalink
Move all contact info struct in one file
Browse files Browse the repository at this point in the history
  • Loading branch information
acdaigneault committed Aug 8, 2024
1 parent 6371927 commit a4ef38f
Show file tree
Hide file tree
Showing 33 changed files with 77 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,29 @@
* ---------------------------------------------------------------------
*/

#ifndef lethe_particle_wall_contact_info_h
#define lethe_particle_wall_contact_info_h
#ifndef lethe_contact_info_h
#define lethe_contact_info_h

#include <deal.II/base/point.h>
#include <deal.II/base/tensor.h>

#include <deal.II/particles/particle_iterator.h>

using namespace dealii;

/**
* @brief This struct handles the information related to the calculation of the
* particle-wall contact force
* @brief Handle the information related to the calculation of the
* particle-particle contact force. Notably it is responsible for storing
* information that has to be preserved over multiple iterations of a contact,
* namely everything related to tangential overlaps
*/

using namespace dealii;
template <int dim>
struct particle_particle_contact_info
{
Particles::ParticleIterator<dim> particle_one;
Particles::ParticleIterator<dim> particle_two;
Tensor<1, 3> tangential_overlap;
};

template <int dim>
class particle_wall_contact_info
Expand All @@ -39,13 +48,16 @@ class particle_wall_contact_info
* boundary id. This is the commonly used constructor since it houses all the
* information required to perform the contact calculation.
*
* @param particle The iterator to the particle in contact with the wall
* @param normal_vector The outward pointing normal vector on the wall
* @param point_on_boundary A point that lies on the face
* @param boundary_id The boundary id. This id corresponds to the number attributed to the boundary condition.
* @param particle The iterator to the particle in contact with the wall.
* @param normal_vector The outward pointing normal vector on the wall.
* @param point_on_boundary A point that lies on the face.
* @param boundary_id The boundary id. This id corresponds to the number
* attributed to the boundary condition.
*
* TODO: This should be a struct and normal_overlap, normal_relative_velocity
* and tangential_relative_velocity should be removed and be calculated on the
* fly as done for pp forces with particle_particle_contact_info
*/

particle_wall_contact_info(const Particles::ParticleIterator<dim> &particle,
const Tensor<1, 3> &normal_vector,
const Point<3> &point_on_boundary,
Expand Down Expand Up @@ -89,4 +101,27 @@ class particle_wall_contact_info
Tensor<1, 3> tangential_relative_velocity;
};

/**
* @brief Handle information related to the calculation of the particle-line
* contact forces.
*/
template <int dim>
struct particle_line_contact_info
{
Particles::ParticleIterator<dim> particle;
Point<3> point_one;
Point<3> point_two;
};

/**
* @brief Handle information related to the calculation of the particle-point
* contact forces.
*/
template <int dim>
struct particle_point_contact_info
{
Particles::ParticleIterator<dim> particle;
Point<3> point;
};

#endif
4 changes: 1 addition & 3 deletions include/dem/data_containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#define lethe_data_containers_h

#include <dem/boundary_cells_info_struct.h>
#include <dem/particle_particle_contact_info.h>
#include <dem/particle_point_line_contact_info.h>
#include <dem/particle_wall_contact_info.h>
#include <dem/contact_info.h>

#include <deal.II/base/tensor.h>

Expand Down
1 change: 0 additions & 1 deletion include/dem/force_chains_visualization.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <dem/dem_contact_manager.h>
#include <dem/dem_solver_parameters.h>
#include <dem/particle_particle_contact_force.h>
#include <dem/particle_particle_contact_info.h>
#include <dem/rolling_resistance_torque_models.h>

#include <deal.II/particles/particle_handler.h>
Expand Down
2 changes: 1 addition & 1 deletion include/dem/grid_motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#ifndef lethe_grid_motion_h
#define lethe_grid_motion_h

#include <dem/contact_info.h>
#include <dem/data_containers.h>
#include <dem/dem_solver_parameters.h>
#include <dem/particle_wall_contact_info.h>

#include <deal.II/distributed/tria.h>

Expand Down
2 changes: 1 addition & 1 deletion include/dem/particle_particle_broad_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
#define lethe_particle_particle_broad_search_h

#include <dem/adaptive_sparse_contacts.h>
#include <dem/contact_info.h>
#include <dem/data_containers.h>
#include <dem/find_boundary_cells_information.h>
#include <dem/particle_particle_contact_info.h>

#include <deal.II/distributed/tria.h>

Expand Down
2 changes: 1 addition & 1 deletion include/dem/particle_particle_contact_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <core/auxiliary_math_functions.h>
#include <core/dem_properties.h>

#include <dem/contact_info.h>
#include <dem/data_containers.h>
#include <dem/dem_contact_manager.h>
#include <dem/dem_solver_parameters.h>
#include <dem/particle_particle_contact_info.h>
#include <dem/rolling_resistance_torque_models.h>

#include <deal.II/particles/particle_handler.h>
Expand Down
40 changes: 0 additions & 40 deletions include/dem/particle_particle_contact_info.h

This file was deleted.

7 changes: 0 additions & 7 deletions include/dem/particle_particle_fine_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,10 @@
#ifndef lethe_particle_particle_fine_search_h
#define lethe_particle_particle_fine_search_h

#include <core/dem_properties.h>

#include <dem/data_containers.h>
#include <dem/particle_particle_contact_info.h>

#include <deal.II/base/tensor.h>

#include <deal.II/particles/particle.h>
#include <deal.II/particles/particle_handler.h>

#include <boost/range/adaptor/map.hpp>

template <int dim>
class DEMContactManager;
Expand Down
1 change: 1 addition & 0 deletions include/dem/particle_point_line_broad_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define lethe_particle_point_line_broad_search_h

#include <dem/adaptive_sparse_contacts.h>
#include <dem/contact_info.h>
#include <dem/data_containers.h>

#include <deal.II/distributed/tria.h>
Expand Down
2 changes: 1 addition & 1 deletion include/dem/particle_point_line_contact_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

#include <core/dem_properties.h>

#include <dem/contact_info.h>
#include <dem/data_containers.h>
#include <dem/dem_solver_parameters.h>
#include <dem/particle_point_line_contact_info.h>

#include <iostream>
#include <vector>
Expand Down
49 changes: 0 additions & 49 deletions include/dem/particle_point_line_contact_info.h

This file was deleted.

8 changes: 0 additions & 8 deletions include/dem/particle_point_line_fine_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,7 @@
#ifndef lethe_particle_point_line_fine_search_h
#define lethe_particle_point_line_fine_search_h

#include <core/dem_properties.h>

#include <dem/data_containers.h>
#include <dem/particle_point_line_contact_info.h>

#include <deal.II/particles/particle_handler.h>

#include <iostream>
#include <vector>

using namespace dealii;

Expand Down
1 change: 1 addition & 0 deletions include/dem/particle_wall_broad_search.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <dem/adaptive_sparse_contacts.h>
#include <dem/boundary_cells_info_struct.h>
#include <dem/contact_info.h>
#include <dem/data_containers.h>
#include <dem/dem_solver_parameters.h>

Expand Down
2 changes: 1 addition & 1 deletion include/dem/particle_wall_contact_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#include <core/dem_properties.h>
#include <core/serial_solid.h>

#include <dem/contact_info.h>
#include <dem/data_containers.h>
#include <dem/dem_solver_parameters.h>
#include <dem/particle_wall_contact_info.h>

#include <boost/math/special_functions.hpp>
#include <boost/range/adaptor/map.hpp>
Expand Down
1 change: 0 additions & 1 deletion include/dem/particle_wall_dmt_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <core/dem_properties.h>

#include <dem/dem_solver_parameters.h>
#include <dem/particle_wall_contact_info.h>
#include <dem/particle_wall_nonlinear_force.h>

#include <deal.II/particles/particle.h>
Expand Down
1 change: 0 additions & 1 deletion include/dem/particle_wall_jkr_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <dem/dem_solver_parameters.h>
#include <dem/particle_wall_contact_force.h>
#include <dem/particle_wall_contact_info.h>

#include <deal.II/particles/particle.h>

Expand Down
1 change: 0 additions & 1 deletion include/dem/particle_wall_linear_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <dem/dem_solver_parameters.h>
#include <dem/particle_wall_contact_force.h>
#include <dem/particle_wall_contact_info.h>

#include <deal.II/particles/particle.h>

Expand Down
1 change: 0 additions & 1 deletion include/dem/particle_wall_nonlinear_force.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <dem/dem_solver_parameters.h>
#include <dem/particle_wall_contact_force.h>
#include <dem/particle_wall_contact_info.h>

#include <deal.II/particles/particle.h>

Expand Down
3 changes: 1 addition & 2 deletions include/dem/update_fine_search_candidates.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@

#include <dem/contact_type.h>
#include <dem/data_containers.h>
#include <dem/particle_particle_contact_info.h>
#include <dem/particle_wall_contact_info.h>


/**
* @brief Manage removing repetitions and adding new contact pairs to the
Expand Down
2 changes: 1 addition & 1 deletion include/dem/update_local_particle_containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
#ifndef lethe_update_local_particle_containers_h
#define lethe_update_local_particle_containers_h

#include <dem/contact_info.h>
#include <dem/contact_type.h>
#include <dem/data_containers.h>
#include <dem/particle_point_line_contact_info.h>

#include <deal.II/particles/particle_handler.h>

Expand Down
8 changes: 3 additions & 5 deletions include/fem-dem/ib_particles_dem.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@
*
*/

#ifndef lethe_ib_particles_dem_h
#define lethe_ib_particles_dem_h

#include <core/ib_particle.h>
#include <core/ib_stencil.h>
#include <core/lethe_grid_tools.h>

#include <dem/particle_particle_contact_force.h>
#include <dem/particle_particle_contact_info.h>
#include <dem/particle_wall_contact_force.h>
#include <dem/particle_wall_contact_info.h>

#include <deal.II/base/tensor.h>

#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_tools.h>

#ifndef lethe_ib_particles_dem_h
# define lethe_ib_particles_dem_h

using namespace dealii;

/**
Expand Down
Loading

0 comments on commit a4ef38f

Please sign in to comment.