Basic Grids
CompositeGrids.SimpleG
— ModuleBasic grids including common grids like arbitrary grids, uniform grids, log grids, and optimized grids like barycheb for interpolation and gausslegendre for integration.
CompositeGrids.SimpleG.AbstractGrid
— TypeAll Grids are derived from AbstractGrid; ClosedGrid has bound[1], bound[2] == grid[1], grid[end], while OpenGrid has bound[1]<grid[1]<grid[end]<bound[2]
CompositeGrids.SimpleG.Arbitrary
— Typestruct Arbitrary{T<:AbstractFloat} <: AbstractGrid
Arbitrary grid generated from given sorted grid.
#Members:
bound
: boundary of the gridsize
: number of grid pointsgrid
: grid pointsweight
: integration weight
#Constructor:
- function Arbitrary{T}(grid) where {T<:AbstractFloat}
CompositeGrids.SimpleG.BaryCheb
— Typestruct BaryCheb{T<:AbstractFloat} <: AbstractGrid
BaryCheb grid generated on [bound[1], bound[2]] with order N.
#Members:
bound
: boundary of the gridsize
: number of grid pointsgrid
: grid pointsweight
: interpolation weight
#Constructor:
- function BaryCheb{T}(bound, size) where {T<:AbstractFloat}
CompositeGrids.SimpleG.GaussLegendre
— Typestruct GaussLegendre{T<:AbstractFloat} <: AbstractGrid
GaussLegendre grid generated on [bound[1], bound[2]] with order N.
#Members:
bound
: boundary of the gridsize
: number of grid pointsgrid
: grid pointsweight
: integration weight
#Constructor:
- function GaussLegendre{T}(bound, size) where {T<:AbstractFloat}
CompositeGrids.SimpleG.Log
— Typestruct Log{T<:AbstractFloat} <: AbstractGrid
Log grid generated on [bound[1], bound[2]] with N grid points. Minimal interval is set to be minterval. Dense to sparse if d2s, vice versa.
On [0, 1], a typical d2s Log grid looks like [0, λ^(N-1), ..., λ^2, λ, 1].
#Members:
bound
: boundary of the gridsize
: number of grid pointsgrid
: grid pointsweight
: integration weightλ
: scale parameterd2s
: dense to sparse or not
#Constructor:
- function Log{T}(bound, size, minterval, d2s) where {T<:AbstractFloat}
CompositeGrids.SimpleG.Uniform
— Typestruct Uniform{T<:AbstractFloat} <: AbstractGrid
Uniform grid generated on [bound[1], bound[2]] with N points
#Members:
bound
: boundary of the gridsize
: number of grid pointsgrid
: grid pointsweight
: integration weight
#Constructor:
- function Uniform{T}(bound, size) where {T<:AbstractFloat}
CompositeGrids.SimpleG.Uniform
— Methodfunction Uniform{T}(bound, N) where {T<:AbstractFloat}
create Uniform grid.
Base.floor
— Methodfunction Base.floor(grid::AbstractGrid, x) #where {T}
use basic searchsorted function to find the index of largest grid point smaller than x.
return 1 for x<grid[1] and grid.size-1 for x>grid[end].
Base.floor
— Methodfunction Base.floor(grid::Log{T}, x) where {T}
find the index of largest grid point smaller than x.
return 1 for x<grid[1] and grid.size-1 for x>grid[end].
Base.floor
— Methodfunction Base.floor(grid::Uniform{T}, x) where {T}
find the index of largest grid point smaller than x.
return 1 for x<grid[1] and grid.size-1 for x>grid[end].
Base.show
— Methodshow(io::IO, grid::AbstractGrid)
Write a text representation of the AbstractGrid grid
to the output stream io
.