Debian Codegraph @

packages/seacas/libraries/exodus/src/deprecated/ex_get_elem_var_tab.c

raw
1 /*
2 * Copyright(C) 1999-2020 National Technology & Engineering Solutions
3 * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4 * NTESS, the U.S. Government retains certain rights in this software.
5 *
6 * See packages/seacas/LICENSE for details
7 */
8 /*****************************************************************************
9 *
10 * exgvtt - ex_get_elem_var_tab
11 *
12 * entry conditions -
13 * input parameters:
14 * int exoid exodus file id
15 * int num_elem_blk number of element blocks
16 * int num_elem_var number of element variables
17 *
18 * exit conditions -
19 * int* elem_var_tab element variable truth table array
20 *
21 * revision history -
22 *
23 *
24 *****************************************************************************/
25
26 #include "exodusII.h" // for ex_get_truth_table, etc
27
28 /*!
29 \deprecated Use ex_get_truth_table()(exoid, EX_ELEM_BLOCK, num_elem_blk,
30 num_elem_var, elem_var_tab)
31
32 The function ex_get_elem_var_tab() reads the exodus element variable
33 truth table from the database. For a description of the truth table,
34 see the usage of the function ex_put_elem_var_tab(). Memory must be
35 allocated for the truth table(num_elem_blk x num_elem_var in length)
36 before this function is invoked. If the truth table is not stored in
37 the file, it will be created based on information in the file and then
38 returned.
39
40 \return In case of an error, ex_get_elem_var_tab() returns a negative
41 number; a warning will return a positive number. Possible causes of
42 errors include:
43 - data file not properly opened with call to ex_create() or ex_open()
44 - data file not initialized properly with call to ex_put_init().
45 - the specified number of element blocks is different than the
46 number specified in a call to ex_put_init().
47 - there are no element variables stored in the file or the
48 specified number of element variables doesn't match the number
49 specified in a call to ex_put_variable_param().
50
51 \param[in] exoid exodus file ID returned from a previous call to
52 ex_create() or ex_open().
53 \param[in] num_elem_blk The number of element blocks.
54 \param[in] num_elem_var The number of element variables.
55 \param[out] elem_var_tab Size [num_elem_blk,num_elem_var].
56 Returned 2-dimensional array (with the
57 num_elem_var index cycling
58 faster) containing the element variable truth table.
59
60 As an example, the following coding will read the element
61 variable truth table from an opened exodus file :
62
63 ~~~{.c}
64 int *truth_tab, num_elem_blk, num_ele_vars, error, exoid;
65
66 truth_tab = (int *) calloc ((num_elem_blk*num_ele_vars),
67 sizeof(int));
68
69 error = ex_get_elem_var_tab (exoid, num_elem_blk, num_ele_vars,
70 truth_tab);
71 ~~~
72
73 */
74
75 int ex_get_elem_var_tab(int exoid, int num_elem_blk, int num_elem_var, int *elem_var_tab)
76 {
77 return ex_get_truth_table(exoid, EX_ELEM_BLOCK, num_elem_blk, num_elem_var, elem_var_tab);
78 }