Exodus 7.22

Functions | Variables
ex_put_elem_var_tab.c File Reference
`#include "exodusII.h"`

## Functions
| for (i=0, k=0;i< num_elem_blk;i++)
*int | ex_put_elem_var_tab (int exoid, int num_elem_blk, int num_elem_var, int *elem_var_tab)

## Variables
| truth_tab = (int *)calloc((num_elem_blk*num_ele_vars), sizeof(int))
| error

## Function Documentation

## ◆ ex_put_elem_var_tab()

* int ex_put_elem_var_tab | ( | int | exoid,
|  | int | num_elem_blk,
|  | int | num_elem_var,
|  | int * | elem_var_tab
| ) |  |

## ◆ for()

for | ( | i | = `0` | ) |

## Variable Documentation

## ◆ error

error

Initial value:
= ex_put_elem_var_tab(exoid, num_elem_blk, num_ele_vars,
truth_tab)

Examples
  /test/test-empty.c, /test/test_nemesis.c, /test/test_ts_files.c, /test/test_ts_nvar.c, /test/test_ts_partial_nvar.c, /test/testcp.c, /test/testcp_nl.c, /test/testcp_tran.c, /test/testcpd.c, /test/testrd-groups.c, /test/testrd-long-name.c, /test/testrd-nfaced.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, /test/testrd_ss.c, /test/testrdd.c, /test/testrdwt.c, /test/testwt-compress.c, /test/testwt-groups.c, /test/testwt-long-name.c, /test/testwt-nface-nside.c, /test/testwt-nfaced.c, /test/testwt-nsided.c, /test/testwt-one-attrib.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/testwt_ss.c, /test/testwtd.c, /test/testwtm.c, and /test/twod.c.

## ◆ truth_tab

truth_tab = (int *)calloc((num_elem_blk*num_ele_vars), sizeof(int))

Deprecated:
  Use ex_put_truth_table()(exoid, EX_ELEM_BLOCK, num_elem_blk, num_elem_var, elem_var_tab)

The function ex_put_elem_var_tab() writes the exodus element variable truth table to the database. The element variable truth table indicates whether a particular element result is written for the elements in a particular element block. A 0 (zero) entry indicates that no results will be output for that element variable for that element block. A non-zero entry indicates that the appropriate results will be output.

Although writing the element variable truth table is optional, it is encouraged because it creates at one time all the necessary ~~~{.c}{NetCDF} variables in which to hold the exodus element variable values. This results in significant time savings.

The function ex_put_variable_param() must be called before this routine in order to define the number of element variables.

Returns
  In case of an error, ex_put_elem_var_tab() 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.
  - data file not initialized properly with call to ex_put_init().
  - the specified number of element blocks is different than the number specified in a call to ex_put_init().
  - ex_put_elem_block() not called previously to specify element block parameters.
  - ex_put_variable_param() not called previously to specify the number of element variables or was called but with a different number of element variables.
  - ex_put_elem_var() previously called.

Parameters

  [in] | exoid | exodus file ID returned from a previous call to ex_create() or ex_open().
  [in] | num_elem_blk | The number of element blocks.
  [in] | num_elem_var | The number of element variables.
  [in] | elem_var_tab | Size [num_elem_blk,num_elem_var]. A 2-dimensional array (with the num_elem_var index cycling faster) containing the element variable truth table.

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

~~~{.c} int *truth_tab, num_elem_blk, num_ele_vars, error, exoid;

/* write element variable truth table

Examples
  /test/ReadEdgeFace.c, /test/test_ts_files.c, /test/testrd-groups.c, /test/testrd-long-name.c, /test/testrd-nsided.c, /test/testrd.c, /test/testrd1.c, /test/testrd_nc.c, /test/testrd_par.c, /test/testrdd.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_clb.c, /test/testwt_nc.c, /test/testwtd.c, and /test/testwtm.c.

truth_tab
truth_tab
Definition: ex_put_elem_var_tab.c:108
ex__obj_stats::exoid
int exoid
Definition: exodusII_int.h:677
ex_put_elem_var_tab
*int ex_put_elem_var_tab(int exoid, int num_elem_blk, int num_elem_var, int *elem_var_tab)
Definition: ex_put_elem_var_tab.c:121