docstr: Creates an OnGrid field from a grid of values.
  
  Args:
    grid_values (ndarray): The grid of values.
    domain (Domain): The domain of the discretization.
docstr_tok: ["Creates","an","OnGrid","field","from","a","grid","of","values",".","Args",":","grid_values","(","ndarray",")",":","The","grid","of","values",".","domain","(","Domain",")",":","The","domain","of","the","discretization","."]
code: def from_grid(cls, grid_values, domain):
      r"""Creates an OnGrid field from a grid of values.
  
      Args:
        grid_values (ndarray): The grid of values.
        domain (Domain): The domain of the discretization.
      """
      a = cls(grid_values, domain)
      return a
  
imports: import warnings
  from typing import Callable, TypeVar
  import equinox
  from equinox import tree_equal
  from jax import eval_shape
  from jax import numpy
  from jax import vmap
  from jaxtyping import PyTree
  from jaxdf.core import Field
  from jaxdf.geometry import Domain
label_desc: Use image node_id 6 for calling the OnGrid obj's underlying member method code with example usage: obj.from_grid(cls, grid_values, domain) and returns: a