Skip to content

Commit

Permalink
Loosen type definitions on generated functions
Browse files Browse the repository at this point in the history
To get user defined types work also as long as get_index is implemented.
  • Loading branch information
ahojukka5 committed Aug 4, 2017
1 parent 2061204 commit 5f75984
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/create_basis.jl
Expand Up @@ -117,13 +117,10 @@ function create_basis{nbasis,dim}(name::Symbol, description::String, X::NTuple{n

# FIXME: this can be done better somehow
if dim == 1
xitype = :(Tuple{T})
unpack = :((u,) = xi)
elseif dim == 2
xitype = :(Tuple{T,T})
unpack = :((u, v) = xi)
else
xitype = :(Tuple{T,T,T})
unpack = :((u, v, w) = xi)
end

Expand All @@ -148,13 +145,13 @@ function create_basis{nbasis,dim}(name::Symbol, description::String, X::NTuple{n
return $X
end

function FEMBasis.eval_basis!{T}(::Type{$name}, N::Matrix{T}, xi::$xitype)
function FEMBasis.eval_basis!{T}(::Type{$name}, N::Matrix{T}, xi)
$unpack
$Q
return N
end

function FEMBasis.eval_dbasis!{T}(::Type{$name}, dN::Matrix{T}, xi::$xitype)
function FEMBasis.eval_dbasis!{T}(::Type{$name}, dN::Matrix{T}, xi)
$unpack
$V
return dN
Expand Down

0 comments on commit 5f75984

Please sign in to comment.