Skip to content

Commit

Permalink
v0.3.6 ned test/Project.toml. FIxed bug in ElementAPI.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeMaincon committed May 2, 2023
1 parent 42a27b4 commit aa213dc
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Muscade"
uuid = "93488820-1883-11ed-0c34-05177b029e4d"
authors = ["Philippe Maincon <philippe.maincon@sintef.no>"]
version = "0.3.5"
version = "0.3.6"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
9 changes: 5 additions & 4 deletions src/BasicElements.jl
Original file line number Diff line number Diff line change
Expand Up @@ -277,14 +277,15 @@ e1 = addelement!(model,DofConstraint,[n1],xinod=(1,),xfield=(:t1,),
mode=positive)
e2 = addelement!(model,QuickFix ,[n1],inod=(1,),field=(:t1,),
res=(x,u,a,t)->0.4x.+.08+.5x.^2)
state = solve(staticX;model,time=[0.],verbose=false)
initialstate = initialize!(model)
state = solve(StaticX;initialstate,time=[0.],verbose=false)
X = state[1].X[1]
# output
2-element Vector{Float64}:
-0.09999867546403915
0.045000397353771225
-0.09999997108612142
0.04500000867027695
```
See also: [`Hold`](@ref), [`off`](@ref), [`equal`](@ref), [`positive`](@ref)
Expand Down Expand Up @@ -400,7 +401,7 @@ e = addelement!(model,QuickFix,[node1,node2];inod=(1,2),field=(:tx1,:tx1),
# output
EleID(1, 1)
Muscade.EleID(1, 1)
```
"""
struct QuickFix{Nx,inod,field,Tres} <: AbstractElement
Expand Down
4 changes: 2 additions & 2 deletions src/ElementAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ a static solver), the output is a vector of zeros.
See also: [`∂0`](@ref),[`∂2`](@ref)
"""
∂1(y) = length(y) 2 ? y[2] : SVector(0. for xy[1])
∂1(y) = length(y) 2 ? y[2] : zeros(SVector{length(y[1])})

"""
position = ∂2(X)
Expand All @@ -55,7 +55,7 @@ a static solver), the output is a vector of zeros.
See also: [`∂0`](@ref),[`∂1`](@ref)
"""
∂2(y) = length(y) 3 ? y[2] : SVector(0. for xy[1])
∂2(y) = length(y) 3 ? y[2] : zeros(SVector{length(y[1])})
∂n(n) = (∂0,∂1,∂2)[n+1]

"""
Expand Down
4 changes: 4 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[deps]
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ module Runtest
@testset "TestUnit" begin
include("TestUnit.jl")
end
#doctest(Muscade)
doctest(Muscade)
end
end

0 comments on commit aa213dc

Please sign in to comment.