Exodus 7.10

Functions
ex_get_time.c File Reference
`#include "exodusII.h"`
`#include "exodusII_int.h"`

## Functions
int | ex_get_time (int exoid, int time_step, void *time_value)

## Function Documentation

## ◆ ex_get_time()

int ex_get_time | ( | int | exoid,
|  | int | time_step,
|  | void * | time_value
| ) |  |

The function ex_get_time() reads the time value for a specified time step.

Because time values are floating point values, the application code must declare the array passed to be the appropriate type (float or double) to match the compute word size passed in ex_create() or ex_open().

Returns
  In case of an error, ex_get_time() returns a negative number; a warning will return a positive number. Possible causes of errors include:
  - data file not properly opened with call to ex_create() or ex_open()
  - no time steps have been stored in the file.

Parameters

  [in] | exoid | exodus file ID returned from a previous call to ex_create() or ex_open().
  [in] | time_step | The time step number. This is essentially an index (in the time dimension) into the global, nodal, and element variables arrays stored in the database. The first time step is 1.
  [out] | time_value | Returned time at the specified time step.

As an example, the following coding will read the time value stored in the data file for time step n:

int n, error, exoid;
float time_value;
/* read time value at time step 3 */
n = 3;
error = ex_get_time (exoid, n, &time_value);