ExodusII
5.15
|
Functions | |
int | ex_get_all_times (int exoid, void *time_values) |
int ex_get_all_times | ( | int | exoid, |
void * | time_values | ||
) |
The function ex_get_all_times() reads the time values for all time steps. Memory must be allocated for the time values array before this function is invoked. The storage requirements (equal to the number of time steps) can be determined by using the ex_inquire() or ex_inquire_int() routines.
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().
[in] | exoid | exodus file ID returned from a previous call to ex_create() or ex_open(). |
[out] | time_values | Returned array of times. These are the time values at all time steps. |
The following code segment will read the time values for all time steps stored in the data file:
#include "exodusII.h" int error, exoid, num_time_steps; float *time_values; \comment{determine how many time steps are stored} num_time_steps = ex_inquire_int(exoid, EX_INQ_TIME); \comment{read time values at all time steps} time_values = (float *) calloc(num_time_steps, sizeof(float)); error = ex_get_all_times(exoid, time_values);