Skip to content

Commit

Permalink
type stability in second statXUA assembly
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeMaincon committed Jan 30, 2023
1 parent ddfc481 commit 7640f00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/core/StaticXUA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ function zero!(out::OUTstaticΛXU_A)
zero!(out.Lya)
zero!(out.Laa)
end
function addin!(out::OUTstaticΛXU_A,asm,iele,scale,eleobj::E,Λ,X,U,A, t,γ,dbg) where{E}
Nx,Nu,Na = getndof(E,(:X,:U,:A))
function addin!(out::OUTstaticΛXU_A,asm,iele,scale,eleobj::E,Λ,X::NTuple{Nxdir,<:SVector{Nx}},
U::NTuple{Nudir,<:SVector{Nu}},A::SVector{Na}, t,γ,dbg) where{E,Nxdir,Nx,Nudir,Nu,Na} # TODO make Nx,Nu,Na types
Ny = 2Nx+Nu # Y=[Λ;X;U]
Nz = 2Nx+Nu+Na # Z = [Y;A]=[Λ;X;U;A]
ΔZ = variate{2,Nz}(δ{1,Nz,𝕣}())
Expand Down
12 changes: 6 additions & 6 deletions test/profile.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ e7 = addelement!(model,Hold ,[n3], field=:tx2)
@once f3(a) = 0.11a^2
e8 = addelement!(model,DofCost ,[n1], class=:X ,field=:tx1 ,cost=f2)
e9 = addelement!(model,DofCost ,[n1], class=:X ,field=:tx2 ,cost=f2)
#e10 = addelement!(model,DofCost ,[n4], class=:A ,field=:ΞL₀ ,cost=f3)
#e10 = addelement!(model,DofCost ,[n4], class=:A ,field=:ΞEI ,cost=f3)
e10 = addelement!(model,DofCost ,[n4], class=:A ,field=:ΞL₀ ,cost=f3)
e10 = addelement!(model,DofCost ,[n4], class=:A ,field=:ΞEI ,cost=f3)
stateX = solve(staticX; model,time=[.5,1.],verbose=false)
#state = solve(staticXUA;model,initial=stateX,maxYiter= 0,verbose=false)
state = solve(staticXUA;model,initial=stateX,maxYiter= 50,verbose=false)
#@btime state = solve(staticXUA;model,initial=stateX,maxYiter= 0,verbose=false)

Profile.clear()
Profile.@profile for i=1:25000
local stateX = solve(staticX; model,time=[.5,1.],verbose=false)
# local state = solve(staticXUA;model,initial=stateX,maxYiter= 50,verbose=false);
Profile.@profile for i=1:1000#25000
# local stateX = solve(staticX; model,time=[.5,1.],verbose=false)
local state = solve(staticXUA;model,initial=stateX,maxYiter= 50,verbose=false);
end
ProfileView.view(fontsize=30);

Expand Down

0 comments on commit 7640f00

Please sign in to comment.