#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int num_elem_in_block, num_nodes_per_elem, num_attr;
int num_nodes_in_set;
int num_sides_in_set, num_df_in_set;
int CPU_word_size = 0;
int IO_word_size = 4;
float version;
&CPU_word_size,
&IO_word_size,
&version);
printf("after ex_open for test.exo\n");
printf(" cpu word size: %d io word size: %d\n", CPU_word_size, IO_word_size);
&CPU_word_size,
&IO_word_size);
printf("after ex_create for test2.exo, exoid = %d\n", exoid2);
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 = %d\n", error);
error =
ex_put_init(exoid2, title, num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets,
num_side_sets);
printf("after ex_put_init, error = %d\n", error);
float *x = (float *)calloc(num_nodes, sizeof(float));
float *y = (float *)calloc(num_nodes, sizeof(float));
float *z = (num_dim >= 3) ? (float *)calloc(num_nodes, sizeof(float)) : NULL;
printf("\nafter ex_get_coord, error = %3d\n", error);
printf("after ex_put_coord, error = %d\n", error);
free(x);
free(y);
if (num_dim >= 3) {
free(z);
}
char *coord_names[3];
for (int i = 0; i < num_dim; i++) {
}
printf("\nafter ex_get_coord_names, error = %3d\n", error);
printf("after ex_put_coord_names, error = %d\n", error);
for (int i = 0; i < num_dim; i++) {
free(coord_names[i]);
}
int *elem_map = (int *)calloc(num_elem, sizeof(int));
printf("\nafter ex_get_id_map, error = %3d\n", error);
printf("after ex_put_id_map, error = %d\n", error);
free(elem_map);
int *ids = (int *)calloc(num_elem_blk, sizeof(int));
printf("\nafter ex_get_elem_blk_ids, error = %3d\n", error);
float attrib[] = {3.14159};
for (int i = 0; i < num_elem_blk; i++) {
&num_nodes_per_elem, 0, 0, &num_attr);
printf("\nafter ex_get_elem_block, error = %d\n", error);
num_nodes_per_elem, 0, 0, num_attr);
printf("after ex_put_elem_block, error = %d\n", error);
int *connect = (int *)calloc((num_nodes_per_elem * num_elem_in_block), sizeof(int));
printf("\nafter ex_get_elem_conn, error = %d\n", error);
printf("after ex_put_elem_conn, error = %d\n", error);
printf("after ex_put_elem_attr, error = %d\n", error);
free(connect);
}
printf("\nafter ex_inquire, error = %d\n", error);
char *prop_names[3];
for (int i = 0; i < num_props; i++) {
}
printf("after ex_get_prop_names, error = %d\n", error);
printf("after ex_put_prop_names, error = %d\n", error);
for (int i = 0; i < num_props; i++) {
for (int j = 0; j < num_elem_blk; j++) {
int prop_value;
printf("after ex_get_prop, error = %d\n", error);
if (i > 0) {
printf("after ex_put_prop, error = %d\n", error);
}
}
}
for (int i = 0; i < num_props; i++) {
free(prop_names[i]);
}
free(ids);
ids = (int *)calloc(num_node_sets, sizeof(int));
printf("\nafter ex_get_node_set_ids, error = %3d\n", error);
for (int i = 0; i < num_node_sets; i++) {
printf("\nafter ex_get_node_set_param, error = %3d\n", error);
printf("after ex_put_node_set_param, error = %d\n", error);
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);
printf("after ex_put_node_set, error = %d\n", error);
if (num_df_in_set > 0) {
printf("\nafter ex_get_node_set_dist_fact, error = %3d\n", error);
printf("after ex_put_node_set, error = %d\n", error);
}
free(node_list);
free(dist_fact);
}
free(ids);
printf("\nafter ex_inquire, error = %d\n", error);
for (int 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);
printf("after ex_put_prop_names, error = %d\n", error);
for (int i = 0; i < num_props; i++) {
printf("after ex_get_prop_array, error = %d\n", error);
printf("after ex_put_prop_array, error = %d\n", error);
}
for (int i = 0; i < num_props; i++) {
free(prop_names[i]);
}
free(prop_values);
ids = (int *)calloc(num_side_sets, sizeof(int));
printf("\nafter ex_get_side_set_ids, error = %3d\n", error);
for (int i = 0; i < num_side_sets; i++) {
printf("\nafter ex_get_side_set_param, error = %3d\n", error);
printf("after ex_put_side_set_param, error = %d\n", error);
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));
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("after ex_put_side_set, error = %d\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("after ex_put_side_set_dist_fact, error = %d\n", error);
}
free(elem_list);
free(side_list);
free(node_ctr_list);
free(node_list);
free(dist_fact);
}
printf("\nafter ex_inquire, error = %d\n", error);
for (int i = 0; i < num_props; i++) {
}
printf("after ex_get_prop_names, error = %d\n", error);
for (int i = 0; i < num_props; i++) {
for (int j = 0; j < num_side_sets; j++) {
int prop_value;
printf("after ex_get_prop, error = %d\n", error);
if (i > 0) {
printf("after ex_put_prop, error = %d\n", error);
}
}
}
for (int i = 0; i < num_props; i++) {
free(prop_names[i]);
}
free(ids);
char *qa_record[2][4];
for (int i = 0; i < num_qa_rec; i++) {
for (int j = 0; j < 4; j++) {
}
}
printf("\nafter ex_get_qa, error = %3d\n", error);
error =
ex_put_qa(exoid2, num_qa_rec, qa_record);
printf("after ex_put_qa, error = %d\n", error);
for (int i = 0; i < num_qa_rec; i++) {
for (int j = 0; j < 4; j++) {
free(qa_record[i][j]);
}
}
printf("\nafter ex_inquire, error = %3d\n", error);
char *info[3];
for (int i = 0; i < num_info; i++) {
}
printf("\nafter ex_get_info, error = %3d\n", error);
printf("after ex_put_info, error = %d\n", error);
for (int i = 0; i < num_info; i++) {
free(info[i]);
}
printf("after ex_close, error = %d\n", error);
printf("after ex_close (2), error = %d\n", error);
return 0;
}
@ EX_SIDE_SET
Definition exodusII.h:278
@ EX_NODE_SET
Definition exodusII.h:270
@ EX_ELEM_MAP
Definition exodusII.h:280
@ EX_ELEM_BLOCK
Definition exodusII.h:275
@ EX_ABORT
Definition exodusII.h:392
@ EX_VERBOSE
Definition exodusII.h:390
@ EX_INQ_INFO
Definition exodusII.h:158
@ EX_INQ_NS_PROP
Definition exodusII.h:161
@ EX_INQ_QA
Definition exodusII.h:157
@ EX_INQ_SS_PROP
Definition exodusII.h:162
@ EX_INQ_EB_PROP
Definition exodusII.h:160
#define EX_READ
Definition exodusII.h:98
#define EX_CLOBBER
Definition exodusII.h:101
int ex_put_set_param(int exoid, ex_entity_type set_type, ex_entity_id set_id, int64_t num_entries_in_set, int64_t num_dist_fact_in_set)
Definition ex_put_set_param.c:39
int ex_get_coord_names(int exoid, char **coord_names)
Definition ex_get_coord_names.c:46
int ex_get_coord(int exoid, void *x_coor, void *y_coor, void *z_coor)
Definition ex_get_coord.c:71
int ex_put_conn(int exoid, ex_entity_type blk_type, ex_entity_id blk_id, const void_int *node_conn, const void_int *elem_edge_conn, const void_int *elem_face_conn)
Definition ex_put_conn.c:44
int ex_put_prop_names(int exoid, ex_entity_type obj_type, int num_props, char **prop_names)
Definition ex_put_prop_names.c:97
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_put_coord_names(int exoid, char *const coord_names[])
Definition ex_put_coord_names.c:46
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_put_coord(int exoid, const void *x_coor, const void *y_coor, const void *z_coor)
Definition ex_put_coord.c:87
int ex_put_prop(int exoid, ex_entity_type obj_type, ex_entity_id obj_id, const char *prop_name, ex_entity_id value)
Definition ex_put_prop.c:77
int ex_put_attr(int exoid, ex_entity_type blk_type, ex_entity_id blk_id, const void *attrib)
Definition ex_put_attr.c:37
int ex_put_prop_array(int exoid, ex_entity_type obj_type, const char *prop_name, const void_int *values)
Definition ex_put_prop_array.c:71
int ex_put_init(int exoid, const char *title, int64_t num_dim, int64_t num_nodes, int64_t num_elem, int64_t num_elem_blk, int64_t num_node_sets, int64_t num_side_sets)
Definition ex_put_init.c:53
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_put_block(int exoid, ex_entity_type blk_type, ex_entity_id blk_id, const char *entry_descrip, int64_t num_entries_this_blk, int64_t num_nodes_per_entry, int64_t num_edges_per_entry, int64_t num_faces_per_entry, int64_t num_attr_per_entry)
Definition ex_put_block.c:47
int ex_put_set_dist_fact(int exoid, ex_entity_type set_type, ex_entity_id set_id, const void *set_dist_fact)
Definition ex_put_set_dist_fact.c:37
int ex_put_set(int exoid, ex_entity_type set_type, ex_entity_id set_id, const void_int *set_entry_list, const void_int *set_extra_list)
Definition ex_put_set.c:41
int ex_put_id_map(int exoid, ex_entity_type map_type, const void_int *map)
Definition ex_put_id_map.c:37
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
#define MAX_STR_LENGTH
Definition exodusII.h:409
#define MAX_LINE_LENGTH
Definition exodusII.h:415
int64_t ex_inquire_int(int exoid, ex_inquiry req_info)
Definition ex_inquire.c:1029
#define ex_create(path, mode, comp_ws, io_ws)
Definition exodusII.h:591
int ex_put_qa(int exoid, int num_qa_records, char *qa_record[][4])
Definition ex_put_qa.c:63
int ex_get_info(int exoid, char **info)
Definition ex_get_info.c:48
int ex_opts(int options)
Definition ex_opts.c:56
#define ex_open(path, mode, comp_ws, io_ws, version)
Definition exodusII.h:597
int ex_put_info(int exoid, int num_info, char *const info[])
Definition ex_put_info.c:73
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