#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
MPI_Comm mpi_comm = MPI_COMM_WORLD;
MPI_Info mpi_info = MPI_INFO_NULL;
int i, j, k;
int *ids;
int *num_nodes_per_set = NULL;
int *num_elem_per_set = NULL;
int *num_df_per_set = NULL;
int *node_ind = NULL;
int *elem_ind = NULL;
int *df_ind = NULL;
int num_qa_rec, num_info;
int num_glo_vars, num_nod_vars, num_ele_vars;
int num_nset_vars, num_sset_vars;
int *truth_tab;
int num_time_steps;
int *num_elem_in_block = NULL;
int *num_nodes_per_elem = NULL;
int *num_attr = NULL;
int num_nodes_in_set;
int num_sides_in_set, num_df_in_set;
int list_len, elem_list_len, node_list_len, df_list_len;
int var_index;
int num_props, prop_value;
int idum;
float time_value, *time_values, *var_values;
float *x, *y, *z;
float *attrib;
float version, fdum;
char *coord_names[3], *qa_record[2][4], *info[3], *var_names[3];
char *attrib_names[10];
char *cdum = NULL;
char *prop_names[3];
int CPU_word_size = 0;
int IO_word_size = 0;
MPI_Init(&argc, &argv);
int exoid = ex_open_par("test.exo",
&CPU_word_size,
&IO_word_size,
&version,
mpi_comm, mpi_info);
printf("\nafter ex_open\n");
if (exoid < 0)
exit(1);
printf("test.exo is an EXODUSII file; version %4.2f\n", version);
printf(" I/O word size %1d\n", IO_word_size);
printf("EXODUSII API; version %4.2f\n", version);
printf("EXODUSII Library API; version %4.2f (%d)\n", version, idum);
int num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets, num_side_sets;
int error =
ex_get_init(exoid, title, &num_dim, &num_nodes, &num_elem, &num_elem_blk,
&num_node_sets, &num_side_sets);
printf("after ex_get_init, error = %3d\n", error);
printf("database parameters:\n");
printf("title = '%s'\n", title);
printf("num_dim = %3d\n", num_dim);
printf("num_nodes = %3d\n", num_nodes);
printf("num_elem = %3d\n", num_elem);
printf("num_elem_blk = %3d\n", num_elem_blk);
printf("num_node_sets = %3d\n", num_node_sets);
printf("num_side_sets = %3d\n", num_side_sets);
printf(" after ex_inquire, error = %d\n", error);
if (strcmp(title, title_chk) != 0) {
printf("error in ex_inquire for EX_INQ_TITLE\n");
}
x = (float *)calloc(num_nodes, sizeof(float));
if (num_dim >= 2)
y = (float *)calloc(num_nodes, sizeof(float));
else
y = NULL;
if (num_dim >= 3)
z = (float *)calloc(num_nodes, sizeof(float));
else
z = NULL;
printf("\nafter ex_get_coord, error = %3d\n", error);
printf("x coords = \n");
for (i = 0; i < num_nodes; i++) {
printf("%5.1f\n", x[i]);
}
if (num_dim >= 2) {
printf("y coords = \n");
for (i = 0; i < num_nodes; i++) {
printf("%5.1f\n", y[i]);
}
}
if (num_dim >= 3) {
printf("z coords = \n");
for (i = 0; i < num_nodes; i++) {
printf("%5.1f\n", z[i]);
}
}
free(x);
if (num_dim >= 2)
free(y);
if (num_dim >= 3)
free(z);
for (i = 0; i < num_dim; i++) {
}
printf("\nafter ex_get_coord_names, error = %3d\n", error);
printf("x coord name = '%s'\n", coord_names[0]);
if (num_dim > 1)
printf("y coord name = '%s'\n", coord_names[1]);
if (num_dim > 2)
printf("z coord name = '%s'\n", coord_names[2]);
for (i = 0; i < num_dim; i++)
free(coord_names[i]);
{
int num_attrs = 0;
printf(" after ex_get_attr_param, error = %d\n", error);
printf("num nodal attributes = %d\n", num_attrs);
if (num_attrs > 0) {
for (j = 0; j < num_attrs; j++) {
}
printf(" after ex_get_attr_names, error = %d\n", error);
if (error == 0) {
attrib = (float *)calloc(num_nodes, sizeof(float));
for (j = 0; j < num_attrs; j++) {
printf("nodal attribute %d = '%s'\n", j, attrib_names[j]);
printf(" after ex_get_one_attr, error = %d\n", error);
for (i = 0; i < num_nodes; i++) {
printf("%5.1f\n", attrib[i]);
}
free(attrib_names[j]);
}
free(attrib);
}
}
}
int *elem_map = (int *)calloc(num_elem, sizeof(int));
printf("\nafter ex_get_id_map, error = %3d\n", error);
for (i = 0; i < num_elem; i++) {
printf("elem_map(%d) = %d \n", i, elem_map[i]);
}
free(elem_map);
if (num_elem_blk > 0) {
ids = (int *)calloc(num_elem_blk, sizeof(int));
num_elem_in_block = (int *)calloc(num_elem_blk, sizeof(int));
num_nodes_per_elem = (int *)calloc(num_elem_blk, sizeof(int));
num_attr = (int *)calloc(num_elem_blk, sizeof(int));
printf("\nafter ex_get_elem_blk_ids, error = %3d\n", error);
char *block_names[10];
for (i = 0; i < num_elem_blk; i++) {
printf("Block # %d is id %d\n", i, ids[i]);
}
printf("\nafter ex_get_names, error = %3d\n", error);
for (i = 0; i < num_elem_blk; i++) {
if (strcmp(name, block_names[i]) != 0) {
printf("error in ex_get_name for block id %d\n", ids[i]);
}
&(num_nodes_per_elem[i]), &(num_attr[i]));
printf("\nafter ex_get_elem_block, id = %d, error = %d\n", ids[i], error);
printf("element block id = %2d\n", ids[i]);
printf("element type = '%s'\n", elem_type);
printf("num_elem_in_block = %2d\n", num_elem_in_block[i]);
printf("num_nodes_per_elem = %2d\n", num_nodes_per_elem[i]);
printf("num_attr = %2d\n", num_attr[i]);
printf("name = '%s'\n", block_names[i]);
free(block_names[i]);
}
printf("\nafter ex_inquire, error = %d\n", error);
printf("\nThere are %2d properties for each element block\n", num_props);
for (i = 0; i < num_props; i++) {
}
printf("after ex_get_prop_names, error = %d\n", error);
for (i = 1; i < num_props; i++)
{
for (j = 0; j < num_elem_blk; j++) {
if (error == 0)
printf("element block %2d, property(%2d): '%s'= %5d\n", j + 1, i + 1, prop_names[i],
prop_value);
else
printf("after ex_get_prop, error = %d\n", error);
}
}
for (i = 0; i < num_props; i++)
free(prop_names[i]);
}
for (i = 0; i < num_elem_blk; i++) {
if (num_elem_in_block[i] > 0) {
int *connect = (int *)calloc((num_nodes_per_elem[i] * num_elem_in_block[i]), sizeof(int));
printf("\nafter ex_get_elem_conn, error = %d\n", error);
printf("connect array for elem block %2d\n", ids[i]);
for (j = 0; j < num_nodes_per_elem[i]; j++) {
printf("%3d\n", connect[j]);
}
free(connect);
}
}
for (i = 0; i < num_elem_blk; i++) {
if (num_elem_in_block[i] > 0) {
for (j = 0; j < num_attr[i]; j++)
attrib = (float *)calloc(num_attr[i] * num_elem_in_block[i], sizeof(float));
printf("\n after ex_get_elem_attr, error = %d\n", error);
if (error == 0) {
printf(" after ex_get_elem_attr_names, error = %d\n", error);
if (error == 0) {
printf("element block %d attribute '%s' = %6.4f\n", ids[i], attrib_names[0], *attrib);
}
}
free(attrib);
for (j = 0; j < num_attr[i]; j++)
free(attrib_names[j]);
}
}
if (num_elem_blk > 0) {
free(ids);
free(num_nodes_per_elem);
free(num_attr);
}
if (num_node_sets > 0) {
ids = (int *)calloc(num_node_sets, sizeof(int));
printf("\nafter ex_get_node_set_ids, error = %3d\n", error);
char *nset_names[10];
for (i = 0; i < num_node_sets; i++) {
}
printf("\nafter ex_get_names, error = %3d\n", error);
for (i = 0; i < num_node_sets; i++) {
if (strcmp(name, nset_names[i]) != 0) {
printf("error in ex_get_name for nodeset id %d\n", ids[i]);
}
printf("\nafter ex_get_node_set_param, error = %3d\n", error);
printf("\nnode set %2d parameters: \n", ids[i]);
printf("num_nodes = %2d\n", num_nodes_in_set);
printf("name = '%s'\n", nset_names[i]);
free(nset_names[i]);
int *node_list = (int *)calloc(num_nodes_in_set, sizeof(int));
float *dist_fact = (float *)calloc(num_nodes_in_set, sizeof(float));
printf("\nafter ex_get_node_set, error = %3d\n", error);
if (num_df_in_set > 0) {
printf("\nafter ex_get_node_set_dist_fact, error = %3d\n", error);
}
printf("\nnode list for node set %2d\n", ids[i]);
for (j = 0; j < num_nodes_in_set; j++) {
printf("%3d\n", node_list[j]);
}
if (num_df_in_set > 0) {
printf("dist factors for node set %2d\n", ids[i]);
for (j = 0; j < num_nodes_in_set; j++) {
printf("%5.2f\n", dist_fact[j]);
}
}
else
printf("no dist factors for node set %2d\n", ids[i]);
free(node_list);
free(dist_fact);
{
int num_attrs = 0;
printf(" after ex_get_attr_param, error = %d\n", error);
printf("num nodeset attributes for nodeset %d = %d\n", ids[i], num_attrs);
if (num_attrs > 0) {
for (j = 0; j < num_attrs; j++) {
}
printf(" after ex_get_attr_names, error = %d\n", error);
if (error == 0) {
attrib = (float *)calloc(num_nodes_in_set, sizeof(float));
for (j = 0; j < num_attrs; j++) {
printf("nodeset attribute %d = '%s'\n", j, attrib_names[j]);
printf(" after ex_get_one_attr, error = %d\n", error);
for (k = 0; k < num_nodes_in_set; k++) {
printf("%5.1f\n", attrib[k]);
}
free(attrib_names[j]);
}
free(attrib);
}
}
}
}
free(ids);
printf("\nafter ex_inquire, error = %d\n", error);
printf("\nThere are %2d properties for each node set\n", num_props);
for (i = 0; i < num_props; i++) {
}
int *prop_values = (int *)calloc(num_node_sets, sizeof(int));
printf("after ex_get_prop_names, error = %d\n", error);
for (i = 0; i < num_props; i++) {
if (error == 0)
for (j = 0; j < num_node_sets; j++)
printf("node set %2d, property(%2d): '%s'= %5d\n", j + 1, i + 1, prop_names[i],
prop_values[j]);
else
printf("after ex_get_prop_array, error = %d\n", error);
}
for (i = 0; i < num_props; i++)
free(prop_names[i]);
free(prop_values);
printf("\nafter ex_inquire, error = %3d\n", error);
ids = (int *)calloc(num_node_sets, sizeof(int));
num_nodes_per_set = (int *)calloc(num_node_sets, sizeof(int));
num_df_per_set = (int *)calloc(num_node_sets, sizeof(int));
node_ind = (int *)calloc(num_node_sets, sizeof(int));
df_ind = (int *)calloc(num_node_sets, sizeof(int));
printf("\nafter ex_inquire: EX_INQ_NS_NODE_LEN = %d, error = %3d\n", list_len, error);
node_list = (int *)calloc(list_len, sizeof(int));
printf("\nafter ex_inquire: EX_INQ_NS_DF_LEN = %d, error = %3d\n", list_len, error);
float *dist_fact = (float *)calloc(list_len, sizeof(float));
node_list, dist_fact);
printf("\nafter ex_get_concat_node_sets, error = %3d\n", error);
printf("\nconcatenated node set info\n");
printf("ids = \n");
for (i = 0; i < num_node_sets; i++)
printf("%3d\n", ids[i]);
printf("num_nodes_per_set = \n");
for (i = 0; i < num_node_sets; i++)
printf("%3d\n", num_nodes_per_set[i]);
printf("node_ind = \n");
for (i = 0; i < num_node_sets; i++)
printf("%3d\n", node_ind[i]);
printf("node_list = \n");
for (i = 0; i < list_len; i++)
printf("%3d\n", node_list[i]);
printf("dist_fact = \n");
for (i = 0; i < list_len; i++)
printf("%5.3f\n", dist_fact[i]);
free(ids);
free(df_ind);
free(node_ind);
free(num_df_per_set);
free(node_list);
free(dist_fact);
}
if (num_side_sets > 0) {
ids = (int *)calloc(num_side_sets, sizeof(int));
printf("\nafter ex_get_side_set_ids, error = %3d\n", error);
char *sset_names[10];
for (i = 0; i < num_side_sets; i++) {
}
printf("\nafter ex_get_names, error = %3d\n", error);
for (i = 0; i < num_side_sets; i++) {
if (strcmp(name, sset_names[i]) != 0) {
printf("error in ex_get_name for sideset id %d\n", ids[i]);
}
printf("\nafter ex_get_side_set_param, error = %3d\n", error);
printf("side set %2d parameters:\n", ids[i]);
printf("name = '%s'\n", sset_names[i]);
printf("num_sides = %3d\n", num_sides_in_set);
printf("num_dist_factors = %3d\n", num_df_in_set);
free(sset_names[i]);
int num_elem_in_set = num_sides_in_set;
int *elem_list = (int *)calloc(num_elem_in_set, sizeof(int));
int *side_list = (int *)calloc(num_sides_in_set, sizeof(int));
int *node_ctr_list = (int *)calloc(num_elem_in_set, sizeof(int));
node_list = (int *)calloc(num_elem_in_set * 21, sizeof(int));
float *dist_fact = (float *)calloc(num_df_in_set, sizeof(float));
printf("\nafter ex_get_side_set, error = %3d\n", error);
printf("\nafter ex_get_side_set_node_list, error = %3d\n", error);
if (num_df_in_set > 0) {
printf("\nafter ex_get_side_set_dist_fact, error = %3d\n", error);
}
printf("element list for side set %2d\n", ids[i]);
for (j = 0; j < num_elem_in_set; j++) {
printf("%3d\n", elem_list[j]);
}
printf("side list for side set %2d\n", ids[i]);
for (j = 0; j < num_sides_in_set; j++) {
printf("%3d\n", side_list[j]);
}
int node_ctr = 0;
printf("node list for side set %2d\n", ids[i]);
for (k = 0; k < num_elem_in_set; k++) {
for (j = 0; j < node_ctr_list[k]; j++) {
printf("%3d\n", node_list[node_ctr + j]);
}
node_ctr += node_ctr_list[k];
}
if (num_df_in_set > 0) {
printf("dist factors for side set %2d\n", ids[i]);
for (j = 0; j < num_df_in_set; j++) {
printf("%5.3f\n", dist_fact[j]);
}
}
else
printf("no dist factors for side set %2d\n", ids[i]);
free(elem_list);
free(side_list);
free(node_ctr_list);
free(node_list);
free(dist_fact);
}
printf("\nafter ex_inquire, error = %d\n", error);
printf("\nThere are %2d properties for each side set\n", num_props);
for (i = 0; i < num_props; i++) {
}
printf("after ex_get_prop_names, error = %d\n", error);
for (i = 0; i < num_props; i++) {
for (j = 0; j < num_side_sets; j++) {
if (error == 0)
printf("side set %2d, property(%2d): '%s'= %5d\n", j + 1, i + 1, prop_names[i],
prop_value);
else
printf("after ex_get_prop, error = %d\n", error);
}
}
for (i = 0; i < num_props; i++)
free(prop_names[i]);
free(ids);
printf("\nafter ex_inquire: EX_INQ_SIDE_SETS = %d, error = %d\n", num_side_sets, error);
if (num_side_sets > 0) {
printf("\nafter ex_inquire: EX_INQ_SS_ELEM_LEN = %d, error = %d\n", elem_list_len, error);
printf("\nafter ex_inquire: EX_INQ_SS_NODE_LEN = %d, error = %d\n", node_list_len, error);
printf("\nafter ex_inquire: EX_INQ_SS_DF_LEN = %d, error = %d\n", df_list_len, error);
ids = (int *)calloc(num_side_sets, sizeof(int));
num_elem_per_set = (int *)calloc(num_side_sets, sizeof(int));
num_df_per_set = (int *)calloc(num_side_sets, sizeof(int));
elem_ind = (int *)calloc(num_side_sets, sizeof(int));
df_ind = (int *)calloc(num_side_sets, sizeof(int));
int *elem_list = (int *)calloc(elem_list_len, sizeof(int));
int *side_list = (int *)calloc(elem_list_len, sizeof(int));
float *dist_fact = (float *)calloc(df_list_len, sizeof(float));
df_ind, elem_list, side_list, dist_fact);
printf("\nafter ex_get_concat_side_sets, error = %3d\n", error);
printf("concatenated side set info\n");
printf("ids = \n");
for (i = 0; i < num_side_sets; i++)
printf("%3d\n", ids[i]);
printf("num_elem_per_set = \n");
for (i = 0; i < num_side_sets; i++)
printf("%3d\n", num_elem_per_set[i]);
printf("num_dist_per_set = \n");
for (i = 0; i < num_side_sets; i++)
printf("%3d\n", num_df_per_set[i]);
printf("elem_ind = \n");
for (i = 0; i < num_side_sets; i++)
printf("%3d\n", elem_ind[i]);
printf("dist_ind = \n");
for (i = 0; i < num_side_sets; i++)
printf("%3d\n", df_ind[i]);
printf("elem_list = \n");
for (i = 0; i < elem_list_len; i++)
printf("%3d\n", elem_list[i]);
printf("side_list = \n");
for (i = 0; i < elem_list_len; i++)
printf("%3d\n", side_list[i]);
printf("dist_fact = \n");
for (i = 0; i < df_list_len; i++)
printf("%5.3f\n", dist_fact[i]);
free(ids);
free(num_df_per_set);
free(df_ind);
free(elem_ind);
free(elem_list);
free(side_list);
free(dist_fact);
}
}
for (i = 0; i < num_qa_rec; i++) {
for (j = 0; j < 4; j++) {
}
}
printf("\nafter ex_get_qa, error = %3d\n", error);
printf("QA records = \n");
for (i = 0; i < num_qa_rec; i++) {
for (j = 0; j < 4; j++) {
printf(" '%s'\n", qa_record[i][j]);
free(qa_record[i][j]);
}
}
printf("\nafter ex_inquire, error = %3d\n", error);
for (i = 0; i < num_info; i++) {
}
printf("\nafter ex_get_info, error = %3d\n", error);
printf("info records = \n");
for (i = 0; i < num_info; i++) {
printf(" '%s'\n", info[i]);
free(info[i]);
}
printf("\nafter ex_get_variable_param, error = %3d\n", error);
for (i = 0; i < num_glo_vars; i++) {
}
printf("\nafter ex_get_variable_names, error = %3d\n", error);
printf("There are %2d global variables; their names are :\n", num_glo_vars);
for (i = 0; i < num_glo_vars; i++) {
printf(" '%s'\n", var_names[i]);
free(var_names[i]);
}
num_nod_vars = 0;
if (num_nodes > 0) {
printf("\nafter ex_get_variable_param, error = %3d\n", error);
for (i = 0; i < num_nod_vars; i++) {
}
printf("\nafter ex_get_variable_names, error = %3d\n", error);
printf("There are %2d nodal variables; their names are :\n", num_nod_vars);
for (i = 0; i < num_nod_vars; i++) {
printf(" '%s'\n", var_names[i]);
free(var_names[i]);
}
}
num_ele_vars = 0;
if (num_elem > 0) {
printf("\nafter ex_get_variable_param, error = %3d\n", error);
for (i = 0; i < num_ele_vars; i++) {
}
printf("\nafter ex_get_variable_names, error = %3d\n", error);
printf("There are %2d element variables; their names are :\n", num_ele_vars);
for (i = 0; i < num_ele_vars; i++) {
printf(" '%s'\n", var_names[i]);
free(var_names[i]);
}
if (num_ele_vars > 0) {
truth_tab = (int *)calloc((num_elem_blk * num_ele_vars), sizeof(int));
printf("\nafter ex_get_elem_var_tab, error = %3d\n", error);
printf("This is the element variable truth table:\n");
k = 0;
for (i = 0; i < num_elem_blk * num_ele_vars; i++) {
printf("%2d\n", truth_tab[k++]);
}
free(truth_tab);
}
}
num_nset_vars = 0;
if (num_node_sets > 0) {
printf("\nafter ex_get_variable_param, error = %3d\n", error);
if (num_nset_vars > 0) {
for (i = 0; i < num_nset_vars; i++) {
}
printf("\nafter ex_get_variable_names, error = %3d\n", error);
printf("There are %2d nodeset variables; their names are :\n", num_nset_vars);
for (i = 0; i < num_nset_vars; i++) {
printf(" '%s'\n", var_names[i]);
free(var_names[i]);
}
if (num_nset_vars > 0) {
truth_tab = (int *)calloc((num_node_sets * num_nset_vars), sizeof(int));
printf("\nafter ex_get_nset_var_tab, error = %3d\n", error);
printf("This is the nodeset variable truth table:\n");
k = 0;
for (i = 0; i < num_node_sets * num_nset_vars; i++) {
printf("%2d\n", truth_tab[k++]);
}
free(truth_tab);
}
}
}
num_sset_vars = 0;
if (num_side_sets > 0) {
printf("\nafter ex_get_variable_param, error = %3d\n", error);
if (num_sset_vars > 0) {
for (i = 0; i < num_sset_vars; i++) {
}
printf("\nafter ex_get_variable_names, error = %3d\n", error);
printf("There are %2d sideset variables; their names are :\n", num_sset_vars);
for (i = 0; i < num_sset_vars; i++) {
printf(" '%s'\n", var_names[i]);
free(var_names[i]);
}
if (num_sset_vars > 0) {
truth_tab = (int *)calloc((num_side_sets * num_sset_vars), sizeof(int));
printf("\nafter ex_get_sset_var_tab, error = %3d\n", error);
printf("This is the sideset variable truth table:\n");
k = 0;
for (i = 0; i < num_side_sets * num_sset_vars; i++) {
printf("%2d\n", truth_tab[k++]);
}
free(truth_tab);
}
}
}
printf("\nafter ex_inquire, error = %3d\n", error);
printf("There are %2d time steps in the database.\n", num_time_steps);
int time_step = 3;
printf("\nafter ex_get_time, error = %3d\n", error);
printf("time value at time step %2d = %5.3f\n", time_step, time_value);
time_values = (float *)calloc(num_time_steps, sizeof(float));
printf("\nafter ex_get_all_times, error = %3d\n", error);
printf("time values at all time steps are:\n");
for (i = 0; i < num_time_steps; i++)
printf("%5.3f\n", time_values[i]);
free(time_values);
var_values = (float *)calloc(num_glo_vars, sizeof(float));
printf("\nafter ex_get_glob_vars, error = %3d\n", error);
printf("global variable values at time step %2d\n", time_step);
for (i = 0; i < num_glo_vars; i++)
printf("%5.3f\n", var_values[i]);
free(var_values);
var_index = 1;
int beg_time = 1;
int end_time = -1;
var_values = (float *)calloc(num_time_steps, sizeof(float));
printf("\nafter ex_get_glob_var_time, error = %3d\n", error);
printf("global variable %2d values through time:\n", var_index);
for (i = 0; i < num_time_steps; i++)
printf("%5.3f\n", var_values[i]);
free(var_values);
if (num_nodes > 0) {
var_values = (float *)calloc(num_nodes, sizeof(float));
printf("\nafter ex_get_nodal_var, error = %3d\n", error);
printf("nodal variable %2d values at time step %2d\n", var_index, time_step);
for (i = 0; i < num_nodes; i++)
printf("%5.3f\n", var_values[i]);
free(var_values);
var_values = (float *)calloc(num_time_steps, sizeof(float));
int node_num = 1;
printf("\nafter ex_get_nodal_var_time, error = %3d\n", error);
printf("nodal variable %2d values for node %2d through time:\n", var_index, node_num);
for (i = 0; i < num_time_steps; i++)
printf("%5.3f\n", var_values[i]);
free(var_values);
}
if (num_elem_blk > 0) {
ids = (int *)calloc(num_elem_blk, sizeof(int));
printf("\n after ex_get_elem_blk_ids, error = %3d\n", error);
for (i = 0; i < num_elem_blk; i++) {
if (num_elem_in_block[i] > 0) {
var_values = (float *)calloc(num_elem_in_block[i], sizeof(float));
var_values);
printf("\nafter ex_get_elem_var, error = %3d\n", error);
if (!error) {
printf("element variable %2d values of element block %2d at time step %2d\n", var_index,
ids[i], time_step);
for (j = 0; j < num_elem_in_block[i]; j++)
printf("%5.3f\n", var_values[j]);
}
free(var_values);
}
}
free(num_elem_in_block);
free(ids);
}
if (num_ele_vars > 0) {
var_values = (float *)calloc(num_time_steps, sizeof(float));
var_index = 2;
int elem_num = 2;
error =
printf("\nafter ex_get_elem_var_time, error = %3d\n", error);
printf("element variable %2d values for element %2d through time:\n", var_index, elem_num);
for (i = 0; i < num_time_steps; i++)
printf("%5.3f\n", var_values[i]);
free(var_values);
}
if (num_sset_vars > 0) {
ids = (int *)calloc(num_side_sets, sizeof(int));
printf("\n after ex_get_side_set_ids, error = %3d\n", error);
for (i = 0; i < num_side_sets; i++) {
var_values = (float *)calloc(num_elem_per_set[i], sizeof(float));
var_values);
printf("\nafter ex_get_sset_var, error = %3d\n", error);
if (!error) {
printf("sideset variable %2d values of sideset %2d at time step %2d\n", var_index, ids[i],
time_step);
for (j = 0; j < num_elem_per_set[i]; j++)
printf("%5.3f\n", var_values[j]);
}
free(var_values);
}
free(num_elem_per_set);
free(ids);
}
if (num_nset_vars > 0) {
ids = (int *)calloc(num_node_sets, sizeof(int));
printf("\n after ex_get_node_set_ids, error = %3d\n", error);
for (i = 0; i < num_node_sets; i++) {
var_values = (float *)calloc(num_nodes_per_set[i], sizeof(float));
var_values);
printf("\nafter ex_get_nset_var, error = %3d\n", error);
if (!error) {
printf("nodeset variable %2d values of nodeset %2d at time step %2d\n", var_index, ids[i],
time_step);
for (j = 0; j < num_nodes_per_set[i]; j++)
printf("%5.3f\n", var_values[j]);
}
free(var_values);
}
free(ids);
}
if (num_node_sets > 0)
free(num_nodes_per_set);
printf("\nafter ex_close, error = %3d\n", error);
MPI_Finalize();
return 0;
}
@ EX_SIDE_SET
Definition exodusII.h:278
@ EX_NODE_SET
Definition exodusII.h:270
@ EX_NODAL
Definition exodusII.h:268
@ EX_GLOBAL
Definition exodusII.h:285
@ EX_ELEM_MAP
Definition exodusII.h:280
@ EX_ELEM_BLOCK
Definition exodusII.h:275
SEACAS_DEPRECATED int ex_get_glob_var_time(int exoid, int glob_var_index, int beg_time_step, int end_time_step, void *glob_var_vals)
Definition ex_get_glob_var_time.c:76
@ EX_ABORT
Definition exodusII.h:392
@ EX_VERBOSE
Definition exodusII.h:390
SEACAS_DEPRECATED int ex_get_concat_side_sets(int exoid, void_int *side_set_ids, void_int *num_elem_per_set, void_int *num_dist_per_set, void_int *side_sets_elem_index, void_int *side_sets_dist_index, void_int *side_sets_elem_list, void_int *side_sets_side_list, void *side_sets_dist_fact)
Definition ex_get_concat_side_sets.c:41
SEACAS_DEPRECATED int ex_get_concat_node_sets(int exoid, void_int *node_set_ids, void_int *num_nodes_per_set, void_int *num_df_per_set, void_int *node_sets_node_index, void_int *node_sets_df_index, void_int *node_sets_node_list, void *node_sets_dist_fact)
Definition ex_get_concat_node_sets.c:103
@ EX_INQ_NS_NODE_LEN
Definition exodusII.h:153
@ EX_INQ_NODE_SETS
Definition exodusII.h:152
@ EX_INQ_TITLE
Definition exodusII.h:147
@ EX_INQ_INFO
Definition exodusII.h:158
@ EX_INQ_API_VERS
Definition exodusII.h:145
@ EX_INQ_LIB_VERS
Definition exodusII.h:165
@ EX_INQ_NS_PROP
Definition exodusII.h:161
@ EX_INQ_SS_DF_LEN
Definition exodusII.h:164
@ EX_INQ_SS_NODE_LEN
Definition exodusII.h:155
@ EX_INQ_QA
Definition exodusII.h:157
@ EX_INQ_SS_PROP
Definition exodusII.h:162
@ EX_INQ_SIDE_SETS
Definition exodusII.h:154
@ EX_INQ_SS_ELEM_LEN
Definition exodusII.h:156
@ EX_INQ_TIME
Definition exodusII.h:159
@ EX_INQ_EB_PROP
Definition exodusII.h:160
@ EX_INQ_NS_DF_LEN
Definition exodusII.h:163
#define EX_READ
Definition exodusII.h:98
int ex_get_coord_names(int exoid, char **coord_names)
Definition ex_get_coord_names.c:46
int ex_get_attr(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, void *attrib)
Definition ex_get_attr.c:33
int ex_get_coord(int exoid, void *x_coor, void *y_coor, void *z_coor)
Definition ex_get_coord.c:71
int ex_get_set(int exoid, ex_entity_type set_type, ex_entity_id set_id, void_int *set_entry_list, void_int *set_extra_list)
Definition ex_get_set.c:23
int ex_get_names(int exoid, ex_entity_type obj_type, char **names)
Definition ex_get_names.c:32
int ex_get_set_param(int exoid, ex_entity_type set_type, ex_entity_id set_id, void_int *num_entry_in_set, void_int *num_dist_fact_in_set)
Definition ex_get_set_param.c:36
int ex_get_prop_array(int exoid, ex_entity_type obj_type, const char *prop_name, void_int *values)
Definition ex_get_prop_array.c:87
int ex_get_side_set_node_list(int exoid, ex_entity_id side_set_id, void_int *side_set_node_cnt_list, void_int *side_set_node_list)
Definition ex_get_side_set_node_list.c:58
int ex_get_set_dist_fact(int exoid, ex_entity_type set_type, ex_entity_id set_id, void *set_dist_fact)
Definition ex_get_set_dist_fact.c:33
int ex_get_block(int exoid, ex_entity_type blk_type, ex_entity_id blk_id, char *elem_type, void_int *num_entries_this_blk, void_int *num_nodes_per_entry, void_int *num_edges_per_entry, void_int *num_faces_per_entry, void_int *num_attr_per_entry)
Definition ex_get_block.c:36
int ex_get_prop(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, const char *prop_name, void_int *value)
Definition ex_get_prop.c:55
int ex_get_init(int exoid, char *title, void_int *num_dim, void_int *num_nodes, void_int *num_elem, void_int *num_elem_blk, void_int *num_node_sets, void_int *num_side_sets)
Definition ex_get_init.c:75
int ex_get_ids(int exoid, ex_entity_type obj_type, void_int *ids)
Definition ex_get_ids.c:101
int ex_get_one_attr(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, int attrib_index, void *attrib)
Definition ex_get_one_attr.c:32
int ex_get_attr_names(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, char **names)
Definition ex_get_attr_names.c:33
int ex_get_name(int exoid, ex_entity_type obj_type, ex_entity_id entity_id, char *name)
Definition ex_get_name.c:33
int ex_get_attr_param(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, int *num_attrs)
Definition ex_get_attr_param.c:31
int ex_get_conn(int exoid, ex_entity_type blk_type, ex_entity_id blk_id, void_int *nodeconn, void_int *edgeconn, void_int *faceconn)
Definition ex_get_conn.c:29
int ex_get_id_map(int exoid, ex_entity_type map_type, void_int *map)
Definition ex_get_id_map.c:29
int ex_get_prop_names(int exoid, ex_entity_type obj_type, char **prop_names)
Definition ex_get_prop_names.c:78
int ex_get_time(int exoid, int time_step, void *time_value)
Definition ex_get_time.c:51
int ex_get_var_time(int exoid, ex_entity_type var_type, int var_index, ex_entity_id id, int beg_time_step, int end_time_step, void *var_vals)
Definition ex_get_var_time.c:44
int ex_get_var(int exoid, int time_step, ex_entity_type var_type, int var_index, ex_entity_id obj_id, int64_t num_entry_this_obj, void *var_vals)
Definition ex_get_var.c:68
int ex_get_all_times(int exoid, void *time_values)
Definition ex_get_all_times.c:55
int ex_get_truth_table(int exoid, ex_entity_type obj_type, int num_blk, int num_var, int *var_tab)
Definition ex_get_truth_table.c:37
int ex_get_variable_names(int exoid, ex_entity_type obj_type, int num_vars, char *var_names[])
Definition ex_get_variable_names.c:67
SEACAS_DEPRECATED int ex_get_glob_vars(int exoid, int time_step, int num_glob_vars, void *glob_var_vals)
Definition ex_get_glob_vars.c:78
int ex_get_variable_param(int exoid, ex_entity_type obj_type, int *num_vars)
Definition ex_get_variable_param.c:73
#define MAX_STR_LENGTH
Definition exodusII.h:409
#define MAX_LINE_LENGTH
Definition exodusII.h:415
int ex_get_info(int exoid, char **info)
Definition ex_get_info.c:48
int ex_opts(int options)
Definition ex_opts.c:56
int ex_inquire(int exoid, ex_inquiry req_info, void_int *ret_int, float *ret_float, char *ret_char)
Definition ex_inquire.c:1095
int ex_close(int exoid)
Definition ex_close.c:47
int ex_get_qa(int exoid, char *qa_record[][4])
Definition ex_get_qa.c:56