Storage of 3D arbitrary polyhedra elements in Exodus.
The 3D polyhedra elements are represented as elements with a variable number of faces in their connectivity. The faces can either be regular faces such as quadrilateral or triangles; or they can be topologically two-dimensional arbitrary polyhedra themselves.
An arbitrary polyhedra 3D element block will have an element type of "nfaced" or "NFACED".
The faces that are used in the connectivity of this block should be defined in one or more face blocks. If the faces are arbitrary polyhedra, then they will have a face type of "nsided" or "NSIDED".
An annotated example of defining an arbitrary polyhedral element block consisting of 3 elements is shown below.
The three elements have the following geometry:
- Element 1: 5 faces.
- Face 1: triangle with nodes 5, 6, 8
- Face 2: triangle with nodes 2, 1, 4
- Face 3: quadrilateral with nodes 6, 2, 4, 8
- Face 4: quadrilateral with nodes 8, 4, 1, 5
- Face 5: quadrilateral with nodes 1, 2, 6, 5
- Element 2: 5 faces.
- Face 6: triangle with nodes 5, 8, 7
- Face 7: triangle with nodes 1, 3, 4
- Face 8: quadrilateral with nodes 7, 8, 4, 3
- Face 9: quadrilateral with nodes 7, 3, 1, 5
- Face 4: quadrilateral with nodes 8, 4, 1, 5 (shared with element 1)
- Element 3: 7 faces.
- Face 8: quadrilateral with nodes 7, 8, 4, 3 (shared with element 2)
- Face 10: pentagonal with nodes 8, 4, 14, 10, 12
- Face 11: pentagonal with nodes 7, 11, 9, 13, 3
- Face 12: quadrilateral with nodes 7, 8, 12, 11
- Face 13: quadrilateral with nodes 11, 12, 10, 9
- Face 14: quadrilateral with nodes 9, 10, 14, 13
- Face 15: quadrilateral with nodes 12, 14, 4, 3
The Exodus model is created via the following calls:
- Output the initial information. Since the model contains faces and a face block, the "extended" version of the
ex_put_init_ext() call must be used:
- Coordinate output is normal...
- Define the face block.
block_name = "face_block_1";
num_face_in_block[0] = 15;
num_total_nodes_per_blk[0] = 58;
block_id = 10;
num_face_in_block[0],
num_total_nodes_per_blk[0],
0, 0, 0);
- Output the face connectivity for "face_block_1". The data for the face connectivity is listed above; a portion is shown below...
connect = (int *) calloc(num_total_nodes_per_blk[0], sizeof(int));
i = 0
connect[i++] = 5;
connect[i++] = 6;
connect[i++] = 8;
connect[i++] = 2;
connect[i++] = 1;
connect[i++] = 4;
connect[i++] = 6;
connect[i++] = 2;
connect[i++] = 4;
connect[i++] = 8;
connect[i++] = 8;
connect[i++] = 4;
connect[i++] = 1;
connect[i++] = 5;
connect[i++] = 1;
connect[i++] = 2;
connect[i++] = 6;
connect[i++] = 5;
connect[i++] = 5;
connect[i++] = 8;
connect[i++] = 7;
... and so on....
assert(i == num_total_nodes_per_blk[0]);
- Output the number of nodes per face count for "face_block_1":
j = 0;
nnpe[ 1] = 3;
nnpe[ 2] = 3;
nnpe[ 3] = 4;
nnpe[ 4] = 4;
nnpe[ 5] = 4;
nnpe[ 6] = 3;
nnpe[ 7] = 3;
nnpe[ 8] = 4;
nnpe[ 9] = 4;
nnpe[10] = 5;
nnpe[11] = 5;
nnpe[12] = 4;
nnpe[13] = 4;
nnpe[14] = 4;
nnpe[15] = 4;
The face block is now fully defined; now define the nfaced element block which uses these faces.
block_name = "nfaced_1";
num_elem_in_block = 3;
num_total_faces_per_blk = 5 + 5 + 7;
block_id = 10;
num_elem_in_block,
0,
0,
num_total_faces_per_blk,
0);
In the ex_put_block() function, the element type is "nfaced". The connectivity is defined in terms of the faces, so the node and edge arguments are passed zeros. The nodal connectivity can be defined, but it isn't required. The face connectivity argument for an nfaced block is the total number of faces in the connectivity for all elements in the nfaced block.
- Write the face connectivity:
connect = (int *) calloc(num_total_faces_per_blk, sizeof(int));
i = 0;
connect[i++] = 1;
connect[i++] = 2;
connect[i++] = 3;
connect[i++] = 4;
connect[i++] = 5;
connect[i++] = 4;
connect[i++] = 6;
connect[i++] = 7;
connect[i++] = 8;
connect[i++] = 9;
connect[i++] = 8;
connect[i++] = 10;
connect[i++] = 11;
connect[i++] = 12;
connect[i++] = 13;
connect[i++] = 14;
connect[i++] = 15;
assert(i == num_total_faces_per_blk);
- Output the number of faces per element count for "nfaced_1":
nnpe[1] = 5;
nnpe[2] = 5;
nnpe[3] = 7;
- That's all; the rest of the calls are the same as normal Exodus except:
- An example read/write usage is shown in the testwt-nfaced.c and testrd-nfaced files.
- These changes are in Exodus version v4.93 and later.
int64_t num_side_sets
Definition: exodusII.h:342
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:73
int64_t num_dim
Definition: exodusII.h:331
int ex_put_name(int exoid, ex_entity_type obj_type, ex_entity_id entity_id, const char *name)
Definition: ex_put_name.c:67
int64_t num_edge_maps
Definition: exodusII.h:345
int64_t num_face_maps
Definition: exodusII.h:346
int64_t num_elem
Definition: exodusII.h:337
int64_t num_face
Definition: exodusII.h:335
int exoid
Definition: exodusII_int.h:666
int64_t num_node_maps
Definition: exodusII.h:344
int64_t num_node_sets
Definition: exodusII.h:339
#define MAX_LINE_LENGTH
Definition: exodusII.h:306
int64_t num_elem_blk
Definition: exodusII.h:338
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:71
Definition: exodusII.h:259
int64_t num_elem_maps
Definition: exodusII.h:347
int64_t num_face_blk
Definition: exodusII.h:336
int64_t num_elem_sets
Definition: exodusII.h:343
int64_t num_nodes
Definition: exodusII.h:332
int ex_put_init_ext(int exoid, const ex_init_params *model)
Definition: ex_put_init_ext.c:237
int64_t num_edge_sets
Definition: exodusII.h:340
int64_t num_edge_blk
Definition: exodusII.h:334
char title[MAX_LINE_LENGTH+1]
Definition: exodusII.h:330
int ex_put_entity_count_per_polyhedra(int exoid, ex_entity_type blk_type, ex_entity_id blk_id, const int *entity_counts)
Definition: ex_put_entity_count_per_polyhedra.c:52
Definition: exodusII.h:261
int64_t num_face_sets
Definition: exodusII.h:341
int64_t num_edge
Definition: exodusII.h:333
char * ex_copy_string(char *dest, char const *source, size_t elements)
Definition: ex_utils.c:2174
Definition: exodusII.h:328