Exodus 7.10

Functions
Results Data

## Functions
int | ex_get_partial_nodal_var_int (int exoid, int time_step, int nodal_var_index, int64_t start_node, int64_t num_nodes, void *var_vals)
int | ex_get_partial_var (int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t start_index, int64_t num_entities, void *var_vals)
int | ex_get_truth_table (int exoid, ex_entity_type obj_type, int num_blk, int num_var, int *var_tab)
int | ex_get_var (int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t num_entry_this_obj, void *var_vals)
int | ex_get_var_time (int exoid, ex_entity_type var_type, int var_index, int64_t id, int beg_time_step, int end_time_step, void *var_vals)
int | ex_get_variable_name (int exoid, ex_entity_type obj_type, int var_num, char *var_name)
int | ex_get_variable_names (int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
int | ex_get_variable_param (int exoid, ex_entity_type obj_type, int *num_vars)
int | ex_put_partial_nodal_var_int (int exoid, int time_step, int nodal_var_index, int64_t start_node, int64_t num_nodes, const void *nodal_var_vals)
int | ex_put_partial_var (int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t start_index, int64_t num_entities, const void *var_vals)
int | ex_put_truth_table (int exoid, ex_entity_type obj_type, int num_blk, int num_var, int *var_tab)
int | ex_put_variable_name (int exoid, ex_entity_type obj_type, int var_num, const char *var_name)
int | ex_put_variable_names (int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
int | ex_put_variable_param (int exoid, ex_entity_type obj_type, int num_vars)
int | ex_get_glob_vars (int exoid, int time_step, int num_glob_vars, void *glob_var_vals)
int | ex_get_n_elem_var (int exoid, int time_step, int elem_var_index, ex_entity_id elem_blk_id, int64_t num_elem_this_blk, int64_t start_elem_num, int64_t num_elem, void *elem_var_vals)
int | ex_get_n_nodal_var (int exoid, int time_step, int nodal_var_index, int64_t start_node, int64_t num_nodes, void *var_vals)
int | ex_get_n_var (int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t start_index, int64_t num_entities, void *var_vals)
int | ex_get_partial_elem_var (int exoid, int time_step, int elem_var_index, ex_entity_id elem_blk_id, int64_t num_elem_this_blk, int64_t start_elem_num, int64_t num_elem, void *elem_var_vals)
int | ex_get_partial_nodal_var (int exoid, int time_step, int nodal_var_index, int64_t start_node, int64_t num_nodes, void *var_vals)
int | ex_get_var_name (int exoid, const char *var_type, int var_num, char *var_name)
int | ex_get_var_names (int exoid, const char *var_type, int num_vars, char *var_names[])
int | ex_get_var_param (int exoid, const char *var_type, int *num_vars)
int | ex_get_var_tab (int exoid, const char *var_type, int num_blk, int num_var, int *var_tab)
int | ex_put_n_nodal_var (int exoid, int time_step, int nodal_var_index, int64_t start_node, int64_t num_nodes, const void *nodal_var_vals)
int | ex_put_n_var (int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t start_index, int64_t num_entities, const void *var_vals)
int | ex_put_partial_nodal_var (int exoid, int time_step, int nodal_var_index, int64_t start_node, int64_t num_nodes, const void *nodal_var_vals)
int | ex_put_var_name (int exoid, const char *var_type, int var_num, const char *var_name)
int | ex_put_var_names (int exoid, const char *var_type, int num_vars, char *var_names[])
int | ex_put_var_param (int exoid, const char *var_type, int num_vars)
int | ex_put_var_tab (int exoid, const char *var_type, int num_blk, int num_var, int *var_tab)

## Detailed Description

This section describes data file utility functions for creating opening a file, initializing a file with global parameters, reading writing information text, inquiring on parameters stored in the data file, and error reporting.

The results are optional and include an optional variable type for each block and set type (node, edge, face, and element) in addition there are global variables and sideset variables – each of which is stored through time. Nodal results are output (at each time step) for all the nodes in the model. An example of a nodal variable is displacement in the X direction. Global results are output (at each time step) for a single element or node, or for a single property. Linear momentum of a structure and the acceleration at a particular point are both examples of global variables. The other results are output (at each time step) for all entities (elements, faces, edges, nodes, or sides) in one or more entity blocks. For example, stress may be an element variable. Another use of element variables is to record element status (a binary flag indicating whether each element is "alive" or "dead") through time. Although these examples correspond to typical FE applications, the data format is flexible enough to accommodate a spectrum of uses.

A few conventions and limitations must be cited:

- There are no restrictions on the frequency of results output except that the time value associated with each successive time step should increase monotonically.
- All variables are output at the same time frequency. To output results at different frequencies (i.e., variable A at every simulation time step, variable B at every other time step) multiple files must be used.
- There are no limits to the number of each type of results, but once declared, the number cannot change.
- If the mesh geometry changes in time (i.e., number of nodes increases, connectivity changes), the new geometry must be output to a new file.

## Function Documentation

## ◆ ex_get_glob_vars()

int ex_get_glob_vars | ( | int | exoid,
|  | int | time_step,
|  | int | num_glob_vars,
|  | void * | glob_var_vals
| ) |  |

Deprecated:

  Use ex_get_var()(exoid, time_step, EX_GLOBAL, 1, 1, num_glob_vars, global_var_vals)

  The function ex_get_glob_vars() reads the values of all the global variables for a single time step. Memory must be allocated for the global variables values array before this function is invoked.

Because global variables 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 case of an error, ex_get_glob_vars() 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 global variables stored in the file.
- a warning value is returned if no global variables are 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, as described under ex_put_time(), at which the global variable values are desired. This is essentially an index (in the time dimension) into the global variable values array stored in the database. The first time step is 1.
  [in] | num_glob_vars | The number of global variables stored in the database.
  [out] | glob_var_vals | Returned array of num_glob_vars global variable values for the time_step'th time step.

The following is an example code segment that reads all the global variables at one time step:

int num_glo_vars, error, time_step;
float *var_values;
error = ex_get_variable_param (idexo, EX_GLOBAL, &num_glo_vars);
var_values = (float *) calloc (num_glo_vars, sizeof(float));
error = ex_get_glob_vars (idexo, time_step, num_glo_vars,
var_values);

## ◆ ex_get_n_elem_var()

int ex_get_n_elem_var | ( | int | exoid,
|  | int | time_step,
|  | int | elem_var_index,
|  | ex_entity_id | elem_blk_id,
|  | int64_t | num_elem_this_blk,
|  | int64_t | start_elem_num,
|  | int64_t | num_elem,
|  | void * | elem_var_vals
| ) |  |

Deprecated:
  Use ex_get_partial_var()(exoid, time_step, EX_ELEM_BLOCK, elem_var_index, elem_blk_id, start_elem_num, num_elem, elem_var_vals) instead

## ◆ ex_get_n_nodal_var()

int ex_get_n_nodal_var | ( | int | exoid,
|  | int | time_step,
|  | int | nodal_var_index,
|  | int64_t | start_node,
|  | int64_t | num_nodes,
|  | void * | var_vals
| ) |  |

Deprecated:
  Use ex_get_partial_var()(exoid, time_step, EX_NODAL, nodal_var_index, 1, start_node, num_nodes, var_vals) instead

## ◆ ex_get_n_var()

int ex_get_n_var | ( | int | exoid,
|  | int | time_step,
|  | ex_entity_type | var_type,
|  | int | var_index,
|  | ex_entity_id | obj_id,
|  | int64_t | start_index,
|  | int64_t | num_entities,
|  | void * | var_vals
| ) |  |

Deprecated:
  Use ex_get_partial_var()(exoid, time_step, var_type, var_index, obj_id, start_index, num_entities, var_vals) instead.

reads the values of a single variable for a partial block at one time step from the database; assume the first time step and variable index and start_index are 1

Parameters

  exoid | exodus file id
  time_step | time step number
  var_type | type (edge block, face block, edge set, ... )
  var_index | element variable index
  obj_id | element block id
  start_index | index of first entity in block to read (1-based)
  num_entities | number of entries to read in this block/set
  var_vals | the values to read

## ◆ ex_get_partial_elem_var()

int ex_get_partial_elem_var | ( | int | exoid,
|  | int | time_step,
|  | int | elem_var_index,
|  | ex_entity_id | elem_blk_id,
|  | int64_t | num_elem_this_blk,
|  | int64_t | start_elem_num,
|  | int64_t | num_elem,
|  | void * | elem_var_vals
| ) |  |

Deprecated:
  use ex_get_partial_var()(exoid, time_step, EX_ELEM_BLOCK, elem_var_index, elem_blk_id, start_elem_num, num_elem, elem_var_vals)

## ◆ ex_get_partial_nodal_var()

int ex_get_partial_nodal_var | ( | int | exoid,
|  | int | time_step,
|  | int | nodal_var_index,
|  | int64_t | start_node,
|  | int64_t | num_nodes,
|  | void * | var_vals
| ) |  |

Deprecated:
  use ex_get_partial_var()(exoid, time_step, EX_NODAL, nodal_var_index, 1, start_node, num_nodes, var_vals);

## ◆ ex_get_partial_nodal_var_int()

int ex_get_partial_nodal_var_int | ( | int | exoid,
|  | int | time_step,
|  | int | nodal_var_index,
|  | int64_t | start_node,
|  | int64_t | num_nodes,
|  | void * | var_vals
| ) |  |

reads the values of a single nodal variable for a single time step from the database; assume the first time step and nodal variable index is 1

## ◆ ex_get_partial_var()

int ex_get_partial_var | ( | int | exoid,
|  | int | time_step,
|  | ex_entity_type | var_type,
|  | int | var_index,
|  | ex_entity_id | obj_id,
|  | int64_t | start_index,
|  | int64_t | num_entities,
|  | void * | var_vals
| ) |  |

reads the values of a single variable for a partial block at one time step from the database; assume the first time step and variable index and start_index are 1

Parameters

  exoid | exodus file id
  time_step | time step number
  var_type | type (edge block, face block, edge set, ... )
  var_index | element variable index
  obj_id | element block id
  start_index | index of first entity in block to read (1-based)
  num_entities | number of entries to read in this block/set
  var_vals | the values to read

## ◆ ex_get_truth_table()

int ex_get_truth_table | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int | num_blk,
|  | int | num_var,
|  | int * | var_tab
| ) |  |

reads the EXODUS specified variable truth table from the database

Parameters

  [in] | exoid | exodus file id
  [in] | obj_type | object type
  [in] | num_blk | number of blocks or sets
  [in] | num_var | number of variables
  [out] | *var_tab | variable truth table array

## ◆ ex_get_var()

int ex_get_var | ( | int | exoid,
|  | int | time_step,
|  | ex_entity_type | var_type,
|  | int | var_index,
|  | ex_entity_id | obj_id,
|  | int64_t | num_entry_this_obj,
|  | void * | var_vals
| ) |  |

The function ex_get_var() reads the values of the selected entity variables for a single time step. Memory must be allocated for the variables values array before this function is invoked.

Because variables 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 case of an error, ex_get_var() 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()
- variable does not exist for the desired block or set.
- invalid block or set.
- no variables of the selected type stored in the file.
- a warning value is returned if no variables of the selected entity type are 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, as described under ex_put_time(), at which the variable values are desired. This is essentially an index (in the time dimension) into the entity variable values array stored in the database. The first time step is 1.
  [in] | var_type | block/variable type node, edge/face/element block, or node/edge/face/side/element set of type ex_entity_type.
  [in] | var_index | variable index; 1-based
  [in] | obj_id | object id, see ex_get_ids()
  [in] | num_entry_this_obj | The number of entities in this object stored in the database.
  [out] | var_vals | Returned array of num_entry_this_obj variable values for the time_step'th time step.

The following is an example code segment that reads the 10th element variable for element block with id 100 at time step 5. There are 'num_elements_this_block' elements in element block 100.

int num_elements_this_block, error, time_step;
int var_index = 10;
int blk_id = 100;
int num_variables;
float *var_values;
var_values = (float *) callo(num_elements_this_block, sizeof(float));
error = ex_get_var (idexo, time_step, EX_ELEM_BLOCK, var_index, blk_id,
num_elements_this_block, var_values);

## ◆ ex_get_var_name()

int ex_get_var_name | ( | int | exoid,
|  | const char * | var_type,
|  | int | var_num,
|  | char * | var_name
| ) |  |

reads the name of a particular results variable from the database

Deprecated:
  use ex_get_variable_name()(exoid, obj_type, var_num, *var_name)

## ◆ ex_get_var_names()

int ex_get_var_names | ( | int | exoid,
|  | const char * | var_type,
|  | int | num_vars,
|  | char * | var_names[]
| ) |  |

reads the names of the results variables from the database

Deprecated:
  Use ex_get_variable_names()(exoid, obj_type, num_vars, var_names)

## ◆ ex_get_var_param()

int ex_get_var_param | ( | int | exoid,
|  | const char * | var_type,
|  | int * | num_vars
| ) |  |

reads the number of global, nodal, or element variables that are stored in the database

Deprecated:
  Use ex_get_variable_param()(exoid, obj_type, *num_vars)

## ◆ ex_get_var_tab()

int ex_get_var_tab | ( | int | exoid,
|  | const char * | var_type,
|  | int | num_blk,
|  | int | num_var,
|  | int * | var_tab
| ) |  |

reads the EXODUS specified variable truth table from the database

Deprecated:
  Use ex_get_truth_table()(exoid, obj_type, num_blk, num_var, var_tab)

## ◆ ex_get_var_time()

int ex_get_var_time | ( | int | exoid,
|  | ex_entity_type | var_type,
|  | int | var_index,
|  | int64_t | id,
|  | int | beg_time_step,
|  | int | end_time_step,
|  | void * | var_vals
| ) |  |

reads the values of a variable for a single entry of an object (block or set) through a specified number of time steps in the database; assume the first variable index, entry number, and time step are 1

## ◆ ex_get_variable_name()

int ex_get_variable_name | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int | var_num,
|  | char * | var_name
| ) |  |

reads the name of a particular results variable from the database

## ◆ ex_get_variable_names()

int ex_get_variable_names | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int | num_vars,
|  | char * | var_names[]
| ) |  |

The function ex_get_variable_names() reads the names of the results variables from the database. Memory must be allocated for the name array before this function is invoked. The names are `MAX_STR_LENGTH-characters` in length.

Returns
  In case of an error, ex_get_variable_names() 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()
  - invalid variable type specified.
  - a warning value is returned if no variables of the specified type are stored in the file.

Parameters

  [in] | exoid | exodus file ID returned from a previous call to ex_create() or ex_open().
  [in] | obj_type | Variable indicating the type of variable which is described. Use one of the options in the table below.
  [in] | num_vars | The number of var_type variables that will be read from the database.
  [out] | var_names | Returned array of pointers to num_vars variable names.

ex_entity_type | description
--- | ---
EX_GLOBAL | Global entity type
EX_NODAL | Nodal entity type
EX_NODE_SET | Node Set entity type
EX_EDGE_BLOCK | Edge Block entity type
EX_EDGE_SET | Edge Set entity type
EX_FACE_BLOCK | Face Block entity type
EX_FACE_SET | Face Set entity type
EX_ELEM_BLOCK | Element Block entity type
EX_ELEM_SET | Element Set entity type
EX_SIDE_SET | Side Set entity type

As an example, the following code segment will read the names of the nodal variables stored in the data file:

int error, exoid, num_nod_vars;
char *var_names[10];
/* read nodal variables parameters and names */
error = ex_get_variable_param(exoid, EX_NODAL, &num_nod_vars);
for (i=0; i < num_nod_vars; i++) {
var_names[i] = (char *) calloc ((MAX_STR_LENGTH+1), sizeof(char));
}
error = ex_get_variable_names(exoid, EX_NODAL, num_nod_vars, var_names);

## ◆ ex_get_variable_param()

int ex_get_variable_param | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int * | num_vars
| ) |  |

The function ex_get_variable_param() reads the number of global, nodal, or element variables stored in the database.

Returns
  In case of an error, ex_get_variable_param() 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()
  - invalid variable type specified.

Parameters

  [in] | exoid | exodus file ID returned from a previous call to ex_create() or ex_open().
  [in] | obj_type | Variable indicating the type of variable which is described. Use one of the options in the table below.
  [out] | num_vars | Returned number of var_type variables that are stored in the database.

ex_entity_type | description
--- | ---
EX_GLOBAL | Global entity type
EX_NODAL | Nodal entity type
EX_NODE_SET | Node Set entity type
EX_EDGE_BLOCK | Edge Block entity type
EX_EDGE_SET | Edge Set entity type
EX_FACE_BLOCK | Face Block entity type
EX_FACE_SET | Face Set entity type
EX_ELEM_BLOCK | Element Block entity type
EX_ELEM_SET | Element Set entity type
EX_SIDE_SET | Side Set entity type

As an example, the following coding will determine the number of global variables stored in the data file:

int num_glo_vars, error, exoid;
/* read global variables parameters */
error = ex_get_variable_param(exoid, EX_GLOBAL, &num_glo_vars);

## ◆ ex_put_n_nodal_var()

int ex_put_n_nodal_var | ( | int | exoid,
|  | int | time_step,
|  | int | nodal_var_index,
|  | int64_t | start_node,
|  | int64_t | num_nodes,
|  | const void * | nodal_var_vals
| ) |  |

Deprecated:
  Use ex_put_partial_var()(exoid, time_step, EX_NODAL, nodal_var_index, 1, start_node, num_nodes, nodal_var_vals)

writes the values of a single nodal variable for a partial block at one single time step to the database; assume the first time step and nodal variable index is 1

Parameters

  exoid | exodus file id
  time_step | whole time step number
  nodal_var_index | index of desired nodal variable
  start_node | index of first node to write data for (1-based)
  num_nodes | number of nodal points
  nodal_var_vals | array of nodal variable values

## ◆ ex_put_n_var()

int ex_put_n_var | ( | int | exoid,
|  | int | time_step,
|  | ex_entity_type | var_type,
|  | int | var_index,
|  | ex_entity_id | obj_id,
|  | int64_t | start_index,
|  | int64_t | num_entities,
|  | const void * | var_vals
| ) |  |

Deprecated:
  use ex_put_partial_var()(exoid, time_step, var_type, var_index, obj_id, start_index, num_entities, var_vals) writes the values of a single variable for a partial block at one time step to the database; assume the first time step and variable index are 1

Parameters

  exoid | exodus file id
  time_step | time step number
  var_type | type (edge block, face block, edge set, ... )
  var_index | element variable index
  obj_id | element block id
  start_index | index of first entity in block to write (1-based)
  num_entities | number of entries in this block/set
  var_vals | the values to be written

## ◆ ex_put_partial_nodal_var()

int ex_put_partial_nodal_var | ( | int | exoid,
|  | int | time_step,
|  | int | nodal_var_index,
|  | int64_t | start_node,
|  | int64_t | num_nodes,
|  | const void * | nodal_var_vals
| ) |  |

Deprecated:
  Use ex_put_partial_var()(exoid, time_step, EX_NODAL, nodal_var_index, 1, start_node, num_nodes, nodal_var_vals)

writes the values of a single nodal variable for a partial block at one single time step to the database; assume the first time step and nodal variable index is 1

Parameters

  exoid | exodus file id
  time_step | whole time step number
  nodal_var_index | index of desired nodal variable
  start_node | index of first node to write data for (1-based)
  num_nodes | number of nodal points
  nodal_var_vals | array of nodal variable values

## ◆ ex_put_partial_nodal_var_int()

int ex_put_partial_nodal_var_int | ( | int | exoid,
|  | int | time_step,
|  | int | nodal_var_index,
|  | int64_t | start_node,
|  | int64_t | num_nodes,
|  | const void * | nodal_var_vals
| ) |  |

writes the values of a single nodal variable for a partial block at one single time step to the database; assume the first time step and nodal variable index is 1

Parameters

  exoid | exodus file id
  time_step | whole time step number
  nodal_var_index | index of desired nodal variable
  start_node | index of first node to write data for (1-based)
  num_nodes | number of nodal points
  nodal_var_vals | array of nodal variable values

## ◆ ex_put_partial_var()

int ex_put_partial_var | ( | int | exoid,
|  | int | time_step,
|  | ex_entity_type | var_type,
|  | int | var_index,
|  | ex_entity_id | obj_id,
|  | int64_t | start_index,
|  | int64_t | num_entities,
|  | const void * | var_vals
| ) |  |

writes the values of a single variable for a partial block at one time step to the database; assume the first time step and variable index are 1

Parameters

  exoid | exodus file id
  time_step | time step number (1-based)
  var_type | type (edge block, face block, edge set, ... )
  var_index | entity variable index (1-based)
  obj_id | entity id
  start_index | index of first entity in block to write (1-based)
  num_entities | number of entries in this block/set
  var_vals | the values to be written

## ◆ ex_put_truth_table()

int ex_put_truth_table | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int | num_blk,
|  | int | num_var,
|  | int * | var_tab
| ) |  |

writes the EXODUS variable truth table to the database; also, creates netCDF variables in which to store EXODUS variable values; although this table isn't required (because the netCDF variables can also be created in ex_put_var()), this call will save tremendous time because all of the variables are defined at once while the file is in define mode, rather than going in and out of define mode (causing the entire file to be copied over and over) which is what occurs when the variables are defined in ex_put_var()

Parameters

  exoid | exodus file id
  obj_type | object type
  num_blk | number of blocks or sets
  num_var | number of variables
  *var_tab | variable truth table array

The following coding will create, populate, and write an element variable truth table to an opened exodus file (NOTE: all element variables are valid for all element blocks in this example.):

int *truth_tab, num_elem_blk, num_ele_vars, error, exoid;
/* write element variable truth table */
truth_tab = (int *)calloc((num_elem_blk*num_ele_vars), sizeof(int));
for (i=0, k=0; i < num_elem_blk; i++) {
for (j=0; j < num_ele_vars; j++) {
truth_tab[k++] = 1;
}
}
error = ex_put_truth_table(exoid, EX_ELEM_BLOCK, num_elem_blk, num_ele_vars,
truth_tab);

## ◆ ex_put_var_name()

int ex_put_var_name | ( | int | exoid,
|  | const char * | var_type,
|  | int | var_num,
|  | const char * | var_name
| ) |  |

writes the name of a particular results variable to the database

Parameters

  exoid | exodus file id
  *var_type | variable type: G,N, or E
  var_num | variable number name to write 1..num_var
  *var_name | ptr of variable name

Deprecated:
  use ex_put_variable_name()(exoid, obj_type, var_num, *var_name)

## ◆ ex_put_var_names()

int ex_put_var_names | ( | int | exoid,
|  | const char * | var_type,
|  | int | num_vars,
|  | char * | var_names[]
| ) |  |

writes the names of the results variables to the database

Parameters

  exoid | exodus file id
  *var_type | variable type: G,N, or E
  num_vars | # of variables to read
  *var_names | ptr array of variable names

Deprecated:
  Use ex_put_variable_names()(exoid, obj_type, num_vars, var_names)

## ◆ ex_put_var_param()

int ex_put_var_param | ( | int | exoid,
|  | const char * | var_type,
|  | int | num_vars
| ) |  |

writes the number and names of global, nodal, or element variables that will be written to the database

Parameters

  exoid | exodus file id
  var_type | variable type G,N, or E
  num_vars | number of variables in database

Deprecated:
  Use ex_put_variable_param()(exoid, obj_type, num_vars)

## ◆ ex_put_var_tab()

int ex_put_var_tab | ( | int | exoid,
|  | const char * | var_type,
|  | int | num_blk,
|  | int | num_var,
|  | int * | var_tab
| ) |  |

writes the EXODUS variable truth table to the database; also, creates netCDF variables in which to store EXODUS variable values; although this table isn't required (because the netCDF variables can also be created in ex_put_var), this call will save tremendous time because all of the variables are defined at once while the file is in define mode, rather than going in and out of define mode (causing the entire file to be copied over and over) which is what occurs when the variables are defined in ex_put_var

Parameters

  exoid | exodus file id
  *var_type | 'e', 'm', 's' element, nodeset, sideset
  num_blk | number of blocks
  num_var | number of variables
  *var_tab | variable truth table array

Deprecated:
  Use ex_put_truth_table()(exoid, obj_type, num_blk, num_var, var_tab)

## ◆ ex_put_variable_name()

int ex_put_variable_name | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int | var_num,
|  | const char * | var_name
| ) |  |

writes the name of a particular results variable to the database

Parameters

  exoid | exodus file id
  obj_type | variable type
  var_num | variable number name to write 1..num_var
  *var_name | ptr of variable name

## ◆ ex_put_variable_names()

int ex_put_variable_names | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int | num_vars,
|  | char * | var_names[]
| ) |  |

The function ex_put_variable_names() writes the names of the results variables to the database. The names are `MAX_STR_LENGTH` -characters in length. The function ex_put_variable_param() must be called before this function is invoked.

Returns
  In case of an error, ex_put_variable_names() 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()
  - data file not initialized properly with call to ex_put_init().
  - invalid variable type specified.
  - ex_put_variable_param() was not called previously or was called with zero variables of the specified type.
  - ex_put_variable_names() has been called previously for the specified variable type.

Parameters

  [in] | exoid | exodus file ID returned from a previous call to ex_create() or ex_open().
  [in] | obj_type | Variable indicating the type of variable which is described. Use one of the options in the table below.
  [in] | num_vars | The number of var_type variables that will be written to the database.
  [in] | var_names | Array of pointers to num_vars variable names.

ex_entity_type | description
--- | ---
EX_GLOBAL | Global entity type
EX_NODAL | Nodal entity type
EX_NODE_SET | Node Set entity type
EX_EDGE_BLOCK | Edge Block entity type
EX_EDGE_SET | Edge Set entity type
EX_FACE_BLOCK | Face Block entity type
EX_FACE_SET | Face Set entity type
EX_ELEM_BLOCK | Element Block entity type
EX_ELEM_SET | Element Set entity type
EX_SIDE_SET | Side Set entity type

The following coding will write out the names associated with the nodal variables:

int num_nod_vars, error, exoid;
char *var_names[2];
/* write results variables parameters and names */
num_nod_vars = 2;
var_names[0] = "disx";
var_names[1] = "disy";
error = ex_put_variable_param (exoid, EX_NODAL, num_nod_vars);
error = ex_put_variable_names (exoid, EX_NODAL, num_nod_vars, var_names);

## ◆ ex_put_variable_param()

int ex_put_variable_param | ( | int | exoid,
|  | ex_entity_type | obj_type,
|  | int | num_vars
| ) |  |

The function ex_put_variable_param() writes the number of global, nodal, nodeset, sideset, edge, face, or element variables that will be written to the database.

Returns
  In case of an error, ex_put_variable_param() 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()
  - data file opened for read only.
  - invalid variable type specified.
  - data file not initialized properly with call to ex_put_init().
  - this routine has already been called with the same variable type; redefining the number of variables is not allowed.
  - a warning value is returned if the number of variables is specified as zero.

Parameters

  [in] | exoid | exodus file ID returned from a previous call to ex_create() or ex_open().
  [in] | obj_type | Variable indicating the type of variable which is described. Use one of the ex_entity_type types specified in the table below.
  [in] | num_vars | The number of var_type variables that will be written to the database.

ex_entity_type | description
--- | ---
EX_GLOBAL | Global entity type
EX_NODAL | Nodal entity type
EX_NODE_SET | Node Set entity type
EX_EDGE_BLOCK | Edge Block entity type
EX_EDGE_SET | Edge Set entity type
EX_FACE_BLOCK | Face Block entity type
EX_FACE_SET | Face Set entity type
EX_ELEM_BLOCK | Element Block entity type
EX_ELEM_SET | Element Set entity type
EX_SIDE_SET | Side Set entity type

For example, the following code segment initializes the data file to store global variables:

int num_glo_vars, error, exoid;
/* write results variables parameters */
num_glo_vars = 3;
error = ex_put_variable_param (exoid, EX_GLOBAL, num_glo_vars);