From b24fbaebba142f32ddaf58265206197239990f5c Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Tue, 30 Nov 2021 12:52:51 +0100 Subject: [PATCH 1/2] Removing explicit @inline except in Algebra and TensorValues --- src/Arrays/AlgebraMaps.jl | 6 +- src/Arrays/CachedArrays.jl | 2 +- src/Arrays/IdentityVectors.jl | 2 +- src/Arrays/Interface.jl | 20 ++-- src/Arrays/LazyArrays.jl | 30 +++--- src/Arrays/Maps.jl | 16 +-- src/Arrays/PosNegReindex.jl | 4 +- src/Arrays/Reindex.jl | 4 +- src/CellData/AttachConstraints.jl | 8 +- src/CellData/AttachDirichlet.jl | 4 +- src/CellData/CellStates.jl | 6 +- src/FESpaces/Assemblers.jl | 4 +- src/FESpaces/FESpacesWithConstantFixed.jl | 2 +- src/FESpaces/FESpacesWithLinearConstraints.jl | 4 +- src/Fields/AffineMaps.jl | 6 +- src/Fields/ApplyOptimizations.jl | 4 +- src/Fields/ArrayBlocks.jl | 6 +- src/Fields/AutoDiff.jl | 32 +++--- src/Fields/DiffOperators.jl | 4 +- src/Fields/FieldArrays.jl | 82 ++++++++-------- src/Fields/FieldsInterfaces.jl | 98 +++++++++---------- src/Fields/MockFields.jl | 2 +- src/Geometry/BoundaryTriangulations.jl | 2 +- src/Geometry/CartesianGrids.jl | 6 +- src/Polynomials/ChangeBasis.jl | 8 +- src/Polynomials/MonomialBases.jl | 16 +-- src/Polynomials/PCurlGradMonomialBases.jl | 6 +- src/Polynomials/QCurlGradMonomialBases.jl | 10 +- src/Polynomials/QGradMonomialBases.jl | 6 +- src/ReferenceFEs/Dofs.jl | 2 +- src/ReferenceFEs/LagrangianDofBases.jl | 10 +- src/ReferenceFEs/MockDofs.jl | 10 +- src/ReferenceFEs/Polytopes.jl | 14 +-- src/ReferenceFEs/RaviartThomasRefFEs.jl | 8 +- 34 files changed, 222 insertions(+), 222 deletions(-) diff --git a/src/Arrays/AlgebraMaps.jl b/src/Arrays/AlgebraMaps.jl index fa8d82feb..c6bd5144c 100644 --- a/src/Arrays/AlgebraMaps.jl +++ b/src/Arrays/AlgebraMaps.jl @@ -4,7 +4,7 @@ function return_cache(::typeof(*),a::AbstractArray{<:Number},b::AbstractArray{<: CachedArray(c) end -@inline function evaluate!(cache,::typeof(*),a::AbstractMatrix{<:Number},b::AbstractVector{<:Number}) +function evaluate!(cache,::typeof(*),a::AbstractMatrix{<:Number},b::AbstractVector{<:Number}) m = size(a,1) setsize!(cache,(m,)) c = cache.array @@ -12,7 +12,7 @@ end c end -@inline function evaluate!(cache,::typeof(*),a::AbstractMatrix{<:Number},b::AbstractMatrix{<:Number}) +function evaluate!(cache,::typeof(*),a::AbstractMatrix{<:Number},b::AbstractMatrix{<:Number}) m = size(a,1) n = size(b,2) setsize!(cache,(m,n)) @@ -31,7 +31,7 @@ function return_cache(k::MulAddMap,a,b,c) CachedArray(d) end -@inline function evaluate!(cache,k::MulAddMap,a,b,c) +function evaluate!(cache,k::MulAddMap,a,b,c) setsize!(cache,size(c)) d = cache.array copyto!(d,c) diff --git a/src/Arrays/CachedArrays.jl b/src/Arrays/CachedArrays.jl index 13f38d016..e9147c2e2 100644 --- a/src/Arrays/CachedArrays.jl +++ b/src/Arrays/CachedArrays.jl @@ -103,7 +103,7 @@ function setsize!(a::CachedArray{T,N},s::NTuple{N,Int}) where {T,N} end end -@inline function setsize!(a::CachedArray{T,N},s::NTuple{N,<:Integer}) where {T,N} +function setsize!(a::CachedArray{T,N},s::NTuple{N,<:Integer}) where {T,N} _s::NTuple{N,Int} = s setsize!(a,_s) end diff --git a/src/Arrays/IdentityVectors.jl b/src/Arrays/IdentityVectors.jl index 3f9984e0c..83163a46c 100644 --- a/src/Arrays/IdentityVectors.jl +++ b/src/Arrays/IdentityVectors.jl @@ -5,7 +5,7 @@ struct IdentityVector{T<:Integer} <: AbstractVector{T} length::T end -@inline function getindex(c::IdentityVector{T},i::Integer) where T +function getindex(c::IdentityVector{T},i::Integer) where T @check i > 0 @check i <= c.length j::T = i diff --git a/src/Arrays/Interface.jl b/src/Arrays/Interface.jl index 62613311b..322bcb1ad 100644 --- a/src/Arrays/Interface.jl +++ b/src/Arrays/Interface.jl @@ -39,16 +39,16 @@ end ``` """ -@inline getindex!(cache,a::AbstractArray,i...) = a[i...] -@inline getindex!(cache,a::AbstractArray,i::CartesianIndex) = getindex!(cache,a,Tuple(i)...) -@inline getindex!(cache,a::AbstractArray,i::Integer) = _getindex_1d!(IndexStyle(a),cache,a,i) -@inline function getindex!(cache,a::AbstractArray{T,N},i::Vararg{Integer,N}) where {T,N} +getindex!(cache,a::AbstractArray,i...) = a[i...] +getindex!(cache,a::AbstractArray,i::CartesianIndex) = getindex!(cache,a,Tuple(i)...) +getindex!(cache,a::AbstractArray,i::Integer) = _getindex_1d!(IndexStyle(a),cache,a,i) +function getindex!(cache,a::AbstractArray{T,N},i::Vararg{Integer,N}) where {T,N} _getindex_nd!(IndexStyle(a),cache,a,CartesianIndex(i)) end -@inline _getindex_1d!(s::IndexLinear,cache,a,i) = a[i] -@inline _getindex_1d!(s::IndexCartesian,cache,a,i) = _getindex_nd!(s,cache,a,CartesianIndices(a)[i]) -@inline _getindex_nd!(s::IndexLinear,cache,a,i) = _getindex_1d!(s,cache,a,LinearIndices(a)[i]) -@inline _getindex_nd!(s::IndexCartesian,cache,a,i) = a[i] +_getindex_1d!(s::IndexLinear,cache,a,i) = a[i] +_getindex_1d!(s::IndexCartesian,cache,a,i) = _getindex_nd!(s,cache,a,CartesianIndices(a)[i]) +_getindex_nd!(s::IndexLinear,cache,a,i) = _getindex_1d!(s,cache,a,LinearIndices(a)[i]) +_getindex_nd!(s::IndexCartesian,cache,a,i) = a[i] """ array_cache(a::AbstractArray) @@ -161,8 +161,8 @@ This function is used to compute [`testitem`](@ref) for 0-length arrays. """ function testvalue end -@inline testvalue(::Type{T}) where T = zero(T) -@inline testvalue(v) = testvalue(typeof(v)) +testvalue(::Type{T}) where T = zero(T) +testvalue(v) = testvalue(typeof(v)) function testvalue(::Type{T}) where T<:AbstractArray{E,N} where {E,N} similar(T,tfill(0,Val(N))...) diff --git a/src/Arrays/LazyArrays.jl b/src/Arrays/LazyArrays.jl index 07b7ddef1..76b70f075 100644 --- a/src/Arrays/LazyArrays.jl +++ b/src/Arrays/LazyArrays.jl @@ -58,7 +58,7 @@ function lazy_map(k,f::AbstractArray...) lazy_map(k,T,f...) end -#@inline lazy_map(::typeof(evaluate),k::AbstractArray,f::AbstractArray...) = LazyArray(k,f...) +#lazy_map(::typeof(evaluate),k::AbstractArray,f::AbstractArray...) = LazyArray(k,f...) # This is the function to be overload to specialize on the Map f """ @@ -67,13 +67,13 @@ end Like [`lazy_map(f,a::AbstractArray...)`](@ref), but the user provides the element type of the resulting array in order to circumvent type inference. """ -@inline function lazy_map(k,T::Type,f::AbstractArray...) +function lazy_map(k,T::Type,f::AbstractArray...) s = _common_size(f...) lazy_map(evaluate,T,Fill(k, s), f...) end # This is the function to be overload to specialize on the array types -@inline function lazy_map(::typeof(evaluate),T::Type,k::AbstractArray,f::AbstractArray...) +function lazy_map(::typeof(evaluate),T::Type,k::AbstractArray,f::AbstractArray...) s = _common_size(k,f...) N = length(s) LazyArray(T,Val(N),k,f...) @@ -193,7 +193,7 @@ function _array_cache!(dict::Dict,a::LazyArray) (cg, cgi, cf), IndexItemPair(index, item) end -@inline function getindex!(cache, a::LazyArray, i::Integer) +function getindex!(cache, a::LazyArray, i::Integer) _cache, index_and_item = cache index = LinearIndices(a)[i] if index_and_item.index != index @@ -205,7 +205,7 @@ end index_and_item.item end -@inline function getindex!(cache, a::LazyArray{G,T,N}, i::Vararg{Integer,N}) where {G,T,N} +function getindex!(cache, a::LazyArray{G,T,N}, i::Vararg{Integer,N}) where {G,T,N} _cache, index_and_item = cache index = LinearIndices(a)[i...] if index_and_item.index != index @@ -217,7 +217,7 @@ end index_and_item.item end -@inline function _getindex_and_call!(cgi,gi,cf,args,i...) +function _getindex_and_call!(cgi,gi,cf,args,i...) fi = map((cj,fj) -> getindex!(cj,fj,i...),cf,args) evaluate!(cgi, gi, fi...) end @@ -322,25 +322,25 @@ end # see https://discourse.julialang.org/t/performance-depends-dramatically-on-compilation-order/58425 # Hopefully, they can be removed in the future -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any},i...) f1 = getindex!(cf[1],args[1],i...) evaluate!(cgi,gi,f1) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) evaluate!(cgi,gi,f1,f2) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) f3 = getindex!(cf[3],args[3],i...) evaluate!(cgi,gi,f1,f2,f3) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) f3 = getindex!(cf[3],args[3],i...) @@ -348,7 +348,7 @@ end evaluate!(cgi,gi,f1,f2,f3,f4) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) f3 = getindex!(cf[3],args[3],i...) @@ -357,7 +357,7 @@ end evaluate!(cgi,gi,f1,f2,f3,f4,f5) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) f3 = getindex!(cf[3],args[3],i...) @@ -367,7 +367,7 @@ end evaluate!(cgi,gi,f1,f2,f3,f4,f5,f6) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) f3 = getindex!(cf[3],args[3],i...) @@ -378,7 +378,7 @@ end evaluate!(cgi,gi,f1,f2,f3,f4,f5,f6,f7) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any,Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any,Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) f3 = getindex!(cf[3],args[3],i...) @@ -390,7 +390,7 @@ end evaluate!(cgi,gi,f1,f2,f3,f4,f5,f6,f7,f8) end -@inline function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any,Any,Any,Any},i...) +function _getindex_and_call!(cgi,gi,cf,args::Tuple{Any,Any,Any,Any,Any,Any,Any,Any,Any},i...) f1 = getindex!(cf[1],args[1],i...) f2 = getindex!(cf[2],args[2],i...) f3 = getindex!(cf[3],args[3],i...) diff --git a/src/Arrays/Maps.jl b/src/Arrays/Maps.jl index ce59ae01a..a9b66809d 100644 --- a/src/Arrays/Maps.jl +++ b/src/Arrays/Maps.jl @@ -150,20 +150,20 @@ end return_cache(f::Broadcasting,x...) = nothing -@inline evaluate!(cache,f::Broadcasting,x...) = broadcast(f.f,x...) +evaluate!(cache,f::Broadcasting,x...) = broadcast(f.f,x...) function return_value(f::Broadcasting,x...) broadcast( (y...) -> f.f(testargs(f.f,y...)...), x... ) end -@inline function evaluate!(cache,f::Broadcasting,x::Union{Number,AbstractArray{<:Number}}...) +function evaluate!(cache,f::Broadcasting,x::Union{Number,AbstractArray{<:Number}}...) r = _prepare_cache!(cache,x...) a = r.array broadcast!(f.f,a,x...) a end -@inline function evaluate!(cache,f::Broadcasting,x::AbstractArray{<:Number}) +function evaluate!(cache,f::Broadcasting,x::AbstractArray{<:Number}) setsize!(cache,size(x)) a = cache.array @inbounds for i in eachindex(x) @@ -198,7 +198,7 @@ function return_cache(f::Broadcasting,x::Union{Number,AbstractArray{<:Number}}.. cache end -@inline function _prepare_cache!(c,x...) +function _prepare_cache!(c,x...) s = map(_size,x) bs = Base.Broadcast.broadcast_shape(s...) if bs != size(c) @@ -207,8 +207,8 @@ end c end -@inline _size(a) = size(a) -@inline _size(a::Number) = (1,) +_size(a) = size(a) +_size(a::Number) = (1,) """ OperationMap(f,args) @@ -221,7 +221,7 @@ That is, `OperationMap(f,args)(x...)` is formally defined as struct OperationMap{K,L} <: Map k::K l::L - @inline function OperationMap(k,l) + function OperationMap(k,l) new{typeof(k),typeof(l)}(k,l) end end @@ -233,7 +233,7 @@ function return_cache(c::OperationMap,x...) ck, cl end -@inline function evaluate!(cache,c::OperationMap,x...) +function evaluate!(cache,c::OperationMap,x...) ck, cf = cache lx = map((ci,fi) -> evaluate!(ci,fi,x...),cf,c.l) evaluate!(ck,c.k,lx...) diff --git a/src/Arrays/PosNegReindex.jl b/src/Arrays/PosNegReindex.jl index 327f9828e..7bb0d3354 100644 --- a/src/Arrays/PosNegReindex.jl +++ b/src/Arrays/PosNegReindex.jl @@ -28,12 +28,12 @@ function return_cache(k::PosNegReindex,i::Integer) c_p, c_n end -@inline function evaluate!(cache,k::PosNegReindex,i::Integer) +function evaluate!(cache,k::PosNegReindex,i::Integer) c_p, c_n = cache i>0 ? getindex!(c_p,k.values_pos,i) : getindex!(c_n,k.values_neg,-i) end -@inline function evaluate(k::PosNegReindex,i::Integer) +function evaluate(k::PosNegReindex,i::Integer) i>0 ? k.values_pos[i] : k.values_neg[-i] end diff --git a/src/Arrays/Reindex.jl b/src/Arrays/Reindex.jl index 49c4a2bb8..71e3ae823 100644 --- a/src/Arrays/Reindex.jl +++ b/src/Arrays/Reindex.jl @@ -18,8 +18,8 @@ function return_value(k::Reindex,i...) length(k.values)!=0 ? evaluate(k,testargs(k,i...)...) : testitem(k.values) end return_cache(k::Reindex,i...) = array_cache(k.values) -@inline evaluate!(cache,k::Reindex,i...) = getindex!(cache,k.values,i...) -@inline evaluate(k::Reindex,i...) = k.values[i...] +evaluate!(cache,k::Reindex,i...) = getindex!(cache,k.values,i...) +evaluate(k::Reindex,i...) = k.values[i...] #""" # reindex(i_to_v::AbstractArray, j_to_i::AbstractArray) diff --git a/src/CellData/AttachConstraints.jl b/src/CellData/AttachConstraints.jl index 59c27e490..41e5e0866 100644 --- a/src/CellData/AttachConstraints.jl +++ b/src/CellData/AttachConstraints.jl @@ -14,7 +14,7 @@ function Arrays.return_cache(k::ConstrainRowsMap,array,constr,mask) return_cache(*,constr,array) end -@inline function Arrays.evaluate!(cache,k::ConstrainRowsMap,array,constr,mask) +function Arrays.evaluate!(cache,k::ConstrainRowsMap,array,constr,mask) if mask evaluate!(cache,*,constr,array) else @@ -29,7 +29,7 @@ function Arrays.return_cache(k::ConstrainRowsMap,matvec::Tuple,constr,mask) (cmat,cvec) end -@inline function Arrays.evaluate!(cache,k::ConstrainRowsMap,matvec::Tuple,constr,mask) +function Arrays.evaluate!(cache,k::ConstrainRowsMap,matvec::Tuple,constr,mask) if mask cmat, cvec = cache mat, vec = matvec @@ -47,7 +47,7 @@ function Arrays.return_cache(k::ConstrainColsMap,array,constr_t,mask) return_cache(*,array,constr_t) end -@inline function Arrays.evaluate!(cache,k::ConstrainColsMap,array,constr_t,mask) +function Arrays.evaluate!(cache,k::ConstrainColsMap,array,constr_t,mask) if mask evaluate!(cache,*,array,constr_t) else @@ -60,7 +60,7 @@ function Arrays.return_cache(k::ConstrainColsMap,matvec::Tuple,constr_t,mask) return_cache(k,mat,constr_t,mask) end -@inline function Arrays.evaluate!(cache,k::ConstrainColsMap,matvec::Tuple,constr_t,mask) +function Arrays.evaluate!(cache,k::ConstrainColsMap,matvec::Tuple,constr_t,mask) if mask mat, vec = matvec _mat = evaluate!(cache,k,mat,constr_t,mask) diff --git a/src/CellData/AttachDirichlet.jl b/src/CellData/AttachDirichlet.jl index 78aa008e4..4bbfd1165 100644 --- a/src/CellData/AttachDirichlet.jl +++ b/src/CellData/AttachDirichlet.jl @@ -63,7 +63,7 @@ function Arrays.return_cache(k::AttachDirichletMap,matvec::Tuple,vals,mask) return_cache(k.muladd,mat,vals,vec) end -@inline function Arrays.evaluate!(cache,k::AttachDirichletMap,matvec::Tuple,vals,mask) +function Arrays.evaluate!(cache,k::AttachDirichletMap,matvec::Tuple,vals,mask) if mask mat, vec = matvec vec_with_bcs = evaluate!(cache,k.muladd,mat,vals,vec) @@ -79,7 +79,7 @@ function Arrays.return_cache(k::AttachDirichletMap,mat,vals,mask) (cm,cv) end -@inline function Arrays.evaluate!(cache,k::AttachDirichletMap,mat,vals,mask) +function Arrays.evaluate!(cache,k::AttachDirichletMap,mat,vals,mask) cm, cv = cache if mask vec_with_bcs = evaluate!(cm,*,mat,vals) diff --git a/src/CellData/CellStates.jl b/src/CellData/CellStates.jl index 70650f217..09bd790d0 100644 --- a/src/CellData/CellStates.jl +++ b/src/CellData/CellStates.jl @@ -129,17 +129,17 @@ end end end -@inline function _update_states!(b,q,states,::Val{i}) where i +function _update_states!(b,q,states,::Val{i}) where i _update_state!(b,q,states,Val{i}()) _update_states!(b,q,states,Val{i-1}()) nothing end -@inline function _update_states!(b,q,states,::Val{0}) +function _update_states!(b,q,states,::Val{0}) nothing end -@inline function _update_state!(b,q,states,::Val{i}) where i +function _update_state!(b,q,states,::Val{i}) where i b[i][q] = states[i] nothing end diff --git a/src/FESpaces/Assemblers.jl b/src/FESpaces/Assemblers.jl index 80540042c..ac7b0f040 100644 --- a/src/FESpaces/Assemblers.jl +++ b/src/FESpaces/Assemblers.jl @@ -27,7 +27,7 @@ function col_mask(a::AssemblyStrategy,col) @abstractmethod end -@inline function map_rows!(gids,a::AssemblyStrategy,rows) +function map_rows!(gids,a::AssemblyStrategy,rows) u = -one(eltype(gids)) for i in eachindex(rows) ri = rows[i] @@ -40,7 +40,7 @@ end nothing end -@inline function map_cols!(gids,a::AssemblyStrategy,cols) +function map_cols!(gids,a::AssemblyStrategy,cols) u = -one(eltype(gids)) for i in eachindex(cols) ri = cols[i] diff --git a/src/FESpaces/FESpacesWithConstantFixed.jl b/src/FESpaces/FESpacesWithConstantFixed.jl index f581f811a..a76f54260 100644 --- a/src/FESpaces/FESpacesWithConstantFixed.jl +++ b/src/FESpaces/FESpacesWithConstantFixed.jl @@ -145,7 +145,7 @@ function array_cache(a::CellDofIdsWithDofFixed) (c, cache) end -@inline function getindex!(d,a::CellDofIdsWithDofFixed,i::Integer) +function getindex!(d,a::CellDofIdsWithDofFixed,i::Integer) c, cache = d b = getindex!(cache,a.cell_dofs,i) setsize!(c,size(b)) diff --git a/src/FESpaces/FESpacesWithLinearConstraints.jl b/src/FESpaces/FESpacesWithLinearConstraints.jl index 717f2d0e7..4f0265ea5 100644 --- a/src/FESpaces/FESpacesWithLinearConstraints.jl +++ b/src/FESpaces/FESpacesWithLinearConstraints.jl @@ -271,7 +271,7 @@ function _setup_cell_to_lmdof_to_mdof(cell_to_ldof_to_dof,DOF_to_mDOFs,n_fdofs,n Table(cell_to_lmdof_to_mdof_data,cell_to_lmdof_to_mdof_ptrs) end -@inline function _dof_to_DOF(dof,n_fdofs) +function _dof_to_DOF(dof,n_fdofs) if dof > 0 DOF = dof else @@ -279,7 +279,7 @@ end end end -@inline function _DOF_to_dof(DOF,n_fdofs) +function _DOF_to_dof(DOF,n_fdofs) if DOF > n_fdofs dof = -(DOF-n_fdofs) else diff --git a/src/Fields/AffineMaps.jl b/src/Fields/AffineMaps.jl index 5beb374d1..b2453c327 100644 --- a/src/Fields/AffineMaps.jl +++ b/src/Fields/AffineMaps.jl @@ -14,9 +14,9 @@ struct AffineMap{D1,D2,T,L} <:Field end end -@inline affine_map(gradient,origin) = AffineMap(gradient,origin) +affine_map(gradient,origin) = AffineMap(gradient,origin) -@inline function evaluate!(cache,f::AffineMap,x::Point) +function evaluate!(cache,f::AffineMap,x::Point) G = f.gradient y0 = f.origin x⋅G + y0 @@ -28,7 +28,7 @@ function return_cache(f::AffineMap,x::AbstractVector{<:Point}) CachedArray(y) end -@inline function evaluate!(cache,f::AffineMap,x::AbstractVector{<:Point}) +function evaluate!(cache,f::AffineMap,x::AbstractVector{<:Point}) setsize!(cache,size(x)) y = cache.array G = f.gradient diff --git a/src/Fields/ApplyOptimizations.jl b/src/Fields/ApplyOptimizations.jl index 9914cc022..76dd091fd 100644 --- a/src/Fields/ApplyOptimizations.jl +++ b/src/Fields/ApplyOptimizations.jl @@ -310,8 +310,8 @@ Base.IndexStyle(::Type{MemoArray{T,N,A}}) where {T,N,A} = IndexStyle(A) Base.getindex(a::MemoArray,i::Integer) = a.parent[i] Base.getindex(a::MemoArray{T,N},i::Vararg{Integer,N}) where {T,N} = a.parent[i...] Arrays.array_cache(a::MemoArray) = array_cache(a.parent) -@inline Arrays.getindex!(cache,a::MemoArray,i::Integer) = getindex!(cache,a.parent,i) -@inline Arrays.getindex!(cache,a::MemoArray{T,N},i::Vararg{Integer,N}) where {T,N} = getindex!(cache,a.parent,i...) +Arrays.getindex!(cache,a::MemoArray,i::Integer) = getindex!(cache,a.parent,i) +Arrays.getindex!(cache,a::MemoArray{T,N},i::Vararg{Integer,N}) where {T,N} = getindex!(cache,a.parent,i...) Arrays.testitem(a::MemoArray) = testitem(a.parent) Arrays.get_array(a::MemoArray) = get_array(a.parent) diff --git a/src/Fields/ArrayBlocks.jl b/src/Fields/ArrayBlocks.jl index 434f2c9a3..e4224485c 100644 --- a/src/Fields/ArrayBlocks.jl +++ b/src/Fields/ArrayBlocks.jl @@ -39,13 +39,13 @@ Base.eltype(::Type{<:ArrayBlock{A}}) where A = A Base.eltype(b::ArrayBlock{A}) where A = A Base.ndims(b::ArrayBlock{A,N}) where {A,N} = N Base.ndims(::Type{ArrayBlock{A,N}}) where {A,N} = N -@inline function Base.getindex(b::ArrayBlock,i...) +function Base.getindex(b::ArrayBlock,i...) if !b.touched[i...] return nothing end b.array[i...] end -@inline function Base.setindex!(b::ArrayBlock,v,i...) +function Base.setindex!(b::ArrayBlock,v,i...) @check b.touched[i...] "Only touched entries can be set" b.array[i...] = v end @@ -1318,7 +1318,7 @@ function _mymul!( mul!(c,a,b,α,1) end -@inline function _mymul!(cIJ,aIK,bKJ,α) +function _mymul!(cIJ,aIK,bKJ,α) @boundscheck begin @assert size(cIJ,1) == size(aIK,1) @assert size(cIJ,2) == size(bKJ,2) diff --git a/src/Fields/AutoDiff.jl b/src/Fields/AutoDiff.jl index b7dc9abab..5c6ada102 100644 --- a/src/Fields/AutoDiff.jl +++ b/src/Fields/AutoDiff.jl @@ -1,13 +1,13 @@ # Number differentiation function gradient(f::Number) - @inline function grad_f(x::Point) + function grad_f(x::Point) zero(return_type(outer,x,f)) end end function ∇∇(f::Number) - @inline function hess_f(x::Point) + function hess_f(x::Point) g = gradient(f)(x) gradient(g)(x) end @@ -16,31 +16,31 @@ end # Automatic differentiation of functions function gradient(f::Function) - @inline function _gradient(x) + function _gradient(x) gradient(f,x) end end function symmetric_gradient(f::Function) - @inline function _symmetric_gradient(x) + function _symmetric_gradient(x) symmetric_gradient(f,x) end end function divergence(f::Function) - @inline function _divergence(x) + function _divergence(x) divergence(f,x) end end function curl(f::Function) - @inline function _curl(x) + function _curl(x) curl(f,x) end end function laplacian(f::Function) - @inline function _laplacian(x) + function _laplacian(x) laplacian(f,x) end end @@ -51,11 +51,11 @@ function gradient(f::Function,x::Point) gradient(f,x,return_value(f,x)) end -@inline function gradient(f::Function,x::Point,fx::Number) +function gradient(f::Function,x::Point,fx::Number) VectorValue(ForwardDiff.gradient(f,get_array(x))) end -@inline function gradient(f::Function,x::Point,fx::VectorValue) +function gradient(f::Function,x::Point,fx::VectorValue) TensorValue(transpose(ForwardDiff.jacobian(y->get_array(f(y)),get_array(x)))) end @@ -121,11 +121,11 @@ function laplacian(f::Function,x::Point) laplacian(f,x,return_value(f,x)) end -@inline function laplacian(f::Function,x::Point,fx::Number) +function laplacian(f::Function,x::Point,fx::Number) tr(ForwardDiff.jacobian(y->ForwardDiff.gradient(f,y), get_array(x))) end -@inline function laplacian(f::Function,x::Point,fx::VectorValue) +function laplacian(f::Function,x::Point,fx::VectorValue) A = length(x) B = length(fx) a = ForwardDiff.jacobian(y->transpose(ForwardDiff.jacobian(z->get_array(f(z)),y)), get_array(x)) @@ -138,8 +138,8 @@ end # Specialization when x::StaticVector -@inline gradient(f::Function,x::SVector) = gradient(f,Point(x)) -@inline symmetric_gradient(f::Function,x::SVector) = symmetric_gradient(f,Point(x)) -@inline divergence(f::Function,x::SVector) = divergence(f,Point(x)) -@inline curl(f::Function,x::SVector) = curl(f,Point(x)) -@inline laplacian(f::Function,x::SVector) = laplacian(f,Point(x)) +gradient(f::Function,x::SVector) = gradient(f,Point(x)) +symmetric_gradient(f::Function,x::SVector) = symmetric_gradient(f,Point(x)) +divergence(f::Function,x::SVector) = divergence(f,Point(x)) +curl(f::Function,x::SVector) = curl(f,Point(x)) +laplacian(f::Function,x::SVector) = laplacian(f,Point(x)) diff --git a/src/Fields/DiffOperators.jl b/src/Fields/DiffOperators.jl index 002b475a9..fcb3f39fc 100644 --- a/src/Fields/DiffOperators.jl +++ b/src/Fields/DiffOperators.jl @@ -46,11 +46,11 @@ end """ grad2curl(∇f) """ -@inline function grad2curl(∇u::TensorValue{2}) +function grad2curl(∇u::TensorValue{2}) ∇u[1,2] - ∇u[2,1] end -@inline function grad2curl(∇u::TensorValue{3}) +function grad2curl(∇u::TensorValue{3}) c1 = ∇u[2,3] - ∇u[3,2] c2 = ∇u[3,1] - ∇u[1,3] c3 = ∇u[1,2] - ∇u[2,1] diff --git a/src/Fields/FieldArrays.jl b/src/Fields/FieldArrays.jl index 24268c317..9bf62378a 100644 --- a/src/Fields/FieldArrays.jl +++ b/src/Fields/FieldArrays.jl @@ -1,7 +1,7 @@ # Make arrays of field behave like Maps -@inline function return_cache(f::AbstractArray{T},x::Point) where T<:Field +function return_cache(f::AbstractArray{T},x::Point) where T<:Field S = return_type(testitem(f),x) cr = CachedArray(zeros(S,size(f))) if isconcretetype(T) @@ -19,7 +19,7 @@ If the field vector has length `nf` and it is evaluated in one point, it returns an `nf` vector with the result. If the same array is applied to a vector of `np` points, it returns a matrix `np` x `nf`. """ -@inline function evaluate!(c,f::AbstractArray{T},x::Point) where T<:Field +function evaluate!(c,f::AbstractArray{T},x::Point) where T<:Field cr, cf = c setsize!(cr,size(f)) r = cr.array @@ -110,15 +110,15 @@ function return_value(k::Broadcasting{typeof(∇∇)},a::AbstractArray{<:Field}) evaluate(k,a) end -@inline function evaluate!(cache,k::Broadcasting{typeof(∇)},a::AbstractArray{<:Field}) +function evaluate!(cache,k::Broadcasting{typeof(∇)},a::AbstractArray{<:Field}) FieldGradientArray{1}(a) end -@inline function evaluate!(cache,k::Broadcasting{typeof(∇)},a::FieldGradientArray{N}) where N +function evaluate!(cache,k::Broadcasting{typeof(∇)},a::FieldGradientArray{N}) where N FieldGradientArray{N+1}(a.fa) end -@inline function evaluate!(cache,k::Broadcasting{typeof(∇∇)},a::AbstractArray{<:Field}) +function evaluate!(cache,k::Broadcasting{typeof(∇∇)},a::AbstractArray{<:Field}) FieldGradientArray{2}(a) end @@ -140,12 +140,12 @@ function ∇∇(a::AbstractArray{<:Field}) @unreachable msg end -@inline Base.size(a::FieldGradientArray) = size(a.fa) -@inline Base.axes(a::FieldGradientArray) = axes(a.fa) -@inline Base.getindex(a::FieldGradientArray{Ng},i::Integer) where Ng = gradient(a.fa[i],Val(Ng)) -@inline Base.getindex( +Base.size(a::FieldGradientArray) = size(a.fa) +Base.axes(a::FieldGradientArray) = axes(a.fa) +Base.getindex(a::FieldGradientArray{Ng},i::Integer) where Ng = gradient(a.fa[i],Val(Ng)) +Base.getindex( a::FieldGradientArray{Ng,A,T,N},i::Vararg{Integer,N}) where {Ng,A,T,N} = gradient(a.fa[i...],Val(Ng)) -@inline Base.IndexStyle(::Type{<:FieldGradientArray{Ng,A}}) where {Ng,A} = IndexStyle(A) +Base.IndexStyle(::Type{<:FieldGradientArray{Ng,A}}) where {Ng,A} = IndexStyle(A) # Optimizing linear_combination. @@ -172,7 +172,7 @@ for T in (:(Point),:(AbstractVector{<:Point})) cf, ck end - @inline function evaluate!(cache,a::LinearCombinationField,x::$T) + function evaluate!(cache,a::LinearCombinationField,x::$T) cf, ck = cache fx = evaluate!(cf,a.fields,x) v = a.values @@ -230,7 +230,7 @@ for T in (:(Point),:(AbstractVector{<:Point})) cf, ck end - @inline function evaluate!(cache,a::LinearCombinationFieldVector,x::$T) + function evaluate!(cache,a::LinearCombinationFieldVector,x::$T) cf, ck = cache fx = evaluate!(cf,a.fields,x) v = a.values @@ -261,7 +261,7 @@ struct LinearCombinationMap{T} <: Map LinearCombinationMap(column::Colon) = new{typeof(column)}(column) end -@inline function evaluate!(cache,k::LinearCombinationMap{<:Integer},v::AbstractArray,fx::AbstractVector) +function evaluate!(cache,k::LinearCombinationMap{<:Integer},v::AbstractArray,fx::AbstractVector) z = zero(return_type(outer,testitem(fx),testitem(v))) @check length(fx) == size(v,1) @inbounds for i in eachindex(fx) @@ -289,7 +289,7 @@ function return_cache(k::LinearCombinationMap{<:Integer},v::AbstractArray,fx::Ab CachedArray(r) end -@inline function evaluate!(cache,k::LinearCombinationMap{<:Integer},v::AbstractArray,fx::AbstractMatrix) +function evaluate!(cache,k::LinearCombinationMap{<:Integer},v::AbstractArray,fx::AbstractMatrix) @check size(fx,2) == size(v,1) setsize!(cache,(size(fx,1),)) r = cache.array @@ -304,7 +304,7 @@ end r end -@inline function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractVector,fx::AbstractVector) +function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractVector,fx::AbstractVector) evaluate!(cache,LinearCombinationMap(1),v,fx) end @@ -316,7 +316,7 @@ function return_cache(k::LinearCombinationMap{Colon},v::AbstractVector,fx::Abstr return_cache(LinearCombinationMap(1),v,fx) end -@inline function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractVector,fx::AbstractMatrix) +function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractVector,fx::AbstractMatrix) evaluate!(cache,LinearCombinationMap(1),v,fx) end @@ -328,7 +328,7 @@ function return_cache(k::LinearCombinationMap{Colon},v::AbstractMatrix,fx::Abstr CachedArray(r) end -@inline function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractMatrix,fx::AbstractVector) +function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractMatrix,fx::AbstractVector) @check length(fx) == size(v,1) setsize!(cache,(size(v,2),)) r = cache.array @@ -350,7 +350,7 @@ function return_cache(k::LinearCombinationMap{Colon},v::AbstractMatrix,fx::Abstr CachedArray(r) end -@inline function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractMatrix,fx::AbstractMatrix) +function evaluate!(cache,k::LinearCombinationMap{Colon},v::AbstractMatrix,fx::AbstractMatrix) @check size(fx,2) == size(v,1) setsize!(cache,(size(fx,1),size(v,2))) r = cache.array @@ -380,8 +380,8 @@ function evaluate!(cache,k::Transpose{<:Field},x::AbstractVector{<:Point}) end struct TransposeMap <: Map end -@inline evaluate!(cache,k::TransposeMap,a::AbstractVector) = transpose(a) -@inline evaluate!(cache,k::TransposeMap,a::AbstractMatrix) = TransposeFieldIndices(a) +evaluate!(cache,k::TransposeMap,a::AbstractVector) = transpose(a) +evaluate!(cache,k::TransposeMap,a::AbstractMatrix) = TransposeFieldIndices(a) """ Given a matrix `np` x `nf1` x `nf2` result of the evaluation of a field vector @@ -391,7 +391,7 @@ but more performant, since it does not involve allocations. """ struct TransposeFieldIndices{A,T} <: AbstractArray{T,3} matrix::A - @inline function TransposeFieldIndices(matrix::AbstractMatrix{T}) where T + function TransposeFieldIndices(matrix::AbstractMatrix{T}) where T A = typeof(matrix) new{A,T}(matrix) end @@ -400,13 +400,13 @@ end function TransposeFieldIndices{A,T}(::UndefInitializer,shape::NTuple{3,Integer}) where {A,T} TransposeFieldIndices(similar(A,(shape[1],shape[3]))) end -@inline Base.size(a::TransposeFieldIndices) = (size(a.matrix,1),1,size(a.matrix,2)) -@inline Base.axes(a::TransposeFieldIndices) = (axes(a.matrix,1),Base.OneTo(1),axes(a.matrix,2)) -@inline Base.IndexStyle(::Type{<:TransposeFieldIndices{A}}) where A = IndexStyle(A) -@inline Base.getindex(a::TransposeFieldIndices,i::Integer,j::Integer,k::Integer) = a.matrix[i,k] -@inline Base.getindex(a::TransposeFieldIndices,i::Integer) = a.matrix[i] -@inline Base.setindex!(a::TransposeFieldIndices,v,i::Integer,j::Integer,k::Integer) = (a.matrix[i,k] = v) -@inline Base.setindex!(a::TransposeFieldIndices,v,i::Integer) = (a.matrix[i] = v) +Base.size(a::TransposeFieldIndices) = (size(a.matrix,1),1,size(a.matrix,2)) +Base.axes(a::TransposeFieldIndices) = (axes(a.matrix,1),Base.OneTo(1),axes(a.matrix,2)) +Base.IndexStyle(::Type{<:TransposeFieldIndices{A}}) where A = IndexStyle(A) +Base.getindex(a::TransposeFieldIndices,i::Integer,j::Integer,k::Integer) = a.matrix[i,k] +Base.getindex(a::TransposeFieldIndices,i::Integer) = a.matrix[i] +Base.setindex!(a::TransposeFieldIndices,v,i::Integer,j::Integer,k::Integer) = (a.matrix[i,k] = v) +Base.setindex!(a::TransposeFieldIndices,v,i::Integer) = (a.matrix[i] = v) # Integration @@ -456,10 +456,10 @@ struct BroadcastOpFieldArray{O,T,N,A} <: AbstractArray{T,N} end end -@inline Base.size(a::BroadcastOpFieldArray) = Base.Broadcast.broadcast_shape(map(size,a.args)...) -@inline Base.axes(a::BroadcastOpFieldArray) = Base.Broadcast.broadcast_shape(map(axes,a.args)...) -@inline Base.IndexStyle(::Type{<:BroadcastOpFieldArray}) = IndexLinear() -@inline Base.getindex(a::BroadcastOpFieldArray,i::Integer) = broadcast(Operation(a.op),a.args...)[i] +Base.size(a::BroadcastOpFieldArray) = Base.Broadcast.broadcast_shape(map(size,a.args)...) +Base.axes(a::BroadcastOpFieldArray) = Base.Broadcast.broadcast_shape(map(axes,a.args)...) +Base.IndexStyle(::Type{<:BroadcastOpFieldArray}) = IndexLinear() +Base.getindex(a::BroadcastOpFieldArray,i::Integer) = broadcast(Operation(a.op),a.args...)[i] function testitem(a::BroadcastOpFieldArray) fs = map(testitem,a.args) return_value(Operation(a.op),fs...) @@ -495,15 +495,15 @@ end return_value(a::BroadcastingFieldOpMap,args...) = return_value(Broadcasting(a.op),args...) return_cache(a::BroadcastingFieldOpMap,args...) = return_cache(Broadcasting(a.op),args...) -@inline evaluate!(cache,a::BroadcastingFieldOpMap,args...) = evaluate!(cache,Broadcasting(a.op),args...) +evaluate!(cache,a::BroadcastingFieldOpMap,args...) = evaluate!(cache,Broadcasting(a.op),args...) return_value(a::BroadcastingFieldOpMap,args::AbstractArray...) = return_value(Broadcasting(a.op),args...) return_cache(a::BroadcastingFieldOpMap,args::AbstractArray...) = return_cache(Broadcasting(a.op),args...) -@inline evaluate!(cache,a::BroadcastingFieldOpMap,args::AbstractArray...) = evaluate!(cache,Broadcasting(a.op),args...) +evaluate!(cache,a::BroadcastingFieldOpMap,args::AbstractArray...) = evaluate!(cache,Broadcasting(a.op),args...) # Follow optimizations are very important to achieve performance -@inline function evaluate!( +function evaluate!( cache, f::BroadcastingFieldOpMap, a::AbstractArray{T,N}, @@ -518,7 +518,7 @@ return_cache(a::BroadcastingFieldOpMap,args::AbstractArray...) = return_cache(Br r end -@inline function evaluate!( +function evaluate!( cache, f::BroadcastingFieldOpMap, a::AbstractMatrix, @@ -541,7 +541,7 @@ end r end -@inline function evaluate!( +function evaluate!( cache, f::BroadcastingFieldOpMap, b::AbstractArray{S,3} where S, @@ -564,7 +564,7 @@ end r end -@inline function evaluate!( +function evaluate!( cache, f::BroadcastingFieldOpMap, a::AbstractVector, @@ -583,7 +583,7 @@ end r end -@inline function evaluate!( +function evaluate!( cache, f::BroadcastingFieldOpMap, b::AbstractMatrix, @@ -602,7 +602,7 @@ end r end -@inline function evaluate!( +function evaluate!( cache, f::BroadcastingFieldOpMap, a::AbstractVector, @@ -623,7 +623,7 @@ end r end -@inline function evaluate!( +function evaluate!( cache, f::BroadcastingFieldOpMap, b::AbstractArray{S,3} where S, diff --git a/src/Fields/FieldsInterfaces.jl b/src/Fields/FieldsInterfaces.jl index 869e36aac..3891b2fd3 100644 --- a/src/Fields/FieldsInterfaces.jl +++ b/src/Fields/FieldsInterfaces.jl @@ -81,11 +81,11 @@ lazy_map(::Broadcasting{typeof(∇∇)},a::AbstractArray{<:Field}) = lazy_map( push_∇(∇a::Field,ϕ::Field) = pinvJt(∇(ϕ))⋅∇a -@inline function pinvJt(Jt::MultiValue{Tuple{D,D}}) where D +function pinvJt(Jt::MultiValue{Tuple{D,D}}) where D inv(Jt) end -@inline function pinvJt(Jt::MultiValue{Tuple{D1,D2}}) where {D1,D2} +function pinvJt(Jt::MultiValue{Tuple{D1,D2}}) where {D1,D2} @check D1 < D2 J = transpose(Jt) transpose(inv(Jt⋅J)⋅Jt) @@ -137,7 +137,7 @@ function testargs(f::Field,x::AbstractArray{<:Point}) (y,) end -@inline function return_cache(f::Field,x::AbstractArray{<:Point}) +function return_cache(f::Field,x::AbstractArray{<:Point}) T = return_type(f,testitem(x)) s = size(x) ab = zeros(T,s) @@ -146,7 +146,7 @@ end cb, cf end -@inline function evaluate!(c,f::Field,x::AbstractArray{<:Point}) +function evaluate!(c,f::Field,x::AbstractArray{<:Point}) cb, cf = c sx = size(x) setsize!(cb,sx) @@ -166,37 +166,37 @@ struct GenericField{T} <: Field object::T end -#@inline Field(f) = GenericField(f) -@inline GenericField(f::Field) = f +#Field(f) = GenericField(f) +GenericField(f::Field) = f testargs(a::GenericField,x::Point) = testargs(a.object,x) return_value(a::GenericField,x::Point) = return_value(a.object,x) return_cache(a::GenericField,x::Point) = return_cache(a.object,x) -@inline evaluate!(cache,a::GenericField,x::Point) = evaluate!(cache,a.object,x) +evaluate!(cache,a::GenericField,x::Point) = evaluate!(cache,a.object,x) function return_cache(f::FieldGradient{N,<:GenericField},x::Point) where N return_cache(FieldGradient{N}(f.object.object),x) end -@inline function evaluate!(c,f::FieldGradient{N,<:GenericField},x::Point) where N +function evaluate!(c,f::FieldGradient{N,<:GenericField},x::Point) where N evaluate!(c,FieldGradient{N}(f.object.object),x) end # Make Field behave like a collection -@inline Base.length(::Field) = 1 -@inline Base.size(::Field) = () -@inline Base.axes(::Field) = () -@inline Base.IteratorSize(::Type{<:Field}) = Base.HasShape{0}() -@inline Base.eltype(::Type{T}) where T<:Field = T -@inline Base.iterate(a::Field) = (a,nothing) -@inline Base.iterate(a::Field,::Nothing) = nothing -@inline Base.getindex(a::Field,i::Integer) = (@check i == 1; a) +Base.length(::Field) = 1 +Base.size(::Field) = () +Base.axes(::Field) = () +Base.IteratorSize(::Type{<:Field}) = Base.HasShape{0}() +Base.eltype(::Type{T}) where T<:Field = T +Base.iterate(a::Field) = (a,nothing) +Base.iterate(a::Field,::Nothing) = nothing +Base.getindex(a::Field,i::Integer) = (@check i == 1; a) testitem(a::Field) = a # Zero field -@inline Base.zero(a::Field) = ZeroField(a) +Base.zero(a::Field) = ZeroField(a) """ It represents `0.0*f` for a field `f`. @@ -206,7 +206,7 @@ struct ZeroField{F} <: Field end return_cache(z::ZeroField,x::Point) = zero(return_type(z.field,x)) -@inline evaluate!(cache,z::ZeroField,x::Point) = cache +evaluate!(cache,z::ZeroField,x::Point) = cache testvalue(::Type{ZeroField{F}}) where F = ZeroField(testvalue(F)) function return_cache(z::ZeroField,x::AbstractArray{<:Point}) @@ -224,7 +224,7 @@ function evaluate!(c,f::ZeroField,x::AbstractArray{<:Point}) c.array end -@inline gradient(z::ZeroField) = ZeroField(gradient(z.field)) +gradient(z::ZeroField) = ZeroField(gradient(z.field)) # Make Number behave like Field # @@ -238,11 +238,11 @@ struct ConstantField{T<:Number} <: Field value::T end -@inline constant_field(a) = ConstantField(a) +constant_field(a) = ConstantField(a) Base.zero(::Type{ConstantField{T}}) where T = ConstantField(zero(T)) -@inline function evaluate!(c,f::ConstantField,x::Point) +function evaluate!(c,f::ConstantField,x::Point) f.value end @@ -263,13 +263,13 @@ function evaluate!(c,f::ConstantField,x::AbstractArray{<:Point}) c.array end -@inline function return_cache(f::FieldGradient{N,<:ConstantField},x::Point) where N +function return_cache(f::FieldGradient{N,<:ConstantField},x::Point) where N gradient(f.object.value,Val(N))(x) end -@inline evaluate!(c,f::FieldGradient{N,<:ConstantField},x::Point) where N = c +evaluate!(c,f::FieldGradient{N,<:ConstantField},x::Point) where N = c -@inline function return_cache(f::FieldGradient{N,<:ConstantField},x::AbstractArray{<:Point}) where N +function return_cache(f::FieldGradient{N,<:ConstantField},x::AbstractArray{<:Point}) where N CachedArray(gradient(f.object.value,Val(N)).(x)) end @@ -291,7 +291,7 @@ end ## Make Function behave like Field return_cache(f::FieldGradient{N,<:Function},x::Point) where N = gradient(f.object,Val(N)) -@inline evaluate!(c,f::FieldGradient{N,<:Function},x::Point) where N = c(x) +evaluate!(c,f::FieldGradient{N,<:Function},x::Point) where N = c(x) # Operations @@ -315,7 +315,7 @@ function return_cache(c::OperationField,x::Point) ck, cl end -@inline function evaluate!(cache,c::OperationField,x::Point) +function evaluate!(cache,c::OperationField,x::Point) ck, cf = cache lx = map((ci,fi) -> evaluate!(ci,fi,x),cf,c.fields) evaluate!(ck,c.op,lx...) @@ -330,7 +330,7 @@ function return_cache(c::OperationField,x::AbstractArray{<:Point}) ca, ck, cf end -@inline function evaluate!(cache,c::OperationField,x::AbstractArray{<:Point}) +function evaluate!(cache,c::OperationField,x::AbstractArray{<:Point}) ca, ck, cf = cache sx = size(x) setsize!(ca,sx) @@ -342,9 +342,9 @@ end r end -@inline evaluate!(cache,op::Operation,x::Field...) = OperationField(op.op,x) +evaluate!(cache,op::Operation,x::Field...) = OperationField(op.op,x) return_value(op::Broadcasting{<:Operation},x::Field...) = OperationField(op.f.op,x) -@inline evaluate!(cache,op::Broadcasting{<:Operation},x::Field...) = OperationField(op.f.op,x) +evaluate!(cache,op::Broadcasting{<:Operation},x::Field...) = OperationField(op.f.op,x) # Define some well known operations @@ -352,20 +352,20 @@ for op in (:+,:-,:*,:/,:⋅,:⊙,:⊗,:inv,:det,:meas,:pinvJt,:tr,:grad2curl,:sy @eval ($op)(a::Field...) = Operation($op)(a...) end -@inline transpose(f::Field) = f +transpose(f::Field) = f for op in (:+,:-,:*,:/,:⋅,:⊙,:⊗) @eval ($op)(a::Field,b::Number) = Operation($op)(a,ConstantField(b)) @eval ($op)(a::Number,b::Field) = Operation($op)(ConstantField(a),b) end -#@inline *(A::Number, B::Field) = ConstantField(A)*B -#@inline *(A::Field, B::Number) = A*ConstantField(B) -#@inline ⋅(A::Number, B::Field) = ConstantField(A)⋅B -#@inline ⋅(A::Field, B::Number) = A⋅ConstantField(B) +#*(A::Number, B::Field) = ConstantField(A)*B +#*(A::Field, B::Number) = A*ConstantField(B) +#⋅(A::Number, B::Field) = ConstantField(A)⋅B +#⋅(A::Field, B::Number) = A⋅ConstantField(B) -#@inline *(A::Function, B::Field) = GenericField(A)*B -#@inline *(A::Field, B::Function) = GenericField(B)*A +#*(A::Function, B::Field) = GenericField(A)*B +#*(A::Field, B::Function) = GenericField(B)*A # Gradient of the sum for op in (:+,:-) @@ -439,7 +439,7 @@ end It returns the composition of two fields, which is just `Operation(f)(g)` """ -@inline Base.:∘(f::Field,g::Field) = Operation(f)(g) +Base.:∘(f::Field,g::Field) = Operation(f)(g) evaluate!(cache,::Broadcasting{typeof(∘)},f::Field,g::Field) = f∘g # Integration @@ -467,7 +467,7 @@ function return_cache(::typeof(integrate),a,x,w) ca, ck end -@inline function evaluate!(cache,::typeof(integrate),a,x,w) +function evaluate!(cache,::typeof(integrate),a,x,w) ca, ck = cache ax = evaluate!(ca,a,x) evaluate!(ck,IntegrationMap(),ax,w) @@ -482,7 +482,7 @@ function return_cache(::typeof(integrate),a,q,w,j) ca, cj, ck end -@inline function evaluate!(cache,::typeof(integrate),a,q,w,j) +function evaluate!(cache,::typeof(integrate),a,q,w,j) ca, cj, ck = cache aq = evaluate!(ca,a,q) jq = evaluate!(cj,j,q) @@ -491,7 +491,7 @@ end struct IntegrationMap <: Map end -@inline function evaluate!(cache,k::IntegrationMap,ax::AbstractVector,w) +function evaluate!(cache,k::IntegrationMap,ax::AbstractVector,w) T = typeof( testitem(ax)*testitem(w) + testitem(ax)*testitem(w) ) z = zero(T) r = z @@ -502,7 +502,7 @@ struct IntegrationMap <: Map end r end -@inline function evaluate!(cache,k::IntegrationMap,aq::AbstractVector,w,jq::AbstractVector) +function evaluate!(cache,k::IntegrationMap,aq::AbstractVector,w,jq::AbstractVector) T = typeof( testitem(aq)*testitem(w)*meas(testitem(jq)) + testitem(aq)*testitem(w)*meas(testitem(jq)) ) z = zero(T) @check length(aq) == length(w) @@ -519,7 +519,7 @@ function return_cache(k::IntegrationMap,ax::AbstractArray,w) CachedArray(r) end -@inline function evaluate!(cache,k::IntegrationMap,ax::AbstractArray,w) +function evaluate!(cache,k::IntegrationMap,ax::AbstractArray,w) setsize!(cache,size(ax)[2:end]) r = cache.array @check size(ax,1) == length(w) @@ -548,7 +548,7 @@ function return_cache(k::IntegrationMap,aq::AbstractArray,w,jq::AbstractVector) CachedArray(r) end -@inline function evaluate!(cache,k::IntegrationMap,aq::AbstractArray,w,jq::AbstractVector) +function evaluate!(cache,k::IntegrationMap,aq::AbstractArray,w,jq::AbstractVector) setsize!(cache,size(aq)[2:end]) r = cache.array @check size(aq,1) == length(w) || size(aq,1) == 0 @@ -571,7 +571,7 @@ function return_cache(k::IntegrationMap,aq::AbstractArray{S,3} where S,w,jq::Abs CachedArray(r), CachedArray(s) end -@inline function evaluate!(cache,k::IntegrationMap,aq::AbstractArray{S,3} where S, w,jq::AbstractVector) +function evaluate!(cache,k::IntegrationMap,aq::AbstractArray{S,3} where S, w,jq::AbstractVector) cache_r, cache_s = cache np, ni, nj = size(aq) setsize!(cache_r,(ni,nj)) @@ -596,7 +596,7 @@ end r end -@inline function evaluate!(cache,k::IntegrationMap,aq::AbstractMatrix, w,jq::AbstractVector) +function evaluate!(cache,k::IntegrationMap,aq::AbstractMatrix, w,jq::AbstractVector) np, ni = size(aq) setsize!(cache,(ni,)) r = cache.array @@ -644,7 +644,7 @@ struct VoidFieldMap <: Map isvoid::Bool end -@inline Arrays.evaluate!(cache,k::VoidFieldMap,b) = VoidField(b,k.isvoid) +Arrays.evaluate!(cache,k::VoidFieldMap,b) = VoidField(b,k.isvoid) struct VoidField{F} <: Field field::F @@ -686,7 +686,7 @@ end testvalue(::Type{VoidField{F}}) where F = VoidField(testvalue(F),false) -@inline gradient(z::VoidField) = VoidField(gradient(z.field),z.isvoid) +gradient(z::VoidField) = VoidField(gradient(z.field),z.isvoid) function lazy_map(::typeof(evaluate),a::LazyArray{<:Fill{VoidFieldMap}},x::AbstractArray) p = a.maps.value @@ -698,7 +698,7 @@ struct VoidBasisMap <: Map isvoid::Bool end -@inline Arrays.evaluate!(cache,k::VoidBasisMap,b) = VoidBasis(b,k.isvoid) +Arrays.evaluate!(cache,k::VoidBasisMap,b) = VoidBasis(b,k.isvoid) struct VoidBasis{T,N,A} <: AbstractArray{T,N} basis::A @@ -772,7 +772,7 @@ end for T in (:Point,:Field,:(AbstractVector{<:Point}),:(AbstractVector{<:Field})) @eval begin - @inline function Fields.evaluate!(cache,a::VoidBasis,x::$T) + function Fields.evaluate!(cache,a::VoidBasis,x::$T) cb, r = cache if a.isvoid r diff --git a/src/Fields/MockFields.jl b/src/Fields/MockFields.jl index a7ec2589f..e6432abf4 100644 --- a/src/Fields/MockFields.jl +++ b/src/Fields/MockFields.jl @@ -29,7 +29,7 @@ end Base.size(a::MockFieldArray) = size(a.values) Base.IndexStyle(::Type{<:MockFieldArray}) = IndexLinear() -@inline Base.getindex(a::MockFieldArray,i::Integer) = GenericField(nothing) +Base.getindex(a::MockFieldArray,i::Integer) = GenericField(nothing) function return_cache(f::MockFieldArray,x::Point) nothing diff --git a/src/Geometry/BoundaryTriangulations.jl b/src/Geometry/BoundaryTriangulations.jl index 21327297d..2ac59e465 100644 --- a/src/Geometry/BoundaryTriangulations.jl +++ b/src/Geometry/BoundaryTriangulations.jl @@ -241,7 +241,7 @@ function get_facet_normal(trian::BoundaryTriangulation) Fields.MemoArray(face_s_n) end -@inline function push_normal(invJt,n) +function push_normal(invJt,n) v = invJt⋅n m = sqrt(inner(v,v)) if m < eps() diff --git a/src/Geometry/CartesianGrids.jl b/src/Geometry/CartesianGrids.jl index 41ace83a3..ee83694c4 100644 --- a/src/Geometry/CartesianGrids.jl +++ b/src/Geometry/CartesianGrids.jl @@ -141,19 +141,19 @@ function array_cache(a::CartesianCellNodes{D}) where D zeros(Int32,2^D) end -#@inline function getindex!(cache,a::CartesianCellNodes,i::Integer) +#function getindex!(cache,a::CartesianCellNodes,i::Integer) # cis = CartesianIndices(size(a)) # ci = cis[i] # getindex!(cache,a,Tuple(ci)...) #end # -#@inline function getindex!(v,a::CartesianCellNodes{1},i::Integer) +#function getindex!(v,a::CartesianCellNodes{1},i::Integer) # v[1] = i # v[2] = i+1 # v #end -@inline function getindex!(v,a::CartesianCellNodes{D},i::Vararg{Integer,D}) where D +function getindex!(v,a::CartesianCellNodes{D},i::Vararg{Integer,D}) where D nodes = LinearIndices(size(a).+1) lnodes = CartesianIndices(tfill(Int32(2),Val{D}())) j = i .- 1 diff --git a/src/Polynomials/ChangeBasis.jl b/src/Polynomials/ChangeBasis.jl index 93c338461..d10427338 100644 --- a/src/Polynomials/ChangeBasis.jl +++ b/src/Polynomials/ChangeBasis.jl @@ -46,11 +46,11 @@ end struct BasisTermFromChangeOfBasis end -@inline Base.size(a::BasisFromChangeOfBasis) = (length(a.basis),) -@inline Base.axes(a::BasisFromChangeOfBasis) = (axes(a.basis,1),) +Base.size(a::BasisFromChangeOfBasis) = (length(a.basis),) +Base.axes(a::BasisFromChangeOfBasis) = (axes(a.basis,1),) # @santiagobadia : Not sure we want to create the real computation here -@inline Base.getindex(a::BasisFromChangeOfBasis,i::Integer) = BasisTermFromChangeOfBasis() -@inline Base.IndexStyle(::BasisFromChangeOfBasis) = IndexLinear() +Base.getindex(a::BasisFromChangeOfBasis,i::Integer) = BasisTermFromChangeOfBasis() +Base.IndexStyle(::BasisFromChangeOfBasis) = IndexLinear() function return_cache(b::BasisFromChangeOfBasis,x) cb = return_cache(b.basis,x) diff --git a/src/Polynomials/MonomialBases.jl b/src/Polynomials/MonomialBases.jl index 3b51d4a76..c3d05a0d5 100644 --- a/src/Polynomials/MonomialBases.jl +++ b/src/Polynomials/MonomialBases.jl @@ -18,10 +18,10 @@ struct MonomialBasis{D,T} <: AbstractVector{Monomial} end end -@inline Base.size(a::MonomialBasis{D,T}) where {D,T} = (length(a.terms)*num_components(T),) +Base.size(a::MonomialBasis{D,T}) where {D,T} = (length(a.terms)*num_components(T),) # @santiagobadia : Not sure we want to create the monomial machinery -@inline Base.getindex(a::MonomialBasis,i::Integer) = Monomial() -@inline Base.IndexStyle(::MonomialBasis) = IndexLinear() +Base.getindex(a::MonomialBasis,i::Integer) = Monomial() +Base.IndexStyle(::MonomialBasis) = IndexLinear() """ MonomialBasis{D}(::Type{T}, orders::Tuple [, filter::Function]) where {D,T} @@ -287,7 +287,7 @@ function _define_terms(filter,orders) [ ci for ci in cis if filter(Int[Tuple(ci-co)...],maxorder) ] end -@inline function _evaluate_1d!(v::AbstractMatrix{T},x,order,d) where T +function _evaluate_1d!(v::AbstractMatrix{T},x,order,d) where T n = order + 1 z = one(T) @inbounds v[d,1] = z @@ -345,7 +345,7 @@ function _evaluate_nd!( end -@inline function _set_value!(v::AbstractVector{V},s::T,k) where {V,T} +function _set_value!(v::AbstractVector{V},s::T,k) where {V,T} m = zero(Mutable(V)) z = zero(T) js = eachindex(m) @@ -360,7 +360,7 @@ end k end -@inline function _set_value!(v::AbstractVector{<:Real},s,k) +function _set_value!(v::AbstractVector{<:Real},s,k) @inbounds v[k] = s k+1 end @@ -406,14 +406,14 @@ function _gradient_nd!( end -@inline function _set_gradient!( +function _set_gradient!( v::AbstractVector{G},s,k,::Type{<:Real}) where G @inbounds v[k] = s k+1 end -@inline function _set_gradient!( +function _set_gradient!( v::AbstractVector{G},s,k,::Type{V}) where {V,G} T = eltype(s) diff --git a/src/Polynomials/PCurlGradMonomialBases.jl b/src/Polynomials/PCurlGradMonomialBases.jl index 41454d8e9..cbc39aad2 100644 --- a/src/Polynomials/PCurlGradMonomialBases.jl +++ b/src/Polynomials/PCurlGradMonomialBases.jl @@ -20,10 +20,10 @@ struct PCurlGradMonomialBasis{D,T} <: AbstractVector{Monomial} end end -@inline Base.size(a::PCurlGradMonomialBasis) = (_ndofs_pgrad(a),) +Base.size(a::PCurlGradMonomialBasis) = (_ndofs_pgrad(a),) # @santiagobadia : Not sure we want to create the monomial machinery -@inline Base.getindex(a::PCurlGradMonomialBasis,i::Integer) = Monomial() -@inline Base.IndexStyle(::PCurlGradMonomialBasis) = IndexLinear() +Base.getindex(a::PCurlGradMonomialBasis,i::Integer) = Monomial() +Base.IndexStyle(::PCurlGradMonomialBasis) = IndexLinear() """ PCurlGradMonomialBasis{D}(::Type{T},order::Int) where {D,T} diff --git a/src/Polynomials/QCurlGradMonomialBases.jl b/src/Polynomials/QCurlGradMonomialBases.jl index b71497f1e..21f456824 100644 --- a/src/Polynomials/QCurlGradMonomialBases.jl +++ b/src/Polynomials/QCurlGradMonomialBases.jl @@ -16,10 +16,10 @@ struct QCurlGradMonomialBasis{D,T} <: AbstractVector{Monomial} end end -@inline Base.size(a::QCurlGradMonomialBasis) = (length(a.qgrad),) +Base.size(a::QCurlGradMonomialBasis) = (length(a.qgrad),) # @santiagobadia : Not sure we want to create the monomial machinery -@inline Base.getindex(a::QCurlGradMonomialBasis,i::Integer) = Monomial() -@inline Base.IndexStyle(::QCurlGradMonomialBasis) = IndexLinear() +Base.getindex(a::QCurlGradMonomialBasis,i::Integer) = Monomial() +Base.IndexStyle(::QCurlGradMonomialBasis) = IndexLinear() """ QCurlGradMonomialBasis{D}(::Type{T},order::Int) where {D,T} @@ -45,7 +45,7 @@ function return_cache(f::QCurlGradMonomialBasis,x::AbstractVector{<:Point}) return_cache(f.qgrad,x) end -@inline function evaluate!(cache,f::QCurlGradMonomialBasis,x::AbstractVector{<:Point}) +function evaluate!(cache,f::QCurlGradMonomialBasis,x::AbstractVector{<:Point}) evaluate!(cache,f.qgrad,x) end @@ -57,7 +57,7 @@ function return_cache( return_cache(FieldGradientArray{N}(f.qgrad),x) end -@inline function evaluate!( +function evaluate!( cache, fg::FieldGradientArray{N,<:QCurlGradMonomialBasis}, x::AbstractVector{<:Point}) where N diff --git a/src/Polynomials/QGradMonomialBases.jl b/src/Polynomials/QGradMonomialBases.jl index 997ce33c2..aa2c42190 100644 --- a/src/Polynomials/QGradMonomialBases.jl +++ b/src/Polynomials/QGradMonomialBases.jl @@ -17,10 +17,10 @@ struct QGradMonomialBasis{D,T} <: AbstractVector{Monomial} end end -@inline Base.size(a::QGradMonomialBasis) = (_ndofs_qgrad(a),) +Base.size(a::QGradMonomialBasis) = (_ndofs_qgrad(a),) # @santiagobadia : Not sure we want to create the monomial machinery -@inline Base.getindex(a::QGradMonomialBasis,i::Integer) = Monomial() -@inline Base.IndexStyle(::QGradMonomialBasis) = IndexLinear() +Base.getindex(a::QGradMonomialBasis,i::Integer) = Monomial() +Base.IndexStyle(::QGradMonomialBasis) = IndexLinear() """ QGradMonomialBasis{D}(::Type{T},order::Int) where {D,T} diff --git a/src/ReferenceFEs/Dofs.jl b/src/ReferenceFEs/Dofs.jl index f9d0b471e..75201f9b0 100644 --- a/src/ReferenceFEs/Dofs.jl +++ b/src/ReferenceFEs/Dofs.jl @@ -100,7 +100,7 @@ end # return_cache(dof,field) #end # -#@inline function evaluate!(cache,k::DofEval,dof,field) +#function evaluate!(cache,k::DofEval,dof,field) # evaluate!(cache,dof,field) #end # diff --git a/src/ReferenceFEs/LagrangianDofBases.jl b/src/ReferenceFEs/LagrangianDofBases.jl index 285c747b3..d690e1c82 100644 --- a/src/ReferenceFEs/LagrangianDofBases.jl +++ b/src/ReferenceFEs/LagrangianDofBases.jl @@ -27,11 +27,11 @@ struct LagrangianDofBasis{P,V} <: AbstractVector{PointValue{P}} node_and_comp_to_dof::Vector{V} end -@inline Base.size(a::LagrangianDofBasis) = (length(a.nodes),) -@inline Base.axes(a::LagrangianDofBasis) = (axes(a.nodes,1),) +Base.size(a::LagrangianDofBasis) = (length(a.nodes),) +Base.axes(a::LagrangianDofBasis) = (axes(a.nodes,1),) # @santiagobadia : Not sure we want to create the monomial machinery -@inline Base.getindex(a::LagrangianDofBasis,i::Integer) = PointValue(a.nodes[i]) -@inline Base.IndexStyle(::LagrangianDofBasis) = IndexLinear() +Base.getindex(a::LagrangianDofBasis,i::Integer) = PointValue(a.nodes[i]) +Base.IndexStyle(::LagrangianDofBasis) = IndexLinear() # This one takes a basis and replaces the nodes function LagrangianDofBasis(dofs::LagrangianDofBasis{P},nodes::Vector{P}) where P @@ -106,7 +106,7 @@ function _lagr_dof_cache(node_pdof_comp_to_val::AbstractMatrix,ndofs) r = zeros(eltype(T),ndofs,npdofs) end -@inline function evaluate!(cache,b::LagrangianDofBasis,field) +function evaluate!(cache,b::LagrangianDofBasis,field) c, cf = cache vals = evaluate!(cf,field,b.nodes) ndofs = length(b.dof_to_node) diff --git a/src/ReferenceFEs/MockDofs.jl b/src/ReferenceFEs/MockDofs.jl index cc22a56f2..017919044 100644 --- a/src/ReferenceFEs/MockDofs.jl +++ b/src/ReferenceFEs/MockDofs.jl @@ -7,12 +7,12 @@ function return_cache(b::MockDofBasis,field) return_cache(field,b.x) end -@inline function evaluate!(cache,b::MockDofBasis,field) +function evaluate!(cache,b::MockDofBasis,field) evaluate!(cache,field,b.x) end -@inline Base.size(a::MockDofBasis) = (length(a.nodes),) -@inline Base.axes(a::MockDofBasis) = (axes(a.nodes,1),) +Base.size(a::MockDofBasis) = (length(a.nodes),) +Base.axes(a::MockDofBasis) = (axes(a.nodes,1),) # @santiagobadia : Not sure we want to create the moment dofs -@inline Base.getindex(a::MockDofBasis,i::Integer) = PointValue(a.x[i]) -@inline Base.IndexStyle(::MockDofBasis) = IndexLinear() +Base.getindex(a::MockDofBasis,i::Integer) = PointValue(a.x[i]) +Base.IndexStyle(::MockDofBasis) = IndexLinear() diff --git a/src/ReferenceFEs/Polytopes.jl b/src/ReferenceFEs/Polytopes.jl index 0f16e99fd..2cf1ddd20 100644 --- a/src/ReferenceFEs/Polytopes.jl +++ b/src/ReferenceFEs/Polytopes.jl @@ -278,7 +278,7 @@ function num_faces(p::Polytope,dim::Integer) _num_faces(p,dim) end -@inline function _num_faces(p,dim) +function _num_faces(p,dim) length(get_dimranges(p)[dim+1]) end @@ -291,7 +291,7 @@ function num_facets(p::Polytope) _num_facets(p) end -@inline function _num_facets(p) +function _num_facets(p) D = num_dims(p) if D > 0 num_faces(p,D-1) @@ -309,7 +309,7 @@ function num_edges(p::Polytope) _num_edges(p) end -@inline function _num_edges(p) +function _num_edges(p) D = num_dims(p) if D > 0 num_faces(p,1) @@ -328,7 +328,7 @@ function num_vertices(p::Polytope) _num_vertices(p) end -@inline function _num_vertices(p) +function _num_vertices(p) num_faces(p,0) end @@ -359,7 +359,7 @@ function get_facedims(p::Polytope) _get_facedims(Int,p) end -@inline function _get_facedims(::Type{T},p) where T +function _get_facedims(::Type{T},p) where T n = num_faces(p) facedims = zeros(T,n) dimrange = get_dimranges(p) @@ -395,7 +395,7 @@ function get_offsets(p::Polytope) _get_offsets(p) end -@inline function _get_offsets(p) +function _get_offsets(p) D = num_dims(p) dimrange = get_dimranges(p) offsets = zeros(Int,D+1) @@ -418,7 +418,7 @@ function get_offset(p::Polytope,d::Integer) _get_offset(p,d) end -@inline function _get_offset(p,d) +function _get_offset(p,d) get_offsets(p)[d+1] end diff --git a/src/ReferenceFEs/RaviartThomasRefFEs.jl b/src/ReferenceFEs/RaviartThomasRefFEs.jl index 612643f02..84851da5f 100644 --- a/src/ReferenceFEs/RaviartThomasRefFEs.jl +++ b/src/ReferenceFEs/RaviartThomasRefFEs.jl @@ -281,11 +281,11 @@ struct MomentBasedDofBasis{P,V} <: AbstractVector{Moment} end end -@inline Base.size(a::MomentBasedDofBasis) = (length(a.nodes),) -@inline Base.axes(a::MomentBasedDofBasis) = (axes(a.nodes,1),) +Base.size(a::MomentBasedDofBasis) = (length(a.nodes),) +Base.axes(a::MomentBasedDofBasis) = (axes(a.nodes,1),) # @santiagobadia : Not sure we want to create the moment dofs -@inline Base.getindex(a::MomentBasedDofBasis,i::Integer) = Moment() -@inline Base.IndexStyle(::MomentBasedDofBasis) = IndexLinear() +Base.getindex(a::MomentBasedDofBasis,i::Integer) = Moment() +Base.IndexStyle(::MomentBasedDofBasis) = IndexLinear() get_nodes(b::MomentBasedDofBasis) = b.nodes get_face_moments(b::MomentBasedDofBasis) = b.face_moments From 681010d004145d87b9f2ddb25f6dd487e6a30ace Mon Sep 17 00:00:00 2001 From: Francesc Verdugo Date: Wed, 1 Dec 2021 18:50:17 +0100 Subject: [PATCH 2/2] Update NEWS.md --- NEWS.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/NEWS.md b/NEWS.md index 4bd1ec8cf..f50d8df37 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed +- Improving compile times by removing unnecessary `@inline` statements. Since PR [#726](https://github.com/gridap/Gridap.jl/pull/726). + ## [0.17.6] - 2021-12-01 ### Added