Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8 add stl meshes with polyhedra #10

Merged
merged 5 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/config/config_iteration_dump.msp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions example/polyhedra/rotating_drum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
25 changes: 25 additions & 0 deletions example/polyhedra/rotating_drum/alpha3.shp
Original file line number Diff line number Diff line change
@@ -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
>
44 changes: 44 additions & 0 deletions example/polyhedra/rotating_drum/octahedron.shp
Original file line number Diff line number Diff line change
@@ -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
>
60 changes: 60 additions & 0 deletions example/polyhedra/rotating_drum/rotating-drum-mixte-mini.msp
Original file line number Diff line number Diff line change
@@ -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
60 changes: 60 additions & 0 deletions example/polyhedra/rotating_drum/rotating-drum-mixte.msp
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions example/polyhedra/stl_mesh/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
73 changes: 73 additions & 0 deletions example/polyhedra/stl_mesh/box_mixte.stl
Original file line number Diff line number Diff line change
@@ -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
59 changes: 59 additions & 0 deletions example/polyhedra/stl_mesh/stl_mesh_box_mixte.msp
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading