From fa4b05925994b977554759ffaf2b7ea9c11ab722 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Thu, 15 Dec 2016 09:17:31 +0200 Subject: [PATCH] if number of shape functions differs from length of field, use length of shape functions (or length of partial derivatives of them) in interpolation, this makes it possible to have longer fields, helping defining elements with variable number of shape functions. --- src/fields.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fields.jl b/src/fields.jl index c510171..2ff82bf 100644 --- a/src/fields.jl +++ b/src/fields.jl @@ -231,14 +231,13 @@ function Base.:*(N::Matrix, f::DCTI) end -# + # Multiply DVTI field with another vector T. Vector length # must match to the field length and this can be used mainly # for interpolation purposes, i.e., u = ∑ Nᵢuᵢ -# function Base.:*(T::Vector, f::DVTI) - @assert length(T) == length(f) - return sum([T[i]*f[i] for i=1:length(f)]) + @assert length(T) <= length(f) + return sum([T[i]*f[i] for i=1:length(T)]) end function vec(field::DVTI) @@ -416,7 +415,8 @@ function (basis::CVTI)(xi::Vector, time::Number) end function Base.:*(grad::Matrix, field::DVTI) - return sum([kron(grad[:,i], field[i]') for i=1:length(field)])' + n, m = size(grad) + return sum([kron(grad[:,i], field[i]') for i=1:m])' end function DVTV(data::Pair{Float64, Vector}...)