diff src/SbpOperators/readoperator.jl @ 990:b6238afd3bb0 feature/stencil_set_type

Add methods for creating derivative operators in 1D from stencil sets without providing directions
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 18 Mar 2022 13:02:46 +0100
parents 7bf3121c6864
children 37fd8c1cadb2
line wrap: on
line diff
--- a/src/SbpOperators/readoperator.jl	Thu Mar 17 21:31:20 2022 +0100
+++ b/src/SbpOperators/readoperator.jl	Fri Mar 18 13:02:46 2022 +0100
@@ -14,12 +14,7 @@
 
 A `StencilSet` contains a set of associated stencils. The stencils
 are are stored in a table, and can be accesed by indexing into the `StencilSet`.
-"""
-struct StencilSet
-    table
-end
 
-"""
     StencilSet(filename; filters)
 
 Creates a `StencilSet` from a TOML file based on some key-value
@@ -38,7 +33,13 @@
 
 See also [`sbp_operators_path`](@ref), [`get_stencil_set`](@ref), [`parse_stencil`](@ref), [`parse_scalar`](@ref), [`parse_tuple`](@ref),.
 """
-StencilSet(filename; filters...) = StencilSet(get_stencil_set(TOML.parsefile(filename); filters...))
+struct StencilSet
+    table
+    function StencilSet(filename; filters...)
+        return new(get_stencil_set(TOML.parsefile(filename); filters...))
+    end
+end
+
 Base.getindex(set::StencilSet,I...) = set.table[I...]
 
 """