changeset 1214:559b623e6a95 feature/dissipation_operators

Merge latest changes
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 07 Feb 2023 21:30:33 +0100
parents 0905c3c674e9 (current diff) d60a10ad6579 (diff)
children fb7c360b22a7
files
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/derivatives/dissipation.jl	Tue Feb 07 21:29:52 2023 +0100
+++ b/src/SbpOperators/volumeops/derivatives/dissipation.jl	Tue Feb 07 21:30:33 2023 +0100
@@ -59,8 +59,16 @@
 dissipation_lower_closure_size(weights) = midpoint(weights) - 1
 dissipation_upper_closure_size(weights) = length(weights) - midpoint(weights)
 
-dissipation_lower_closure_stencils(interior_weights) = ntuple(i->Stencil(interior_weights..., center=i                       ), dissipation_lower_closure_size(interior_weights))
-dissipation_upper_closure_stencils(interior_weights) = ntuple(i->Stencil(interior_weights..., center=length(interior_weights)-dissipation_upper_closure_size(interior_weights)+i), dissipation_upper_closure_size(interior_weights))
+function dissipation_lower_closure_stencils(interior_weights)
+    stencil(i) = Stencil(interior_weights..., center=i)
+    return ntuple(i->stencil(i), dissipation_lower_closure_size(interior_weights))
+end
+
+function dissipation_upper_closure_stencils(interior_weights)
+    center(i) = length(interior_weights) - dissipation_upper_closure_size(interior_weights) + i
+    stencil(i) = Stencil(interior_weights..., center=center(i))
+    return ntuple(i->stencil(i), dissipation_upper_closure_size(interior_weights))
+end
 
 function dissipation_transpose_lower_closure_stencils(interior_weights)
     closure = ntuple(i->dissipation_transpose_lower_closure_stencil(interior_weights, i), length(interior_weights))