diff --git a/applications/lethe-particles/dem.cc b/applications/lethe-particles/dem.cc index 32cab5707a..4d63f29b4e 100644 --- a/applications/lethe-particles/dem.cc +++ b/applications/lethe-particles/dem.cc @@ -32,7 +32,8 @@ main(int argc, char *argv[]) // Parsing of the file prm.parse_input(argv[1]); dem_parameters.parse(prm); - const DEM::SolverType solver_type = dem_parameters.model_parameters.solver_type; + const DEM::SolverType solver_type = + dem_parameters.model_parameters.solver_type; if (solver_type == DEM::SolverType::dem) { @@ -41,7 +42,13 @@ main(int argc, char *argv[]) } else { - return 1; + AssertThrow( + false, + dealii::ExcMessage( + "While reading the solver type from the input file, " + "Lethe found a value different than \"dem\". As of January 2025, " + "the lethe-particles application requires the uses of " + "\"solver type = dem\", which is the default value.")); } } @@ -54,8 +61,9 @@ main(int argc, char *argv[]) // Parsing of the file prm.parse_input(argv[1]); dem_parameters.parse(prm); - const DEM::SolverType solver_type = dem_parameters.model_parameters.solver_type; - + // const DEM::SolverType solver_type = + // dem_parameters.model_parameters.solver_type; + const DEM::SolverType solver_type = DEM::SolverType::dem; if (solver_type == DEM::SolverType::dem) { DEMSolver<3, DEM::SolverType::dem> problem(dem_parameters); @@ -63,7 +71,13 @@ main(int argc, char *argv[]) } else { - return 1; + AssertThrow( + false, + dealii::ExcMessage( + "While reading the solver type from the input file, " + "Lethe found a value different than \"dem\". As of January 2025, " + "the lethe-particles application requires the uses of " + "\"solver type = dem\", which is the default value.")); } } diff --git a/include/core/dem_properties.h b/include/core/dem_properties.h index 5408e5ffb4..3cf52e03b5 100644 --- a/include/core/dem_properties.h +++ b/include/core/dem_properties.h @@ -9,11 +9,12 @@ namespace DEM { - /* The SolverType enum identifies which type of solver is using the DEM particles. - * This is used to identify which index corresponds to which properties. Two type of - * solvers are currently supported. DEM implies pure DEM simulation whereas cfd_dem - * is used to indicate simulations in which the particles are coupled to CFD. In the latter case - * the particles carry additional properties related to the particle-fluid coupling. + /* The SolverType enum identifies which type of solver is used by the DEM + * particles. This is used to identify which index corresponds to which + * properties. Two type of solvers are currently supported. DEM implies pure + * DEM simulation whereas cfd_dem is used to indicate simulations in which the + * particles are coupled to CFD. In the latter case the particles carry + * additional properties related to the particle-fluid coupling. */ enum SolverType { @@ -42,7 +43,7 @@ namespace DEM mass = 8, n_properties = 9, - }; + } }; // Specialization for `cfd_dem` @@ -67,7 +68,7 @@ namespace DEM mass = 14, volumetric_contribution = 15, n_properties = 16, - }; + } }; /// Template specialization to select the adequate PropertiesIndex @@ -86,18 +87,33 @@ namespace DEM using Index = CFDDEMsolver::PropertiesIndexCFDDEM; }; + // This typename helps for code readability template using PropertiesIndex = typename PropertiesIndexEnum::Index; - + /** + * @brief Return the number of properties stored on each particle. + * @tparam solve_type Type of solver used for the DEM. + * @return Number of DEM properties. + */ template unsigned int get_number_properties(); + /** + * @brief Controls the name of output variables for the vtu. + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + */ template class DEMProperties { public: + /** + * @brief Return the names of each DEM property. Used to properly generate + * output files. + * @return A vector with the names of each property. + */ static std::vector> get_properties_name(); }; diff --git a/include/core/lethe_grid_tools.h b/include/core/lethe_grid_tools.h index 1ebf6167da..285c80637e 100644 --- a/include/core/lethe_grid_tools.h +++ b/include/core/lethe_grid_tools.h @@ -272,16 +272,19 @@ namespace LetheGridTools * Variables name are taken straight from this reference to ensure a better * readability. * - * @return A tuple in which 0. a vector of bools to determine if the particle is - * close to the triangle plane, 1. a vector of projected location of particles - * on the triangle, 2. a vector of normal vectors of the triangles + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. * * @param triangle A vector of points that defines a triangle * @param particles A particle_iterator_range that refers to all the particles * located in the background (base) cell * @param n_particles_in_base_cell Number of particles in the base cell * + * * @return A tuple in which 0. a vector of bools to determine if the particle is + * close to the triangle plane, 1. a vector of projected location of particles + * on the triangle, 2. a vector of normal vectors of the triangles */ + template std:: tuple, std::vector>, std::vector>> diff --git a/include/dem/adaptive_sparse_contacts.h b/include/dem/adaptive_sparse_contacts.h index 5873c9fc33..0ff0501b0d 100644 --- a/include/dem/adaptive_sparse_contacts.h +++ b/include/dem/adaptive_sparse_contacts.h @@ -98,7 +98,8 @@ template class LinearAlgebra::distributed::Vector; * flagged as active cells. It works with the assignment and verification of the * mobility status at nodes to check the status of the neighboring cells. * - * @tparam dim Spatial dimension + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class AdaptiveSparseContacts diff --git a/include/dem/dem.h b/include/dem/dem.h index b828f12436..2d06d48566 100644 --- a/include/dem/dem.h +++ b/include/dem/dem.h @@ -47,6 +47,8 @@ using namespace DEM; /** * @brief Solver using the soft-sphere model of the discrete element method * (DEM) to simulate granular systems. + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class DEMSolver @@ -269,6 +271,8 @@ class DEMSolver /** * @brief The properties of the DEM simulation. + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ DEM::DEMProperties properties_class; diff --git a/include/dem/dem_contact_manager.h b/include/dem/dem_contact_manager.h index 49f46db2f6..aff0139eb5 100644 --- a/include/dem/dem_contact_manager.h +++ b/include/dem/dem_contact_manager.h @@ -29,6 +29,9 @@ using namespace DEM; * * This class mostly calls proper functions in regards the type of contacts for * the contact detection and updates of data containers. + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class DEMContactManager diff --git a/include/dem/dem_post_processing.h b/include/dem/dem_post_processing.h index cb56b7f89c..30afbad8e5 100644 --- a/include/dem/dem_post_processing.h +++ b/include/dem/dem_post_processing.h @@ -32,7 +32,8 @@ namespace DEM * - Translational velocity * - Rotational (angular) velocity * - * @tparam dim Dimensionality of the problem (2D or 3D) + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. * @tparam dem_statistics_variable Enum variable used to identify which * granular statistics is being calculated * diff --git a/include/dem/explicit_euler_integrator.h b/include/dem/explicit_euler_integrator.h index b0667a40c4..a0d39ef501 100644 --- a/include/dem/explicit_euler_integrator.h +++ b/include/dem/explicit_euler_integrator.h @@ -16,6 +16,8 @@ using namespace dealii; * also integrated into integration class * * @note Euler is a first-order integration scheme. Calculation proceudre: + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. * * x(n+1) = x(n) + v(n) * dt * v(n+1) = v(n) + a(n) * dt diff --git a/include/dem/find_contact_detection_step.h b/include/dem/find_contact_detection_step.h index 432f418da6..478f08a860 100644 --- a/include/dem/find_contact_detection_step.h +++ b/include/dem/find_contact_detection_step.h @@ -15,7 +15,9 @@ using namespace dealii; /** * @brief Find steps for dynamic contact search for particle-particle contacts. - * + + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. * @param particle_handler * @param dt DEM time step * @param smallest_contact_search_criterion A criterion for finding diff --git a/include/dem/force_chains_visualization.h b/include/dem/force_chains_visualization.h index 2e57b96b1d..2cbc5b28fb 100644 --- a/include/dem/force_chains_visualization.h +++ b/include/dem/force_chains_visualization.h @@ -25,12 +25,14 @@ using namespace dealii; using namespace DEM; /** - * Base class for the particles force chains contact force models. + * @brief Base class for the particles force chains contact force models. * This class does not implement any of the models, but ensures that * an interface without template specialization is available. All of the * actual implementation of the models are carried out in the * ParticlesForceChains class which is templated by the contact model * type. + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class ParticlesForceChainsBase diff --git a/include/dem/integrator.h b/include/dem/integrator.h index 9708f93a0a..b97263b5d7 100644 --- a/include/dem/integrator.h +++ b/include/dem/integrator.h @@ -16,6 +16,8 @@ using namespace dealii; /** * @brief Base interface for classes that carry out the integration of the velocity and * position of particles with inertia + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class Integrator diff --git a/include/dem/lagrangian_post_processing.h b/include/dem/lagrangian_post_processing.h index 2188e69fd4..b6ff2467be 100644 --- a/include/dem/lagrangian_post_processing.h +++ b/include/dem/lagrangian_post_processing.h @@ -31,6 +31,9 @@ using namespace dealii; /** * @brief Carries out writing the cell data of the domain. * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * * @param triangulation Triangulation of the domain. * @param grid_pvdhandler PVD handler for grid. * @param background_dh Background DoF handler. diff --git a/include/dem/load_balancing.h b/include/dem/load_balancing.h index b1c5f42215..62d3216f86 100644 --- a/include/dem/load_balancing.h +++ b/include/dem/load_balancing.h @@ -20,6 +20,9 @@ using namespace dealii; * @brief Manages the load balancing (repartitioning), of the domain according * to the computational load of the cells and the particles. * It is used by the DEM and the coupling CFD-DEM solvers. + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class LagrangianLoadBalancing diff --git a/include/dem/particle_particle_broad_search.h b/include/dem/particle_particle_broad_search.h index 87d4c7176d..f9855aa9ec 100644 --- a/include/dem/particle_particle_broad_search.h +++ b/include/dem/particle_particle_broad_search.h @@ -57,6 +57,9 @@ find_particle_particle_contact_pairs( * This version of the function is used when adaptive sparse contacts is * enabled. * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * * @param particle_handler The particle handler of particles in the broad * search * @param[in] cells_local_neighbor_list A vector (with size equal to the number diff --git a/include/dem/particle_particle_contact_force.h b/include/dem/particle_particle_contact_force.h index 59088d97eb..fff73f4d2a 100644 --- a/include/dem/particle_particle_contact_force.h +++ b/include/dem/particle_particle_contact_force.h @@ -29,6 +29,8 @@ using namespace dealii; * actual implementation of the models are carried out in the * ParticleParticleContactForce class which is templated by the contact model * type. + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class ParticleParticleContactForceBase diff --git a/include/dem/particle_point_line_broad_search.h b/include/dem/particle_point_line_broad_search.h index 95c5cb97b7..c8cfe68fbd 100644 --- a/include/dem/particle_point_line_broad_search.h +++ b/include/dem/particle_point_line_broad_search.h @@ -44,6 +44,9 @@ find_particle_point_contact_pairs( * collision pairs will be investigated in the fine search to check if they * are in contact or not. * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * * @param particle_handler Particle handler of particles located in boundary * cells. * @param boundary_cells_with_points A container of cells which are located at diff --git a/include/dem/particle_point_line_contact_force.h b/include/dem/particle_point_line_contact_force.h index ce7b9c2e06..208a682aad 100644 --- a/include/dem/particle_point_line_contact_force.h +++ b/include/dem/particle_point_line_contact_force.h @@ -21,6 +21,9 @@ using namespace dealii; * of particles and walls. Since the inputs and the calculation method of * particle-point and particle-line contact forces are similar, we only used one * function for both tasks. + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class ParticlePointLineForce diff --git a/include/dem/particle_point_line_fine_search.h b/include/dem/particle_point_line_fine_search.h index 579c139f63..abf9c037d7 100644 --- a/include/dem/particle_point_line_fine_search.h +++ b/include/dem/particle_point_line_fine_search.h @@ -14,6 +14,9 @@ using namespace dealii; * contact, the normal overlap, normal vector of contact and contact normal * relative velocity are stored in a map which is the output of this function. * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * * @param particle_point_contact_candidates The output of particle-point broad * search which shows contact pair candidates. * @param neighborhood_threshold A value which defines the neighbor particles. diff --git a/include/dem/particle_wall_broad_search.h b/include/dem/particle_wall_broad_search.h index df81831ba4..dbee2fbefb 100644 --- a/include/dem/particle_wall_broad_search.h +++ b/include/dem/particle_wall_broad_search.h @@ -45,6 +45,25 @@ find_particle_wall_contact_pairs( typename DEM::dem_data_structures::particle_wall_candidates &particle_wall_contact_candidates); +/** + * @brief Finds unordered map of tuples (tuple of particle located in + * boundary cells, normal vector of the boundary face, a + * point on the face and the corresponding boundary cell) which shows the + * candidate particle-wall collision pairs. These collision candidates will be + * investigated in the fine search to check if they are in contact or not. + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * + * @param boundary_cells_information Information of the boundary cells and + * faces. This is the output of the FindBoundaryCellsInformation class. + * @param particle_handler Particle handler of particles located in boundary + * cells. + * @param particle_wall_contact_candidates A two-layered unordered map of tuples. Each + * tuple contains a particle located near boundaries, the normal vector of + * the corresponding face boundary, a point on the boundary and the boundary + * cell. The contact pair is used in the fine search. + */ template void find_particle_wall_contact_pairs( @@ -85,6 +104,26 @@ find_particle_floating_wall_contact_pairs( typename DEM::dem_data_structures::particle_floating_wall_candidates &particle_floating_wall_candidates); +/** + * @brief Find a two-layered unordered map of particle iterators which shows the + * candidate particle-floating wall collision candidates. These collision + * pairs will be investigated in the fine search to check if they are in + * contact or not + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * + * @param boundary_cells_for_floating_walls Boundary cells located adjacent to + * floating walls + * @param particle_handler Particle handler of particles located in boundary + * cells + * @param floating_wall_properties Properties of the floating walls specified + * in the parameter handler file + * @param simulation_time Simulation time + * @param particle_floating_wall_candidates Output of particle-floating wall + * broad search which contains all the particle-floating wall collision + * candidates + */ template void find_particle_floating_wall_contact_pairs( @@ -127,6 +166,27 @@ particle_solid_surfaces_contact_search( typename DEM::dem_data_structures::cells_total_neighbor_list &cells_total_neighbor_list); + +/** + * @brief Find a two-layered unordered map + * (particle_floating_mesh_contact_candidates) of particle iterators that + * shows the candidate particle-floating mesh collision candidates. These + * collision pairs will be investigated in the fine search to check if they + * are in contact or not + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * + * @param solid_surfaces_mesh_information Information of the solid surfaces mapped + * in the background triangulation. + * @param particle_handler + * @param particle_floating_mesh_contact_candidates Particle-floating mesh contact + * candidates + * @param cells_total_neighbor_list A container in which all the neighbor cells + * of the local cells are stored + * @param sparse_contacts_object The object that contains the + * information about the mobility status of cells + */ template void particle_solid_surfaces_contact_search( diff --git a/include/dem/particle_wall_contact_force.h b/include/dem/particle_wall_contact_force.h index a68c0e6fdb..17dda12cca 100644 --- a/include/dem/particle_wall_contact_force.h +++ b/include/dem/particle_wall_contact_force.h @@ -23,6 +23,9 @@ using namespace dealii; /** * @brief Base interface for classes that carry out the calculation of * particle-wall contact force. + + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template diff --git a/include/dem/particle_wall_dmt_force.h b/include/dem/particle_wall_dmt_force.h index 07460e4949..8762705d43 100644 --- a/include/dem/particle_wall_dmt_force.h +++ b/include/dem/particle_wall_dmt_force.h @@ -21,6 +21,9 @@ using namespace dealii; * @brief Calculation of the DMT particle-wall contact force using the * information obtained from the fine search and physical properties of * particles and walls + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class ParticleWallDMTForce : public ParticleWallNonLinearForce diff --git a/include/dem/particle_wall_jkr_force.h b/include/dem/particle_wall_jkr_force.h index 49e8138d90..982587e13d 100644 --- a/include/dem/particle_wall_jkr_force.h +++ b/include/dem/particle_wall_jkr_force.h @@ -21,6 +21,9 @@ using namespace dealii; * @brief Calculation of the JKR particle-wall contact force using the * information obtained from the fine search and physical properties of * particles and walls + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class ParticleWallJKRForce : public ParticleWallContactForce diff --git a/include/dem/particle_wall_linear_force.h b/include/dem/particle_wall_linear_force.h index 7bde9e2a4a..ae324f1903 100644 --- a/include/dem/particle_wall_linear_force.h +++ b/include/dem/particle_wall_linear_force.h @@ -22,6 +22,8 @@ using namespace dealii; * information obtained from the fine search and physical properties of * particles and walls * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. */ template class ParticleWallLinearForce diff --git a/include/dem/particle_wall_nonlinear_force.h b/include/dem/particle_wall_nonlinear_force.h index 973c7ccbe1..c94f455563 100644 --- a/include/dem/particle_wall_nonlinear_force.h +++ b/include/dem/particle_wall_nonlinear_force.h @@ -21,6 +21,9 @@ using namespace dealii; * @brief Calculate the non-linear particle-wall contact force using the * information obtained from the fine search and physical properties of * particles and walls. + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM.* */ template class ParticleWallNonLinearForce diff --git a/include/dem/rolling_resistance_torque_models.h b/include/dem/rolling_resistance_torque_models.h index b001f7c640..b86052f393 100644 --- a/include/dem/rolling_resistance_torque_models.h +++ b/include/dem/rolling_resistance_torque_models.h @@ -38,6 +38,9 @@ no_rolling_resistance_torque( * The model woks as follows: * M_r = - mu_r * R_eff * |F_n| * omega_hat * omega_hat = (omega_i - omega_j) / (|oemaga_i - omega_j|) + * + * @tparam solve_type Type of solver used for the DEM. + * * @param[in] effective_r Effective radius. * @param[in] particle_one_properties Properties of particle one in contact. * @param[in] particle_two_properties Properties of particle two in contact. @@ -85,6 +88,9 @@ constant_rolling_resistance_torque( * M_r = - mu_r * R_eff * |F_n| * |V_omega| * omega_hat * omega_hat = (omega_i - omega_j) / (|oemaga_i - omega_j|) * V_omega = omega_i × (R_i * n_ij) - omega_j × (R_j * n_ji) + * + * @tparam solve_type Type of solver used for the DEM. + * * @param[in] effective_r Effective radius. * @param[in] particle_one_properties Properties of particle one in contact. * @param[in] particle_two_properties Properties of particle two in contact. diff --git a/include/dem/set_particle_particle_contact_force_model.h b/include/dem/set_particle_particle_contact_force_model.h index 2f71dcc26f..416cb40f40 100644 --- a/include/dem/set_particle_particle_contact_force_model.h +++ b/include/dem/set_particle_particle_contact_force_model.h @@ -14,7 +14,8 @@ * spring-dashpot model and the rolling resistance model (and the cohesive * force model if applicable). * - * @tparam dim Space dimension. + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. * * @param[in] dem_parameters DEM parameters. * @@ -29,7 +30,8 @@ set_particle_particle_contact_force_model( * @brief Set the rolling resistance model for the particle-particle contact * force model. * - * @tparam dim Space dimension. + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. * @tparam particle_particle_contact_force_model Particle-particle contact force * model. * @@ -52,6 +54,9 @@ set_rolling_resistance_model( * spring-dashpot model and the rolling resistance model (and the cohesive * force model if applicable) for the force-chain post-processing. * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * * @param dem_parameters DEM parameters. * * @return The pointer to the particle-particle contact force object. diff --git a/include/dem/set_particle_wall_contact_force_model.h b/include/dem/set_particle_wall_contact_force_model.h index c2c415b999..fd2cc1d15c 100644 --- a/include/dem/set_particle_wall_contact_force_model.h +++ b/include/dem/set_particle_wall_contact_force_model.h @@ -16,6 +16,9 @@ * @brief Set the selected particle-wall contact force model in the parameter * handler file. * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * * @param dem_parameters DEM parameters * @param triangulation Triangulation * @return A pointer to the particle-wall contact force object diff --git a/include/dem/velocity_verlet_integrator.h b/include/dem/velocity_verlet_integrator.h index 20e1a12937..34526e24fd 100644 --- a/include/dem/velocity_verlet_integrator.h +++ b/include/dem/velocity_verlet_integrator.h @@ -29,6 +29,10 @@ using namespace dealii; * Updating acceleration and velocity of particle * a(n+1) = F(n+1) / m * v(n+1) = v(n+1/2) + 1/2 * a(n+1) * dt + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * */ template class VelocityVerletIntegrator : public Integrator diff --git a/include/dem/visualization.h b/include/dem/visualization.h index 393fa924c2..8aa0fb9525 100644 --- a/include/dem/visualization.h +++ b/include/dem/visualization.h @@ -21,6 +21,10 @@ using namespace dealii; /** * @brief Building patches of particle properties for visualization. * This function is taken from Aspect and dealii and implemented here. + * + * @tparam dim An integer that denotes the number of spatial dimensions. + * @tparam solve_type Type of solver used for the DEM. + * */ template class Visualization : public dealii::DataOutInterface<0, dim> diff --git a/source/core/parameters_lagrangian.cc b/source/core/parameters_lagrangian.cc index c8ca067496..8bd049715e 100644 --- a/source/core/parameters_lagrangian.cc +++ b/source/core/parameters_lagrangian.cc @@ -931,10 +931,9 @@ namespace Parameters else if (solver_type_str == "cfd_dem") solver_type = DEM::SolverType::cfd_dem; else - { - throw(std::runtime_error("Invalid solver type")); - } - + { + throw(std::runtime_error("Invalid solver type")); + } } prm.leave_subsection(); } diff --git a/tests/dem/find_contact_pairs.cc b/tests/dem/find_contact_pairs.cc index b567c8f32f..aabe10e186 100644 --- a/tests/dem/find_contact_pairs.cc +++ b/tests/dem/find_contact_pairs.cc @@ -45,7 +45,7 @@ test() MappingQ1 mapping; - DEMContactManager contact_manager; + DEMContactManager contact_manager; Particles::ParticleHandler particle_handler(triangulation, mapping); // Finding cell neighbors list, it is required for finding the broad search @@ -89,7 +89,8 @@ test() particle_handler.insert_particle(particle3, pt3_info.first); // Dummy Adaptive sparse contacts object for next call - AdaptiveSparseContacts dummy_adaptive_sparse_contacts; + AdaptiveSparseContacts + dummy_adaptive_sparse_contacts; // Calling broad search function contact_manager.execute_particle_particle_broad_search( diff --git a/tests/dem/integration_euler.cc b/tests/dem/integration_euler.cc index e85f189959..a50acee610 100644 --- a/tests/dem/integration_euler.cc +++ b/tests/dem/integration_euler.cc @@ -67,27 +67,21 @@ test() Particles::ParticleIterator pit = particle_handler.insert_particle(particle1, particle_cell); - pit->get_properties()[DEM::PropertiesIndex::type] = - 1; - pit->get_properties()[DEM::PropertiesIndex::dp] = - 0.005; + pit->get_properties()[DEM::PropertiesIndex::type] = 1; + pit->get_properties()[DEM::PropertiesIndex::dp] = 0.005; // Velocity - pit->get_properties()[DEM::PropertiesIndex::v_x] = + pit->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit->get_properties()[DEM::PropertiesIndex::v_z] = 0; + // Angular velocity + pit->get_properties()[DEM::PropertiesIndex::omega_x] = 0; - pit->get_properties()[DEM::PropertiesIndex::v_y] = + pit->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit->get_properties()[DEM::PropertiesIndex::v_z] = + pit->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - // Angular velocity - pit->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; // mass and moment of inertia - pit->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit->get_properties()[DEM::PropertiesIndex::mass] = 1; std::vector> torque; std::vector> force; diff --git a/tests/dem/integration_schemes_accuracy.cc b/tests/dem/integration_schemes_accuracy.cc index 68c3b48327..d14c96500a 100644 --- a/tests/dem/integration_schemes_accuracy.cc +++ b/tests/dem/integration_schemes_accuracy.cc @@ -83,17 +83,14 @@ test() Particles::ParticleIterator pit0 = particle_handler.insert_particle(particle0, particle0_cell); - pit0->get_properties()[DEM::PropertiesIndex::v_x] = - 0; - pit0->get_properties()[DEM::PropertiesIndex::v_y] = - 0; - pit0->get_properties()[DEM::PropertiesIndex::v_z] = - 0; + pit0->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit0->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit0->get_properties()[DEM::PropertiesIndex::v_z] = 0; pit0->get_properties()[DEM::PropertiesIndex::mass] = particle_mass; // Calling integrators - ExplicitEulerIntegrator explicit_euler_object; + ExplicitEulerIntegrator explicit_euler_object; std::vector> torque; std::vector> force; @@ -150,12 +147,9 @@ test() particle_handler.insert_particle(particle1, particle1_cell); - pit1->get_properties()[DEM::PropertiesIndex::v_x] = - 0; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = - 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; pit1->get_properties()[DEM::PropertiesIndex::mass] = particle_mass; @@ -213,12 +207,9 @@ test() Particles::ParticleIterator pit2 = particle_handler.insert_particle(particle2, particle2_cell); - pit2->get_properties()[DEM::PropertiesIndex::v_x] = - 0; - pit2->get_properties()[DEM::PropertiesIndex::v_y] = - 0; - pit2->get_properties()[DEM::PropertiesIndex::v_z] = - 0; + pit2->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_z] = 0; pit2->get_properties()[DEM::PropertiesIndex::mass] = particle_mass; @@ -285,12 +276,9 @@ test() Particles::ParticleIterator pit3 = particle_handler.insert_particle(particle3, particle3_cell); - pit3->get_properties()[DEM::PropertiesIndex::v_x] = - 0; - pit3->get_properties()[DEM::PropertiesIndex::v_y] = - 0; - pit3->get_properties()[DEM::PropertiesIndex::v_z] = - 0; + pit3->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit3->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit3->get_properties()[DEM::PropertiesIndex::v_z] = 0; pit3->get_properties()[DEM::PropertiesIndex::mass] = particle_mass; diff --git a/tests/dem/integration_velocity_verlet.cc b/tests/dem/integration_velocity_verlet.cc index d370b3afdf..671ddedb61 100644 --- a/tests/dem/integration_velocity_verlet.cc +++ b/tests/dem/integration_velocity_verlet.cc @@ -72,24 +72,18 @@ test() Particles::ParticleIterator pit = particle_handler.insert_particle(particle1, particle_cell); - pit->get_properties()[DEM::PropertiesIndex::type] = - 1; - pit->get_properties()[DEM::PropertiesIndex::dp] = - 0.005; - pit->get_properties()[DEM::PropertiesIndex::v_x] = + pit->get_properties()[DEM::PropertiesIndex::type] = 1; + pit->get_properties()[DEM::PropertiesIndex::dp] = 0.005; + pit->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit->get_properties()[DEM::PropertiesIndex::omega_x] = 0; - pit->get_properties()[DEM::PropertiesIndex::v_y] = + pit->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit->get_properties()[DEM::PropertiesIndex::v_z] = + pit->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit->get_properties()[DEM::PropertiesIndex::mass] = 1; std::vector> torque; std::vector> force; @@ -99,7 +93,7 @@ test() MOI.push_back(1); // Calling velocity verlet integrator - VelocityVerletIntegrator integration_object; + VelocityVerletIntegrator integration_object; integration_object.integrate(particle_handler, g, dt, torque, force, MOI); // Output diff --git a/tests/dem/normal_force.cc b/tests/dem/normal_force.cc index da6f7884f4..31aab0a7be 100644 --- a/tests/dem/normal_force.cc +++ b/tests/dem/normal_force.cc @@ -108,24 +108,20 @@ test() GridTools::find_active_cell_around_point(tr, particle1.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, particle_cell); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; pit1->get_properties()[DEM::PropertiesIndex::v_x] = -1.0; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = 1; std::vector> torque; std::vector> force; @@ -156,11 +152,12 @@ test() // Particle-Wall fine search typename DEM::dem_data_structures::particle_wall_in_contact - particle_wall_contact_information; - ParticleWallNonLinearForce particle_wall_force_object(dem_parameters); - VelocityVerletIntegrator integrator_object; - double distance; - double time = 0.0; + particle_wall_contact_information; + ParticleWallNonLinearForce + particle_wall_force_object(dem_parameters); + VelocityVerletIntegrator integrator_object; + double distance; + double time = 0.0; while (time < 0.00115) { @@ -171,10 +168,11 @@ test() { force[0][2] = 0; } - distance = hyper_cube_length + particle->get_location()[0] - - particle->get_properties() - [DEM::PropertiesIndex::dp] / - 2.0; + distance = + hyper_cube_length + particle->get_location()[0] - + particle + ->get_properties()[DEM::PropertiesIndex::dp] / + 2.0; if (distance > 0.0) { diff --git a/tests/dem/particle_particle_contact_force_linear.cc b/tests/dem/particle_particle_contact_force_linear.cc index 52a6f0cfaa..ea773fbecd 100644 --- a/tests/dem/particle_particle_contact_force_linear.cc +++ b/tests/dem/particle_particle_contact_force_linear.cc @@ -71,13 +71,11 @@ test() const double neighborhood_threshold = std::pow(1.3 * particle_diameter, 2); Particles::ParticleHandler particle_handler( - triangulation, - mapping, - DEM::get_number_properties()); + triangulation, mapping, DEM::get_number_properties()); // Creating containers manager for finding cell neighbor and also broad and // fine particle-particle search objects - DEMContactManager contact_manager; + DEMContactManager contact_manager; // Finding cell neighbors list, it is required for finding the broad search // pairs in the contact_manager @@ -97,24 +95,20 @@ test() particle1.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, cell1); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; pit1->get_properties()[DEM::PropertiesIndex::v_x] = 0.01; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = 1; Particles::Particle particle2(position2, position2, id2); typename Triangulation::active_cell_iterator cell2 = @@ -122,24 +116,19 @@ test() particle2.get_location()); Particles::ParticleIterator pit2 = particle_handler.insert_particle(particle2, cell2); - pit2->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit2->get_properties()[DEM::PropertiesIndex::type] = 0; pit2->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit2->get_properties()[DEM::PropertiesIndex::v_x] = + pit2->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit2->get_properties()[DEM::PropertiesIndex::omega_x] = 0; - pit2->get_properties()[DEM::PropertiesIndex::v_y] = + pit2->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit2->get_properties()[DEM::PropertiesIndex::v_z] = + pit2->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit2->get_properties()[DEM::PropertiesIndex::mass] = 1; std::vector> torque; std::vector> force; @@ -155,7 +144,8 @@ test() contact_manager.update_local_particles_in_cells(particle_handler); // Dummy Adaptive sparse contacts object and particle-particle broad search - AdaptiveSparseContacts dummy_adaptive_sparse_contacts; + AdaptiveSparseContacts + dummy_adaptive_sparse_contacts; contact_manager.execute_particle_particle_broad_search( particle_handler, dummy_adaptive_sparse_contacts); @@ -164,7 +154,8 @@ test() // Calling linear force ParticleParticleContactForce< - dim, DEM::SolverType::dem, + dim, + DEM::SolverType::dem, Parameters::Lagrangian::ParticleParticleContactForceModel::linear, Parameters::Lagrangian::RollingResistanceMethod::constant_resistance> linear_force_object(dem_parameters); diff --git a/tests/dem/particle_particle_contact_force_nonlinear.cc b/tests/dem/particle_particle_contact_force_nonlinear.cc index 07f89b28c9..9224047d61 100644 --- a/tests/dem/particle_particle_contact_force_nonlinear.cc +++ b/tests/dem/particle_particle_contact_force_nonlinear.cc @@ -70,13 +70,11 @@ test() const double neighborhood_threshold = std::pow(1.3 * particle_diameter, 2); Particles::ParticleHandler particle_handler( - triangulation, - mapping, - DEM::get_number_properties()); + triangulation, mapping, DEM::get_number_properties()); // Creating containers manager for finding cell neighbor and also broad and // fine particle-particle search objects - DEMContactManager contact_manager; + DEMContactManager contact_manager; // Finding cell neighbors typename dem_data_structures::periodic_boundaries_cells_info @@ -95,24 +93,20 @@ test() particle1.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, cell1); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; pit1->get_properties()[DEM::PropertiesIndex::v_x] = 0.01; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = 1; Particles::Particle particle2(position2, position2, id2); typename Triangulation::active_cell_iterator cell2 = @@ -120,24 +114,19 @@ test() particle2.get_location()); Particles::ParticleIterator pit2 = particle_handler.insert_particle(particle2, cell2); - pit2->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit2->get_properties()[DEM::PropertiesIndex::type] = 0; pit2->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit2->get_properties()[DEM::PropertiesIndex::v_x] = + pit2->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit2->get_properties()[DEM::PropertiesIndex::omega_x] = 0; - pit2->get_properties()[DEM::PropertiesIndex::v_y] = + pit2->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit2->get_properties()[DEM::PropertiesIndex::v_z] = + pit2->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit2->get_properties()[DEM::PropertiesIndex::mass] = 1; std::vector> torque; std::vector> force; @@ -153,7 +142,8 @@ test() contact_manager.update_local_particles_in_cells(particle_handler); // Dummy Adaptive sparse contacts object and particle-particle broad search - AdaptiveSparseContacts dummy_adaptive_sparse_contacts; + AdaptiveSparseContacts + dummy_adaptive_sparse_contacts; contact_manager.execute_particle_particle_broad_search( particle_handler, dummy_adaptive_sparse_contacts); @@ -162,7 +152,8 @@ test() // Calling linear force ParticleParticleContactForce< - dim, DEM::SolverType::dem, + dim, + DEM::SolverType::dem, Parameters::Lagrangian::ParticleParticleContactForceModel:: hertz_mindlin_limit_overlap, Parameters::Lagrangian::RollingResistanceMethod::constant_resistance> diff --git a/tests/dem/particle_particle_contact_on_two_processors.cc b/tests/dem/particle_particle_contact_on_two_processors.cc index cea4cb812d..7586f68b03 100644 --- a/tests/dem/particle_particle_contact_on_two_processors.cc +++ b/tests/dem/particle_particle_contact_on_two_processors.cc @@ -95,14 +95,12 @@ test() const double neighborhood_threshold = std::pow(1.3 * particle_diameter, 2); Particles::ParticleHandler particle_handler( - triangulation, - mapping, - DEM::get_number_properties()); + triangulation, mapping, DEM::get_number_properties()); typename dem_data_structures<2>::particle_index_iterator_map local_particle_container; - DEMContactManager contact_manager; + DEMContactManager contact_manager; // Finding cell neighbors typename dem_data_structures::periodic_boundaries_cells_info @@ -111,12 +109,13 @@ test() // Creating particle-particle force objects ParticleParticleContactForce< - dim,DEM::SolverType::dem, + dim, + DEM::SolverType::dem, Parameters::Lagrangian::ParticleParticleContactForceModel:: hertz_mindlin_limit_overlap, Parameters::Lagrangian::RollingResistanceMethod::constant_resistance> - nonlinear_force_object(dem_parameters); - VelocityVerletIntegrator integrator_object; + nonlinear_force_object(dem_parameters); + VelocityVerletIntegrator integrator_object; MPI_Comm communicator = triangulation.get_communicator(); auto this_mpi_process = Utilities::MPI::this_mpi_process(communicator); @@ -137,25 +136,24 @@ test() particle1.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, cell1); - pit1->get_properties() - [DEM::PropertiesIndex::type] = 0; - pit1 - ->get_properties()[DEM::PropertiesIndex::dp] = + pit1->get_properties()[DEM::PropertiesIndex::type] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit1->get_properties() - [DEM::PropertiesIndex::v_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::v_y] = -0.5; - pit1->get_properties() - [DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::v_y] = + -0.5; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = + 0; pit1->get_properties() [DEM::PropertiesIndex::omega_x] = 0; pit1->get_properties() [DEM::PropertiesIndex::omega_y] = 0; pit1->get_properties() [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::mass] = 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = + 1; } // Particle 2 is inserted in a cell owned by process0 @@ -167,25 +165,24 @@ test() particle2.get_location()); Particles::ParticleIterator pit2 = particle_handler.insert_particle(particle2, cell2); - pit2->get_properties() - [DEM::PropertiesIndex::type] = 0; - pit2 - ->get_properties()[DEM::PropertiesIndex::dp] = + pit2->get_properties()[DEM::PropertiesIndex::type] = + 0; + pit2->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit2->get_properties() - [DEM::PropertiesIndex::v_x] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::v_y] = 0.5; - pit2->get_properties() - [DEM::PropertiesIndex::v_z] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_x] = + 0; + pit2->get_properties()[DEM::PropertiesIndex::v_y] = + 0.5; + pit2->get_properties()[DEM::PropertiesIndex::v_z] = + 0; pit2->get_properties() [DEM::PropertiesIndex::omega_x] = 0; pit2->get_properties() [DEM::PropertiesIndex::omega_y] = 0; pit2->get_properties() [DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::mass] = 1; + pit2->get_properties()[DEM::PropertiesIndex::mass] = + 1; } std::vector> torque; @@ -210,7 +207,8 @@ test() // Dummy Adaptive sparse contacts object and particle-particle broad // search - AdaptiveSparseContacts dummy_adaptive_sparse_contacts; + AdaptiveSparseContacts + dummy_adaptive_sparse_contacts; contact_manager.execute_particle_particle_broad_search( particle_handler, dummy_adaptive_sparse_contacts); diff --git a/tests/dem/particle_particle_fine_search.cc b/tests/dem/particle_particle_fine_search.cc index 886ec53f77..896416c44d 100644 --- a/tests/dem/particle_particle_fine_search.cc +++ b/tests/dem/particle_particle_fine_search.cc @@ -48,11 +48,9 @@ test() // Defining general simulation parameters Particles::ParticleHandler particle_handler( - triangulation, - mapping, - DEM::get_number_properties()); + triangulation, mapping, DEM::get_number_properties()); - DEMContactManager contact_manager; + DEMContactManager contact_manager; // Finding cell neighbors typename dem_data_structures::periodic_boundaries_cells_info @@ -75,24 +73,19 @@ test() Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, cell1); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit1->get_properties()[DEM::PropertiesIndex::v_x] = + pit1->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = 1; Particles::Particle particle2(position2, position2, id2); typename Triangulation::active_cell_iterator cell2 = @@ -100,29 +93,25 @@ test() particle2.get_location()); Particles::ParticleIterator pit2 = particle_handler.insert_particle(particle2, cell2); - pit2->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit2->get_properties()[DEM::PropertiesIndex::type] = 0; pit2->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit2->get_properties()[DEM::PropertiesIndex::v_x] = + pit2->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit2->get_properties()[DEM::PropertiesIndex::omega_x] = 0; - pit2->get_properties()[DEM::PropertiesIndex::v_y] = + pit2->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit2->get_properties()[DEM::PropertiesIndex::v_z] = + pit2->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit2->get_properties()[DEM::PropertiesIndex::mass] = 1; contact_manager.update_local_particles_in_cells(particle_handler); // Dummy Adaptive sparse contacts object and particle-particle broad search - AdaptiveSparseContacts dummy_adaptive_sparse_contacts; + AdaptiveSparseContacts + dummy_adaptive_sparse_contacts; contact_manager.execute_particle_particle_broad_search( particle_handler, dummy_adaptive_sparse_contacts); diff --git a/tests/dem/particle_point_contact.cc b/tests/dem/particle_point_contact.cc index 319bd50787..1d9539d7a1 100644 --- a/tests/dem/particle_point_contact.cc +++ b/tests/dem/particle_point_contact.cc @@ -90,24 +90,19 @@ test() Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, particle_cell); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit1->get_properties()[DEM::PropertiesIndex::v_x] = + pit1->get_properties()[DEM::PropertiesIndex::v_x] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = 1; // Construct boundary cells object and build it BoundaryCellsInformation boundary_cells_object; @@ -127,7 +122,7 @@ test() typename DEM::dem_data_structures::particle_point_in_contact contact_information; - ParticlePointLineForce force_object; + ParticlePointLineForce force_object; VelocityVerletIntegrator integrator_object; std::vector> torque; @@ -155,9 +150,8 @@ test() boundary_cells_object.get_boundary_cells_with_points(), contact_candidates); - particle_point_fine_search(contact_candidates, - neighborhood_threshold, - contact_information); + particle_point_fine_search( + contact_candidates, neighborhood_threshold, contact_information); force_object.calculate_particle_point_contact_force( &contact_information, diff --git a/tests/dem/particle_wall_contact_force_linear.cc b/tests/dem/particle_wall_contact_force_linear.cc index 3be933a635..c80d8e2040 100644 --- a/tests/dem/particle_wall_contact_force_linear.cc +++ b/tests/dem/particle_wall_contact_force_linear.cc @@ -104,24 +104,20 @@ test() GridTools::find_active_cell_around_point(tr, particle1.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, cell1); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; pit1->get_properties()[DEM::PropertiesIndex::v_x] = 0.01; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = 1; std::vector> torque; std::vector> force; @@ -164,7 +160,8 @@ test() particle_wall_contact_information); // Calling linear force - ParticleWallLinearForce force_object(dem_parameters); + ParticleWallLinearForce force_object( + dem_parameters); force_object.calculate_particle_wall_contact_force( particle_wall_contact_information, dt, torque, force); diff --git a/tests/dem/particle_wall_contact_force_nonlinear.cc b/tests/dem/particle_wall_contact_force_nonlinear.cc index 79de33c981..3eddb3dcee 100644 --- a/tests/dem/particle_wall_contact_force_nonlinear.cc +++ b/tests/dem/particle_wall_contact_force_nonlinear.cc @@ -104,24 +104,20 @@ test() GridTools::find_active_cell_around_point(tr, particle1.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, cell1); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; pit1->get_properties()[DEM::PropertiesIndex::v_x] = 0.01; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties()[DEM::PropertiesIndex::mass] = - 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = 1; std::vector> torque; std::vector> force; @@ -164,7 +160,8 @@ test() particle_wall_contact_information); // Calling non-linear force - ParticleWallNonLinearForce force_object(dem_parameters); + ParticleWallNonLinearForce force_object( + dem_parameters); force_object.calculate_particle_wall_contact_force( particle_wall_contact_information, dt, torque, force); diff --git a/tests/dem/post_collision_velocity.cc b/tests/dem/post_collision_velocity.cc index f404d2b0d4..a44d4ba092 100644 --- a/tests/dem/post_collision_velocity.cc +++ b/tests/dem/post_collision_velocity.cc @@ -106,22 +106,19 @@ test(double coefficient_of_restitution) GridTools::find_active_cell_around_point(tr, particle.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle, particle_cell); - pit1->get_properties()[DEM::PropertiesIndex::type] = - 0; + pit1->get_properties()[DEM::PropertiesIndex::type] = 0; pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; pit1->get_properties()[DEM::PropertiesIndex::v_x] = -0.1; - pit1->get_properties()[DEM::PropertiesIndex::v_y] = + pit1->get_properties()[DEM::PropertiesIndex::v_y] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties()[DEM::PropertiesIndex::v_z] = + pit1->get_properties()[DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_y] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::omega_z] = 0; pit1->get_properties()[DEM::PropertiesIndex::mass] = M_PI * particle_diameter * particle_diameter * particle_diameter / 6; @@ -157,9 +154,10 @@ test(double coefficient_of_restitution) // P-W fine search typename DEM::dem_data_structures::particle_wall_in_contact - particle_wall_contact_information; - ParticleWallNonLinearForce particle_wall_force_object(dem_parameters); - VelocityVerletIntegrator integrator_object; + particle_wall_contact_information; + ParticleWallNonLinearForce + particle_wall_force_object(dem_parameters); + VelocityVerletIntegrator integrator_object; auto particle1 = particle_handler.begin(); diff --git a/tests/dem/two_particles_multiple_contacts_parallel.cc b/tests/dem/two_particles_multiple_contacts_parallel.cc index c05070a5dd..f39da6c882 100644 --- a/tests/dem/two_particles_multiple_contacts_parallel.cc +++ b/tests/dem/two_particles_multiple_contacts_parallel.cc @@ -88,14 +88,12 @@ test() Parameters::Lagrangian::RollingResistanceMethod::constant_resistance; Particles::ParticleHandler particle_handler( - triangulation, - mapping, - DEM::get_number_properties()); + triangulation, mapping, DEM::get_number_properties()); typename dem_data_structures<2>::particle_index_iterator_map local_particle_container; - DEMContactManager contact_manager; + DEMContactManager contact_manager; // Finding cell neighbors typename dem_data_structures::periodic_boundaries_cells_info @@ -104,12 +102,13 @@ test() // Particle-particle force objects ParticleParticleContactForce< - dim, DEM::SolverType::dem, + dim, + DEM::SolverType::dem, Parameters::Lagrangian::ParticleParticleContactForceModel:: hertz_mindlin_limit_overlap, Parameters::Lagrangian::RollingResistanceMethod::constant_resistance> - nonlinear_force_object(dem_parameters); - VelocityVerletIntegrator integrator_object; + nonlinear_force_object(dem_parameters); + VelocityVerletIntegrator integrator_object; MPI_Comm communicator = triangulation.get_communicator(); auto this_mpi_process = Utilities::MPI::this_mpi_process(communicator); @@ -129,25 +128,24 @@ test() particle1.get_location()); Particles::ParticleIterator pit1 = particle_handler.insert_particle(particle1, cell1); - pit1->get_properties() - [DEM::PropertiesIndex::type] = 0; - pit1 - ->get_properties()[DEM::PropertiesIndex::dp] = + pit1->get_properties()[DEM::PropertiesIndex::type] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit1->get_properties() - [DEM::PropertiesIndex::v_x] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::v_y] = -0.4; - pit1->get_properties() - [DEM::PropertiesIndex::v_z] = 0; + pit1->get_properties()[DEM::PropertiesIndex::v_x] = + 0; + pit1->get_properties()[DEM::PropertiesIndex::v_y] = + -0.4; + pit1->get_properties()[DEM::PropertiesIndex::v_z] = + 0; pit1->get_properties() [DEM::PropertiesIndex::omega_x] = 0; pit1->get_properties() [DEM::PropertiesIndex::omega_y] = 0; pit1->get_properties() [DEM::PropertiesIndex::omega_z] = 0; - pit1->get_properties() - [DEM::PropertiesIndex::mass] = 1; + pit1->get_properties()[DEM::PropertiesIndex::mass] = + 1; Particles::Particle particle2(position2, position2, id2); typename Triangulation::active_cell_iterator cell2 = @@ -155,25 +153,24 @@ test() particle2.get_location()); Particles::ParticleIterator pit2 = particle_handler.insert_particle(particle2, cell2); - pit2->get_properties() - [DEM::PropertiesIndex::type] = 0; - pit2 - ->get_properties()[DEM::PropertiesIndex::dp] = + pit2->get_properties()[DEM::PropertiesIndex::type] = + 0; + pit2->get_properties()[DEM::PropertiesIndex::dp] = particle_diameter; - pit2->get_properties() - [DEM::PropertiesIndex::v_x] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::v_y] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::v_z] = 0; + pit2->get_properties()[DEM::PropertiesIndex::v_x] = + 0; + pit2->get_properties()[DEM::PropertiesIndex::v_y] = + 0; + pit2->get_properties()[DEM::PropertiesIndex::v_z] = + 0; pit2->get_properties() [DEM::PropertiesIndex::omega_x] = 0; pit2->get_properties() [DEM::PropertiesIndex::omega_y] = 0; pit2->get_properties() [DEM::PropertiesIndex::omega_z] = 0; - pit2->get_properties() - [DEM::PropertiesIndex::mass] = 1; + pit2->get_properties()[DEM::PropertiesIndex::mass] = + 1; } @@ -203,7 +200,8 @@ test() // Dummy Adaptive sparse contacts object and particle-particle broad // search - AdaptiveSparseContacts dummy_adaptive_sparse_contacts; + AdaptiveSparseContacts + dummy_adaptive_sparse_contacts; contact_manager.execute_particle_particle_broad_search( particle_handler, dummy_adaptive_sparse_contacts);