This is an example of how to use the netdem library.
1import netdem
2
3
5pd_sim.settings.result_dir = "tmp/out/peridigm/verify_sphere/"
6
7
9stl_model.InitFromSTL("data/sphere.stl")
10stl_model.SetSize(2.0)
11
12mesh_res = 25
13pd_sim.discretization.type = netdem.PeriDigmDiscretization.Type.level_set
14pd_sim.discretization.InitFromSTL(stl_model, mesh_res)
15pd_sim.InitDefaultSetup()
16
17
18pd_sim.materials[0].density = 2650e-6
19pd_sim.materials[0].youngs_modulus = 100e3
20pd_sim.materials[0].poissons_ratio = 0.15
21energy_release_rate = 30e-3
22pd_sim.damage_models[0].InitFromEnergyReleaseRate(
23 pd_sim.materials[0].youngs_modulus,
24 pd_sim.materials[0].poissons_ratio,
25 pd_sim.blocks[0].horizon,
26 energy_release_rate,
27)
28pd_sim.InitAutoTimestep()
29
30bc_fixed = pd_sim.InsertBoundaryCondition()
31for i in range(0, len(pd_sim.discretization.nodes)):
32 if abs(pd_sim.discretization.nodes[i][2] + 1.0) < 2.0 / mesh_res:
33 bc_fixed.InsertNode(i)
34bc_fixed.SetActivatedDimensions(True, True, True)
35
36bc_compress = pd_sim.InsertBoundaryCondition()
37for i in range(0, len(pd_sim.discretization.nodes)):
38 if abs(pd_sim.discretization.nodes[i][2] - 1.0) < 2.0 / mesh_res:
39 bc_compress.InsertNode(i)
40
41
42loading_rate = -0.1
43utimate_disp = -0.01
44
45bc_compress.SetByDisplacementRate(0, 0, loading_rate)
46bc_fixed.SetActivatedDimensions(True, True, True)
47
48pd_sim.settings.output_freqency = 10
49pd_sim.Solve(utimate_disp / loading_rate)
A class representing a simulator for peridynamic simulations.
Definition peridigm_simulator.hpp:24
Class for working with STL models.
Definition stl_model.hpp:17