#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#if 0
typedef int64_t INT;
#else
int mymode = 0;
typedef int INT;
#endif
#define EX_TEST_FILENAME "ExodusTestData.e"
int cf_ids[2] = {20, 13};
double pt_coords[9 * 2] = {1, 0, 0, 1, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0};
char tags[2] = {'r', 'c'};
double coordsX[] = {0., 0., 0., 0., 3., 3., 3., 3., -3., -3., -3., -3.};
double coordsY[] = {-1., 1., 1., -1., -3., 3., 3., -3., -3., 3., 3., -3.};
double coordsZ[] = {-1., -1., 1., 1., -3., -3., 3., 3., -3., -3., 3., 3.};
const char *coordsNames[] = {"X", "Y", "Z"};
INT conn1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 3, 4};
INT conn2[] = {1, 2, 3, 5};
INT conn3[] = {12, 11, 10, 9};
INT conn4[] = {1, 3, 5, 7, 9, 11};
INT conn5[] = {12, 8, 11, 7, 10, 6, 9, 5};
INT econn1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 17, 18, 19, 20};
INT fconn1[] = {4, 5, 7, 6, 3, 2, 8, 9, 11, 10, 1, 3};
INT ebconn1[] = {1, 2, 2, 3, 3, 4, 4, 1, 5, 6, 6, 7, 7, 8, 8, 5, 1, 5, 2, 6,
4, 8, 3, 7, 9, 10, 10, 11, 11, 12, 12, 9, 9, 1, 10, 2, 12, 4, 11, 3};
INT fbconn1[] = {12, 11, 10, 9, 5, 6, 7, 8};
INT fbconn2[] = {1, 2, 3, 4};
INT fbconn3[] = {1, 5, 6, 2, 3, 7, 8, 4, 2, 6, 7, 3, 4, 8, 5, 1,
9, 1, 2, 10, 11, 3, 4, 12, 10, 2, 3, 11, 12, 4, 1, 9};
INT nmap1[] = {12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1};
INT nmap2[] = {120, 110, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10};
INT edmap1[] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20};
INT famap1[] = {2, 1, 4, 3, 6, 5, 7, 8, 9, 10, 11};
INT emap1[] = {10, 20, 30, 44, 91, 92, 93, 94, 95, 96, 88, 87, 86, 85};
const char *eblk_names[] = {"Eli_WALLACH", "Angelo_NOVI", "A_Shell", "Some_Sphere_Elements",
"Reinforcement"};
const char *edblk_names[] = {"Aldo_GIUFFRE"};
const char *fablk_names[] = {"Livio_LORENZON", "Claudio_SCARCHILLI", "John_BARTHA"};
const char *nmap_names[] = {"Luigi_PISTILLI"};
const char *edmap_names[] = {"Antonio_CASALE"};
const char *famap_names[] = {"Sandro_SCARCHILLI"};
const char *emap_names[] = {"Benito_STEFANELLI"};
INT nset_nodes[] = {5, 6, 9};
INT eset_edges[] = {1, 2, 4, 15, 19, 20};
INT eset_orient[] = {+1, +1, +1, +1, +1, -1};
double eset_df[] = {2., 2., 0.5, 0.5, 1., 1.};
INT fset_faces[] = {3, 9};
INT fset_orient[] = {+1, -1};
INT sset_elems[] = {1, 1, 1, 2, 2};
INT sset_sides[] = {1, 3, 5, 2, 4};
INT sset1_elems[] = {4, 4, 4};
INT sset1_sides[] = {1, 3, 5};
INT elset_elems[] = {1, 2};
const char *elset_names[] = {"Clint_EASTWOOD", "Lee_VAN_CLEEF"};
const char *nset_names[] = {"Ennio_MORRICONE"};
const char *eset_names[] = {"Rada_RASSIMOV"};
const char *fset_names[] = {"Enzo_PETITO"};
const char *sset_names[] = {"Luciano_VINCENZONI",
"A_Very_Long_Name_That_Tests_Capability_for_Long_Names"};
const char *node_attr_names[] = {"Influence_Diameter"};
const char *edge_attr_names1[] = {"Sergio_LEONE"};
const char *face_attr_names1[] = {"GOOD"};
const char *face_attr_names2[] = {"BAD"};
const char *face_attr_names3[] = {"UGLY"};
const char *elem_attr_names1[] = {"SPAGHETTI", "WESTERN"};
const char *elem_attr_names3[] = {"Thickness"};
const char *elem_attr_names4[] = {"Radius", "Volume"};
const char *elem_attr_names5[] = {"Area", "I_1", "I_2", "J", "V_x", "V_y", "V_z"};
const char *elem_var_names[] = {"my_stress_xx_1",
"my_stress_yy_1",
"my_stress_zz_1",
"my_stress_xy_1",
"my_stress_yz_1",
"my_stress_zx_1",
"my_stress_xx_2",
"my_stress_yy_2",
"my_stress_zz_2",
"my_stress_xy_2",
"my_stress_yz_2",
"my_stress_zx_2",
"von_mises_which_is_calculated_the_standard_way_from_stress",
"tension"};
const char *nset_var_names[] = {"var_name.xx", "var_name.yy", "var_name.zz",
"var_name.xy", "var_name.yz", "var_name.zx"};
const char *sset_var_names[] = {"stressxx", "stressyy", "stresszz",
"stressxy", "stressyz", "stresszx"};
double edge_attr_values1[] = {1., 2., 3., 5., 7., 11., 13., 17., 19., 23.,
29., 31., 37., 41., 43., 47., 53., 59., 61., 67.};
double node_attr_values[] = {12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1.};
double face_attr_values1[] = {71., 73.};
double face_attr_values2[] = {79.};
double face_attr_values3[] = {83., 89., 97., 101., 103., 107., 109., 113.};
double elem_attr_values1[] = {127., 101., 137., 139.};
double elem_attr_values4[] = {.10, 0.0, .11, 0.0, .12, 0.0, .13, 0.0, .14, 0.0, .15, 0.0};
double elem_attr_values5[] = {
1.0, 10.0, 11.0, 12.0, 0.0, 0.0, 1.0, 1.1, 10.1, 11.1,
12.1, 1.0, 0.0, 0.0, 1.2, 10.2, 11.2, 12.2, 0.0, 1.0,
0.0, 1.3, 10.3, 11.3, 12.3, 1.0, 1.0, 1.0};
double vals_glo_var[2][3] = {{36., 37., 38.}, {42., 43., 44.}};
double vals_nod_var[2][12] = {{0.1, 0.8, 0.0, 0.4, 0.3, 0.9, 0.8, 0.5, 0.3, 0.7, 0.4, 0.6},
{0.7, 0.5, 0.3, 0.5, 0.2, 0.7, 0.9, 0.8, 0.0, 0.2, 0.3, 0.5}};
double vals_edge_var1eb1[2][20] = {
{20., 19., 18., 17., 16., 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2., 1.},
{21., 20., 19., 18., 17., 16., 15., 14., 13., 12., 11., 10., 9., 8., 7., 6., 5., 4., 3., 2.}};
double vals_edge_var2eb1[2][20] = {
{1., 1., 0., 0., 1., 1., 2., 0., 2., 0., 1., 1., 1., 1., 0., 0., 2., 2., 2., 2.},
{1., 1., 0., 0., 1., 1., 2., 0., 2., 0., 1., 1., 1., 1., 0., 0., 2., 2., 2., 2.}};
double vals_face_var1fb1[2][2] = {{0, 1}, {2, 0}};
double vals_face_var1fb3[2][8] = {{1, 0, 2, 0, 3, 0, 4, 0}, {0, 1, 0, 2, 0, 3, 0, 4}};
double vals_elem_var[2][2 * 6 * 2] = {
{8.0, 8.0, 8.1, 8.1, 8.2, 8.2, 8.3, 8.3, 8.4, 8.4, 8.5, 8.5,
18.0, 18.0, 18.1, 18.1, 18.2, 18.2, 18.3, 18.3, 18.4, 18.4, 18.5, 18.5},
{-7.0, -7.0, -7.1, -7.1, -7.2, -7.2, -7.3, -7.3, -7.4, -7.4, -7.5, -7.5,
-7.0, -17.0, -17.1, -17.1, -17.2, -17.2, -17.3, -17.3, -17.4, -17.4, -17.5, -17.5}};
double vals_elem_var1[2][1] = {{88.8}, {99.9}};
double vals_tension[2][4] = {{1000., 2000., 3000., 4000.}, {2000., 4000., 6000., 8000.}};
double vals_elem_var2[2][6 * 3] = {{1.01, 1.02, 1.03, 2.01, 2.02, 2.03, 3.01, 3.02, 3.03, 4.01,
4.02, 4.03, 5.01, 5.02, 5.03, 6.01, 6.02, 6.03},
{11.01, 11.02, 11.03, 12.01, 12.02, 12.03, 13.01, 13.02, 13.03,
14.01, 14.02, 14.03, 15.01, 15.02, 15.03, 16.01, 16.02, 16.03}};
double vals_nset_var[2][3 * 6] = {
{8.0, 8.1, 8.2, 7.0, 7.1, 7.2, 6.0, 6.1, 6.2, 5.0, 5.1, 5.2, 4.0, 4.1, 4.2, 3.0, 3.1, 3.2},
{-8.0, -8.1, -8.2, -7.0, -7.1, -7.2, -6.0, -6.1, -6.2, -5.0, -5.1, -5.2, -4.0, -4.1, -4.2, -3.0,
-3.1, -3.2},
};
double vals_sset_var[2][5 * 6] = {
{18.0, 18.1, 18.2, 18.3, 18.4, 17.0, 17.1, 17.2, 17.3, 17.4, 16.0, 16.1, 16.2, 16.3, 16.4,
15.0, 15.1, 15.2, 15.3, 15.4, 14.0, 14.1, 14.2, 14.3, 14.4, 13.0, 13.1, 13.2, 13.3, 13.4},
{-18.0, -18.1, -18.2, -18.3, -18.4, -17.0, -17.1, -17.2, -17.3, -17.4,
-16.0, -16.1, -16.2, -16.3, -16.4, -15.0, -15.1, -15.2, -15.3, -15.4,
-14.0, -14.1, -14.2, -14.3, -14.4, -13.0, -13.1, -13.2, -13.3, -13.4},
};
double vals_fset_var1fs1[2][2] = {{1., 3.}, {9., 27.}};
#define EXCHECK(funcall, errmsg) \
if ((funcall) < 0) { \
fprintf(stderr, errmsg); \
return 1; \
}
int ex_have_arg(int argc, char *argv[], const char *aname)
{
int i;
for (i = 0; i < argc; ++i)
if (!strcmp(argv[i], aname))
return 1;
return 0;
}
{
int exoid;
int appWordSize = 8;
int diskWordSize = 8;
int concatBlocks = ex_have_arg(argc, argv, "-pcab");
int concatSets = ex_have_arg(argc, argv, "-pcset");
int concatResult = ex_have_arg(argc, argv, "-pvpax");
double t;
int i;
"CreateEdgeFace Test",
3,
12,
20,
1,
11,
3,
14,
5,
1,
1,
1,
2,
2,
1,
1,
1,
1,
};
blockParams.
edge_blk_id = (
int *)malloc(1 *
sizeof(INT));
blockParams.
face_blk_id = (
int *)malloc(3 *
sizeof(INT));
blockParams.
elem_blk_id = (
int *)malloc(5 *
sizeof(INT));
blockParams.
edge_type = (
char **)malloc(1 *
sizeof(
char *));
blockParams.
face_type = (
char **)malloc(3 *
sizeof(
char *));
blockParams.
elem_type = (
char **)malloc(5 *
sizeof(
char *));
;
if (exoid <= 0) {
fprintf(stderr, "Unable to open \"%s\" for writing.\n", EX_TEST_FILENAME);
return 1;
}
"Unable to output coordinate frame.\n");
if (concatBlocks) {
}
else {
int blk;
"Unable to write edge block");
}
"Unable to write face block");
}
"Unable to write elem block");
}
}
"Unable to write coordinates.\n");
"Unable to write edge block connectivity.\n");
"Unable to write face block 1 connectivity.\n");
"Unable to write face block 2 connectivity.\n");
"Unable to write face block 3 connectivity.\n");
"Unable to write elem block 1 connectivity.\n");
"Unable to write elem block 2 connectivity.\n");
"Unable to write elem block 3 connectivity.\n");
"Unable to write elem block 4 connectivity.\n");
"Unable to write elem block 5 connectivity.\n");
"Unable to write edge block names.\n");
"Unable to write face block names.\n");
"Unable to write element block names.\n");
"Unable to write node map names.\n");
"Unable to write edge map names.\n");
"Unable to write face map names.\n");
"Unable to write element map names.\n");
(char **)edge_attr_names1),
"Unable to write edge block 1 attribute names.\n");
"Unable to write nodal attribute names.\n");
(char **)face_attr_names1),
"Unable to write face block 1 attribute names.\n");
(char **)face_attr_names2),
"Unable to write face block 1 attribute names.\n");
(char **)face_attr_names3),
"Unable to write face block 1 attribute names.\n");
(char **)elem_attr_names1),
"Unable to write elem block 1 attribute names.\n");
(char **)elem_attr_names3),
"Unable to write elem block 3 attribute names.\n");
(char **)elem_attr_names4),
"Unable to write elem block 4 attribute names.\n");
(char **)elem_attr_names5),
"Unable to write elem block 5 attribute names.\n");
"Unable to write edge block 1 attribute values.\n");
"Unable to write node attribute values.\n");
"Unable to write face block 1 attribute values.\n");
"Unable to write face block 1 attribute values.\n");
"Unable to write face block 1 attribute values.\n");
"Unable to write elem block 1 attribute values.\n");
"Unable to write elem block 3 attribute values.\n");
for (i = 0; i < 6; i++) {
elem_attr_values4[2 * i + 1] = 4.0 / 3.0 * 3.14 * elem_attr_values4[2 * i] *
elem_attr_values4[2 * i] * elem_attr_values4[2 * i];
}
"Unable to write elem block 3 attribute values.\n");
"Unable to write elem block 4 attribute values.\n");
"Unable to write node set names.\n");
"Unable to write edge set names.\n");
"Unable to write face set names.\n");
"Unable to write side set names.\n");
"Unable to write element set names.\n");
if (concatSets) {
setParams.
sets_ids = (
int *)malloc(2 *
sizeof(INT));
{
entry_list[0] = nset_nodes[0];
entry_list[1] = nset_nodes[1];
entry_list[2] = nset_nodes[2];
}
{
entry_list[0] = eset_edges[0];
entry_list[1] = eset_edges[1];
entry_list[2] = eset_edges[2];
entry_list[3] = eset_edges[3];
entry_list[4] = eset_edges[4];
entry_list[5] = eset_edges[5];
extra_list[0] = eset_orient[0];
extra_list[1] = eset_orient[1];
extra_list[2] = eset_orient[2];
extra_list[3] = eset_orient[3];
extra_list[4] = eset_orient[4];
extra_list[5] = eset_orient[5];
}
memcpy(setParams.
sets_dist_fact, eset_df,
sizeof(eset_df) /
sizeof(eset_df[0]));
{
entry_list[0] = fset_faces[0];
entry_list[1] = fset_faces[1];
extra_list[0] = fset_orient[0];
extra_list[1] = fset_orient[1];
}
memcpy(setParams.
sets_entry_list, sset_elems,
sizeof(sset_elems) /
sizeof(sset_elems[0]));
memcpy(setParams.
sets_extra_list, sset_sides,
sizeof(sset_sides) /
sizeof(sset_sides[0]));
memcpy(setParams.
sets_entry_list, elset_elems,
sizeof(elset_elems) /
sizeof(elset_elems[0]));
}
else {
"Unable to write edge set.\n");
"Unable to write edge set dist factors.\n");
"Unable to write face set.\n");
"Unable to write side set.\n");
"Unable to write side set.\n");
"Unable to write element set 1 params.\n");
"Unable to write element set 1.\n");
"Unable to write element set 2 params.\n");
"Unable to write element set 2.\n");
}
if (concatResult) {
"Unable to write result variable parameter information.\n");
}
else {
"Unable to write global result variable parameters.\n");
"Unable to write nodal result variable parameters.\n");
"Unable to write element result variable parameters.\n");
"Unable to write edge result variable parameters.\n");
"Unable to write face result variable parameters.\n");
"Unable to write faceset result variable parameters.\n");
"Unable to write sideset result variable parameters.\n");
"Unable to write nodeset result variable parameters.\n");
}
"Unable to write variable name.\n");
"Unable to write variable name.\n");
"Unable to write variable name.\n");
"Unable to write variable name.\n");
"Unable to write variable name.\n");
"Unable to write variable name.\n");
"Unable to write variable name.\n");
"Unable to write variable name.\n");
t = 1.;
"Unable to write global var 1.\n");
"Unable to write edge block 1 var 1.\n");
"Unable to write edge block 1 var 2.\n");
"Unable to write face block 1 var 1.\n");
"Unable to write face block 3 var 1.\n");
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
for (i = 0; i < 6; i++) {
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
}
"Unable to write face set 1 var 1.\n");
t = 2.;
"Unable to write global var 1.\n");
"Unable to write edge block 1 var 1.\n");
"Unable to write edge block 1 var 2.\n");
"Unable to write face block 1 var 1.\n");
"Unable to write face block 3 var 1.\n");
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
for (i = 0; i < 6; i++) {
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
"Unable to write elem block 1 var 1.\n");
}
"Unable to write face set 1 var 1.\n");
return 0;
}
#if !defined(USING_CMAKE)
#endif