Mercurial > repos > public > sbplib_julia
diff src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl @ 1374:4f3dd84891f6 feature/variable_derivatives
Simplify constructor for SecondDerivativeVariable
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 26 May 2023 22:50:39 +0200 |
parents | 3f7f826489a1 |
children | e9dfc1998d31 |
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl Fri May 26 21:54:23 2023 +0200 +++ b/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl Fri May 26 22:50:39 2023 +0200 @@ -26,7 +26,7 @@ Δxᵢ = spacing(g.grids[dir]) scaled_inner_stencil = scale(inner_stencil, 1/Δxᵢ^2) scaled_closure_stencils = scale.(Tuple(closure_stencils), 1/Δxᵢ^2) - return SecondDerivativeVariable{dir, ndims(g)}(scaled_inner_stencil, scaled_closure_stencils, coeff) + return SecondDerivativeVariable(coeff, scaled_inner_stencil, scaled_closure_stencils, dir) end function check_coefficient(g, coeff) @@ -51,11 +51,12 @@ closure_stencils::NTuple{M,CStencil} coefficient::TArray - function SecondDerivativeVariable{Dir, D}(inner_stencil::NestedStencil{T}, closure_stencils::NTuple{M,NestedStencil{T}}, coefficient::AbstractArray) where {Dir,T,D,M} + function SecondDerivativeVariable(coefficient::AbstractArray, inner_stencil::NestedStencil{T}, closure_stencils::NTuple{M,NestedStencil{T}}, dir) where {T,M} + D = ndims(coefficient) IStencil = typeof(inner_stencil) CStencil = eltype(closure_stencils) TArray = typeof(coefficient) - return new{Dir,T,D,M,IStencil,CStencil,TArray}(inner_stencil, closure_stencils, coefficient) + return new{dir,T,D,M,IStencil,CStencil,TArray}(inner_stencil, closure_stencils, coefficient) end end