using PtFEM
ProjDir = dirname(@__FILE__)
data = Dict(
# Plane(ndim, nst, nxe, nye, nip, direction, finite_element(nod, nodof), axisymmetric)
:struc_el => Plane(2, 4, 8, 4, 4, :y, Quadrilateral(8, 2), false),
:properties => [100.0 1.0e5 0.3;],
:x_coords => [0.0, 1.0, 2.0, 3.0, 4.0, 5.5, 7.0, 9.0, 12.0],
:y_coords => [0.0, -1.25, -2.5, -3.75, -5.0],
:support => [
( 1, [0 1]), ( 2, [0 1]), ( 3, [0 1]), ( 4, [0 1]), ( 5, [0 1]), ( 6, [0 1]),
( 7, [0 1]), ( 8, [0 1]), ( 9, [0 0]), ( 14, [0 0]), ( 23, [0 0]), ( 28, [0 0]),
( 37, [0 0]), ( 42, [0 0]), ( 51, [0 0]), ( 56, [0 0]), ( 65, [0 0]), ( 70, [0 0]),
( 79, [0 0]), ( 84, [0 0]), ( 93, [0 0]), ( 98, [0 0]), (107, [0 0]), (112, [0 0]),
(113, [0 1]), (114, [0 1]), (115, [0 1]), (116, [0 1]), (117, [0 1]), (118, [0 1]),
(119, [0 1]), (120, [0 1]), (121, [0 0])
],
:loaded_nodes => [
( 1, [0.0 -0.166667]), (10, [0.0 -0.666667]), (15, [0.0 -0.333333]),
(24, [0.0 -0.666667]), (29, [0.0 -0.166667])
],
:tol => 0.001,
:limit => 250,
:qincs => [200.0, 100.0, 50.0, 50.0, 50.0, 30.0, 20.0, 10.0, 5.0, 4.0],
:cg_tol => 0.0001,
:cg_limit => 100
)
data |> display
println()
@time m = p62(data)
println()
m |> display
if VERSION.minor < 6
using Plots
gr(size=(400,400))
disp = convert(Array, m[:disp])
qcu = convert(Array, m[:loads]) / 100.0
iters = convert(Array, m[:iters])
plot(qcu, disp, leg=false,
xlim=(0, 6), ylim = (-0.08, 0.0),
ylab="Centerline displacement", xlab="Bearing stress"
)
for i in 1:size(m, 1 )
tf = "$(iters[i])"
annotate!([(qcu[i], disp[i], text(tf, 8, :red, :center))])
end
plot!([5.14, 5.14], [-0.02, -0.045], color=:darkblue)
plot!([5.14, 5.14], [-0.046, -0.065], line=(:dash), color=:darkblue)
scatter!([5.14], [-0.045], marker=(Plots._shape_keys[9], 6), color=:darkblue)
annotate!([(5.14, -0.015, text("Prandtl", 8, :black, :center))])
annotate!([(5.14, -0.018, text("5.14", 8, :black, :center))])
savefig(ProjDir*"/fig6.11.png")
end