Manual

GridArrays

abstract type AbstractGrid{T,N} <: AbstractArray{T,N}

Grids are arrays of points.

source

A MappedGrid consists of a grid and a map. Each grid point of the mapped grid is the map of the corresponding point of the underlying grid.

source

A ProductGrid represents the cartesian product of other grids.

struct ProductGrid{TG,T,N} <: AbstractGrid{T,N}

Parameters:

  • TG is a tuple of (grid) types
  • T is the element type of the grid
  • N is the dimension of the grid layout
source

A grid corresponding to an unstructured collection of points.

source
iscomposite(grid::AbstractGrid)

Does the grid consist of multiple grids such as e.g. ProductGrid? Used for pretty printing.

source

Compute a scattered grid of M points randomly distributed in Ω, using the uniform probability measure on Ω.

source
GridArrays.resizeMethod.
resize(grid::AbstractGrid, dims...)

Create a grid of same structure (such as product structure) but with different points in the different dimensions.

source
struct IndexSubGrid{G,I,T,N} <: AbstractSubGrid{T,N}

An IndexSubGrid is a subgrid corresponding to a certain range of indices of the underlying grid. It is assumed to be an 1D grid.

source
struct MaskedGrid{G,M,I,T} <: AbstractSubGrid{T,1}

A MaskedGrid is a subgrid of another grid that is defined by a mask. The mask is true or false for each point in the supergrid. The set of points for which it is true make up the MaskedGrid.

source
hasextension(grid::AbstractGrid)

Is it possible to use the resize function. See also resize

source

Generate a single random point inside the given domain, with eltype T. Random points are generated inside the given box, until one is inside the domain.

source

Generate a single random point inside the given box, with eltype T.

source
abstract type AbstractEquispacedGrid{T} <: AbstractIntervalGrid{T}

An equispaced grid has equispaced points, and therefore it has a step.

source
abstract type AbstractIntervalGrid{T} <: AbstractGrid1d{T}

An AbstractIntervalGrid is a grid that is defined on an interval, i.e. it is connected.

source
struct EquispacedGrid{T} <: AbstractEquispacedGrid{T}

An equispaced grid with n points on an interval [a,b], including the endpoints. It has step (b-a)/(n-1).

Example

julia> EquispacedGrid(4,0,1)
4-element EquispacedGrid{Float64}:
 0.0
 0.3333333333333333
 0.6666666666666666
 1.0
source
struct FourierGrid{T} <: AbstractEquispacedGrid{T}

A Fourier grid is a periodic equispaced grid on the interval [0,1).

example

julia> FourierGrid(4)
4-element FourierGrid{Float64}:
 0.0
 0.25
 0.5
 0.75
source
struct MidpointEquispacedGrid{T} <: AbstractEquispacedGrid{T}

A MidpointEquispaced grid is an equispaced grid with grid points in the centers of the equispaced subintervals. In other words, this is a DCT-II grid. It has step (b-a)/n.

Example

julia> MidpointEquispacedGrid(4,0,1)
4-element MidpointEquispacedGrid{Float64}:
 0.125
 0.375
 0.6249999999999999
 0.875
source
struct PeriodicEquispacedGrid{T} <: AbstractEquispacedGrid{T}

A periodic equispaced grid is an equispaced grid that omits the right endpoint. It has step (b-a)/n.

Example

julia> PeriodicEquispacedGrid(4,0,1)
4-element PeriodicEquispacedGrid{Float64}:
 0.0
 0.25
 0.5
 0.75
source