parameters: (self,
                      value: Field or Tensor or Number or Geometry or callable = 0.,
                      type: type = CenteredGrid,
                      extrapolation: math.Extrapolation or str = 'vector')
return_statement: return result
docstring: Creates a vector grid matching the resolution and bounds of the domain.
          The grid is created from the given `value` which must be one of the following:
          
          * Number (int, float, complex or zero-dimensional tensor): all grid values will be equal to `value`. This has a near-zero memory footprint.
          * Field: the given value is resampled to the grid cells of this Domain.
          * Tensor with spatial dimensions matcing the domain resolution: grid values will equal `value`.
          * Geometry: grid values are determined from the volume overlap between grid cells and geometry. Non-overlapping = 0, fully enclosed grid cell = 1.
          * function(location: Tensor) returning one of the above.
          
          The returned grid will have a vector dimension with size equal to the rank of the domain.
  
          Args:
            value: constant, Field, Tensor or function specifying the grid values
            type: class of Grid to create, must be either CenteredGrid or StaggeredGrid
            extrapolation: (optional) grid extrapolation, defaults to Domain.boundaries['vector']
  
          Returns:
            Grid of specified type
docstring_summary: Creates a vector grid matching the resolution and bounds of the domain.
          The grid is created from the given `value` which must be one of the following:
          
          * Number (int, float, complex or zero-dimensional tensor): all grid values will be equal to `value`. This has a near-zero memory footprint.
          * Field: the given value is resampled to the grid cells of this Domain.
          * Tensor with spatial dimensions matcing the domain resolution: grid values will equal `value`.
          * Geometry: grid values are determined from the volume overlap between grid cells and geometry. Non-overlapping = 0, fully enclosed grid cell = 1.
          * function(location: Tensor) returning one of the above.
          
          The returned grid will have a vector dimension with size equal to the rank of the domain.
docstring_tokens: Creates a vector grid matching the resolution and bounds of the domain . The grid is created from the given value which must be one of the following : * Number ( int float complex or zero - dimensional tensor ) : all grid values will be equal to value . This has a near - zero memory footprint . * Field : the given value is resampled to the grid cells of this Domain . * Tensor with spatial dimensions matcing the domain resolution : grid values will equal value . * Geometry : grid values are determined from the volume overlap between grid cells and geometry . Non - overlapping = 0 fully enclosed grid cell = 1 . * function ( location : Tensor ) returning one of the above . The returned grid will have a vector dimension with size equal to the rank of the domain .
function: def vector_grid(self,
                      value: Field or Tensor or Number or Geometry or callable = 0.,
                      type: type = CenteredGrid,
                      extrapolation: math.Extrapolation or str = 'vector') -> CenteredGrid or StaggeredGrid:
          """
          Creates a vector grid matching the resolution and bounds of the domain.
          The grid is created from the given `value` which must be one of the following:
          
          * Number (int, float, complex or zero-dimensional tensor): all grid values will be equal to `value`. This has a near-zero memory footprint.
          * Field: the given value is resampled to the grid cells of this Domain.
          * Tensor with spatial dimensions matcing the domain resolution: grid values will equal `value`.
          * Geometry: grid values are determined from the volume overlap between grid cells and geometry. Non-overlapping = 0, fully enclosed grid cell = 1.
          * function(location: Tensor) returning one of the above.
          
          The returned grid will have a vector dimension with size equal to the rank of the domain.
  
          Args:
            value: constant, Field, Tensor or function specifying the grid values
            type: class of Grid to create, must be either CenteredGrid or StaggeredGrid
            extrapolation: (optional) grid extrapolation, defaults to Domain.boundaries['vector']
  
          Returns:
            Grid of specified type
          """
          extrapolation = extrapolation if isinstance(extrapolation, math.Extrapolation) else self.boundaries[extrapolation]
          result = type(value, resolution=self.resolution, bounds=self.bounds, extrapolation=extrapolation)
          if result.shape.channel_rank == 0:
              result = result.with_values(math.expand(result.values, channel(vector=self.rank)))
          else:
              assert result.shape.get_size('vector') == self.rank
          return result
function_tokens: def vector_grid ( self , value : Field or Tensor or Number or Geometry or callable = 0. , type : type = CenteredGrid , extrapolation : math . Extrapolation or str = 'vector' ) -> CenteredGrid or StaggeredGrid : extrapolation = extrapolation if isinstance ( extrapolation , math . Extrapolation ) else self . boundaries [ extrapolation ] result = type ( value , resolution = self . resolution , bounds = self . bounds , extrapolation = extrapolation ) if result . shape . channel_rank == 0 : result = result . with_values ( math . expand ( result . values , channel ( vector = self . rank ) ) ) else : assert result . shape . get_size ( 'vector' ) == self . rank return result