|
Exodus
7.10
|
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) |
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:
| int ex_get_glob_vars | ( | int | exoid, |
| int | time_step, | ||
| int | num_glob_vars, | ||
| void * | glob_var_vals | ||
| ) |
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:
| [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 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 | ||
| ) |
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
| 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 |
| 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_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
| 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
| 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 |
| 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
| [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 |
| 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:
| [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 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
| 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
| 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
| 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
| 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
| 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
| 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.
| [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 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.
| [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 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 | ||
| ) |
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
| 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 |
| 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 | ||
| ) |
| 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 |
| 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 | ||
| ) |
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
| 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 |
| 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
| 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 |
| 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
| 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 |
| 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()
| 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 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
| 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 |
| 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
| 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 |
| 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
| exoid | exodus file id |
| var_type | variable type G,N, or E |
| num_vars | number of variables in database |
| 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
| 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 |
| 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
| exoid | exodus file id |
| obj_type | variable type |
| var_num | variable number name to write 1..num_var |
| *var_name | ptr of variable name |
| 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.
| [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 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.
| [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: