Note
Go to the end to download the full example code.
3D Canteleaver Beam with geometric nonlinearities

Iter 1 - Time: 0.20000 - dt 0.20000 - NR iter: 2 - Err: 0.00004
Iter 2 - Time: 0.40000 - dt 0.20000 - NR iter: 2 - Err: 0.00004
Iter 3 - Time: 0.60000 - dt 0.20000 - NR iter: 2 - Err: 0.00003
Iter 4 - Time: 0.80000 - dt 0.20000 - NR iter: 1 - Err: 0.00089
Iter 5 - Time: 1.00000 - dt 0.20000 - NR iter: 1 - Err: 0.00079
import fedoo as fd
import numpy as np
import time
# --------------- Pre-Treatment --------------------------------------------------------
fd.ModelingSpace("3D")
# Units: N, mm, MPa
mesh = fd.mesh.box_mesh(
nx=31,
ny=7,
nz=7,
x_min=0,
x_max=1000,
y_min=0,
y_max=100,
z_min=0,
z_max=100,
elm_type="hex8",
name="Domain",
)
# Material definition
fd.constitutivelaw.ElasticIsotrop(200e3, 0.3, name="ElasticLaw")
wf = fd.weakform.StressEquilibrium("ElasticLaw", nlgeom=True)
# Assembly (print the time required for assembling)
assemb = fd.Assembly.create(wf, mesh, "hex8", name="Assembling")
# Type of problem
pb = fd.problem.NonLinear("Assembling")
# Boundary conditions
nodes_left = mesh.find_nodes("X", mesh.bounding_box.xmin)
nodes_load = mesh.find_nodes(
f"X=={mesh.bounding_box.xmax} and Y=={mesh.bounding_box.ymax}"
)
pb.bc.add("Dirichlet", nodes_left, "Disp", 0)
pb.bc.add("Dirichlet", nodes_load, "DispY", -500)
# --------------- Solve --------------------------------------------------------
pb.nlsolve(dt=0.2)
# #--------------- Post-Treatment -----------------------------------------------
res = pb.get_results("Assembling", ["Stress", "Disp"])
res.plot("Stress", "XX", "Node", show_edges=False)
Total running time of the script: (0 minutes 2.500 seconds)