Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl @ 916:fc1f03fc8d65 feature/variable_derivatives
Remove comments
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 18 Feb 2022 07:19:08 +0100 |
parents | cad3a9f82009 |
children | eb054537fc63 |
comparison
equal
deleted
inserted
replaced
915:50d2c2b9dc2c | 916:fc1f03fc8d65 |
---|---|
1 export SecondDerivativeVariable | 1 export SecondDerivativeVariable |
2 | 2 |
3 # """ | 3 # REVIEW: Fixa docs |
4 # SecondDerivativeVariable(grid, inner_stencil, closure_stencils, parity, direction) | 4 """ |
5 SecondDerivativeVariable{Dir,T,D,...} <: TensorMapping{T,D,D} | |
5 | 6 |
6 # Creates a volume operator on a `Dim`-dimensional grid acting along the | 7 A second derivative operator in direction `Dir` with a variable coefficient. |
7 # specified coordinate `direction`. The action of the operator is determined by | |
8 # the stencils `inner_stencil` and `closure_stencils`. When `Dim=1`, the | |
9 # corresponding `SecondDerivativeVariable` tensor mapping is returned. When `Dim>1`, the | |
10 # returned operator is the appropriate outer product of a one-dimensional | |
11 # operators and `IdentityMapping`s, e.g for `Dim=3` the volume operator in the | |
12 # y-direction is `I⊗op⊗I`. | |
13 # """ | |
14 # function volume_operator(grid::EquidistantGrid, inner_stencil, closure_stencils, parity, direction) | |
15 # #TODO: Check that direction <= Dim? | |
16 | |
17 # # Create 1D volume operator in along coordinate direction | |
18 # op = SecondDerivativeVariable(restrict(grid, direction), inner_stencil, closure_stencils, parity) | |
19 # # Create 1D IdentityMappings for each coordinate direction | |
20 # one_d_grids = restrict.(Ref(grid), Tuple(1:dimension(grid))) | |
21 # Is = IdentityMapping{eltype(grid)}.(size.(one_d_grids)) | |
22 # # Formulate the correct outer product sequence of the identity mappings and | |
23 # # the volume operator | |
24 # parts = Base.setindex(Is, op, direction) | |
25 # return foldl(⊗, parts) | |
26 # end | |
27 | |
28 """ | |
29 SecondDerivativeVariable{T,N,M,K} <: TensorOperator{T,1} | |
30 | |
31 Implements the one-dimensional second derivative with variable coefficients. | |
32 """ | 8 """ |
33 struct SecondDerivativeVariable{Dir,T,D,M,IStencil<:NestedStencil{T},CStencil<:NestedStencil{T},TArray<:AbstractArray} <: TensorMapping{T,D,D} | 9 struct SecondDerivativeVariable{Dir,T,D,M,IStencil<:NestedStencil{T},CStencil<:NestedStencil{T},TArray<:AbstractArray} <: TensorMapping{T,D,D} |
34 inner_stencil::IStencil | 10 inner_stencil::IStencil |
35 closure_stencils::NTuple{M,CStencil} | 11 closure_stencils::NTuple{M,CStencil} |
36 size::NTuple{D,Int} | 12 size::NTuple{D,Int} |
120 | 96 |
121 I = map(i->Index(i, Interior), I) | 97 I = map(i->Index(i, Interior), I) |
122 I = Base.setindex(I, Index(i, r), dir) | 98 I = Base.setindex(I, Index(i, r), dir) |
123 return LazyTensors.apply(op, v, I...) | 99 return LazyTensors.apply(op, v, I...) |
124 end | 100 end |
125 | |
126 # TODO: Rename SecondDerivativeVariable -> VariableSecondDerivative |