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

Element function accepts incompatible input arguments #29

Open
ahniemi opened this issue Aug 13, 2018 · 1 comment
Open

Element function accepts incompatible input arguments #29

ahniemi opened this issue Aug 13, 2018 · 1 comment

Comments

@ahniemi
Copy link

ahniemi commented Aug 13, 2018

Element function allows creation of Quad8 type element with four nodes:

julia> element2 = Element(Quad8, [1,2,3,4])
FEMBase.Element{FEMBasis.Quad8}(-1, [1, 2, 3, 4], FEMBase.Point{")FEMBase.IntegrationPoint}[], Dict{String,FEMBase.AbstractField}(), FEMBasis.Quad8())

It might good to check compatibility of input arguments here.

ahniemi added a commit to ahniemi/FEMBase.jl that referenced this issue Aug 13, 2018
@ahojukka5
Copy link
Member

Interestingly, this is actually not breaking the code. During interpolation, we loop through the number of basis functions, so this is working:

using FEMBase
el = Element(Quad4, [1, 2, 3, 4, 5])
X = Dict(1=>[0.0,0.0], 2=>[1.0,0.0], 3=>[1.0,1.0], 4=>[0.0,1.0], 5=>[2.0,0.0])
update!(el, "geometry", X)
xi = (0.0, 0.0)
time = 0.0
el("geometry", xi, time)

# output

2-element Array{Float64,1}:
 0.5
 0.5

In principle, given the geometry locally, the element is working as its own little "unit", without any knowledge about its connectivity:

el2 = Element(Quad4, Int[])
update!(el2, "geometry", ([0.0,0.0], [1.0,0.0], [1.0,1.0], [0.0,1.0]))
el2("geometry", xi, time)

# output

2-element Array{Float64,1}:
 0.5
 0.5

Maybe should give a warning if there is a length mismatch between the connectivity and length of basis?

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