Note
Go to the end to download the full example code.
Benchmark problem: Wedged Plate - finite deformations
Features
Using PatchMesher to model the plate
nodal boundary conditions using location-based search
face loads using location-based search
finite deformation Triangle and Quad elements
history plot feature
import numpy as np
from femedu.examples import Example
from femedu.domain import System
from femedu.solver import NewtonRaphsonSolver
from femedu.elements.finite import Quad, Triangle
from femedu.materials import PlaneStress
from femedu.mesher import *
class Example20_Benchmark01(Example):
def problem(self):
# ========== setting mesh parameters ==============
Nx = 8 # number of elements in the mesh
Ny = 4 # number of elements in the mesh
L1 = 48.0
L2 = 44.0
L3 = 16.0
# ========== setting material parameters ==============
params = dict(
E = 1000., # Young's modulus
nu = 0.3, # Poisson's ratio
t = 1.00 # thickness of the plate
)
# ========== setting load parameters ==============
px = 0.0 # uniform load normal to x=Lx
pxy = 100.0/L3 # uniform shear load on x=L1
# ========== setting analysis parameters ==============
target_load_level = 5.00 # reference load
max_steps = 26 # number of load steps: 2 -> [0.0, 1.0]
# define a list of target load levels
load_levels = np.linspace(0, target_load_level, max_steps)
#
# ==== Build the system model ====
#
model = System()
model.setSolver(NewtonRaphsonSolver())
# create nodes
mesher = PatchMesher(model, (0.,0.),(L1, L2),(L1, L2+L3),(0.,L2) )
nodes, elements = mesher.quadMesh(Nx, Ny, Quad, PlaneStress(params))
mesher.shift(1.25*L1, 0.0)
nodes2, elements2 = mesher.triangleMesh(Nx, Ny, Triangle, PlaneStress(params))
nodes += nodes2
elements += elements2
# ==== Apply boundary conditions ====
#
# the left model
#
## fix left side
for node, _ in model.findNodesAlongLine((0.0, 0.0), (0.0, 1.0)):
node.fixDOF('ux', 'uy')
## define loads ...
for _, face in model.findFacesAlongLine((L1,0.0), (0.0,1.0), orientation=+1):
face.setLoad(px, pxy)
## locate the node at the centerline
nodeA, dist = model.findNodesAt((L1, L2+L3))[0]
#
# the right model
#
## fix left side
for node, _ in model.findNodesAlongLine((1.25*L1, 0.0), (0.0, 1.0)):
node.fixDOF('ux', 'uy')
## define loads ...
for _, face in model.findFacesAlongLine((2.25*L1,0.0), (0.0,1.0), orientation=+1):
face.setLoad(px, pxy)
## locate the node at the centerline
nodeB, dist = model.findNodesAt((2.25*L1, L2+L3))[0]
#model.report()
# set up a recorder
model.initRecorder(variables=['ux','uy'], nodes=[nodeA, nodeB])
model.startRecorder()
model.plot(factor=0, title="undeformed system", filename="benchmark01_undeformed.png", show_bc=1, show_loads=1)
for lf in np.linspace(0.0, target_load_level, max_steps):
model.setLoadFactor(lf)
model.solve(verbose=True)
#model.report()
model.plot(factor=1., show_bc=1, show_loads=1, show_reactions=1)
model.valuePlot('sxx', show_mesh=True)
model.valuePlot('syy', show_mesh=True)
model.valuePlot('sxy', show_mesh=True)
# create a history plot for the end node
#model.historyPlot('lam', ['ux','uy'], nodes=[nodeA,nodeA])
#model.historyPlot('lam', ['ux','uy'], nodes=[nodeB,nodeB])
model.historyPlot('lam', ['ux','uy','ux','uy'], nodes=[nodeA,nodeA,nodeB,nodeB])
Run the example by creating an instance of the problem and executing it by calling Example.run()
if __name__ == "__main__":
ex = Example20_Benchmark01()
ex.run()
+ Quad_6854: nodes ( Node_4321 Node_4322 Node_4331 Node_4330 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Quad_6854: nodes ( Node_4321 Node_4322 Node_4331 Node_4330 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Quad_6862: nodes ( Node_4330 Node_4331 Node_4340 Node_4339 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Quad_6862: nodes ( Node_4330 Node_4331 Node_4340 Node_4339 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Quad_6870: nodes ( Node_4339 Node_4340 Node_4349 Node_4348 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Quad_6870: nodes ( Node_4339 Node_4340 Node_4349 Node_4348 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Quad_6878: nodes ( Node_4348 Node_4349 Node_4358 Node_4357 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Quad_6878: nodes ( Node_4348 Node_4349 Node_4358 Node_4357 )
material: list
strain (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (0): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (1): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (2): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
strain (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress (3): xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6893: nodes ( Node_4366 Node_4367 Node_4375 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6894: nodes ( Node_4376 Node_4375 Node_4367 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6894: nodes ( Node_4376 Node_4375 Node_4367 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6909: nodes ( Node_4375 Node_4376 Node_4384 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6910: nodes ( Node_4385 Node_4384 Node_4376 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6910: nodes ( Node_4385 Node_4384 Node_4376 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6925: nodes ( Node_4384 Node_4385 Node_4393 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6926: nodes ( Node_4394 Node_4393 Node_4385 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6926: nodes ( Node_4394 Node_4393 Node_4385 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6941: nodes ( Node_4393 Node_4394 Node_4402 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6942: nodes ( Node_4403 Node_4402 Node_4394 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
+ Triangle_6942: nodes ( Node_4403 Node_4402 Node_4394 )
material: PlaneStress
strain: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=-0.000e+00
stress: xx=0.000e+00 yy=0.000e+00 xy=0.000e+00 zz=0.000e+00
norm of the out-of-balance force: 2.7688e-11
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.7967e+00
norm of the out-of-balance force: 8.7339e-04
norm of the out-of-balance force: 1.3869e-09
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.6992e+00
norm of the out-of-balance force: 8.4504e-04
norm of the out-of-balance force: 1.3341e-09
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.6018e+00
norm of the out-of-balance force: 8.1663e-04
norm of the out-of-balance force: 1.2800e-09
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.5050e+00
norm of the out-of-balance force: 7.8823e-04
norm of the out-of-balance force: 1.2278e-09
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.4088e+00
norm of the out-of-balance force: 7.5995e-04
norm of the out-of-balance force: 1.1697e-09
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.3136e+00
norm of the out-of-balance force: 7.3186e-04
norm of the out-of-balance force: 1.1009e-09
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.2193e+00
norm of the out-of-balance force: 7.0406e-04
norm of the out-of-balance force: 1.0257e-09
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.1263e+00
norm of the out-of-balance force: 6.7662e-04
norm of the out-of-balance force: 9.6203e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 3.0346e+00
norm of the out-of-balance force: 6.4960e-04
norm of the out-of-balance force: 9.0858e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.9445e+00
norm of the out-of-balance force: 6.2307e-04
norm of the out-of-balance force: 8.5029e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.8559e+00
norm of the out-of-balance force: 5.9709e-04
norm of the out-of-balance force: 7.7695e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.7691e+00
norm of the out-of-balance force: 5.7170e-04
norm of the out-of-balance force: 7.2541e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.6841e+00
norm of the out-of-balance force: 5.4694e-04
norm of the out-of-balance force: 6.5840e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.6009e+00
norm of the out-of-balance force: 5.2286e-04
norm of the out-of-balance force: 6.1889e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.5197e+00
norm of the out-of-balance force: 4.9947e-04
norm of the out-of-balance force: 5.4816e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.4404e+00
norm of the out-of-balance force: 4.7681e-04
norm of the out-of-balance force: 5.0640e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.3631e+00
norm of the out-of-balance force: 4.5488e-04
norm of the out-of-balance force: 4.6202e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.2879e+00
norm of the out-of-balance force: 4.3371e-04
norm of the out-of-balance force: 4.2264e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.2147e+00
norm of the out-of-balance force: 4.1330e-04
norm of the out-of-balance force: 3.8200e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.1436e+00
norm of the out-of-balance force: 3.9364e-04
norm of the out-of-balance force: 3.5541e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.0745e+00
norm of the out-of-balance force: 3.7475e-04
norm of the out-of-balance force: 3.1965e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 2.0075e+00
norm of the out-of-balance force: 3.5661e-04
norm of the out-of-balance force: 2.8849e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 1.9426e+00
norm of the out-of-balance force: 3.3921e-04
norm of the out-of-balance force: 2.5962e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 1.8796e+00
norm of the out-of-balance force: 3.2255e-04
norm of the out-of-balance force: 2.5385e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
norm of the out-of-balance force: 1.3229e+01
norm of the out-of-balance force: 1.8187e+00
norm of the out-of-balance force: 3.0661e-04
norm of the out-of-balance force: 2.1568e-10
Recorder.addData: 'stability' not initialized by the recorder: ignored
+
Total running time of the script: (0 minutes 23.394 seconds)