GiD - The personal pre and post processor
GiD_fWriteElementsBlock (array of connectivities)
int GiD_fWriteElementsBlock( GiD_FILE fd, int num_elements, GP_CONST int *connectivities );
int GiD_fWriteElementsIdBlock( GiD_FILE fd, int num_elements, GP_CONST int *list_ids, GP_CONST int *connectivities );
int GiD_fWriteElementsMatBlock( GiD_FILE fd, int num_elements, GP_CONST int *connectivities, GP_CONST int *lst_material_id );
int GiD_fWriteElementsIdMatBlock( GiD_FILE fd, int num_elements, GP_CONST int *list_ids, GP_CONST int *connectivities, GP_CONST int *lst_material_id );
Description:
Write the connectivities array of the elements of the current mesh. These functions include GiD_fBeginElements()
and GiD_fEndElements()
. All elements are of the same type EType
as described in GiD_fBeginMesh, GiD_fBeginMeshColor
If GiD_fWriteElementsBlock()
or GiD_fWriteElementsMatBlock()
are used, i.e. no list of element's id’s are provided, then the element's id’s are assumed to be 1..num_elements
.
If GiD_fWriteElementsBlock()
or GiD_fWriteElementsIdBlock()
are used, i.e. no list of element’s materials are provided, then the elements id's are assumed to be 0
.
Parameters:
list_ids
is the array of element’s id's and expected to be num_elements
in size.
list_material_id
is the array of element's material's and expected to be num_elements
in size.
connectivities
is the array consecutive element’s connectivities of the num_elements
, and it is expected to have num_elements * NNode
doubles. Being Nnode
the number of nodes per element as specified in GiD_fBeginMesh, GiD_fBeginMeshColor .
Example:
C/C++ as in testpost_fd.c
:
int ids[ NUM_ELEMS ];
int connectivities[ NUM_ELEMS * 3 ];
int mat_ids[ NUM_ELEMS ];
for ( int i = 0; i < NUM_ELEMS; i++ ) {
ids[ i ] = G_elems[ i ].id;
connectivities[ i * 3 + 0 ] = G_elems[ i ].n1;
connectivities[ i * 3 + 1 ] = G_elems[ i ].n2;
connectivities[ i * 3 + 2 ] = G_elems[ i ].n3;
mat_ids[ i ] = 2;
}
GiD_fWriteElementsIdMatBlock( fdm, NUM_ELEMS, ids, connectivities, mat_ids );
COPYRIGHT © 2022 · GID · CIMNE