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

Load error due to type problem #24

Open
bocc opened this issue May 4, 2020 · 0 comments
Open

Load error due to type problem #24

bocc opened this issue May 4, 2020 · 0 comments

Comments

@bocc
Copy link

bocc commented May 4, 2020

The following method definition

function FEMBase.get_integration_points(::Problem{Beam}, ::Element{Seg2})
    return FEMQuad.get_quadrature_points(Val{:GLSEG3})
end

causes the following error: LoadError: TypeError: in AbstractElement, in M, expected M <: FEMBase.AbstractFieldSet, got Type{Seg2} in version 0.3.1, with Julia 1.4.1. It seems to me that it is caused by FEMBase.Element having two type parameters, so supplying any subtype of AbstractFieldSet as the first type param resolves the issue. (If there is a way to ignore a type parameter, that would also work, since only the second is needed for dispatch, but I couldn't find it.)

function FEMBase.get_integration_points(::Problem{Beam}, 
    ::Element{<:FEMBase.AbstractFieldSet, Seg2})
    return FEMQuad.get_quadrature_points(Val{:GLSEG3})
end

To test this out, we can try:

e = Element(Seg2, [1, 2])
p = Problem(Beam, "example 1", 6)

FEMBase.get_integration_points(p, e)

This works, and produces an Iterator of tuples. (@which also confirms this method is called.)

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

1 participant