import anon
'jax_disable_jit', True)
anon.conf.config.update("jax_enable_x64", True)
anon.conf.config.update(import anon.atom as anp
import elle.sections
import elle.beam2d
import anabel as em
= elle.beam2d.transform_no2(elle.beam2d.geom_no2)
geom_template = elle.beam2d.resp_no1 beam_template
An Assembler
is an object with an .assemble()
and optionally a .compose()
method
# Create a model Assembler
= em.SkeletalModel(ndm=2,ndf=3)
model
# Define problem parameters
= model.param("ColumnE")
ColumnE = model.param("GirderE")
GirderE = model.param("P1")
P1
# Define model components
= em.aisc.load("w33x130")
girder_section = em.aisc.load("w14x159")
column_section = beam_template(**girder_section, E=GirderE)
basic_girder = beam_template(**column_section, E=ColumnE)
basic_column
= geom_template(basic_girder)
girder = geom_template(basic_column) column
WARNING:absl:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)
# Set up nodes
= 12
ft = 30.*ft, 13.*ft
B, H "1", 0., 0.)
model.node("2", 0., H )
model.node("3", B/2, H )
model.node("4", B , H )
model.node("5", B , 0.)
model.node(
"a", "1", "2", **column_section, elem=column)
model.beam("b", "2", "3", **girder_section, elem=girder)
model.beam("c", "3", "4", **girder_section, elem=girder)
model.beam("d", "4", "5", **column_section, elem=column)
model.beam(
"1", [1,1,1])
model.boun("5", [1,1,1])
model.boun(
"2", P1, dof="x")
model.load("2", -2e3, dof="y")
model.load("4", -2e3, dof="y")
model.load(
; em.plot_skeletal(model)
= model.compose() f
3600.,3600.,2e3) f(
/home/claudio/elle/numeric/elle/numeric/inverse.py:111: UserWarning: Function inversion failed to converge.
warnings.warn("Function inversion failed to converge.")
DeviceArray([[ 0.28355172],
[ 171.74283748],
[ 0.84689206],
[-202.66515683],
[-149.92389898],
[ 5.04060219],
[ -14.82161937],
[-148.43045677],
[ 5.1556104 ]], dtype=float64)
= em.plot_displ(model, f(29e6,29e6,20e3),scale=1e3) fig, ax
/home/claudio/elle/numeric/elle/numeric/inverse.py:111: UserWarning: Function inversion failed to converge.
warnings.warn("Function inversion failed to converge.")
= anon.diff.jacfwd(f, None, (0,1),squeeze=False) df
29e6,29e6,20e3) df(
dx: Traced<ConcreteArray([[20000.]
[-2000.]
[ 0.]
[ 0.]
[ 0.]
[ 0.]
[ 0.]
[-2000.]
[ 0.]])>with<JVPTrace(level=2/0)>
with primal = DeviceArray([[20000.],
[-2000.],
[ 0.],
[ 0.],
[ 0.],
[ 0.],
[ 0.],
[-2000.],
[ 0.]], dtype=float64)
tangent = Traced<ShapedArray(float64[9,1])>with<BatchTrace(level=1/0)>
with val = DeviceArray([[[-0.],
[-0.]],
[[-0.],
[-0.]],
[[-0.],
[-0.]],
[[-0.],
[-0.]],
[[-0.],
[-0.]],
[[-0.],
[-0.]],
[[-0.],
[-0.]],
[[-0.],
[-0.]],
[[-0.],
[-0.]]], dtype=float64)
batch_dim = 1
/home/claudio/elle/numeric/elle/numeric/inverse.py:112: UserWarning: Function inversion failed to converge.
warnings.warn("Function inversion failed to converge.")
(DeviceArray([[-2.04476205e-09],
[-1.10382234e-11],
[ 7.00882848e-13],
[-2.04415680e-09],
[-5.35148746e-12],
[-2.71208496e-13],
[-2.04355123e-09],
[ 2.30895445e-11],
[ 9.53551267e-13]], dtype=float64),
DeviceArray([[-5.79214813e-10],
[ 9.60734398e-13],
[ 7.15495715e-12],
[-5.24811184e-10],
[ 3.78153916e-11],
[-3.37652007e-12],
[-4.70407107e-10],
[-1.95779547e-12],
[ 6.30254346e-12]], dtype=float64))