Skip to content

Commit

Permalink
add case for <:Vec
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdAlazezAhmed committed Sep 15, 2023
1 parent ed7f14d commit 9f117dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/FEValues/interface_values.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ where ``u_i`` are the value of ``u`` in the nodes. For a vector valued function
``\\mathbf{u}(\\mathbf{x}) = \\sum\\limits_{i = 1}^n N_i (\\mathbf{x}) \\mathbf{u}_i`` where ``\\mathbf{u}_i`` are the
nodal values of ``\\mathbf{u}``.
"""
function function_value(iv::InterfaceValues, q_point::Int, u::AbstractVector, dof_range = eachindex(u); here::Bool = true)
function function_value(iv::InterfaceValues, q_point::Int, u::AbstractVector{T}, dof_range = eachindex(u); here::Bool = true) where T
fv = here ? iv.face_values_a : iv.face_values_b
function_value(fv, q_point, u, dof_range)
T <: Vec ? function_value(fv, q_point, u) : function_value(fv, q_point, u, dof_range)
end

shape_value_type(::InterfaceValues{<:FaceValues{<:Any, N_t}}) where N_t = N_t
Expand All @@ -148,9 +148,9 @@ For a vector valued function with use of `ScalarValues` the gradient is computed
``\\mathbf{\\nabla} \\mathbf{u}(\\mathbf{x}) = \\sum\\limits_{i = 1}^n \\mathbf{u}_i \\otimes \\mathbf{\\nabla} N_i (\\mathbf{x})``
where ``\\mathbf{u}_i`` are the nodal values of ``\\mathbf{u}``.
"""
function function_gradient(iv::InterfaceValues, q_point::Int, u::AbstractVector, dof_range = eachindex(u); here::Bool = true)
function function_gradient(iv::InterfaceValues, q_point::Int, u::AbstractVector{T}, dof_range = eachindex(u); here::Bool = true) where T
fv = here ? iv.face_values_a : iv.face_values_b
function_gradient(fv, q_point, u, dof_range)
T <: Vec ? function_gradient(fv, q_point, u) : function_gradient(fv, q_point, u, dof_range)
end

"""
Expand All @@ -166,9 +166,9 @@ The symmetric gradient of a scalar function is computed as
``\\left[ \\mathbf{\\nabla} \\mathbf{u}(\\mathbf{x_q}) \\right]^\\text{sym} = \\sum\\limits_{i = 1}^n \\frac{1}{2} \\left[ \\mathbf{\\nabla} N_i (\\mathbf{x}_q) \\otimes \\mathbf{u}_i + \\mathbf{u}_i \\otimes \\mathbf{\\nabla} N_i (\\mathbf{x}_q) \\right]``
where ``\\mathbf{u}_i`` are the nodal values of the function.
"""
function function_symmetric_gradient(iv::InterfaceValues, q_point::Int, u::AbstractVector, dof_range = eachindex(u); here::Bool = true)
function function_symmetric_gradient(iv::InterfaceValues, q_point::Int, u::AbstractVector{T}, dof_range = eachindex(u); here::Bool = true) where T
fv = here ? iv.face_values_a : iv.face_values_b
function_symmetric_gradient(fv, q_point, u, dof_range)
T <: Vec ? function_symmetric_gradient(fv, q_point, u) : function_symmetric_gradient(fv, q_point, u, dof_range)
end

"""
Expand Down

0 comments on commit 9f117dd

Please sign in to comment.