Debian Codegraph @

packages/seacas/libraries/exodus/src/deprecated/ex_get_nodal_var_time.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" // for ex_get_var_time, etc
10
11 /*!
12 \deprecated Use ex_get_var_time()(exoid, EX_NODAL, nodal_var_index,
13 node_number, beg_time_step, end_time_step, node_var_vals)
14 The function ex_get_nodal_var_time() reads the values of a nodal
15 variable for a single node through a specified number of time
16 steps. Memory must be allocated for the nodal variable values array
17 before this function is invoked.
18
19 Because nodal variables are floating point values, the application
20 code must declare the array passed to be the appropriate type
21 (float or ``double'') to match the compute word size passed in
22 ex_create() or ex_open().
23
24 \return In case of an error, ex_get_nodal_var_time() returns a
25 negative number; a warning will return a positive number. Possible
26 causes of errors include:
27 - specified nodal variable does not exist.
28 - a warning value is returned if no nodal variables are stored in the file.
29
30 \param[in] exoid exodus file ID returned from a previous call to
31 ex_create() or
32 ex_open().
33
34 \param[in] nodal_var_index The index of the desired nodal variable. The first
35 variable has an
36 index of 1.
37
38 \param[in] node_number The internal ID (see Section LocalNodeIds) of the
39 desired
40 node. The first node is 1.
41
42 \param[in] beg_time_step The beginning time step for which a nodal variable
43 value
44 is desired. This is not a time value but rather a
45 time step number,
46 as described under ex_put_time(). The first time
47 step is 1.
48
49 \param[in] end_time_step The last time step for which a nodal variable value
50 is desired. If
51 negative, the last time step in the database will
52 be used. The first
53 time step is 1.
54
55 \param[out] nodal_var_vals Returned array of(end_time_step {-}
56 beg_time_step +1) values
57 of the node_number-th node for the
58 nodal_var_index-th nodal
59 variable.
60
61 For example, the following code segment will read the values of the
62 first nodal variable for node number one for all time steps stored in
63 the data file:
64
65 ~~~{.c}
66 int num_time_steps, var_index, node_num, beg_time, end_time, error, exoid;
67 float *var_values;
68
69 \comment{determine how many time steps are stored}
70 num_time_steps = ex_inquire_int(exoid, EX_INQ_TIME);
71
72 \comment{read a nodal variable through time}
73 var_values = (float *) calloc (num_time_steps, sizeof(float));
74
75 var_index = 1; node_num = 1; beg_time = 1; end_time = -1;
76 error = ex_get_var_time(exoid, EX_NODAL, var_index, node_num, beg_time,
77 end_time, var_values);
78
79 ~~~
80 */
81
82 int ex_get_nodal_var_time(int exoid, int nodal_var_index, int64_t node_number, int beg_time_step,
83 int end_time_step, void *nodal_var_vals)
84 {
85 return ex_get_var_time(exoid, EX_NODAL, nodal_var_index, node_number, beg_time_step,
86 end_time_step, nodal_var_vals);
87 }