ExodusII  5.15
ex_get_prop_names.c File Reference
#include <string.h>
#include "exodusII.h"
#include "exodusII_int.h"

Functions

int ex_get_prop_names (int exoid, ex_entity_type obj_type, char **prop_names)

Function Documentation

int ex_get_prop_names ( int  exoid,
ex_entity_type  obj_type,
char **  prop_names 
)

The function ex_get_prop_names() returns names of integer properties stored for an element block, node set, or side set. The number of properties (needed to allocate space for the property names) can be obtained via a call to ex_inquire() or ex_inquire_int().

Returns:
In case of an error, ex_get_prop_names() 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()
  • invalid object type specified.
Parameters:
[in]exoidexodus file ID returned from a previous call to ex_create() or ex_open().
[in]obj_typeType of object; use one of the options in the table below.
[out]prop_namesReturned array containing num_props (obtained from call to ex_inquire() or ex_inquire_int()) names (of maximum length MAX_STR_LENGTH ) of properties to be stored. ID, a reserved property name, will be the first name in the array.
EX_NODE_SET Node Set entity type
EX_EDGE_BLOCK Edge Block entity type
EX_EDGE_SET Edge Set entity type
EX_FACE_BLOCK Face Block entity type
EX_FACE_SET Face Set entity type
EX_ELEM_BLOCK Element Block entity type
EX_ELEM_SET Element Set entity type
EX_SIDE_SET Side Set entity type
EX_ELEM_MAP Element Map entity type
EX_NODE_MAP Node Map entity type
EX_EDGE_MAP Edge Map entity type
EX_FACE_MAP Face Map entity type

As an example, the following code segment reads in properties assigned to node sets:

#include "exodusII.h";
int error, exoid, num_props, *prop_values;
char *prop_names[MAX_PROPS];

\comment{read node set properties}
num_props = ex_inquire_int(exoid, EX_INQ_NS_PROP);

for (i=0; i < num_props; i++) {
   prop_names[i] = (char *) malloc ((MAX_STR_LENGTH+1), sizeof(char));
   prop_values = (int *) malloc (num_node_sets, sizeof(int));
}

error = ex_get_prop_names(exoid,EX_NODE_SET,prop_names);

for (i=0; i < num_props; i++) {
   error = ex_get_prop_array(exoid, EX_NODE_SET, prop_names[i],
                             prop_values);
}
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines