Fix incorrect dof value type for linear constraints fe spaces #1009
+14
−8
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When e.g. solving the Helmholtz equation we set
vector_type=Vector{ComplexF64}
for theFESpace
, in that case we obtain correctly thatget_dof_value_type(V) == ComplexF64
.When the space is a
FESpaceWithLinearConstraints
thenget_dof_value_type
incorrectly returnsFloat64
; based on the default implementation inFESpaceInterface.jl
.My fix is to add
to
FESpacesWithLinearConstraints.jl
.PS: It might be that the default implementation for
get_dof_value_type
inFESpaceInterface.jl
is incorrect, as also forV
aFESpace
withvector_type=Vector{ComplexF64}
I obtainget_dof_value_type(get_fe_basis(V), get_fe_dof_basis(V)) == Float64
instead ofComplexF64
.I have extended the tests in
FESpacesWithLinearConstraintsTests.jl
to havevector_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 thebroken=true
; the second commit corrects the bug inFESpacesWithLinearConstraints.jl
and just leaves a@test get_dof_value_type(Vc) == ComplexF64
in place.