changeset 723:c16abc564b82 feature/laplace_opset

Change from EquidistantGrid to AbstractGrid in Laplace interface
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Wed, 17 Mar 2021 10:20:05 +0100
parents 0402b9042adc
children f88b2117dc69
files src/Grids/AbstractGrid.jl src/SbpOperators/volumeops/laplace/laplace.jl
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/Grids/AbstractGrid.jl	Mon Feb 22 15:15:24 2021 +0100
+++ b/src/Grids/AbstractGrid.jl	Wed Mar 17 10:20:05 2021 +0100
@@ -7,7 +7,7 @@
 
 """
 abstract type AbstractGrid end
-
+export AbstractGrid
 function dimension end
 function points end
 export dimension, points
--- a/src/SbpOperators/volumeops/laplace/laplace.jl	Mon Feb 22 15:15:24 2021 +0100
+++ b/src/SbpOperators/volumeops/laplace/laplace.jl	Wed Mar 17 10:20:05 2021 +0100
@@ -1,14 +1,14 @@
 """
     Laplace{T, Dim, ...} <: TensorMapping{T,Dim,Dim}
-    Laplace(grid::EquidistantGrid, fn; order)
+    Laplace(grid::AbstractGrid, fn; order)
 
 Implements the Laplace operator, approximating ∑d²/xᵢ² , i = 1,...,`Dim` as a
 `TensorMapping`. Additionally, `Laplace` stores the inner product and boundary
 operators relevant for constructing a SBP finite difference scheme as `TensorMapping`s.
 
-Laplace(grid::EquidistantGrid, fn; order) creates the Laplace operator on an
-equidistant grid, where the operators are read from TOML. The differential operator
-is created using `laplace(grid,...)`.
+Laplace(grid, fn; order) creates the Laplace operator defined on `grid`,
+where the operators are read from TOML. The differential operator is created
+using `laplace(grid::AbstractGrid,...)`.
 """
 struct Laplace{T, Dim, Rb, TMdiffop<:TensorMapping{T,Dim,Dim}, # Differential operator
                            TMipop<:TensorMapping{T,Dim,Dim}, # Inner product operator
@@ -24,7 +24,7 @@
 end
 export Laplace
 
-function Laplace(grid::EquidistantGrid, fn; order)
+function Laplace(grid::AbstractGrid, fn; order)
     # TODO: Removed once we can construct the volume and
     # boundary operators by op(grid, fn; order,...).
     # Read stencils
@@ -67,7 +67,7 @@
 export boundary_quadrature
 
 """
-    laplace(grid::EquidistantGrid, inner_stencil, closure_stencils)
+    laplace(grid, inner_stencil, closure_stencils)
 
 Creates the Laplace operator operator `Δ` as a `TensorMapping`
 
@@ -79,7 +79,7 @@
 multi-dimensional `grid`, `Δ` is the sum of multi-dimensional `second_derivative`s
 where the sum is carried out lazily.
 """
-function laplace(grid::EquidistantGrid, inner_stencil, closure_stencils)
+function laplace(grid::AbstractGrid, inner_stencil, closure_stencils)
     Δ = second_derivative(grid, inner_stencil, closure_stencils, 1)
     for d = 2:dimension(grid)
         Δ += second_derivative(grid, inner_stencil, closure_stencils, d)