int GiD_fWriteResultBlock( GiD_FILE fd, GP_CONST char *result_name, GP_CONST char *analysis_name, double step_value, GiD_ResultType result_type, GiD_ResultLocation result_location, GP_CONST char *gauss_point_name, GP_CONST char *range_table_name, int num_component_names, GP_CONST char *list_component_names[], GP_CONST char *unit_name, int num_result_values, GP_CONST int *list_result_ids, // list_component_values === // num_component_values == 1 --> scalar_array // num_component_values == 2 --> VxVyVz_array // num_component_values == 6 --> SxxSyySxySzzSxzSyz_array // ... int num_component_values, GP_CONST double *list_component_values );
Description:
Write the results values array. This functions include GiD_fBeginResult()
and GiD_fEndResult()
.
If list_result_ids
is omitted, i.e. == NULL
, then result value's id’s are assumed to be 1..num_result_values
.
Parameters:
result_name, analysis_name, step_value, result_type, result_location, gauss_point_name, range_table_name, num_component_names, list_component_names[]
are the same as in GiD_fBeginResult (DEPRECATED) and https://gidsimulation.atlassian.net/wiki/spaces/GPT/pages/2500165910 . gauss_point_name, range_table_name, num_component_names, list_component_names
can be NULL, ““ or 0.
unit_name
is the name of the unit of the result, as in https://gidsimulation.atlassian.net/wiki/spaces/GPT/pages/2500165922 . it can be NULL, or ““
num_result_values
is the number of result values provided, i.e. number of scalars, or vectors, or tensors, etc.
list_result_ids
is the array of result id's and expected to be num_result_values
in size. It can be NULL.
num_component_values
is the number of components per result value, for instance 1 for scalar, 2, 3, or 4 for vector, etc… as described in GiD_fBeginResult (DEPRECATED) and https://gidsimulation.atlassian.net/wiki/spaces/GPT/pages/2500165910
list_component_values
is the array of consecutive result values, for instance v1v2v3v1v2v3...
for 3-component vector result, and expected to have num_result_values * num_component_values
doubles.
Example:
C/C++ as in testpost_fd.c
:
const int num_components = 3; // xyz vector const int offset_value = 3000; double *scalar = create_dummy_result_block( num_components, NUM_NODES, offset_value ); // returns a malloc'ed vector // GiD_fWriteResultBlock includes BeginResult()/BeginValues() and EndValues()/EndResult() int list_ids[ NUM_NODES ]; for ( int i = 0; i < NUM_NODES; i++ ) { list_ids[ i ] = G_nodes[ i ].id; } const char *unit_name = "m/s"; // just an example GiD_fWriteResultBlock( fdr, "VectorNodos", "Analysis", 1.0, GiD_Vector, GiD_OnNodes, NULL, NULL, 0, NULL, unit_name, NUM_NODES, list_ids, num_components, scalar ); free( scalar );