diff --git a/src/FESetL2BeamModule.jl b/src/FESetL2BeamModule.jl index ae2a8b5..524c256 100644 --- a/src/FESetL2BeamModule.jl +++ b/src/FESetL2BeamModule.jl @@ -32,11 +32,12 @@ end Constructor. -Supply the total number of elements in the set, and the cross-section definition. +Supply the total number of elements in the set, and the cross-section +definition. The parameters of the section are assumed to be uniform along the +set of the beam elements. """ function FESetL2Beam(N::IT, crosssection::CT) where {IT<:Integer, CT} par = crosssection.parameters(0.0) - N = size(conn, 1) _A = fill(par.A, N) _I1 = fill(par.I1, N) _I2 = fill(par.I2, N) @@ -70,11 +71,12 @@ function cat(self::T, other::T) where {T<:FESetL2Beam} end """ - subset(self::T, L::FIntVec) where {T<:FESetL2Beam} + subset(self::T, L::IT) where {T<:FESetL2Beam, IT} Subset of a beam-element set. """ -function subset(self::T, L::FIntVec) where {T<:FESetL2Beam} +function subset(self::T, L::IT) where {T<:FESetL2Beam, IT} + @info "Here" result = deepcopy(self) result.A = self.A[L] result.I1 = self.I1[L] diff --git a/test/test_beam_mesh.jl b/test/test_beam_mesh.jl index 73fee1c..4c4624b 100644 --- a/test/test_beam_mesh.jl +++ b/test/test_beam_mesh.jl @@ -1,4 +1,4 @@ -module m2 +module mframe1 using FinEtools using FinEtoolsFlexStructures.FESetL2BeamModule: FESetL2Beam using FinEtoolsFlexStructures.CrossSectionModule: CrossSectionCircle @@ -18,6 +18,59 @@ function test() @test count(fes) == 20 true end +test() +end + +module mframe2 +using FinEtools +using FinEtoolsFlexStructures.FESetL2BeamModule: FESetL2Beam +using FinEtoolsFlexStructures.CrossSectionModule: CrossSectionCircle +using FinEtoolsFlexStructures.MeshFrameMemberModule: frame_member +using Test +function test() + L = 42 + xyz = [0 0 0; + 0 L/4 L*1/4; + L/4 L/4 L*2/4; + L/4 0 L*3/4; + 0 0 L] + nL = 20 + + cs = CrossSectionCircle(s -> 5.9910, s -> [0.0, 0.0, 1.0]) + fens, fes = frame_member(xyz, nL, cs) + @test count(fes) == 20 + + cs = CrossSectionCircle(s -> 5.9910, s -> [0.0, 0.0, 1.0]) + fens, fes = frame_member(xyz, nL, cs) + list = 1:2 + fes = subset(fes, list) + accepttodelegate(fes, subset(fes.delegateof, list)) + @test count(fes) == 2 + @show fes + true +end +test() +end + +module mframe3 +using FinEtools +using FinEtoolsFlexStructures.FESetL2BeamModule: FESetL2Beam +using FinEtoolsFlexStructures.CrossSectionModule: CrossSectionCircle +using FinEtoolsFlexStructures.MeshFrameMemberModule: frame_member +using Test +function test() + L = 42 + xyz = [0 0 0; + 0 L/4 L*1/4; + L/4 L/4 L*2/4; + L/4 0 L*3/4; + 0 0 L] + nL = 20 + + cs = CrossSectionCircle(s -> 5.9910, s -> [0.0, 0.0, 1.0]) + fes = FESetL2Beam(nL, cs) + @show fes + true +end +test() end -using .m2 -m2.test()