x determines how it will be treated.
If x has length 1, it is returned as a single
color. If the length of x is the number of nodes
in the grid, its value for each element is calculated as
the average of the value at the adjoining nodes. If the
length of x is the number of elements in the grid,
it is returned as is. Any other values throw an error.
length
get.nnodes(grid)get.nelems(grid)