SummationByPartsOperators.jl icon indicating copy to clipboard operation
SummationByPartsOperators.jl copied to clipboard

Add Dissipation Operators for DienerDorbandSchnetterTiglio2007

Open svretina opened this issue 1 year ago • 2 comments

  1. Is the only dissipation operator available the one of MattssonSvärdNordström2004? I am trying to construct a dissipation operator from DienerDorbandSchnetterTiglio2007 but I get a MethodError.

MWE:

d = derivative_operator(DienerDorbandSchnetterTiglio2007(), 1, 2, -5,5,11)
di = dissipation_operator(d)
# d.coefficients -> Mattsson, Nordström (2004)

dissipation_operator(DienerDorbandSchnetterTiglio2007(), 2, -5,5,11, d.coefficients.left_weights, d.coefficients.right_weights)
ERROR: MethodError: no method matching dissipation_coefficients(::DienerDorbandSchnetterTiglio2007, ::Int64, ::StepRangeLen{…}, ::SVector{…}, ::SVector{…}, ::FastMode)

Closest candidates are:
  dissipation_coefficients(::MattssonSvärdNordström2004, ::Int64, ::Any, ::Any, ::Any, ::Any)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/SBP_coefficients/MattssonSvärdNordström2004.jl:29
  dissipation_coefficients(::MattssonSvärdNordström2004, ::Int64, ::Any, ::Any, ::Any)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/SBP_coefficients/MattssonSvärdNordström2004.jl:29

Stacktrace:
 [1] dissipation_operator(source_of_coefficients::DienerDorbandSchnetterTiglio2007, order::Int64, xmin::Int64, xmax::Int64, N::Int64, left_weights::SVector{…}, right_weights::SVector{…}, strength::Int64, mode::FastMode, parallel::Nothing)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/dissipation_operators.jl:231
 [2] dissipation_operator(source_of_coefficients::DienerDorbandSchnetterTiglio2007, order::Int64, xmin::Int64, xmax::Int64, N::Int64, left_weights::SVector{…}, right_weights::SVector{…})
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/dissipation_operators.jl:224
 [3] top-level scope
   @ REPL[26]:1
 [4] top-level scope
   @ ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1428
Some type information was truncated. Use `show(err)` to see complete types.


## trying a different method:
dissipation_operator(DienerDorbandSchnetterTiglio2007(), d; strength=1.0, order=2,mode=d.coefficients.mode)
ERROR: MethodError: no method matching dissipation_coefficients(::DienerDorbandSchnetterTiglio2007, ::Int64, ::StepRangeLen{…}, ::SVector{…}, ::SVector{…}, ::FastMode)

Closest candidates are:
  dissipation_coefficients(::MattssonSvärdNordström2004, ::Int64, ::Any, ::Any, ::Any, ::Any)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/SBP_coefficients/MattssonSvärdNordström2004.jl:29
  dissipation_coefficients(::MattssonSvärdNordström2004, ::Int64, ::Any, ::Any, ::Any)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/SBP_coefficients/MattssonSvärdNordström2004.jl:29

Stacktrace:
 [1] dissipation_operator(source_of_coefficients::DienerDorbandSchnetterTiglio2007, order::Int64, xmin::Float64, xmax::Float64, N::Int64, left_weights::SVector{…}, right_weights::SVector{…}, strength::Float64, mode::FastMode, parallel::Nothing)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/dissipation_operators.jl:231
 [2] dissipation_operator(source_of_coefficients::DienerDorbandSchnetterTiglio2007, order::Int64, xmin::Float64, xmax::Float64, N::Int64, left_weights::SVector{…}, right_weights::SVector{…}, strength::Float64, mode::FastMode)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/dissipation_operators.jl:224
 [3] dissipation_operator(source_of_coefficients::DienerDorbandSchnetterTiglio2007, D::DerivativeOperator{…}; strength::Float64, order::Int64, mode::FastMode, parallel::Nothing)
   @ SummationByPartsOperators ~/.julia/packages/SummationByPartsOperators/VWtwV/src/dissipation_operators.jl:260
 [4] top-level scope
   @ REPL[24]:1
 [5] top-level scope
   @ ~/.julia/juliaup/julia-1.10.0+0.x64.linux.gnu/share/julia/stdlib/v1.10/REPL/src/REPL.jl:1428
Some type information was truncated. Use `show(err)` to see complete types.

in the paper of Diener et al they provide dissipation coefficients up to 8th order (D_{8-4}), up to now only up to 2nd order dissipation operators are supported?

svretina avatar Feb 18 '24 13:02 svretina

Currently, dissipation operators are only implemented for

  • MattssonSvärdNordström2004 (see SummationByPartsOperators.dissipation_coefficients)
  • PeriodicDerivativeOperators (taking basically the interior parts of the operators of MattssonSvärdNordström2004)
  • FourierDerivativeOperators

Adding the dissipation operators of DienerDorbandSchnetterTiglio2007 would be a nice contribution and I would be happy to review a PR. Let me know if you need help with this. (I changed the title of this issue to reflect this)

in the paper of Diener et al they provide dissipation coefficients up to 8th order (D_{8-4}), up to now only up to 2nd order dissipation operators are supported?

I'm not sure I understand this part correctly. Do you refer to the order of accuracy or the order of the derivatives that the dissipation operators approximate? The ones of Mattsson et al. use higher-order undivided difference approximations of a $2p$-th derivative for SBP operators with interior order of accuracy $2p$. That's why they keep the order of accuracy of the SBP operators for which they are designed.

ranocha avatar Feb 21 '24 09:02 ranocha

The operators I am referring to are actually in the dev/DienerDorbandSchnetterTiglio2007. I will have a look how the dissipation operators are implemented and try to add the ones for DienerDorbandSchnetterTiglio2007.

svretina avatar Feb 29 '24 11:02 svretina