Cartesian Grid

The object Grid defines a structured cartesian $n$-dimensional grid and it is the base for all other types of grids. Here below is the object constructor and associated functions. For examples see the documentation of GeometricTools.

GeometricTools.GridType

Grid(P_min, P_max, NDIVS)

Generates an n-dimensional grid.

Arguments

  • P_min::Array{Float64,1} : Minimum point of the domain.
  • P_max::Array{Float64,1} : Maximum point of the domain.
  • NDIVS::Array{Int64,1} : Number of divisions in each coordinate.

Properties

  • dims::Int64 : Number of dimensions.
  • nnodes::Int64 : Number of nodes in the grid.
  • nodes::Array{Float64,2} : Matrix size (nnodes, dims) of node position.
  • field : Contains calculated fields formated as field[fieldname] = Dict( "fieldname" => fieldname::String, "fieldtype" => "scalar" or "vector", "entrytype" => "node" or "cell", "fielddata" => data ) where data is an array data[i] = [val1, val2, ...] containing this field values (scalar or vector) at each node in the grid.

NOTE: All indexing is done linearly, meaning that nodes is indexed from 1 to nnodes, and all data fields follow the same indexing.

NOTE2: NDIVS can either be an array of integers with NDIVS[i] indicating the number of divisions in the i-th coordinate, or it can be an array of sections (see multidiscretize() doc) with NDIVS[i] = [sec1, sec2, ...] indicating the discretization into sections in the i-th coordinate.

GeometricTools.get_nodeFunction

get_node(grid, i)

Returns the position of the i-th node (1-indexed) in the grid

get_node(grid, coor)

Returns the position of the node of subscript coordinates coor (1-indexed)

GeometricTools.get_cellFunction

get_cell(grid, i)

Returns the nodes indices of i-th cell in the grid (1-indexed)

get_cell(grid, coor)

Returns the node indices of the cell with subscript coordinates coor (1-indexed). The format corresponds to VTKHEXAHEDRON (=12) in 3D, VTKQUAD (=9) in 2D, or VTK_LINE (=3) in 1D–-except that points are 1-indexed instead of 0-indexed.

Pic here Pic here Pic here