Skip to content

Commit ccc5d64

Browse files
committed
minor changes
1 parent a08f523 commit ccc5d64

14 files changed

Lines changed: 39 additions & 32 deletions

File tree

examples/mech/truss.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ addstage!(model, bcs)
2525
solve!(model)
2626

2727
mchart = MeshChart(model,
28-
field = :sX,
28+
field = :σx´,
2929
colormap = :coolwarm,
3030
label = L"\sigma_x",
3131
warp = 100

src/mech/mech-modal-solver.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ function mech_modal_solver!(ana::MechModalAnalysis, stage::Stage; kwargs...)
8888

8989
# todo: check there are not force boundary conditions
9090

91-
@show 100
92-
9391
# get only bulk elements # todo: improve this
9492
model = FEModel(model.elems.bulks)
9593

@@ -115,9 +113,6 @@ function mech_modal_solver!(ana::MechModalAnalysis, stage::Stage; kwargs...)
115113
dof.vals[dof.natname] = 0.0
116114
end
117115

118-
@show 200
119-
120-
121116
K11 = mount_K(model.elems, ndofs)[1:nu, 1:nu]
122117
M11 = mount_M(model.elems, ndofs)[1:nu, 1:nu]
123118

@@ -142,15 +137,13 @@ function mech_modal_solver!(ana::MechModalAnalysis, stage::Stage; kwargs...)
142137
# eingenvalues and eingenvectors
143138
# Eig = eigs(P, nev=nmodes, which=:SR, tol=1e-6, maxiter=600, check=1) # SR: smallest real part
144139
# nenv = size(P,2) - 2
145-
@show 300
146140

147141
# Eig = eigs(P, nev=nmodes, which=:SM, tol=1e-6, ncv=min(2*nmodes, nenv), check=1) # SM: smallest magnitude
148142
λ, V = eigs(P, nev=nmodes, which=:SM, tol=1e-6, check=1, maxiter=10000) # SM: smallest magnitude
149143
# Eig = eigs(P, nev=nmodes, which=:LM) # LM: largest magnitude
150144
# w0 = λ # frequencies
151145
# λ = copy(w0)
152146

153-
@show 400
154147

155148
# @show wi
156149
# @show wi

src/mesh/genmesh.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Mesh_Geo_params = [
44
FunInfo(:Mesh, "Creates a `Mesh` structure from a `GeoModel` object."),
55
ArgInfo(:geo, "GeoModel object"),
6-
KwArgInfo(:ndim, "Mesh dimension hint", 1),
6+
KwArgInfo(:ndim, "Mesh dimension hint", nothing),
77
KwArgInfo(:size, "Characteristic length for meshing", 0.1),
88
KwArgInfo(:quadratic, "Flag for quadratic cells (gmsh)", false),
99
KwArgInfo(:algorithm, "Algorithm for triangulation (gmsh)", :delaunay),
@@ -17,7 +17,6 @@ Mesh_Geo_params = [
1717
function Mesh(geo::GeoModel; kwargs...)
1818
args = checkargs([geo], kwargs, Mesh_Geo_params)
1919
quiet = args.quiet
20-
ndim = args.ndim
2120

2221
# check for blocks
2322
blocks = [ b for b in geo.blocks if b isa Block ]
@@ -35,11 +34,15 @@ function Mesh(geo::GeoModel; kwargs...)
3534
elseif length(blocks)>0
3635
!quiet && printstyled("Structured mesh generation:\n", bold=true, color=:cyan)
3736
mesh = mesh_structured(geo)
38-
mesh.ctx.ndim = ndim
37+
# mesh.ctx.ndim = ndim
3938
else
4039
error("Mesh: No blocks or surfaces/volumes found")
4140
end
4241

42+
if args.ndim != nothing
43+
mesh.ctx.ndim = max(args.ndim, mesh.ctx.ndim)
44+
end
45+
4346
if length(geo.subpaths)>0
4447
gen_insets!(mesh, geo.subpaths)
4548
synchronize!(mesh)

src/plot/line-chart.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Chart_params = [
3030
KwArgInfo( :colorbar_label, "Label for the colorbar", "" ),
3131
KwArgInfo( :colorbar_limits, "Range of values in the colorbar", Float64[0.0,0.0], length=2 ),
3232
KwArgInfo( :colorbar_font_size, "Font size for the colorbar labels", 7.0, cond=:(colorbar_font_size>0)),
33+
KwArgInfo(:quiet, "Flag to set silent mode", false),
3334
]
3435
@doc docstring(Chart_params) Chart
3536

@@ -53,6 +54,8 @@ mutable struct Chart<:Figure
5354
icolor::Int
5455
iorder::Int
5556
args::NamedTuple
57+
58+
quiet::Bool
5659

5760
function Chart(; args...)
5861
args = checkargs(args, Chart_params, aliens=false)
@@ -69,6 +72,14 @@ mutable struct Chart<:Figure
6972
this.iorder = 1
7073
this.args = args
7174

75+
this.quiet = args.quiet
76+
77+
if !this.quiet
78+
printstyled("Chart figure\n", bold=true, color=:cyan)
79+
println(" size: $(this.width) x $(this.height) dpi")
80+
println(" axes: $(args.x_label) vs $(args.y_label)")
81+
end
82+
7283
return this
7384
end
7485
end

src/plot/text.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function fix_tex_elems!(elems)
4040
end
4141

4242
# fix spacement for × character
43-
pos = findfirst(elem -> elem[1].represented_char == '×', elems)
43+
pos = findfirst(elem -> !(elem[1] isa HLine) && elem[1].represented_char == '×', elems)
4444
if pos !== nothing && pos < length(elems)
4545
elem = elems[pos]
4646
point = typeof(elem[2])(elem[2][1] - 0.07, elem[2][2])

test/dynamic/modal-bathe.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ mesh=Mesh(bl1, bl2, bl3, bl4, bl5, bl6, bl7, bl8, bl9, bl10, bl21, bl11, bl12, b
4646
mats = [
4747
:solids => MechSolid => DruckerPrager => (E=Ec, nu=0.2, rho=roc, alpha=0.4312, kappa=3771.2),
4848
:lines => MechBar => LinearElastic => (E=Ea, A=Aa, rho=roa),
49-
:joints1d => MechLSJoint => ElasticLSJoint => (ks=1.e7, kn=1.e7, p=p),
49+
:joints1d => MechBondSlip => ElasticBondSlip => (ks=1.e7, kn=1.e7, p=p),
5050
# MaterialBind(:solids, DruckerPrager => (E=Ec, nu=0.2, rho=roc, alpha=0.4312, kappa=3771.2) ),
5151
# MaterialBind(:joints1D, ElasticJoint1D(ks=1.e7, kn=1.e7, A=Aa) ),
5252
# MaterialBind(:lines , ElasticRod => (E=Ea, A=Aa, rho=roa) ),
@@ -55,7 +55,7 @@ mats = [
5555
matl = MaterialList()
5656
matl.add_material(:solids, MechSolid, DruckerPrager, E=Ec, nu=0.2, rho=roc, alpha=0.4312, kappa=3771.2)
5757
matl.add_material(:lines, MechBar, LinearElastic, E=Ea, A=Aa, rho=roa)
58-
matl.add_material(:joints1d, MechLSJoint, ElasticLSJoint, ks=1.e7, kn=1.e7, p=p)
58+
matl.add_material(:joints1d, MechBondSlip, ElasticBondSlip, ks=1.e7, kn=1.e7, p=p)
5959

6060
ctx = MechContext()
6161
model = FEModel(mesh, mats, ctx)

test/mech/elem/inset/ceb.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ tag!(msh.elems["solids"].nodes, "fixed_points")
2222
mats = [
2323
"solids" => MechSolid => LinearElastic => (E=24e3, nu=0.2),
2424
"bars" => MechTruss => LinearElastic => (E=200e6, A=0.00011),
25-
"joints" => MechRSJoint => CebLSJoint => (taumax=12, taures=3, s1=0.001, s2=0.0011, s3=0.004, alpha=0.5, beta=0.5,
25+
"joints" => MechBondSlip => CebBondSlip => (taumax=12, taures=3, s1=0.001, s2=0.0011, s3=0.004, alpha=0.5, beta=0.5,
2626
ks=(12/0.001)*5, kn=5000, p=0.25)
2727
]
2828

test/mech/elem/inset/dowel.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ mats = [
2929
# :lines => MechTruss => LinearElastic => (E=200e6, A=0.00011),
3030
:lines => MechBeam => LinearElastic => (E=200e6, A=0.00011),
3131

32-
:linejoints => MechLSJoint => LinearLSInterface => (kn=5000, ks=6000, p=0.25),
33-
# :linejoints => MechLSJoint => CebLSInterface => (taumax=12, taures=3, s1=0.001, s2=0.0011, s3=0.004, alpha=0.5, beta=0.5, ks=(12/0.001)*5, kn=5000, p=0.25)
32+
:linejoints => MechBondSlip => LinearBondSlip => (kn=5000, ks=6000, p=0.25),
33+
# :linejoints => MechBondSlip => CebBondSlip => (taumax=12, taures=3, s1=0.001, s2=0.0011, s3=0.004, alpha=0.5, beta=0.5, ks=(12/0.001)*5, kn=5000, p=0.25)
3434
]
3535

3636
ctx = MechContext(stressmodel=:planestress)

test/mech/elem/inset/tip.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ save(msh, "mesh.vtk")
1717
mats = [
1818
"solids" => MechSolid => LinearElastic => (E=24e3, nu=0.2),
1919
"bars" => MechBar => LinearElastic => (E=200e6, A=0.00011),
20-
"joints" => MechRSJoint => CebLSJoint => (taumax=12, taures=3, s1=0.001, s2=0.0011, s3=0.004, alpha=0.5, beta=0.5, ks=(12/0.001)*5, kn=5000, p=0.25),
21-
"tips" => MechTipJoint => TipContact => (k=1e8, fixed=false)
20+
"joints" => MechBondSlip => CebBondSlip => (taumax=12, taures=3, s1=0.001, s2=0.0011, s3=0.004, alpha=0.5, beta=0.5, ks=(12/0.001)*5, kn=5000, p=0.25),
21+
"tips" => MechSlipTip => LinearTipContact => (k=1e8, fixed=false)
2222
]
2323

2424
ctx = MechContext()

test/mech/elem/joint/joint1d.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mesh = Mesh(bls)
1414

1515
mats = [
1616
"solids" => MechSolid => LinearElastic => (E=1.e4, nu=0.),
17-
"joints" => MechRSJoint => ElasticRSJoint => (ks=1.e5, kn=1.e5, p=0.25),
17+
"joints" => MechBondSlip => ElasticRSJoint => (ks=1.e5, kn=1.e5, p=0.25),
1818
"bars" => MechBar => LinearElastic => (E=1.e8, A=0.005),
1919
]
2020

0 commit comments

Comments
 (0)