diff --git a/data/config/config_iteration_dump.msp b/data/config/config_iteration_dump.msp index 7c682cc..01a350a 100644 --- a/data/config/config_iteration_dump.msp +++ b/data/config/config_iteration_dump.msp @@ -23,7 +23,7 @@ write_paraview_generic: binary: false write_ghost: false write_box: true - fields: ["vx","vy","vz","id","orient"] + fields: ["type","vx","vy","vz","id","orient"] # fields: ["vx","vy","vz","id","radius"] dump_data_paraview: diff --git a/example/polyhedra/rotating_drum/CMakeLists.txt b/example/polyhedra/rotating_drum/CMakeLists.txt index 79f786d..ff598a2 100644 --- a/example/polyhedra/rotating_drum/CMakeLists.txt +++ b/example/polyhedra/rotating_drum/CMakeLists.txt @@ -3,6 +3,15 @@ set(ExampleName "OctahedraRotatingDrum") set(FileName "rotating-drum.msp") file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/shapes.shp DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/alpha3.shp DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/octahedron.shp DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) + +add_test(Example_ExaDEM_${ExampleName} ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) +add_test(Example_ExaDEM_${ExampleName}_omp ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 2) +add_test(Example_ExaDEM_${ExampleName}_mpi mpirun -n 2 ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) + +set(ExampleName "OctahedraHexapodsRotatingDrum") +set(FileName "rotating-drum-mixte-mini.msp") add_test(Example_ExaDEM_${ExampleName} ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) add_test(Example_ExaDEM_${ExampleName}_omp ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 2) diff --git a/example/polyhedra/rotating_drum/alpha3.shp b/example/polyhedra/rotating_drum/alpha3.shp new file mode 100644 index 0000000..54f1e1f --- /dev/null +++ b/example/polyhedra/rotating_drum/alpha3.shp @@ -0,0 +1,25 @@ + +< +name alpha3 +radius 0.237770037899799 +preCompDone y +nv 6 +0.475540075799599 0 0 +-0.475540075799599 0 0 +0 0.475540075799599 0 +0 -0.475540075799599 0 +0 0 0.475540075799599 +0 0 -0.475540075799599 +ne 3 +0 1 +2 3 +4 5 +nf 0 +obb.extent 0.713310113699398 0.713310113699398 0.713310113699398 +obb.e1 1 0 0 +obb.e2 0 1 0 +obb.e3 0 0 1 +obb.center 0 0 0 +volume 0.523598775598299 +I/m 0.13266 0.13266 0.13266 +> diff --git a/example/polyhedra/rotating_drum/octahedron.shp b/example/polyhedra/rotating_drum/octahedron.shp new file mode 100644 index 0000000..82acda4 --- /dev/null +++ b/example/polyhedra/rotating_drum/octahedron.shp @@ -0,0 +1,44 @@ + +< +name Octahedron +radius 0.1 +preCompDone y +nv 6 +0.2310789034541148 -0.2310789034541148 0.0 +0.2310789034541148 0.2310789034541148 0.0 +0.0 0.0 0.32679491924311227 +-0.2310789034541148 -0.2310789034541148 0.0 +-0.2310789034541148 0.2310789034541148 0.0 +0.0 0.0 -0.32679491924311227 +ne 12 +0 1 +2 1 +2 0 +0 3 +2 3 +3 4 +4 2 +4 1 +5 0 +5 1 +5 4 +5 3 +nf 8 +3 0 1 2 +3 2 3 4 +3 1 2 4 +3 0 2 3 +3 0 5 1 +3 0 5 3 +3 3 5 4 +3 4 5 1 +obb.extent 0.33107890345411484 0.33107890345411484 0.4267949192431123 +obb.e1 1.0 0.0 0.0 +obb.e2 0.0 1.0 0.0 +obb.e3 0.0 0.0 1.0 +obb.center 0.0 0.0 0.0 +position 0.0 0.0 0.0 +orientation 1.0 0.0 0.0 0.0 +volume 0.16666666666666666 +I/m 0.04999999999999999 0.04999999999999999 0.04999999999999999 +> diff --git a/example/polyhedra/rotating_drum/rotating-drum-mixte-mini.msp b/example/polyhedra/rotating_drum/rotating-drum-mixte-mini.msp new file mode 100644 index 0000000..89817c5 --- /dev/null +++ b/example/polyhedra/rotating_drum/rotating-drum-mixte-mini.msp @@ -0,0 +1,60 @@ +grid_flavor: grid_flavor_dem + +includes: + - config_polyhedra.msp + +input_data: + - lattice: + structure: BCC + types: [ 0 , 1 ] + size: [ 1.5 , 1.5 , 1.5 ] + repeats: [ 5 , 5 , 5 ] + enlarge_bounds: 0.0 m + - read_shape_file: + filename: alpha3.shp + - read_shape_file: + filename: octahedron.shp + - polyhedra_define_radius + - polyhedra_set_density + - set_rand_velocity: + var: 0.1 + mean: [0.0,0.0,0.0] + - set_rand_vrot_arot + - set_quaternion + - polyhedra_update_inertia + + +input_data: + - reader1 + +setup_drivers: + - add_cylinder: + id: 0 + center: [7.5, 7.5, 7.5] + axis: [1, 0, 1] + radius: 13 + angular_velocity: [0,0.2,0] + + +compute_force: + - gravity_force + - compute_hooke_interaction: + config: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.1, damp_rate: 0.999} + config_driver: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.5, damp_rate: 0.999} + +domain: + cell_size: 2 m + periodic: [false,true,false] + +write_vtklegacy: + ascii: true + ghost: false + +global: + simulation_dump_frequency: -1 + simulation_end_iteration: 10000 + simulation_log_frequency: 1000 + simulation_paraview_frequency: -1 + dt: 0.00005 s + rcut_inc: 0.1 m + enable_stl_mesh: true diff --git a/example/polyhedra/rotating_drum/rotating-drum-mixte.msp b/example/polyhedra/rotating_drum/rotating-drum-mixte.msp new file mode 100644 index 0000000..a7907f7 --- /dev/null +++ b/example/polyhedra/rotating_drum/rotating-drum-mixte.msp @@ -0,0 +1,60 @@ +grid_flavor: grid_flavor_dem + +includes: + - config_polyhedra.msp + +input_data: + - lattice: + structure: BCC + types: [ 0 , 1 ] + size: [ 1.5 , 1.5 , 1.5 ] + repeats: [ 30 , 30 , 30 ] + enlarge_bounds: 0.0 m + - read_shape_file: + filename: alpha3.shp + - read_shape_file: + filename: octahedron.shp + - polyhedra_define_radius + - polyhedra_set_density + - set_rand_velocity: + var: 0.1 + mean: [0.0,0.0,0.0] + - set_rand_vrot_arot + - set_quaternion + - polyhedra_update_inertia + + +input_data: + - reader1 + +setup_drivers: + - add_cylinder: + id: 0 + center: [22.5, 22.5, 22.5] + axis: [1, 0, 1] + radius: 39 + angular_velocity: [0,0.05,0] + + +compute_force: + - gravity_force + - compute_hooke_interaction: + config: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.1, damp_rate: 0.999} + config_driver: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.5, damp_rate: 0.999} + +domain: + cell_size: 2 m + periodic: [false,true,false] + +write_vtklegacy: + ascii: true + ghost: false + +global: + simulation_dump_frequency: -1 + simulation_end_iteration: 1000000 + simulation_log_frequency: 1000 + simulation_paraview_frequency: 5000 + dt: 0.0001 s + rcut_inc: 0.05 m + enable_stl_mesh: true diff --git a/example/polyhedra/stl_mesh/CMakeLists.txt b/example/polyhedra/stl_mesh/CMakeLists.txt index 46ab16a..6375bb5 100644 --- a/example/polyhedra/stl_mesh/CMakeLists.txt +++ b/example/polyhedra/stl_mesh/CMakeLists.txt @@ -5,6 +5,7 @@ set(FileName "stl_mesh_box_hexapod_mini.msp") file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/alpha3.shp DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/octahedron.shp DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/box.stl DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/box_mixte.stl DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/box_for_octa.stl DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) add_test(Example_ExaDEM_${ExampleName} ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) @@ -17,3 +18,10 @@ set(FileName "stl_mesh_box_octahedron_mini.msp") add_test(Example_ExaDEM_${ExampleName} ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) add_test(Example_ExaDEM_${ExampleName}_omp ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 2) add_test(Example_ExaDEM_${ExampleName}_mpi mpirun -n 2 ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) + +set(ExampleName "STLMeshOctahedraHexapods") +set(FileName "stl_mesh_box_mixte_mini.msp") + +add_test(Example_ExaDEM_${ExampleName} ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) +add_test(Example_ExaDEM_${ExampleName}_omp ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 2) +add_test(Example_ExaDEM_${ExampleName}_mpi mpirun -n 2 ${CMAKE_BINARY_DIR}/exaDEM ${CMAKE_CURRENT_SOURCE_DIR}/${FileName} --omp_num_threads 1) \ No newline at end of file diff --git a/example/polyhedra/stl_mesh/box_mixte.stl b/example/polyhedra/stl_mesh/box_mixte.stl new file mode 100644 index 0000000..2d3f23c --- /dev/null +++ b/example/polyhedra/stl_mesh/box_mixte.stl @@ -0,0 +1,73 @@ +solid Created by Gmsh +facet normal -1 0 0 + outer loop + vertex -1 -1 19 + vertex -1 19 -1 + vertex -1 -1 -1 + endloop +endfacet +facet normal -1 0 0 + outer loop + vertex -1 -1 19 + vertex -1 19 19 + vertex -1 19 -1 + endloop +endfacet +facet normal 1 0 0 + outer loop + vertex 19 -1 19 + vertex 19 -1 -1 + vertex 19 19 -1 + endloop +endfacet +facet normal 1 -0 0 + outer loop + vertex 19 -1 19 + vertex 19 19 -1 + vertex 19 19 19 + endloop +endfacet +facet normal 0 -1 -0 + outer loop + vertex 19 -1 19 + vertex -1 -1 -1 + vertex 19 -1 -1 + endloop +endfacet +facet normal -0 -1 0 + outer loop + vertex 19 -1 19 + vertex -1 -1 19 + vertex -1 -1 -1 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 19 19 19 + vertex 19 19 -1 + vertex -1 19 -1 + endloop +endfacet +facet normal 0 1 0 + outer loop + vertex 19 19 19 + vertex -1 19 -1 + vertex -1 19 19 + endloop +endfacet +facet normal -0 0 -1 + outer loop + vertex 19 19 -1 + vertex -1 -1 -1 + vertex -1 19 -1 + endloop +endfacet +facet normal 0 -0 -1 + outer loop + vertex 19 19 -1 + vertex 19 -1 -1 + vertex -1 -1 -1 + endloop +endfacet + +endsolid Created by Gmsh diff --git a/example/polyhedra/stl_mesh/stl_mesh_box_mixte.msp b/example/polyhedra/stl_mesh/stl_mesh_box_mixte.msp new file mode 100644 index 0000000..0cc04ec --- /dev/null +++ b/example/polyhedra/stl_mesh/stl_mesh_box_mixte.msp @@ -0,0 +1,59 @@ +grid_flavor: grid_flavor_dem + +includes: + - config_polyhedra.msp + +input_data: + - lattice: + structure: BCC + types: [ 0 , 1 ] + size: [ 1.5 , 1.5 , 1.5 ] + repeats: [ 12 , 12 , 40 ] + enlarge_bounds: 0.0 m + - read_shape_file: + filename: alpha3.shp + - read_shape_file: + filename: octahedron.shp + - polyhedra_define_radius + - polyhedra_set_density + - set_rand_velocity: + var: 0.1 + mean: [0.0,0.0,0.0] + - set_rand_vrot_arot + - set_quaternion + - polyhedra_update_inertia + + +input_data: + - reader1 + +setup_drivers: + - add_stl_mesh: + id: 0 + filename: box_mixte.stl + minskowski: 0.01 + - update_grid_stl_mesh + + +compute_force: + - gravity_force + - compute_hooke_interaction: + config: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.1, damp_rate: 0.999} + config_driver: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.5, damp_rate: 0.999} + +domain: + cell_size: 2 m + periodic: [false,false,false] + +write_vtklegacy: + ascii: true + ghost: false + +global: + simulation_dump_frequency: -1 + simulation_end_iteration: 100000 + simulation_log_frequency: 1000 + simulation_paraview_frequency: 1000 + dt: 0.0001 s + rcut_inc: 0.1 m + enable_stl_mesh: true diff --git a/example/polyhedra/stl_mesh/stl_mesh_box_mixte_mini.msp b/example/polyhedra/stl_mesh/stl_mesh_box_mixte_mini.msp new file mode 100644 index 0000000..ca686f9 --- /dev/null +++ b/example/polyhedra/stl_mesh/stl_mesh_box_mixte_mini.msp @@ -0,0 +1,59 @@ +grid_flavor: grid_flavor_dem + +includes: + - config_polyhedra.msp + +input_data: + - lattice: + structure: BCC + types: [ 0 , 1 ] + size: [ 1.5 , 1.5 , 1.5 ] + repeats: [ 5 , 5 , 5 ] + enlarge_bounds: 0.0 m + - read_shape_file: + filename: alpha3.shp + - read_shape_file: + filename: octahedron.shp + - polyhedra_define_radius + - polyhedra_set_density + - set_rand_velocity: + var: 0.1 + mean: [0.0,0.0,0.0] + - set_rand_vrot_arot + - set_quaternion + - polyhedra_update_inertia + + +input_data: + - reader1 + +setup_drivers: + - add_stl_mesh: + id: 0 + filename: box_mixte.stl + minskowski: 0.01 + - update_grid_stl_mesh + + +compute_force: + - gravity_force + - compute_hooke_interaction: + config: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.1, damp_rate: 0.999} + config_driver: { rcut: 0.0 m , dncut: 0.0 m, kn: 10000, kt: 8000, kr: 0.0, fc: 0.0, mu: 0.5, damp_rate: 0.999} + +domain: + cell_size: 2 m + periodic: [false,false,false] + +write_vtklegacy: + ascii: true + ghost: false + +global: + simulation_dump_frequency: -1 + simulation_end_iteration: 12000 + simulation_log_frequency: 1000 + simulation_paraview_frequency: -1 + dt: 0.0001 s + rcut_inc: 0.05 m + enable_stl_mesh: true diff --git a/src/polyhedra/include/exaDEM/compute_hooke_interaction.h b/src/polyhedra/include/exaDEM/compute_hooke_interaction.h index a451243..77681ac 100644 --- a/src/polyhedra/include/exaDEM/compute_hooke_interaction.h +++ b/src/polyhedra/include/exaDEM/compute_hooke_interaction.h @@ -87,13 +87,12 @@ namespace exaDEM const Vec3d r_i = { cell[field::rx][p_i], cell[field::ry][p_i], cell[field::rz][p_i] }; // === vrot const Vec3d& vrot_i = cell[field::vrot][p_i]; - const auto& t_i = cell[field::type][p_i]; const Quaternion& orient_i = cell[field::orient][p_i]; const auto& shp_j = driver.shp; // WARNING const Quaternion orient_j = {1.0,0.0,0.0,0.0}; - auto [contact, dn, n, contact_position] = func(I.type, r_i, sub_i, &shp_i[t_i], orient_i, driver.center, sub_j, &shp_j, orient_j); + auto [contact, dn, n, contact_position] = func(I.type, r_i, sub_i, shp_i, orient_i, driver.center, sub_j, &shp_j, orient_j); if(contact) {