| 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_get_set_param()(exoid, EX_NODE_SET, node_set_id, |
| 13 |
num_nodes_in_set, num_df_in_set) |
| 14 |
|
| 15 |
The function ex_get_node_set_param() reads the number of nodes which |
| 16 |
describe a single node set and the number of distribution factors for |
| 17 |
the node set. |
| 18 |
|
| 19 |
\return In case of an error, ex_get_node_set_param() returns a |
| 20 |
negative number; a warning will return a positive number. Possible |
| 21 |
causes of errors include: |
| 22 |
- data file not properly opened with call to ex_create() or ex_open() |
| 23 |
- a warning value is returned if no node sets are stored in the file. |
| 24 |
- incorrect node set ID. |
| 25 |
|
| 26 |
\param[in] exoid exodus file ID returned from a previous call to |
| 27 |
ex_create() or ex_open(). |
| 28 |
\param[in] node_set_id The node set ID. |
| 29 |
\param[out] num_nodes_in_set Returned number of nodes in the node set. |
| 30 |
\param[out] num_df_in_set Returned number of distribution factors in the node |
| 31 |
set. |
| 32 |
|
| 33 |
The following code segment will read a node set from an open exodus |
| 34 |
file : |
| 35 |
~~~{.c} |
| 36 |
int error, exoid, id, num_nodes_in_set, num_df_in_set, *node_list; |
| 37 |
float *dist_fact; |
| 38 |
|
| 39 |
\comment{read node set parameters} |
| 40 |
id = 100; |
| 41 |
|
| 42 |
error = ex_get_node_set_param(exoid, id, &num_nodes_in_set, |
| 43 |
&num_df_in_set); |
| 44 |
|
| 45 |
\comment{read node set node list} |
| 46 |
node_list = (int *) calloc(num_nodes_in_set, sizeof(int)); |
| 47 |
error = ex_get_node_set(exoid, id, node_list); |
| 48 |
|
| 49 |
\comment{read node set distribution factors} |
| 50 |
if (num_df_in_set > 0) { |
| 51 |
dist_fact = (float *) calloc(num_nodes_in_set, sizeof(float)); |
| 52 |
error = ex_get_node_set_dist_fact(exoid, id, dist_fact); |
| 53 |
} |
| 54 |
|
| 55 |
\comment{Same result using non-deprecated functions} |
| 56 |
error = ex_get_set_param(exoid, EX_NODE_SET, id, &num_nodes_in_set, |
| 57 |
&num_df_in_set); |
| 58 |
error = ex_get_set(exoid, EX_NODE_SET, id, node_list); |
| 59 |
if (num_df_in_set > 0) { |
| 60 |
error = ex_get_set_dist_fact(exoid, EX_NODE_SET, id, dist_fact); |
| 61 |
} |
| 62 |
|
| 63 |
~~~ |
| 64 |
|
| 65 |
*/ |
| 66 |
|
| 67 |
int ex_get_node_set_param(int exoid, ex_entity_id node_set_id, void_int *num_nodes_in_set, |
| 68 |
void_int *num_df_in_set) |
| 69 |
{ |
| 70 |
return ex_get_set_param(exoid, EX_NODE_SET, node_set_id, num_nodes_in_set, num_df_in_set); |
| 71 |
} |