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

Fix incorrect dof value type for linear constraints fe spaces #1009

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dnuy
Copy link

@dnuy dnuy commented May 22, 2024

When e.g. solving the Helmholtz equation we set vector_type=Vector{ComplexF64} for the FESpace, in that case we obtain correctly that get_dof_value_type(V) == ComplexF64.
When the space is a FESpaceWithLinearConstraints then get_dof_value_type incorrectly returns Float64; based on the default implementation in FESpaceInterface.jl.

My fix is to add

get_dof_value_type(f::FESpaceWithLinearConstraints) = eltype(get_vector_type(f.space))

to FESpacesWithLinearConstraints.jl.

PS: It might be that the default implementation for get_dof_value_type in FESpaceInterface.jl is incorrect, as also for V a FESpace with vector_type=Vector{ComplexF64} I obtain get_dof_value_type(get_fe_basis(V), get_fe_dof_basis(V)) == Float64 instead of ComplexF64.

I have extended the tests in FESpacesWithLinearConstraintsTests.jl to have vector_type=Vector{ComplexF64} and added appropriate tests. The first commit in this merge request just shows the current bug with @test get_dof_value_type(Vc) == ComplexF64 broken=true and then fixes the bug as above and runs the test again without the broken=true; the second commit corrects the bug in FESpacesWithLinearConstraints.jl and just leaves a @test get_dof_value_type(Vc) == ComplexF64 in place.

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

Successfully merging this pull request may close these issues.

1 participant