diff src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl @ 882:9098fc936776 feature/variable_derivatives

Add the coefficient as a part of the struct. Wrap tests in testsets
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 21 Jan 2022 09:20:58 +0100
parents aa4875f9a530
children d228d1b26729
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl	Thu Jan 20 15:18:14 2022 +0100
+++ b/src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl	Fri Jan 21 09:20:58 2022 +0100
@@ -27,16 +27,18 @@
 
 """
     SecondDerivativeVariable{T,N,M,K} <: TensorOperator{T,1}
-Implements a one-dimensional constant coefficients volume operator
+
+Implements the one-dimensional second derivative with variable coefficients.
 """
-struct SecondDerivativeVariable{T,N,M,K} <: TensorMapping{T,1,1}
+struct SecondDerivativeVariable{T,N,M,K,TArray<:AbstractVector} <: TensorMapping{T,1,1}
     inner_stencil::NestedStencil{T,N}
     closure_stencils::NTuple{M,NestedStencil{T,K}}
     size::NTuple{1,Int}
+    coefficient::TArray
 end
 
-function SecondDerivativeVariable(grid::EquidistantGrid{1}, inner_stencil, closure_stencils)
-    return SecondDerivativeVariable(inner_stencil, Tuple(closure_stencils), size(grid))
+function SecondDerivativeVariable(grid::EquidistantGrid{1}, coeff::AbstractVector, inner_stencil, closure_stencils)
+    return SecondDerivativeVariable(inner_stencil, Tuple(closure_stencils), size(grid), coeff)
 end
 
 closure_size(::SecondDerivativeVariable{T,N,M}) where {T,N,M} = M