GiD - The personal pre and post processor

Functions provided by GiD

Inside the GiD_PostImportFile function, following functions can be called to pass information to GiD:

extern "C" int GiD_NewPostProcess( void);

extern "C" int GiD_NewMesh( _t_gidMode gid_mode,		_t_gidMeshType mesh_type,	const char *name);

extern "C" int GiD_SetColor( int id, float red, float green, float blue, float alpha);

extern "C" int GiD_SetVertexPointer( int id,
_t_gidBasicType basic_type,
_t_gidVertexListType list_type,
int num_components,
int num_vertices,
unsigned int offset_next_element,const void *pointer);

extern "C" int GiD_SetElementPointer( int id,
_t_gidBasicType basic_type,
_t_gidElementListType list_type,
_t_gidElementType element_type,
int num_elements,
unsigned int offset_next_element,
const void *pointer,
unsigned int offset_float_data,
const void *float_ptr);

extern "C" int GiD_NewResult( const char *analysis_name, double step_value,
const char *result_name, int mesh_id);

extern "C" int GiD_SetResultPointer( int id,
_t_gidBasicType basic_type,
_t_gidResultListType list_type,
_t_gidResultType result_type,
_t_gidResultLocation result_location,
int num_results,
unsigned int offset_next_element,
const void *pointer);

extern "C" int GiD_EndResult( int id);

extern "C" int GiD_EndMesh( int id);

extern "C" Tcl_Interp *GiD_GetTclInterpreter();



Here is the description for each provided function:


GiD_NewPostProcess : starts a new post-process session, deleting all mesh and results information inside GiD.


GiD_NewMesh : a new mesh will be transferred to GiD and an identifier will be returned so that more information can be defined for this mesh. Following parameters must be specified:
_t_gidMode gid_mode : may be one of GID_PRE or GID_POST. At the moment only GID_POST is supported
_t_gidMeshType mesh_type : may be one of GIDPOST_NEW_MESH, GIDPOST_MERGE_MESH and GIDPOST_MULTIPLE_MESH. At the moment only GIDPOST_NEW_MESH has been tested
const char *name : name of the mesh which will appear in the Display Style window.


GiD_SetColor : to specify a color for the mesh identified by the given id. The red, green, blue and alpha components should be between 0.0 and 1.0.


GiD_SetVertexPointer : sets the vertices of the mesh identified by the given id. This vertices are the ones to be referred from the element's connectivity. Following parameters may be set:
_t_gidBasicType basic_type : data type of the coordinates of the vertices, should be one of GIDPOST_FLOAT or GIDPOST_DOUBLE;
_t_gidVertexListType list_type : herewith the format of the vertices is specified. Should be one of
GIDPOST_VERTICES: where all num_components coordinates are specified with no label and so they will be numerated between 0 and num_vertices-1
GIDPOST_IDX_VERTICES: where each set of num_components coordinates are preceded by a label indicating its node number (should be a 4-byte integer)
int num_components : number of coordinates per vertex
int num_vertices : number of vertices in the list
unsigned int offset_next_element : distance in bytes between the beginning of vertex i and the beginning of vertex i + 1. If 0 is entered then the vertices are all consecutive
const void *pointer : pointer to the list of vertices.


GiD_SetElementPointer : sets the elements of the mesh identified by the given id. The elements connectivity refers to the previous specified list of vertices. Note that for spheres and circles not only their connectivity should be specified but also their radius and eventually their normal. In this case two separate vectors should passed: one for the integer data and another one for the floating point data. Following parameters may be set:
_t_gidBasicType basic_type : data type of the extra data entered for sphere and circle elements, should be one of GIDPOST_FLOAT or GIDPOST_DOUBLE.
_t_gidElementListType list_type : herewith the format of the elements is specified. Should be one of GIDPOST_CONNECTIVITIES: where all the elements are specified without element number, thus being automatically numbered between 0 and num_elements-1
GIDPOST_IDX_CONNECTIVITIES: where each element is preceded by a label indicating its element number (should be a 4-byte integer)
_t_gidElementType element_type : type of element to be defined. May be one of GIDPOST_TRIANGLE, GIDPOST_QUADRILATERAL, GIDPOST_LINE, GIDPOST_TETRAHEDRON, GIDPOST_HEXAHEDRON, GIDPOST_POINT, GIDPOST_PRISM, GIDPOST_PYRAMID, GIDPOST_SPHERE, GIDPOST_CIRCLE.
int num_elements : number of elements in the list
unsigned int offset_next_element : distance in bytes between the beginning of element i and the beginning of element i+1. If 0 is entered then the elements are all consecutive
const void *pointer : pointer to the list of the elements connectivity (integer data)
unsigned int offset_float_data : distance in bytes between the beginning of float data of element i and the beginning of float data of element i+1. If 0 is entered then the element's float data are all consecutive.
const void *float_ptr : pointer to the list of the floating point data for the elements. For spheres only the radius should be specified, so just a single value, and for circles four values should be specified: its radius and the three components of the normal.


GiD_NewResult : a new result will be defined for GiD and an identifier will be returned so that more information can be defined for this result. Following parameters must be specified:
const char *analysis_name : analysis name of the result
double step_value : step value inside the analysis where the result should be defined
const char *result_name : result name
int mesh_id : mesh identifier where the result is defined. If 0 is entered the result will be defined for all meshes.


GiD_SetResultPointer : specifies the list with the result values for a given result's id. Following parameters may be set:
_t_gidBasicType basic_type : data type of the results, should be one of GIDPOST_FLOAT or GIDPOST_DOUBLE
_t_gidResultListType list_type : herewith the format of the results is specified. Should be one of GIDPOST_RESULTS: where all results are defined consecutively and will refer to the nodes / elements between 0 and num_results-1
GIDPOST_IDX_RESULTS: where each result is preceded by a label indicating its node /element number (should be a 4-byte integer)
_t_gidResultType result_type : type of result which will be defined. May be one of GIDPOST_SCALAR, GIDPOST_VECTOR_2 (vector result with 2 components), GIDPOST_VECTOR_3 (vector with 3 components), GIDPOST_VECTOR_4 (vector with 4 components, including signed modulus), GIDPOST_MATRIX_3 (matrix with 3 components Sxx, Syy and Sxy), GIDPOST_MATRIX_4 (Sxx, Syy, Sxy and Szz, GIDPOST_MATRIX_6 (Sxx, Syy, Sxy, Szz and Syz and Sxz), GIDPOST_EULER (with 3 euler angles), GIDPOST_COMPLEX_SCALAR (real and imaginary part), GIDPOST_COMPLEX_VECTOR_4 (2d complex vector: Vxr, Vxi, Vyr and Vyi), GIDPOST_COMPLEX_VECTOR_6 (3d complex vector: Vxr, Vxi, Vyr, Vyi, Vzr and Vzi) and GIDPOST_COMPLEX_VECTOR_9 (3d complex vector: Vxr, Vxi, Vyr, Vyi, Vzr, Vzi, |real part|, |imaginary part| and signed |vector|)
_t_gidResultLocation result_location : location of the result. May be one of GIDPOST_NODAL, GIDPOST_ELEMENTAL or GIDPOST_GAUSSIAN. At the moment GIDPOST_GAUSSIAN is not supported
int num_results : number of results in the list
unsigned int offset_next_element : distance in bytes between the beginning of result i and the beginning of result i+1. If 0 is entered then the results are all consecutive
const void *pointer : pointer to the list of results.


GiD_EndResult : indicates GiD that the definition of the result with the give id is finished. GiD will process the result.


GiD_EndMesh : indicates GiD that the definition of the mesh with the give id is finished. GiD will process the mesh.


GiD_GetTclInterpreter : returns a pointer to GiD's global interpreter so that the plug-in can open their windows or execute their Tcl scripts using the predefined Tcl procedures of GiD.


The developer should keep in mind that all the plug-in code is executed inside GiD's memory space and so, all the memory allocated inside the plug-in should also be freed inside the plug-in to avoid memory accumulation when the dynamic library is called repeatedly. This also includes the arrays passed to GiD, which can be deleted just after passing them to GiD.

COPYRIGHT © 2022 · GID · CIMNE