Debian Codegraph @

packages/seacas/libraries/exodus/src/deprecated/ex_put_elem_num_map.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 #include "exodusII.h"
10
11 /*!
12 \deprecated Use ex_put_id_map()(exoid, EX_ELEM_MAP, elem_map)
13
14 The function ex_put_elem_num_map() writes out the optional element
15 number map to the database. See Section LocalElementIds for a description
16 of the element number map. The function ex_put_init() must be invoked
17 before this call is made.
18
19 \return In case of an error, ex_put_elem_num_map() returns a negative
20 number; a warning will return a positive number. Possible causes of
21 errors include:
22 - data file not properly opened with call to ex_create() or ex_open()
23 - data file opened for read only.
24 - data file not initialized properly with call to ex_put_init().
25 - an element number map already exists in the file.
26
27 \param[in] exoid exodus file ID returned from a previous call to ex_create()
28 or ex_open().
29 \param[in] elem_map The element number map.
30
31 The following code generates a default element number map and outputs
32 it to an open exodus file. This is a trivial case and included just
33 for illustration. Since this map is optional, it should be written out
34 only if it contains something other than the default map.
35
36 ~~~{.c}
37 int error, exoid;
38 int *elem_map = (int *)calloc(num_elem, sizeof(int));
39
40 for (i=1; i <= num_elem; i++)
41 elem_map[i-1] = i;
42
43 error = ex_put_elem_num_map(exoid, elem_map);
44
45 \comment{Equivalent using non-deprecated function}
46 error = ex_put_id_map(exoid, EX_ELEM_MAP, elem_map);
47 ~~~
48
49 */
50
51 int ex_put_elem_num_map(int exoid, const void_int *elem_map)
52 {
53 return ex_put_id_map(exoid, EX_ELEM_MAP, elem_map);
54 }