Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor bug fixes #106

Merged
merged 5 commits into from
Mar 29, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
various bug fixes and tweaks
  • Loading branch information
taylormcd committed Mar 29, 2023
commit 762e4dc2259812d896173ccf951005919b990eb0
13 changes: 5 additions & 8 deletions src/analyses.jl
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ function steady_output!(system, x, p, constants)
assembly, pcond, dload, pmass, gvec, vb_p, ωb_p, ab_p, αb_p = steady_parameters(x, p, constants)

# initialize state rate vector (if necessary)
dx = typeof(system.dx) <: typeof(x) ? system.dx .= 0 : similar(x) .= system.x
dx = typeof(system.dx) <: typeof(x) ? system.dx .= 0 : zero(x)

# extract body frame accelerations
ab, αb = body_accelerations(x, indices.icol_body, ab_p, αb_p)
Expand Down Expand Up @@ -1002,7 +1002,7 @@ function left_eigenvectors(K, M, λ, V)
for iλ = 1:nev

# factorize (K + λ*M)'
KmλMfact = factorize(K' + λ[iλ]'*M')
KmλMfact = factorize(K' + (λ[iλ]+1e-9)'*M')

# initialize left eigenvector
for i = 1:nx
Expand Down Expand Up @@ -1050,7 +1050,7 @@ function left_eigenvectors(K, M::SparseMatrixCSC, λ, V)
for iλ = 1:nev

# factorize (K + λ*M)'
KmλMfact = factorize(K' + λ[iλ]'*M')
KmλMfact = factorize(K' + (λ[iλ]+1e-9)'*M')

# initialize left eigenvector
for i = 1:nx
Expand Down Expand Up @@ -2353,7 +2353,7 @@ function time_domain_analysis!(system::DynamicSystem, assembly, tvec;
# --- Initialize Time-Domain Solution --- #

# initialize storage for each time step
history = Vector{AssemblyState{eltype(x)}}(undef, length(save))
history = Vector{AssemblyState{eltype(x), Vector{PointState{eltype(x)}}, Vector{ElementState{eltype(x)}}}}(undef, length(save))
isave = 1

# add initial state to the solution history
Expand Down Expand Up @@ -2496,7 +2496,7 @@ function newmark_parameters(p, constants)
Ωdot_init = [SVector{3}(p_i[12*(ip-1)+10], p_i[12*(ip-1)+11], p_i[12*(ip-1)+12]) for ip = 1:length(assembly.points)]

# overwrite default assembly and parameters (if applicable)
parameters = isnothing(xpfunc) ? pfunc(p, t) : xpfunc(x, p, t)
parameters = isnothing(xpfunc) ? pfunc(p_p, t) : xpfunc(x, p_p, t)
assembly = get(parameters, :assembly, assembly)
prescribed_conditions = get(parameters, :prescribed_conditions, prescribed_conditions)
distributed_loads = get(parameters, :distributed_loads, distributed_loads)
Expand Down Expand Up @@ -2605,9 +2605,6 @@ function newmark_output(system, x, p, constants)
# combine constants and parameters
assembly, pcond, dload, pmass, gvec, vb_p, ωb_p, udot_init, θdot_init, Vdot_init, Ωdot_init, dt = newmark_parameters(p, constants)

# update acceleration state variable indices
update_body_acceleration_indices!(indices, pcond)

# initialize state rate vector (if necessary)
dx = typeof(system.dx) <: typeof(x) ? system.dx .= 0 : similar(x) .= 0

Expand Down