This is an example of how to use the netdem library.
1import netdem
2
4
5sim.domain_manager.SetBound(-12, -12, -12, 12, 12, 12)
6sim.domain_manager.GetSelfSubDomain().cell_manager.SetSpacing(0.3, 0.3, 0.3)
7
8
10collision_model_ptr = sim.scene.InsertContactModel(collision_model)
11sim.scene.SetNumberOfMaterials(1)
12sim.scene.SetCollisionModel(0, 0, collision_model_ptr)
13
15bond_model.label = "bond_model"
16bond_model_ptr = sim.scene.InsertContactModel(bond_model)
17
19stl_vase.InitFromSTL("data/particle_template.stl")
20stl_vase.Standardize()
21stl_vase.SetSize(0.2)
22
23
24
25
27bonded_voronois.SetBondModel(bond_model_ptr)
28bonded_voronois.InitFromSTL(stl_vase, 20)
29bonded_voronois.SaveAsVTK("tmp/out/shape/bonded_voronois.vtk")
30
31sim.scene.InsertParticle(bonded_voronois)
32
33
34
36plane_ptr = sim.scene.InsertShape(plane)
38sim.scene.InsertWall(wall)
39
41grav.Init(sim)
42sim.modifier_manager.Insert(grav)
43sim.modifier_manager.Enable(grav.label)
44
46data_dumper.Init(sim)
47data_dumper.SetRootPath("tmp/out/")
48data_dumper.SetSaveByCycles(1000)
49data_dumper.dump_wall_info = True
50data_dumper.dump_contact_info = True
51data_dumper.dump_mesh = True
52data_dumper.SaveShapeInfoAsSTL()
53sim.modifier_manager.Insert(data_dumper)
54sim.modifier_manager.Enable(data_dumper.label)
55
56sim.dem_solver.timestep = 1.0e-5
57sim.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
A class used to apply gravity to particles in a DEM simulation.
Definition gravity.hpp:10
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
A class for representing a plane with a center point and normal vector.
Definition shape_plane.hpp:22
Class for working with STL models.
Definition stl_model.hpp:17
Class for managing a DEM simulation.
Definition simulation.hpp:21
A class representing a wall object in a physics simulation.
Definition wall.hpp:32