This is an example of how to use the netdem library.
1import netdem
2
3
5sim.domain_manager.SetBound(-12, -12, -12, 12, 12, 12)
6sim.domain_manager.SetCellSpacing(1.0, 1.0, 1.0)
7
8
10cnt_model_prt = sim.scene.InsertContactModel(cnt_model)
11sim.scene.SetNumberOfMaterials(1)
12sim.scene.SetCollisionModel(0, 0, cnt_model_prt)
13
15bond_model.label = "bond_model"
16bond_model_ptr = sim.scene.InsertContactModel(bond_model)
17
19stl_model.RemoveDuplicateVertices()
20stl_model.RemoveUnreferencedVertices()
21stl_model.ReorientFacets()
22stl_model.SetSize(6.2035)
23
25bonded_voronois.SetBondModel(bond_model_ptr)
26bonded_voronois.InitFromSTL(stl_model, 1000)
27bonded_voronois.SaveAsVTK("tmp/out/shape/bonded_voronois_box.vtk")
28sim.scene.InsertParticle(bonded_voronois)
29
30sim.scene.SetGravity(0, 0, -9.81e-3)
31for p in sim.scene.particle_list:
32 p.SetDensity(2650)
33
35wall_box.ImportToScene(sim.scene)
36
37
38
39
40
41
43data_dumper.Init(sim)
44data_dumper.SetRootPath("tmp/out/")
45data_dumper.SetSaveByCycles(100)
46data_dumper.dump_contact_info = True
47data_dumper.dump_wall_info = True
48data_dumper.SaveShapeInfoAsSTL()
49sim.modifier_manager.Insert(data_dumper)
50sim.modifier_manager.Enable(data_dumper.label)
51
52
54disp_control.Init(sim)
55disp_control.SetWall([5])
56disp_control.SetVelocity(0, 0, -0.25)
57sim.modifier_manager.Insert(disp_control)
58sim.modifier_manager.Enable(disp_control.label)
59
60netdem.omp_set_num_threads(1)
61sim.Run(2.0)
A class representing a set of bonded Voronoi cells generated from an STL file.
Definition bonded_voronois.hpp:19
A class used to dump particle data into vtk files. This is a post-modifier, which will be executed at...
Definition data_dumper.hpp:12
Contact model that uses linear spring elements to evaluate contact forces and moments.
Definition model_linear_spring.hpp:16
Contact model that evaluates forces and moments between two particles using parallel bond models.
Definition model_parallel_bond.hpp:15
static STLModel ReadFile(std::string const &filename)
Read an STL file.
Definition stl_reader.cpp:15
Class for managing a DEM simulation.
Definition simulation.hpp:21
A class for generating a box of six walls.
Definition gen_wall_box_plane.hpp:23
A class used to control the displacement of walls in a DEM simulation.
Definition wall_motion_control.hpp:16