#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char **argv)
{
int exoid, num_dim, num_nodes, num_elem, num_elem_blk;
int num_node_sets, num_side_sets,
error;
int i, j, k, m;
int num_glo_vars, num_nod_vars, num_ele_vars;
int whole_time_step, num_time_steps;
int CPU_word_size, IO_word_size;
float *glob_var_vals, *nodal_var_vals, *elem_var_vals;
float time_value;
char * var_names[3];
char * title = "This is a test";
CPU_word_size = 0;
IO_word_size = 4;
&CPU_word_size,
&IO_word_size);
printf("after ex_create for test.exo, exoid = %d\n", exoid);
printf(" cpu word size: %d io word size: %d\n", CPU_word_size, IO_word_size);
num_dim = 0;
num_nodes = 33;
num_elem = 7;
num_elem_blk = 7;
num_node_sets = 0;
num_side_sets = 0;
error =
ex_put_init(exoid, title, num_dim, num_nodes, num_elem, num_elem_blk, num_node_sets,
num_side_sets);
for (i = 0; i < 10; i++) {
}
num_glo_vars = 1;
var_names[0] = "glo_vars";
printf(
"after ex_put_variable_param, error = %d\n",
error);
exit(-1);
}
printf(
"after ex_put_variable_names, error = %d\n",
error);
exit(-1);
}
num_nod_vars = 2;
var_names[0] = "node_variable_a_very_long_name_0";
var_names[1] = "nod_var1";
printf(
"after ex_put_variable_param, error = %d\n",
error);
exit(-1);
}
printf(
"after ex_put_variable_names, error = %d\n",
error);
exit(-1);
}
num_ele_vars = 3;
var_names[0] = "this_variable_name_is_short";
var_names[1] = "this_variable_name_is_just_right";
var_names[2] = "this_variable_name_is_tooooo_long";
printf(
"after ex_put_variable_param, error = %d\n",
error);
exit(-1);
}
printf(
"after ex_put_variable_names, error = %d\n",
error);
exit(-1);
}
truth_tab = (
int *)calloc((num_elem_blk * num_ele_vars),
sizeof(int));
k = 0;
for (i = 0; i < num_elem_blk; i++) {
for (j = 0; j < num_ele_vars; j++) {
}
}
printf(
"after ex_put_elem_var_tab, error = %d\n",
error);
exit(-1);
}
whole_time_step = 1;
num_time_steps = 10;
glob_var_vals = (float *)calloc(num_glo_vars, CPU_word_size);
nodal_var_vals = (float *)calloc(num_nodes, CPU_word_size);
elem_var_vals = (float *)calloc(4, CPU_word_size);
for (i = 0; i < num_time_steps; i++) {
time_value = (float)(i + 1) / 100.0f;
printf(
"after ex_put_time, error = %d\n",
error);
exit(-1);
}
for (j = 0; j < num_glo_vars; j++) {
glob_var_vals[j] = (float)(j + 2) * time_value;
}
printf(
"after ex_put_glob_vars, error = %d\n",
error);
exit(-1);
}
for (k = 1; k <= num_nod_vars; k++) {
for (j = 0; j < num_nodes; j++) {
nodal_var_vals[j] = (float)k + ((float)(j + 1) * time_value);
}
printf(
"after ex_put_nodal_var, error = %d\n",
error);
exit(-1);
}
}
for (k = 1; k <= num_ele_vars; k++) {
for (j = 0; j < num_elem_blk; j++) {
elem_var_vals[m] = (float)(k + 1) + (float)(j + 2) + ((float)(m + 1) * time_value);
}
printf(
"after ex_put_elem_var, error = %d\n",
error);
exit(-1);
}
}
}
whole_time_step++;
printf(
"after ex_update, error = %d\n",
error);
exit(-1);
}
}
free(glob_var_vals);
free(nodal_var_vals);
free(elem_var_vals);
printf(
"after ex_close, error = %d\n",
error);
exit(-1);
}
return 0;
}