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