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