Note
Go to the end to download the full example code.
Hyperelas3#
A L shape part undergoing bending deformation.




===== hyperelastic problem at iteration 0 =====
At Newton iteration 1 norm is 6.497862896539e+06
At Newton iteration 2 norm is 2.358952920613e+08
At Newton iteration 3 norm is 2.055017619686e+07
At Newton iteration 4 norm is 1.847687094048e+06
At Newton iteration 5 norm is 7.842704053203e+05
At Newton iteration 6 norm is 4.044220405259e+03
At Newton iteration 7 norm is 2.745963073942e+00
At Newton iteration 8 norm is 1.247175864676e-06
==================== Mesh ====================
Element type: PRISM6
Ne = 2370, Nn = 1744
==================== Model ====================
<EasyFEA.Models.HyperElastic._laws.SaintVenantKirchhoff object at 0x7f4414d9e150>
solver : scipy
============= Boundary Conditions =============
Unspecified.
=================== Results ===================
Unspecified.
=================== TicTac ===================
Mesh : 57.802 ms
Boundary Conditions : 16.212 µs
Matrix : 777.121 ms
Solver : 1.091 s
Resolution hyperelastic : 1.901 s
PyVista_Interface : 165.206 ms
13 from EasyFEA import Display, Models, ElemType, Simulations, PyVista
14 from EasyFEA.Geoms import Point, Points
15
16 if __name__ == "__main__":
17 Display.Clear()
18
19 # ----------------------------------------------
20 # Configuration
21 # ----------------------------------------------
22 dim = 3
23
24 # geom
25 L = 250
26 thickness = 50
27 w = 50
28
29 # load
30 sigMax = 8 * 1e6 / (w * thickness)
31
32 # ----------------------------------------------
33 # Mesh
34 # ----------------------------------------------
35 meshSize = L / 10
36
37 p1 = Point(0, 0)
38 p2 = Point(L, 0)
39 p3 = Point(L, L, r=50)
40 p4 = Point(2 * L - w, L)
41 p5 = Point(2 * L, L)
42 p6 = Point(2 * L, 2 * L)
43 p7 = Point(2 * L - w, 2 * L)
44 p8 = Point(0, 2 * L)
45
46 contour = Points([p1, p2, p3, p4, p5, p6, p7, p8], meshSize)
47
48 if dim == 2:
49 mesh = contour.Mesh_2D([], ElemType.TRI3)
50 else:
51 mesh = contour.Mesh_Extrude([], [0, 0, -thickness], [3], ElemType.PRISM6)
52
53 nodes_y0 = mesh.Nodes_Conditions(lambda x, y, z: y == 0)
54 nodes_Load = mesh.Nodes_Conditions(lambda x, y, z: x == 2 * L)
55
56 # ----------------------------------------------
57 # Simulation
58 # ----------------------------------------------
59 elas = Models.Elastic.Isotropic(dim, E=210000, v=0.25, planeStress=True)
60 material = Models.HyperElastic.SaintVenantKirchhoff(
61 dim, elas.get_lambda(), elas.get_mu(), thickness=thickness
62 )
63
64 simu = Simulations.HyperElastic(mesh, material)
65
66 simu.add_dirichlet(nodes_y0, [0] * dim, simu.Get_unknowns())
67 simu.add_surfLoad(nodes_Load, [sigMax], ["y"])
68
69 simu.Solve()
70
71 # ----------------------------------------------
72 # Results
73 # ----------------------------------------------
74
75 PyVista.Plot_Mesh(simu).show()
76 PyVista.Plot_BoundaryConditions(simu).show()
77 PyVista.Plot(simu, "ux", deformFactor=1).show()
78 PyVista.Plot(simu, "uy", deformFactor=1).show()
79
80 print(simu)
Total running time of the script: (0 minutes 2.683 seconds)