CurvilinearGrids.GridTypes.CurvilinearGrid1DType

CurvilinearGrid1D

Fields

  • x: Node function, e.g. x -> f(ξ)
  • ∂x∂ξ: Derivative of x wrt ξ; ∂x∂ξ(ξ)
  • nhalo: Number of halo cells for all dims
  • nnodes: Number of nodes/vertices
  • limits: Cell loop limits based on halo cells
CurvilinearGrids.GridTypes.CurvilinearGrid2DType

CurvilinearGrid2D

Fields

  • x: Node function; e.g., x(i,j)
  • y: Node function; e.g., y(i,j)
  • jacobian_matrix_func: jacobian matrix, e.g., J(i,j)
  • nhalo: Number of halo cells for all dims
  • nnodes: Number of nodes/vertices
  • limits: Cell loop limits based on halo cells
CurvilinearGrids.GridTypes.CurvilinearGrid3DType

CurvilinearGrid3D

Fields

  • x: Node function; e.g., x(i,j,k)
  • y: Node function; e.g., y(i,j,k)
  • z: Node function; e.g., z(i,j,k)
  • jacobian_matrix_func: Function to compute the jacobian matrix, e.g., J(i,j,k)
  • conserv_metric_func: Function to compute the conservative metrics
  • nhalo: Number of halo cells for all dims
  • nnodes: Number of nodes/vertices
  • limits: Cell loop limits based on halo cells
CurvilinearGrids.GridTypes.centroidMethod

Get the position of the centroid for the given cell index. NOTE: these indices are consistent with halo cells included. This means that if your grid has 2 halo cells, the position of the first non-halo centroid is index at coord(mesh, 3). The CurvilinearGrid only keeps track of the number of halo cells for each dimension, whereas the grid functions have no knowledge halos. Therefore, the coord function applies a shift to the index for you.

CurvilinearGrids.GridTypes.coordMethod

Get the position/coordinate at a given index. NOTE: these indices are consistent with halo cells included. This means that if your grid has 2 halo cells, the position of the first non-halo vertex is index at coord(mesh, 3). The CurvilinearGrid only keeps track of the number of halo cells for each dimension, whereas the grid functions have no knowledge halos. Therefore, the coord function applies a shift to the index for you.

CurvilinearGrids.IndexingUtilsModule

Functions used to work on CartesianIndex and CartesianIndices to make looping and stencil creation easy for arbitary dimensions and axes

CurvilinearGrids.IndexingUtils.lower_boundary_indicesMethod

Take a given CartesianIndices and extract only the lower boundary indices at an offset of n along a given axis.

Example

julia> domain = CartesianIndices((1:10, 4:8))
CartesianIndices((1:10, 4:8))

julia> lower_boundary_indices(domain, 2, 0) # select the first index on axis 2
CartesianIndices((1:10, 4:4))
CurvilinearGrids.IndexingUtils.plus_minusMethod

Get indices of of ±n for an arbitary axis. For a 2d index, and and offset on the j axis, this would be [i,j-n:j+n]. This makes it simple to generate arbitrary stencils on arbitrary axes.

Arguments

  • I::CartesianIndex{N}
  • axis::Int: which axis to provide the ±n to
  • n::Int: how much to offset on a given axis

Example

julia> I = CartesianIndex((4,5))
CartesianIndex(4, 5)

julia> plus_minus(I, 2, 2)
CartesianIndices((4:4, 3:7))
CurvilinearGrids.IndexingUtils.upper_boundary_indicesMethod

Take a given CartesianIndices and extract only the upper boundary indices at an offset of n along a given axis.

Example

julia> domain = CartesianIndices((1:10, 4:8))
CartesianIndices((1:10, 4:8))

julia> upper_boundary_indices(domain, 2, 1)
CartesianIndices((1:10, 8:8))
CurvilinearGrids.IndexingUtils.δMethod

Apply a delta function to the cartesian index on a specified axis. For example, δ(3, CartesianIndex(1,2,3)) will give CartesianIndex(0,0,1).

CurvilinearGrids.MetricDiscretizationSchemes.IndexingUtils.plus_minusMethod

Get indices of of ±n for an arbitary axis. For a 2d index, and and offset on the j axis, this would be [i,j-n:j+n]. This makes it simple to generate arbitrary stencils on arbitrary axes.

Arguments

  • I::CartesianIndex{N}
  • axis::Int: which axis to provide the ±n to
  • n::Int: how much to offset on a given axis

Example

julia> I = CartesianIndex((4,5))
CartesianIndex(4, 5)

julia> plus_minus(I, 2, 2)
CartesianIndices((4:4, 3:7))