> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# RAGridFunction

### *class* RAGridFunction

Identifies a grid function in the model.

It acts as a handle of the grid function and not the actual grid function, which means that when
the time changes, this handle will start returning the values for the grid function at the new
time and not at the time where it was requested initially.

I.e.:
: GoToFirstTimeStep()
grid = GetGrid(‘Main Grid’)
gf = grid.GetGridFunction(‘Oil Pressure’)
gf.GetMax() #Max value at time 0.
GoToNextTimeStep()
gf.GetMax() #Max value at time 1.

Although most function also accept passing in the time.

I.e.:
: grid = GetGrid(‘Main Grid’)
gf = grid.GetGridFunction(‘Oil Pressure’)
gf.GetMax(time\_step=0) #Max value at time 0.
gf.GetMax(time\_step=2) #Max value at time 2.

**Methods:**

| Name | Description |
| - | - |
| [`GetArray`](#generated.RAGridFunction.GetArray)(\[unit, time\_step]) | |
| [`GetAverage`](#generated.RAGridFunction.GetAverage)(\[unit, time\_step]) | |
| [`GetGrid`](#generated.RAGridFunction.GetGrid)() | |
| [`GetIsStatic`](#generated.RAGridFunction.GetIsStatic)() | |
| [`GetIsTransient`](#generated.RAGridFunction.GetIsTransient)() | |
| [`GetLimits`](#generated.RAGridFunction.GetLimits)(\[unit, time\_step]) | |
| [`GetLocation`](#generated.RAGridFunction.GetLocation)() | |
| [`GetMax`](#generated.RAGridFunction.GetMax)(\[unit, time\_step]) | |
| [`GetMin`](#generated.RAGridFunction.GetMin)(\[unit, time\_step]) | |
| [`GetStandardDeviation`](#generated.RAGridFunction.GetStandardDeviation)(\[unit, time\_step]) | |
| [`GetSum`](#generated.RAGridFunction.GetSum)(\[unit, time\_step]) | |
| [`GetSumSquared`](#generated.RAGridFunction.GetSumSquared)(\[unit, time\_step]) | |
| [`GetTimeStep`](#generated.RAGridFunction.GetTimeStep)(time\_step\[, accept\_global]) | Get the timestep corresponding to the given time. |
| [`GetUnit`](#generated.RAGridFunction.GetUnit)() | |
| [`GetValue`](#generated.RAGridFunction.GetValue)(i\[, j, k, unit, time\_step]) | |
| [`GetVariance`](#generated.RAGridFunction.GetVariance)(\[unit, time\_step]) | |
| [`Modified`](#generated.RAGridFunction.Modified)(\*args, \*\*kwargs) | Resets all the cache information after a change in the subject being tracked. |
| [`SetCurrentTimeStep`](#generated.RAGridFunction.SetCurrentTimeStep)(time\_step) | Sets the current time step. |

**Attributes:**

| Name |
| - |
| [`average`](#generated.RAGridFunction.average) |
| [`is_static`](#generated.RAGridFunction.is_static) |
| [`is_transient`](#generated.RAGridFunction.is_transient) |
| [`limits`](#generated.RAGridFunction.limits) |
| [`max`](#generated.RAGridFunction.max) |
| [`min`](#generated.RAGridFunction.min) |
| [`standard_deviation`](#generated.RAGridFunction.standard_deviation) |
| [`sum`](#generated.RAGridFunction.sum) |
| [`sum_squared`](#generated.RAGridFunction.sum_squared) |
| [`unit`](#generated.RAGridFunction.unit) |
| [`variance`](#generated.RAGridFunction.variance) |

#### GetArray(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the array should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  numpy array or None
* **Returns:**
  Returns a numpy array representing the passed grid function or None if it couldn’t be
  found.

#### GetAverage(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the average value for the grid function or None if it’s not available for the
  current time.

#### GetGrid()

* **Return type:**
  KAGrid
* **Returns:**
  The grid that “owns” the grid function.

#### GetIsStatic()

* **Return type:**
  bool
* **Returns:**
  Returns whether this grid function is static.

#### GetIsTransient()

* **Return type:**
  bool
* **Returns:**
  Returns whether this grid function is transient.

#### GetLimits(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the limits should be gotten
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with
    : ’current’ identifying the current time step
    ‘global’ identifying that the global limits should be gotten

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  list(float, float) or None
* **Returns:**
  Returns a tuple with the min and max value for the limits and None if the limit is
  not available for the current time.

#### GetLocation()

* **Return type:**
  \[‘cell’, ‘node’]
* **Returns:**
  Returns whether this grid function is a cell or node/vertex grid function.

#### GetMax(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with
    : ’current’ identifying the current time step
    ‘global’ identifying that the global limits should be gotten

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the max value or None if it’s not available for the current time.

#### GetMin(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with
    : ’current’ identifying the current time step
    ‘global’ identifying that the global limits should be gotten

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the min value or None if it’s not available for the current time.

#### GetStandardDeviation(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the standard deviation of the grid function or None if it’s not available for
  the current time.

#### GetSum(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the sum of all values in the grid function or None if it’s not available for
  the current time.

#### GetSumSquared(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the sum squared considering all values in the grid function or None if it’s
  not available for the current time.

#### GetTimeStep(time\_step, accept\_global=False)

Get the timestep corresponding to the given time.

* **Parameters:**
  * **time\_step** (*unicode* *,* *ITimeStep* *or* *int*) –

    Either a string with
    : ’current’ identifying the current time step
    ‘global’ identifying that the global limits should be gotten
    (note that if accept\_global=False and ‘global’ is passed, an error is raised).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
  * **accept\_global** (*bool*) – If True, a global time step is accepted (and returns None), otherwise, an error is
    raised if ‘global’ is passed.
* **Return type:**
  ITimeStep
* **Returns:**
  Returns the time step to be used or None if accept\_global == True and the time
  step passed is ‘global’.

#### GetUnit()

* **Return type:**
  str
* **Returns:**
  Returns the default unit for the grid function.

#### GetValue(i, j=None, k=None, unit=None, time\_step='current')

* **Parameters:**
  * **i** (*int*) – The topological I cell index or the grid cell handle
  * **j** (*int*) – The topological J cell index
  * **k** (*int*) – The topological K cell index
  * **unit** (*str*) – The unit in which the array should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float
* **Returns:**
  Returns the grid function value for the given cell

#### GetVariance(unit=None, time\_step='current')

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the variance of the grid function or None if it’s not available for the
  current time.

#### Modified(\*args, \*\*kwargs)

Resets all the cache information after a change in the subject being tracked.

#### SetCurrentTimeStep(time\_step)

Sets the current time step.

* **Parameters:**
  **time\_step** (*ITimeStep*) – The time step to be considered the ‘current’ time step.

#### *property* average

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the average value for the grid function or None if it’s not available for the
  current time.

#### *property* is\_static

* **Return type:**
  bool
* **Returns:**
  Returns whether this grid function is static.

#### *property* is\_transient

* **Return type:**
  bool
* **Returns:**
  Returns whether this grid function is transient.

#### *property* limits

* **Parameters:**
  * **unit** (*str*) – The unit in which the limits should be gotten
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with
    : ’current’ identifying the current time step
    ‘global’ identifying that the global limits should be gotten

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  list(float, float) or None
* **Returns:**
  Returns a tuple with the min and max value for the limits and None if the limit is
  not available for the current time.

#### *property* max

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with
    : ’current’ identifying the current time step
    ‘global’ identifying that the global limits should be gotten

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the max value or None if it’s not available for the current time.

#### *property* min

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with
    : ’current’ identifying the current time step
    ‘global’ identifying that the global limits should be gotten

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the min value or None if it’s not available for the current time.

#### *property* standard\_deviation

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the standard deviation of the grid function or None if it’s not available for
  the current time.

#### *property* sum

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the sum of all values in the grid function or None if it’s not available for
  the current time.

#### *property* sum\_squared

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the sum squared considering all values in the grid function or None if it’s
  not available for the current time.

#### *property* unit

* **Return type:**
  str
* **Returns:**
  Returns the default unit for the grid function.

#### *property* variance

* **Parameters:**
  * **unit** (*str*) – The unit in which the value should be gotten (if not passed, the default unit is used).
  * **time\_step** (*str* *,* *ITimeStep* *or* *int*) –

    Either a string with ‘current’ identifying the current time step (note
    that ‘global’ is NOT accepted for this statistic).

    or an ITimeStep identifying the time to get the limits

    or an int identifying the time step index to be used based on the global time set
* **Return type:**
  float or None
* **Returns:**
  Returns a the variance of the grid function or None if it’s not available for the
  current time.
