Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
KnutAM authored Feb 26, 2025
1 parent 87c4fc7 commit 5f0b0f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/Dofs/DofHandler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -933,8 +933,8 @@ function evaluate_at_grid_nodes(dh::DofHandler, u::AbstractVector, fieldname::Sy
return _evaluate_at_grid_nodes(dh, u, fieldname)
end

_function_value_type(::ScalarInterpolation, ::AbstractVector{T}) where {T} = T
_function_value_type(::VectorInterpolation{vdim}, ::AbstractVector{T}) where {vdim, T <: Number} = Vec{vdim, T}
function_value_init(::ScalarInterpolation, ::AbstractVector{T}) where {T} = zero(T)
function_value_init(::VectorInterpolation{vdim}, ::AbstractVector{T}) where {vdim, T <: Number} = zero(Vec{vdim, T})

Check warning on line 937 in src/Dofs/DofHandler.jl

View check run for this annotation

Codecov / codecov/patch

src/Dofs/DofHandler.jl#L936-L937

Added lines #L936 - L937 were not covered by tests

# Internal method that have the vtk option to allocate the output differently
function _evaluate_at_grid_nodes(dh::DofHandler{sdim}, u::AbstractVector{T}, fieldname::Symbol, ::Val{vtk} = Val(false)) where {T, vtk, sdim}
Expand All @@ -943,7 +943,7 @@ function _evaluate_at_grid_nodes(dh::DofHandler{sdim}, u::AbstractVector{T}, fie
# Figure out the return type (scalar or vector)
field_idx = find_field(dh, fieldname)
ip = getfieldinterpolation(dh, field_idx)
RT = _function_value_type(ip, u)
RT = typeof(function_value_init(ip, u))

Check warning on line 946 in src/Dofs/DofHandler.jl

View check run for this annotation

Codecov / codecov/patch

src/Dofs/DofHandler.jl#L946

Added line #L946 was not covered by tests
if vtk
# VTK output of solution field (or L2 projected scalar data)
n_c = n_components(ip)
Expand Down
2 changes: 1 addition & 1 deletion test/test_interpolations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function test_interpolation_properties(ip::Interpolation{RefShape, FunOrder}) wh
# Test A-D
_test_interpolation_properties(dof_data, refshape_data)

# Test E: All base functions implemented and infers correct types
# Test E: All base functions implemented and infers correct types.
# Argument errors for 0th and n+1 indices.
for T in (Float64, Float32)
ξ = zero(Vec{Ferrite.getrefdim(ip), T})
Expand Down

0 comments on commit 5f0b0f8

Please sign in to comment.