Note
Go to the end to download the full example code.
Hyperelas4#
A cantilever beam undergoing bending deformation in dynamic.



===== hyperelastic problem at iteration 0 =====
At Newton iteration 1 norm is 1.321961470281e+07
At Newton iteration 2 norm is 9.093944319768e+05
At Newton iteration 3 norm is 1.425886127162e+04
At Newton iteration 4 norm is 1.528342335463e+02
At Newton iteration 5 norm is 1.308350458499e-01
At Newton iteration 6 norm is 2.233925299051e-08
===== hyperelastic problem at iteration 1 =====
At Newton iteration 1 norm is 5.063370201521e+04
At Newton iteration 2 norm is 5.945769422922e+03
At Newton iteration 3 norm is 1.808625373409e+01
At Newton iteration 4 norm is 4.014702927275e-03
At Newton iteration 5 norm is 1.415030370253e-08
===== hyperelastic problem at iteration 2 =====
At Newton iteration 1 norm is 4.978636183249e+03
At Newton iteration 2 norm is 3.685464342498e+04
At Newton iteration 3 norm is 2.448434983793e+01
At Newton iteration 4 norm is 8.768078202221e-05
At Newton iteration 5 norm is 1.361450279688e-08
===== hyperelastic problem at iteration 3 =====
At Newton iteration 1 norm is 8.938665529061e+03
At Newton iteration 2 norm is 7.012222278536e+04
At Newton iteration 3 norm is 7.276664416861e+01
At Newton iteration 4 norm is 1.203266134890e-03
At Newton iteration 5 norm is 1.065325553128e-08
===== hyperelastic problem at iteration 4 =====
At Newton iteration 1 norm is 1.137171002519e+04
At Newton iteration 2 norm is 1.119397616765e+05
At Newton iteration 3 norm is 1.855269808677e+02
At Newton iteration 4 norm is 2.702486268004e-02
At Newton iteration 5 norm is 1.324003690473e-08
===== hyperelastic problem at iteration 5 =====
At Newton iteration 1 norm is 1.171954197748e+04
At Newton iteration 2 norm is 1.595152303517e+05
At Newton iteration 3 norm is 4.163062787094e+02
At Newton iteration 4 norm is 1.100727505071e-02
At Newton iteration 5 norm is 1.425474629941e-08
===== hyperelastic problem at iteration 6 =====
At Newton iteration 1 norm is 1.002040542127e+04
At Newton iteration 2 norm is 1.071125200654e+05
At Newton iteration 3 norm is 1.848234915367e+02
At Newton iteration 4 norm is 5.746142315737e-02
At Newton iteration 5 norm is 2.426594367340e-08
===== hyperelastic problem at iteration 7 =====
At Newton iteration 1 norm is 6.712638577580e+03
At Newton iteration 2 norm is 3.205841852490e+04
At Newton iteration 3 norm is 1.441124162503e+01
At Newton iteration 4 norm is 1.111882391506e-04
At Newton iteration 5 norm is 1.369397846277e-08
Generate movie 1/8 (12.50 %) 1.67 s
Generate movie 2/8 (25.00 %) 834.68 ms
Generate movie 3/8 (37.50 %) 634.58 ms
Generate movie 4/8 (50.00 %) 503.30 ms
Generate movie 5/8 (62.50 %) 377.28 ms
Generate movie 6/8 (75.00 %) 252.45 ms
Generate movie 7/8 (87.50 %) 125.93 ms
Generate movie 8/8 (100.00 %) 0.00 µs
12 from EasyFEA import Display, Folder, ElemType, Models, Simulations, PyVista
13 from EasyFEA.Geoms import Domain
14
15 if __name__ == "__main__":
16 Display.Clear()
17
18 # ----------------------------------------------
19 # Configuration
20 # ----------------------------------------------
21
22 # outputs
23 folder = Folder.Join(Folder.RESULTS_DIR, "Hyperelasticity")
24 makeMovie = True
25 result = "uy"
26
27 # geom
28 L = 120
29 h = 13
30
31 # model
32 lmbda = 121153.84615384616 # Mpa
33 mu = 80769.23076923077
34
35 # ----------------------------------------------
36 # Mesh
37 # ----------------------------------------------
38 meshSize = h / 3
39
40 contour = Domain((0, 0), (L, h), h / 3)
41
42 mesh = contour.Mesh_Extrude(
43 [], [0, 0, h], [h / meshSize], ElemType.HEXA8, isOrganised=True
44 )
45 nodesX0 = mesh.Nodes_Conditions(lambda x, y, z: x == 0)
46 nodesXL = mesh.Nodes_Conditions(lambda x, y, z: x == L)
47
48 # ----------------------------------------------
49 # Simulation
50 # ----------------------------------------------
51
52 mat = Models.SaintVenantKirchhoff(3, lmbda, mu)
53
54 simu = Simulations.HyperElasticSimu(mesh, mat)
55
56 simu.add_dirichlet(nodesX0, [0, 0, 0], simu.Get_unknowns())
57 simu.add_dirichlet(nodesXL, [-h], ["y"])
58
59 # static
60 simu.Solve()
61 simu.Save_Iter()
62
63 # dynamic
64 T = 7
65 dt = T / 7
66 simu.Bc_Init()
67 simu.Solver_Set_Hyperbolic_Algorithm(dt)
68 simu.add_dirichlet(nodesX0, [0, 0, 0], simu.Get_unknowns())
69
70 for _ in range(int(T / dt)):
71 simu.Solve()
72 simu.Save_Iter()
73
74 # ----------------------------------------------
75 # Results
76 # ----------------------------------------------
77
78 PyVista.Plot_BoundaryConditions(simu).show()
79
80 if makeMovie:
81 PyVista.Movie_simu(
82 simu, "uy", folder, "Hyperelas4.gif", deformFactor=1, plotMesh=True
83 )
84
85 PyVista.Plot(simu, "uy", 1, plotMesh=True).show()
Total running time of the script: (0 minutes 4.483 seconds)