changeset 1605:1388149b54ad feature/boundary_conditions

REVIEW: Suggestions for minor fixes
author Jonatan Werpers <jonatan@werpers.com>
date Sat, 08 Jun 2024 23:43:49 +0200
parents b459082533f7
children 93b86625fcfd df1856b0e2f0
files src/LazyTensors/lazy_tensor_operations.jl src/SbpOperators/boundary_conditions/boundary_condition.jl src/SbpOperators/operators/standard_diagonal.toml
diffstat 3 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/LazyTensors/lazy_tensor_operations.jl	Sat Jun 08 22:51:31 2024 +0200
+++ b/src/LazyTensors/lazy_tensor_operations.jl	Sat Jun 08 23:43:49 2024 +0200
@@ -121,7 +121,7 @@
 
 Base.:*(a::T, tm::LazyTensor{T}) where T = TensorComposition(ScalingTensor{T,range_dim(tm)}(a,range_size(tm)), tm)
 Base.:*(tm::LazyTensor{T}, a::T) where T = a*tm
-Base.:-(tm::LazyTensor{T}) where T = (-one(T))*tm
+Base.:-(tm::LazyTensor) where T = (-one(eltype(tm)))*tm
 
 """
     InflatedTensor{T,R,D} <: LazyTensor{T,R,D}
--- a/src/SbpOperators/boundary_conditions/boundary_condition.jl	Sat Jun 08 22:51:31 2024 +0200
+++ b/src/SbpOperators/boundary_conditions/boundary_condition.jl	Sat Jun 08 23:43:49 2024 +0200
@@ -30,16 +30,16 @@
     return eval_on(boundary_grid(grid, boundary(bc)), boundary_data(bc))
 end
 
-struct DirichletCondition{T1,T2} <: BoundaryCondition{T2}
-    data::T1
+struct DirichletCondition{DT,BID} <: BoundaryCondition{BID}
+    data::DT
     function DirichletCondition(data, id)
         return new{typeof(data),typeof(id)}(data)
     end
 end
 boundary_data(bc::DirichletCondition) = bc.data
 
-struct NeumannCondition{T1,T2} <: BoundaryCondition{T2}
-    data::T1
+struct NeumannCondition{DT,BID} <: BoundaryCondition{BID}
+    data::DT
     function NeumannCondition(data, id)
         return new{typeof(data),typeof(id)}(data)
     end
--- a/src/SbpOperators/operators/standard_diagonal.toml	Sat Jun 08 22:51:31 2024 +0200
+++ b/src/SbpOperators/operators/standard_diagonal.toml	Sat Jun 08 23:43:49 2024 +0200
@@ -34,12 +34,13 @@
     {s = ["1", "-2", "1"], c = 1},
 ]
 
+D2.positivity = {theta_M = "0.3636363636", theta_R = "1.000000538455350", m_b = "2"}
+
 D2variable.inner_stencil = [["1/2", "1/2", "0"],[ "-1/2", "-1", "-1/2"],["0", "1/2", "1/2"]]
 D2variable.closure_stencils = [
         {s = [["2", "-1", "0"],["-3", "1",   "0"],["1","0","0"]], c = 1},
 ]
 
-D2.positivity = {theta_M = "0.3636363636", theta_R = "1.000000538455350", m_b = "2"}
 
 [[stencil_set]]
 
@@ -67,6 +68,8 @@
     {s = [ "-1/49",     "0",   "59/49", "-118/49", "64/49", "-4/49"], c = 4},
 ]
 
+D2.positivity = {theta_M = "0.2505765857", theta_R = "0.577587500088313", m_b = "4"}
+
 D2variable.inner_stencil = [
     ["-1/8",   "1/6", "-1/8",   "0",    "0"  ],
     [ "1/6",   "1/2",  "1/2",  "1/6",   "0"  ],
@@ -137,7 +140,6 @@
     ]}
 ]
 
-D2.positivity = {theta_M = "0.2505765857", theta_R = "0.577587500088313", m_b = "4"}
 
 [[stencil_set]]