Exodus 8.24
Loading...
Searching...
No Matches
Results Data

Functions

int ex_get_time (int exoid, int time_step, void *time_value)
 
int ex_get_variable_names (int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
 
int ex_get_variable_name (int exoid, ex_entity_type obj_type, int var_num, char *var_name)
 
int ex_get_variable_param (int exoid, ex_entity_type obj_type, int *num_vars)
 
int ex_get_reduction_variable_names (int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
 
int ex_get_reduction_variable_name (int exoid, ex_entity_type obj_type, int var_num, char *var_name)
 
int ex_get_reduction_variable_param (int exoid, ex_entity_type obj_type, int *num_vars)
 
int ex_get_object_truth_vector (int exoid, ex_entity_type obj_type, ex_entity_id entity_id, int num_var, int *var_vec)
 
int ex_get_truth_table (int exoid, ex_entity_type obj_type, int num_blk, int num_var, int *var_tab)
 
int ex_put_all_var_param (int exoid, int num_g, int num_n, int num_e, const int *elem_var_tab, int num_m, const int *nset_var_tab, int num_s, const int *sset_var_tab)
 
int ex_put_time (int exoid, int time_step, const void *time_value)
 
int ex_get_all_times (int exoid, void *time_values)
 
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 *const var_names[])
 
int ex_put_variable_param (int exoid, ex_entity_type obj_type, int num_vars)
 
int ex_put_reduction_variable_name (int exoid, ex_entity_type obj_type, int var_num, const char *var_name)
 
int ex_put_reduction_variable_names (int exoid, ex_entity_type obj_type, int num_vars, char *const var_names[])
 
int ex_put_reduction_variable_param (int exoid, ex_entity_type obj_type, int num_vars)
 
int ex_put_truth_table (int exoid, ex_entity_type obj_type, int num_blk, int num_var, const int *var_tab)
 
int ex_put_all_var_param_ext (int exoid, const ex_var_params *vp)
 
int ex_put_var (int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t num_entries_this_obj, const void *var_vals)
 
int ex_put_var_multi_time (int exoid, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t num_entries_this_obj, int beg_time_step, int end_time_step, const void *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_reduction_vars (int exoid, int time_step, ex_entity_type obj_type, ex_entity_id obj_id, int64_t num_variables, const void *var_vals)
 
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_multi_time (int exoid, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t num_entry_this_obj, int beg_time_step, int end_time_step, void *var_vals)
 
int ex_get_var_time (int exoid, ex_entity_type var_type, int var_index, ex_entity_id id, int beg_time_step, int end_time_step, 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_reduction_vars (int exoid, int time_step, ex_entity_type obj_type, ex_entity_id obj_id, int64_t num_variables, void *var_vals)
 
int exi_get_nodal_var_multi_time (int exoid, int nodal_var_index, int64_t num_nodes, int beg_time_step, int end_time_step, void *nodal_var_vals)
 
int exi_put_nodal_var_time (int exoid, int nodal_var_index, int64_t num_nodes, int beg_time_step, int end_time_step, const void *nodal_var_vals)
 
int exi_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 exi_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_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_nodal_var (int exoid, int time_step, int nodal_var_index, int64_t num_nodes, void *nodal_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_nodal_var_slab (int exoid, int time_step, int nodal_var_index, int64_t start_pos, int64_t num_vals, void *nodal_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:

Function Documentation

◆ ex_get_all_times()

int ex_get_all_times ( int exoid,
void * time_values )
extern

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().

Returns
In case of an error, ex_get_all_times() 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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[out]time_valuesReturned 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:

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);
@ EX_INQ_TIME
Definition exodusII.h:159
int ex_get_all_times(int exoid, void *time_values)
Definition ex_get_all_times.c:55
int64_t ex_inquire_int(int exoid, ex_inquiry req_info)
Definition ex_inquire.c:1029
Examples
/test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, and /test/testrdd.c.

◆ 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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe 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_varsThe number of global variables stored in the database.
[out]glob_var_valsReturned 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_GLOBAL
Definition exodusII.h:285
SEACAS_DEPRECATED int ex_get_glob_vars(int exoid, int time_step, int num_glob_vars, void *glob_var_vals)
Definition ex_get_glob_vars.c:78
int ex_get_variable_param(int exoid, ex_entity_type obj_type, int *num_vars)
Definition ex_get_variable_param.c:73

◆ 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
exoidexodus file id
time_steptime step number
var_typetype (edge block, face block, edge set, ... )
var_indexelement variable index
obj_idelement block id
start_indexindex of first entity in block to read (1-based)
num_entitiesnumber of entries to read in this block/set
var_valsthe values to read

◆ ex_get_nodal_var()

int ex_get_nodal_var ( int exoid,
int time_step,
int nodal_var_index,
int64_t num_nodes,
void * nodal_var_vals )
Deprecated
Use ex_get_var()(exoid, time_step, EX_NODAL, nodal_var_index, 1, num_nodes, nodal_var_vals) The function ex_get_nodal_var() reads the values of a single nodal variable for a single time step. Memory must be allocated for the nodal variable values array before this function is invoked.

Because nodal 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().

Returns
In case of an error, ex_get_nodal_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()
  • specified nodal variable does not exist.
  • a warning value is returned if no nodal variables are stored in the file.
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe time step, as described under ex_put_time(), at which the nodal variable values are desired. This is essentially an index (in the time dimension) into the nodal variable values array stored in the database. The first time step is 1.
[in]nodal_var_indexThe index of the desired nodal variable. The first variable has an index of 1.
[in]num_nodesThe number of nodal points.
[out]nodal_var_valsReturned array of num_nodes values of the nodal_var_index-th nodal variable for the time_step-th time step.

For example, the following demonstrates how this function would be used:

int num_nodes, time_step, var_index;
float *var_values;
\comment{read the second nodal variable at the first time step}
time_step = 1;
var_index = 2;
var_values = (float *) calloc (num_nodes, sizeof(float));
error = ex_get_nodal_var(exoid, time_step, var_index, num_nodes,
var_values);
SEACAS_DEPRECATED int ex_get_nodal_var(int exoid, int time_step, int nodal_var_index, int64_t num_nodes, void *nodal_var_vals)
Definition ex_get_nodal_var.c:72

◆ ex_get_object_truth_vector()

int ex_get_object_truth_vector ( int exoid,
ex_entity_type obj_type,
ex_entity_id entity_id,
int num_var,
int * var_vec )
extern

reads the EXODUS specified variable truth vector from the database

◆ 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_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 )
extern

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
exoidexodus file id
time_steptime step number
var_typetype (edge block, face block, edge set, ... )
var_indexelement variable index
obj_idelement block id
start_indexindex of first entity in block to read (1-based)
num_entitiesnumber of entries to read in this block/set
var_valsthe values to read
Examples
/test/test_ts_partial_nvar_rd.c.

◆ ex_get_reduction_variable_name()

int ex_get_reduction_variable_name ( int exoid,
ex_entity_type obj_type,
int var_num,
char * var_name )
extern

reads the name of a particular results reduction variable from the database

◆ ex_get_reduction_variable_names()

int ex_get_reduction_variable_names ( int exoid,
ex_entity_type obj_type,
int num_vars,
char * var_names[] )
extern

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.

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of variable which is described. Use one of the options in the table below.
[in]num_varsThe number of var_type variables that will be read from the database.
[out]var_namesReturned array of pointers to num_vars variable names.
ex_entity_type description
EX_GLOBAL Global 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_assem_vars;
char *var_names[10];
\comment{read assembly variables parameters and names}
error = ex_get_reduction_variable_param(exoid, EX_ASSEMBLY, &num_assem_vars);
int name_len = ex_inquire_int(exoid, EX_INT_MAX_READ_NAME_LENGTH);
for (i=0; i < num_assem_vars; i++) {
var_names[i] = (char *) calloc ((name_len+1), sizeof(char));
}
error = ex_get_reduction_variable_names(exoid, EX_ASSEMBLY, num_assem_vars, var_names);
@ EX_ASSEMBLY
Definition exodusII.h:287
int ex_get_reduction_variable_param(int exoid, ex_entity_type obj_type, int *num_vars)
Definition ex_get_reduction_variable_param.c:56
int ex_get_reduction_variable_names(int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
Definition ex_get_reduction_variable_names.c:66

◆ ex_get_reduction_variable_param()

int ex_get_reduction_variable_param ( int exoid,
ex_entity_type obj_type,
int * num_vars )
extern

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

Returns
In case of an error, ex_get_reduction_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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of reduction variable which is described. Use one of the options in the table below.
[out]num_varsReturned number of var_type variables that are stored in the database.
ex_entity_type description
EX_GLOBAL Global 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;
\comment{read global variables parameters}
error = ex_get_variable_param(exoid, EX_GLOBAL, &num_glo_vars);

◆ ex_get_reduction_vars()

int ex_get_reduction_vars ( int exoid,
int time_step,
ex_entity_type var_type,
ex_entity_id obj_id,
int64_t num_variables,
void * var_vals )
extern

The function ex_get_reduction_vars() reads the values of the selected entity reduction 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_reduction_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()
  • 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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe 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_typeblock/variable type node, edge/face/element block, or node/edge/face/side/element set of type ex_entity_type.
[in]obj_idobject id, see ex_get_ids()
[in]num_variablesThe number of reduction variables in this object stored in the database.
[out]var_valsReturned array of num_variables variable values for the time_step'th time step.

The following is an example code segment that reads the element reduction variables for element block with id 100 at time step 5. There are 'num_variables' reduction variables for element block 100.

int num_variables, error, time_step;
int blk_id = 100;
float *var_values;
var_values = (float *) callo(num_variables, sizeof(float));
error = ex_get_reduction_vars (idexo, time_step, EX_ELEM_BLOCK, blk_id,
num_variables, var_values);
@ EX_ELEM_BLOCK
Definition exodusII.h:275
int ex_get_reduction_vars(int exoid, int time_step, ex_entity_type obj_type, ex_entity_id obj_id, int64_t num_variables, void *var_vals)
Definition ex_get_reduction_vars.c:66

◆ ex_get_time()

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

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe 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_valueReturned 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;
\comment{read time value at time step 3}
n = 3;
error = ex_get_time (exoid, n, &time_value);
int ex_get_time(int exoid, int time_step, void *time_value)
Definition ex_get_time.c:51
Examples
/test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, and /test/testrdd.c.

◆ 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 )
extern

reads the EXODUS specified variable truth table from the database

Parameters
[in]exoidexodus file id
[in]obj_typeobject type
[in]num_blknumber of blocks or sets
[in]num_varnumber of variables
[out]*var_tabvariable truth table array
Examples
/test/ReadEdgeFace.c, /test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, and /test/testrdd.c.

◆ 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 )
extern

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe 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_typeblock/variable type node, edge/face/element block, or node/edge/face/side/element set of type ex_entity_type.
[in]var_indexvariable index; 1-based
[in]obj_idobject id, see ex_get_ids()
[in]num_entry_this_objThe number of entities in this object stored in the database.
[out]var_valsReturned 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);
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)
Definition ex_get_var.c:68
Examples
/test/ReadEdgeFace.c, /test/rd_wt_mesh.c, /test/test_ts_nvar_rd.c, /test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, and /test/testrdd.c.

◆ ex_get_var_multi_time()

int ex_get_var_multi_time ( int exoid,
ex_entity_type var_type,
int var_index,
ex_entity_id obj_id,
int64_t num_entry_this_obj,
int beg_time_step,
int end_time_step,
void * var_vals )
extern

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]var_typeblock/variable type node, edge/face/element block, or node/edge/face/side/element set of type ex_entity_type.
[in]var_indexvariable index; 1-based
[in]obj_idobject id, see ex_get_ids()
[in]num_entry_this_objThe number of entities in this object stored in the database.
[in]beg_time_stepThe first time step to access variable data from. 1-based.
[in]end_time_stepThe last time step to access variable data from. 1-based.
[out]var_valsReturned 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 over all 10 time steps. 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_time_step = 10;
int num_variables;
float *var_values;
var_values = (float *) calloc(num_elements_this_block * num_time_step, sizeof(float));
error = ex_get_var_multi_time (idexo, EX_ELEM_BLOCK, var_index, blk_id,
num_elements_this_block, 1, num_time_step, var_values);
int ex_get_var_multi_time(int exoid, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t num_entry_this_obj, int beg_time_step, int end_time_step, void *var_vals)
Definition ex_get_var_multi_time.c:67

◆ 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 )
extern

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

Examples
/test/ReadEdgeFace.c, /test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, and /test/testrdd.c.

◆ ex_get_variable_name()

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

reads the name of a particular results variable from the database

Examples
/test/test_ts_nvar_rd.c, /test/test_ts_partial_nvar_rd.c, and /test/testrd1.c.

◆ ex_get_variable_names()

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

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.

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of variable which is described. Use one of the options in the table below.
[in]num_varsThe number of var_type variables that will be read from the database.
[out]var_namesReturned 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];
\comment{read nodal variables parameters and names}
error = ex_get_variable_param(exoid, EX_NODAL, &num_nod_vars);
int name_len = ex_inquire_int(exoid, EX_INT_MAX_READ_NAME_LENGTH);
for (i=0; i < num_nod_vars; i++) {
var_names[i] = (char *) calloc ((name_len+1), sizeof(char));
}
error = ex_get_variable_names(exoid, EX_NODAL, num_nod_vars, var_names);
@ EX_NODAL
Definition exodusII.h:268
int ex_get_variable_names(int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
Definition ex_get_variable_names.c:67
Examples
/test/ReadEdgeFace.c, /test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, and /test/testrdd.c.

◆ ex_get_variable_param()

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

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of variable which is described. Use one of the options in the table below.
[out]num_varsReturned 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;
\comment{read global variables parameters}
error = ex_get_variable_param(exoid, EX_GLOBAL, &num_glo_vars);
Examples
/test/ReadEdgeFace.c, /test/rd_wt_mesh.c, /test/testcp_tran.c, /test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, and /test/testrdd.c.

◆ ex_put_all_var_param()

int ex_put_all_var_param ( int exoid,
int num_g,
int num_n,
int num_e,
const int * elem_var_tab,
int num_m,
const int * nset_var_tab,
int num_s,
const int * sset_var_tab )
extern

defines the number of global, nodal, element, nodeset, and sideset variables that will be written to the database

Parameters
exoidexodus file id
num_gglobal variable count
num_nnodal variable count
num_eelement variable count
*elem_var_tabelement variable truth table array
num_mnodeset variable count
*nset_var_tabnodeset variable truth table array
num_ssideset variable count
*sset_var_tabsideset variable truth table array
Examples
/test/create_mesh.c, /test/rd_wt_mesh.c, and /test/testwt_clb.c.

◆ ex_put_all_var_param_ext()

int ex_put_all_var_param_ext ( int exoid,
const ex_var_params * vp )
extern

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

Parameters
exoidexodus file id
*vppointer to variable parameter info
Examples
/test/CreateEdgeFace.c.

◆ 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
exoidexodus file id
time_stepwhole time step number
nodal_var_indexindex of desired nodal variable
start_nodeindex of first node to write data for (1-based)
num_nodesnumber of nodal points
nodal_var_valsarray 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
exoidexodus file id
time_steptime step number
var_typetype (edge block, face block, edge set, ... )
var_indexelement variable index
obj_idelement block id
start_indexindex of first entity in block to write (1-based)
num_entitiesnumber of entries in this block/set
var_valsthe values to be written

◆ ex_put_nodal_var_slab()

int ex_put_nodal_var_slab ( int exoid,
int time_step,
int nodal_var_index,
int64_t start_pos,
int64_t num_vals,
void * nodal_var_vals )
Deprecated
Use ex_put_partial_var()(exoid, time_step, EX_NODAL, nodal_var_index, 1, start_pos, num_vals, nodal_var_vals) instead.
Parameters
exoidNetCDF/Exodus file ID
time_stepThe time step index
nodal_var_indexNodal variable index
start_posStart position for write
num_valsNumber of nodal variables
nodal_var_valsNodal variable values

◆ 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
exoidexodus file id
time_stepwhole time step number
nodal_var_indexindex of desired nodal variable
start_nodeindex of first node to write data for (1-based)
num_nodesnumber of nodal points
nodal_var_valsarray 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 )
extern

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
exoidexodus file id
time_steptime step number (1-based)
var_typetype (edge block, face block, edge set, ... )
var_indexentity variable index (1-based)
obj_identity id
start_indexindex of first entity in block to write (1-based)
num_entitiesnumber of entries in this block/set
var_valsthe values to be written
Examples
/test/test_ts_partial_nvar.c.

◆ ex_put_reduction_variable_name()

int ex_put_reduction_variable_name ( int exoid,
ex_entity_type obj_type,
int var_num,
const char * var_name )
extern

writes the name of a particular results variable to the database

Parameters
exoidexodus file id
obj_typevariable type
var_numvariable number name to write 1..num_var
*var_nameptr of variable name

◆ ex_put_reduction_variable_names()

int ex_put_reduction_variable_names ( int exoid,
ex_entity_type obj_type,
int num_vars,
char *const var_names[] )
extern

The function ex_put_variable_names() writes the names of the results variables to the database. The maximum length of the names returned is specified by the return value from ex_inquire_int()(exoid, EX_INQ_MAX_READ_NAME_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:
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of variable which is described. Use one of the options in the table below.
[in]num_varsThe number of var_type variables that will be written to the database.
[in]var_namesArray 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];
\comment{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);
int ex_put_variable_names(int exoid, ex_entity_type obj_type, int num_vars, char *const var_names[])
Definition ex_put_variable_names.c:125
int ex_put_variable_param(int exoid, ex_entity_type obj_type, int num_vars)
Definition ex_put_variable_param.c:124

◆ ex_put_reduction_variable_param()

int ex_put_reduction_variable_param ( int exoid,
ex_entity_type obj_type,
int num_vars )
extern

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of variable which is described. Use one of the ex_entity_type types specified in the table below.
[in]num_varsThe number of var_type variables that will be written to the database.
ex_entity_type description
EX_GLOBAL Global 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;
\comment{write results variables parameters}
num_glo_vars = 3;
error = ex_put_variable_param (exoid, EX_GLOBAL, num_glo_vars);

◆ ex_put_reduction_vars()

int ex_put_reduction_vars ( int exoid,
int time_step,
ex_entity_type var_type,
ex_entity_id obj_id,
int64_t num_variables,
const void * var_vals )
extern

writes the values of a single variable of the specified type for a single time step. The function ex_put_reduction_variable_param() must be invoked before this call is made.

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().

Returns
In case of an error, ex_put_reduction_vars() returns a negative number; a warning will return a positive number. Possible causes of errors include:
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe time step number, as described under ex_put_time(). This is essentially a counter that is incremented when results variables are output. The first time step is 1.
[in]var_typetype (edge block, face block, edge set, ... )
[in]obj_identity block/set id (ignored for global and nodal variables)
[in]num_variablesThe number of reduction variables in this block/set
[in]var_valsArray of num_variables values for all reduction variables for the time_step-th time step.

As an example, the following code segment writes all the assembly variables for assembly 100 for a single time step:

int num_assem_vars, num_assembly, error, exoid, time_step;
float *assembly_var_vals;
\comment{write assembly variables}
assembly_var_vals = (float *) calloc(num_assem_vars, sizeof(float));
for (int k=1; k <= num_assem_vars; k++) {
\comment{application code fills in this array}
assembly_var_vals[j] = 10.0;
}
error = ex_put_reduction_vars(exoid, time_step, EX_ASSEMBLY, 100, num_assem_vars,
assembly_var_vals);
}
int ex_put_reduction_vars(int exoid, int time_step, ex_entity_type obj_type, ex_entity_id obj_id, int64_t num_variables, const void *var_vals)
Definition ex_put_reduction_vars.c:182

◆ ex_put_time()

int ex_put_time ( int exoid,
int time_step,
const void * time_value )
extern

The function ex_put_time() writes 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_put_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()
  • data file opened for read only.
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe time step number. This is essentially a counter that is incremented only when results variables are output to the data file. The first time step is 1.
[in]time_valueThe time at the specified time step.

The following code segment will write out the simulation time value at simulation time step n:

int error, exoid, n;
float time_value;
\comment{write time value}
error = ex_put_time (exoid, n, &time_value);
int ex_put_time(int exoid, int time_step, const void *time_value)
Definition ex_put_time.c:51
Examples
/test/CreateEdgeFace.c, /test/create_mesh.c, /test/rd_wt_mesh.c, /test/test_ts_files.c, /test/test_ts_nvar.c, /test/test_ts_partial_nvar.c, /test/testwt-compress.c, /test/testwt-groups.c, /test/testwt-long-name.c, /test/testwt-nface-nside.c, /test/testwt-nsided.c, /test/testwt-oned.c, /test/testwt-partial.c, /test/testwt-results.c, /test/testwt-zeroe.c, /test/testwt-zeron.c, /test/testwt.c, /test/testwt1.c, /test/testwt2.c, /test/testwt_clb.c, /test/testwt_nc.c, /test/testwt_nossnsdf.c, /test/testwtd.c, /test/testwtm.c, and /test/twod.c.

◆ ex_put_truth_table()

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

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
exoidexodus file id
obj_typeobject type
num_blknumber of blocks or sets
num_varnumber of variables
*var_tabvariable 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;
\comment{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);
int ex_put_truth_table(int exoid, ex_entity_type obj_type, int num_blk, int num_var, const int *var_tab)
Definition ex_put_truth_table.c:67
Examples
/test/test_ts_files.c, /test/testwt-compress.c, /test/testwt-groups.c, /test/testwt-long-name.c, /test/testwt-nface-nside.c, /test/testwt-nsided.c, /test/testwt-oned.c, /test/testwt-partial.c, /test/testwt-results.c, /test/testwt.c, /test/testwt2.c, /test/testwt_nc.c, /test/testwtd.c, and /test/testwtm.c.

◆ ex_put_var()

int ex_put_var ( int exoid,
int time_step,
ex_entity_type var_type,
int var_index,
ex_entity_id obj_id,
int64_t num_entries_this_obj,
const void * var_vals )
extern

writes the values of a single variable of the specified type for a single time step. The function ex_put_variable_param() must be invoked before this call is made.

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().

Returns
In case of an error, ex_put_var() returns a negative number; a warning will return a positive number. Possible causes of errors include:
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]time_stepThe time step number, as described under ex_put_time(). This is essentially a counter that is incremented when results variables are output. The first time step is 1.
[in]var_typetype (edge block, face block, edge set, ... )
[in]var_indexThe index of the variable. The first variable has an index of 1.
[in]obj_identity block/set id (ignored for global and nodal variables)
[in]num_entries_this_objThe number of items in this block/set
[in]var_valsArray of num_entries_this_obj values of the var_index-th variable for the time_step-th time step.

As an example, the following code segment writes all the nodal variables for a single time step:

int num_nod_vars, num_nodes, error, exoid, time_step;
float *nodal_var_vals;
\comment{write nodal variables}
nodal_var_vals = (float *) calloc(num_nodes, sizeof(float));
for (k=1; k <= num_nod_vars; k++) {
for (j=0; j < num_nodes; j++) {
\comment{application code fills in this array}
nodal_var_vals[j] = 10.0;
}
error = ex_put_var(exoid, time_step, EX_NODAL, 0, k, num_nodes,
nodal_var_vals);
}
int ex_put_var(int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t num_entries_this_obj, const void *var_vals)
Definition ex_put_var.c:77
Examples
/test/CreateEdgeFace.c, /test/create_mesh.c, /test/rd_wt_mesh.c, /test/test_ts_files.c, /test/test_ts_nvar.c, /test/testcp_tran.c, /test/testwt-compress.c, /test/testwt-groups.c, /test/testwt-long-name.c, /test/testwt-nface-nside.c, /test/testwt-nsided.c, /test/testwt-oned.c, /test/testwt-partial.c, /test/testwt-results.c, /test/testwt-zeroe.c, /test/testwt-zeron.c, /test/testwt.c, /test/testwt1.c, /test/testwt2.c, /test/testwt_clb.c, /test/testwt_nc.c, /test/testwt_nossnsdf.c, /test/testwtd.c, /test/testwtm.c, and /test/twod.c.

◆ ex_put_var_multi_time()

int ex_put_var_multi_time ( int exoid,
ex_entity_type var_type,
int var_index,
ex_entity_id obj_id,
int64_t num_entries_this_obj,
int beg_time_step,
int end_time_step,
const void * var_vals )
extern

writes the values of a single variable of the specified type for a single time step. The function ex_put_variable_param() must be invoked before this call is made.

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().

Returns
In case of an error, ex_put_var() returns a negative number; a warning will return a positive number. Possible causes of errors include:
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]var_typetype (edge block, face block, edge set, ... )
[in]var_indexThe index of the variable. The first variable has an index of 1.
[in]obj_identity block/set id (ignored for global and nodal variables)
[in]num_entries_this_objThe number of items in this block/set
[in]beg_time_stepThe beginning time step number, as described under ex_put_time(). This is essentially a counter that is incremented when results variables are output. The first time step is 1.
[in]end_time_stepThe last step number to put values. The first time step is 1.
[in]var_valsArray of num_entries_this_obj values of the var_index-th variable for the requested time step(s).

As an example, the following code segment writes all the nodal variables for a single time step:

int num_nod_vars, num_nodes, error, exoid, beg_time_step, end_time_step;
float *nodal_var_vals;
\comment{write nodal variables}
nodal_var_vals = (float *) calloc(num_nodes*num_steps, sizeof(float));
for (k=1; k <= num_nod_vars; k++) {
for (t=1, t < num_steps; t++) {
for (j=0; j < num_nodes; j++) {
\comment{application code fills in this array}
nodal_var_vals[j] = 10.0;
}
}
error = ex_put_var(exoid, EX_NODAL, 0, k, num_nodes,
1, 1+num_steps, nodal_var_vals);
}

◆ 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
exoidexodus file id
*var_typevariable type: G,N, or E
var_numvariable number name to write 1..num_var
*var_nameptr 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
exoidexodus file id
*var_typevariable type: G,N, or E
num_vars# of variables to read
*var_namesptr 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
exoidexodus file id
var_typevariable type G,N, or E
num_varsnumber 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
exoidexodus file id
*var_type'e', 'm', 's' element, nodeset, sideset
num_blknumber of blocks
num_varnumber of variables
*var_tabvariable 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 )
extern

writes the name of a particular results variable to the database

Parameters
exoidexodus file id
obj_typevariable type
var_numvariable number name to write 1..num_var
*var_nameptr of variable name
Examples
/test/CreateEdgeFace.c, /test/test_ts_nvar.c, /test/test_ts_partial_nvar.c, /test/testcp_tran.c, /test/testwt1.c, and /test/testwt_nossnsdf.c.

◆ ex_put_variable_names()

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

The function ex_put_variable_names() writes the names of the results variables to the database. The maximum length of the names returned is specified by the return value from ex_inquire_int()(exoid, EX_INQ_MAX_READ_NAME_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:
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of variable which is described. Use one of the options in the table below.
[in]num_varsThe number of var_type variables that will be written to the database.
[in]var_namesArray 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];
\comment{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);
Examples
/test/create_mesh.c, /test/rd_wt_mesh.c, /test/test_ts_files.c, /test/testwt-compress.c, /test/testwt-groups.c, /test/testwt-long-name.c, /test/testwt-nface-nside.c, /test/testwt-nsided.c, /test/testwt-oned.c, /test/testwt-partial.c, /test/testwt-results.c, /test/testwt-zeroe.c, /test/testwt-zeron.c, /test/testwt.c, /test/testwt1.c, /test/testwt2.c, /test/testwt_clb.c, /test/testwt_nc.c, /test/testwt_nossnsdf.c, /test/testwtd.c, /test/testwtm.c, and /test/twod.c.

◆ ex_put_variable_param()

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

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]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeVariable indicating the type of variable which is described. Use one of the ex_entity_type types specified in the table below.
[in]num_varsThe 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;
\comment{write results variables parameters}
num_glo_vars = 3;
error = ex_put_variable_param (exoid, EX_GLOBAL, num_glo_vars);
Examples
/test/CreateEdgeFace.c, /test/test_ts_files.c, /test/test_ts_nvar.c, /test/test_ts_partial_nvar.c, /test/testcp_tran.c, /test/testwt-compress.c, /test/testwt-groups.c, /test/testwt-long-name.c, /test/testwt-nface-nside.c, /test/testwt-nsided.c, /test/testwt-oned.c, /test/testwt-partial.c, /test/testwt-results.c, /test/testwt-zeroe.c, /test/testwt-zeron.c, /test/testwt.c, /test/testwt1.c, /test/testwt2.c, /test/testwt_nc.c, /test/testwt_nossnsdf.c, /test/testwtd.c, /test/testwtm.c, and /test/twod.c.

◆ exi_get_nodal_var_multi_time()

int exi_get_nodal_var_multi_time ( int exoid,
int nodal_var_index,
int64_t num_nodes,
int beg_time_step,
int end_time_step,
void * nodal_var_vals )
Note
This function is called internally by ex_get_var_multi_time() to handle the reading of nodal variable values.

The function exi_get_nodal_var_multi_time() reads the values of a single nodal variable for a one or more time steps. Memory must be allocated for the nodal variable values array before this function is invoked.

Because nodal 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().

Returns
In case of an error, exi_get_nodal_var_multi_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()
  • specified nodal variable does not exist.
  • a warning value is returned if no nodal variables are stored in the file.
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]nodal_var_indexThe index of the desired nodal variable. The first variable has an index of 1.
[in]num_nodesThe number of nodal points.
[in]beg_time_stepThe first time step to get values for.
[in]end_time_stepThe last time step to get values for.
[out]nodal_var_valsReturned array of num_nodes values of the nodal_var_index-th nodal variable for the desired timesteps.

For example, the following demonstrates how this function would be used:

int num_nodes, time_step, var_index;
float *var_values;
\comment{read the second nodal variable at the first time step}
time_step = 1;
var_index = 2;
var_values = (float *) calloc (num_nodes, sizeof(float));
error = exi_get_nodal_var_multi_time(exoid, var_index, num_nodes,
time_step, time_step, var_values);
int exi_get_nodal_var_multi_time(int exoid, int nodal_var_index, int64_t node_number, int beg_time_step, int end_time_step, void *nodal_var_vals)
Definition ex__get_nodal_var_multi_time.c:67

◆ exi_get_partial_nodal_var()

int exi_get_partial_nodal_var ( int exoid,
int time_step,
int nodal_var_index,
int64_t start_node,
int64_t num_nodes,
void * var_vals )
Note
This function is called internally by ex_get_partial_var() to handle the reading of nodal variable values.

◆ exi_put_nodal_var_time()

int exi_put_nodal_var_time ( int exoid,
int nodal_var_index,
int64_t num_nodes,
int beg_time_step,
int end_time_step,
const void * nodal_var_vals )
Note
This function is called internally by ex_put_var_time() to handle the writing of nodal variable values.

The function exi_put_nodal_var_time() writes the values of a single nodal variable for multiple time steps. The function ex_put_variable_param() must be invoked before this call is made.

Because nodal 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().

Returns
In case of an error, exi_put_nodal_var() returns a negative number; a warning will return a positive number. Possible causes of errors include:
Parameters
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]nodal_var_indexThe index of the nodal variable. The first variable has an index of 1.
[in]num_nodesThe number of nodal points.
[in]beg_time_stepThe beginning time step number, as described under ex_put_time(). This is counter that is incremented when results variables are output. The first time step is 1.
[in]end_time_stepThe ending time step number, as described under ex_put_time(). This is counter that is incremented when results variables are output. The first time step is 1.
[in]nodal_var_valsArray of num_nodes values of the nodal_var_index-th nodal variable for the time_step-th time step.

As an example, the following code segment writes all the nodal variables for a single time step:

int num_nod_vars, num_nodes, error, exoid, time_step;
float *nodal_var_vals;
\comment{write nodal variables}
nodal_var_vals = (float *) calloc(num_nodes, sizeof(float));
for (k=1; k <= num_nod_vars; k++) {
for (j=0; j < num_nodes; j++) {
\comment{application code fills in this array}
nodal_var_vals[j] = 10.0;
}
error = ex_put_var_time(exoid, EX_NODAL, k, 0, num_nodes, beg_time_step, end_time_step
nodal_var_vals);
}

◆ exi_put_partial_nodal_var()

int exi_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 )
Note
This function is called internally by ex_put_partial_var() to handle the reading of nodal variable values.

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
exoidexodus file id
time_stepwhole time step number
nodal_var_indexindex of desired nodal variable
start_nodeindex of first node to write data for (1-based)
num_nodesnumber of nodal points
nodal_var_valsarray of nodal variable values