You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FEMBasis does some "puns" on Base functions, for example:
function Base.size(::Type{$name})
return ($D, $N)
end
function Base.size(::Type{$name}, j::Int)
j == 1 && return $D
j == 2 && return $N
end
function Base.length(::Type{$name})
return $N
end
length is typically defined for collections (or at least when the instance of the type is a collection). AbstractBasis is not iterable and it probably shouldn't be. Instead of defining these functions I think they should have their own names ndim, nbasis.
Overloading Base functions are typically meant so you can write generic code but there is no way to write generic code with puns like this.
The text was updated successfully, but these errors were encountered:
Yes, we could do this somehow differently. This convention originates from the need to know proper dimensions of workspace when evaluating e.g. basis functions.
FEMBasis does some "puns" on Base functions, for example:
length
is typically defined for collections (or at least when the instance of the type is a collection).AbstractBasis
is not iterable and it probably shouldn't be. Instead of defining these functions I think they should have their own namesndim
,nbasis
.Overloading Base functions are typically meant so you can write generic code but there is no way to write generic code with puns like this.
The text was updated successfully, but these errors were encountered: