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

"::Vec" Type declaration outdated? #42

Open
thomaskroi1996 opened this issue Jul 9, 2024 · 1 comment
Open

"::Vec" Type declaration outdated? #42

thomaskroi1996 opened this issue Jul 9, 2024 · 1 comment

Comments

@thomaskroi1996
Copy link

thomaskroi1996 commented Jul 9, 2024

Hello!

in lines 101 and 108 of create_basis.jl:

@inline function FEMBasis.eval_basis!(::Type{$name}, N::Vector{<:Number}, xi::Vec)
@inline function FEMBasis.eval_dbasis!(::Type{$name}, dN::Vector{<:Vec{$D}}, xi::Vec)

the type declaration throws me errors, when trying to use a Vector for xi. Is this on purpose or is it simply a relict from an older version? Changing them to xi::Vector fixed the issue. Furthermore, in the documentation of JuliaFEM.jl this is done with xi as a tuple.

This code should reproduce the example, with Julia v.1.9.2 and FEMBasis 0.3.2
B = Quad4()
N = zeros(1, length(B))
xi = [0.0, 0.0] #(or using (0.0, 0.0) as in JuliaFEM doc)
eval_basis!(B, N, xi)

I am trying to use FEMBasis as if i were using it from JuliaFEM, i.e. with the help of JuliaFEM documentation. A related issue is that basis functions are not defined in JuliaFEM, does anybody know about this?
using JuliaFEM
Tri3() #not defined error

I don't know if it is useful to open a seperate issue, or if this unavailability of the basis functions are related to this package. They seem to be exported in JuliaFEM, but not defined.

Thank you for the help in advance!

@ahojukka5
Copy link
Member

Have you been trying using Tensors.jl? Using Vector seems to be a bad idea for xi, because we should use something that is allocated to stack, not heap. Like tuple, but Tensors.jl or StaticArrays.jl might be better choices. In general, these should work (and fixed if they don't):

xi = (0.0, 0.0)
eval_basis!(B, N, xi)
using Tensors
xi = Vec(0.0, 0.0)
eval_basis!(B, N, xi)
using StaticArrays
xi = @SVector [0.0, 0.0]
eval_basis!(B, N, xi)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants