Skip to main content

Post-processing tools 2024 R1

dynamic_visualization_store_api

Last update: 16.07.2025
Go to the documentation of this file.
1/* *************************************************************
2 * Copyright 2017-2023 ANSYS, Inc.
3 * All Rights Reserved.
4 *
5 * Restricted Rights Legend
6 *
7 * Use, duplication, or disclosure of this
8 * software and its documentation by the
9 * Government is subject to restrictions as
10 * set forth in subdivision [(b)(3)(ii)] of
11 * the Rights in Technical Data and Computer
12 * Software clause at 52.227-7013.
13 * *************************************************************
14 */
15
16#ifndef _DYNAMIC_VISUALIZATION_STORE_API_
17#define _DYNAMIC_VISUALIZATION_STORE_API_
18
60#include <stdint.h>
64
65#include "include/dvs_import_export.h"
66
67#ifdef __cplusplus
68extern "C"
69{
70#endif /* __cplusplus */
71
77{
78 uint32_t _id;
79 char* _name;
80 uint8_t _structured;
81 uint8_t _chunking;
85};
86
92{
93 uint32_t _id;
94 char* _name;
97 char* _unit;
102};
103
109{
110 uint32_t _id;
111 char* _name;
119};
120
133DVS_DLL_EXPORT dvs_ret dvs_connect(int32_t server_id, enum dvs_client_flags flags, const char* secret, int32_t* session_id);
134
135// Function definition for logging of client messages
136// First param is for user defined data
137
143typedef void (*dvs_log_func)(void*, const char*);
144
156DVS_DLL_EXPORT dvs_ret dvs_register_log_func(int32_t session_id, void* user_data, dvs_log_func func, enum dvs_log_flags flags);
157
169DVS_DLL_EXPORT const char* dvs_get_version();
170
182DVS_DLL_EXPORT dvs_ret dvs_begin_init(int32_t session_id, const char* dataset_name, uint32_t current_rank, uint32_t total_ranks, uint32_t num_chunks);
183
193DVS_DLL_EXPORT dvs_ret dvs_set_unit_system(int32_t session_id, const char* system);
194
213DVS_DLL_EXPORT dvs_ret dvs_add_metadata(int32_t session_id, const char* const metadata_keys[], const char* const metadata_vals[], uint32_t num_metadata_pairs);
214
225DVS_DLL_EXPORT dvs_ret dvs_add_part_info(int32_t session_id, const struct dvs_part_info* parts, uint32_t num_parts);
226
237DVS_DLL_EXPORT dvs_ret dvs_add_var_info(int32_t session_id, const struct dvs_var_info* vars, uint32_t num_vars);
238
249DVS_DLL_EXPORT dvs_ret dvs_add_plot_info(int32_t session_id, const struct dvs_plot_info* plots, uint32_t num_plots);
250
259DVS_DLL_EXPORT uint32_t dvs_get_num_part_info(int32_t session_id);
260
269DVS_DLL_EXPORT uint32_t dvs_get_num_var_info(int32_t session_id);
270
271
280DVS_DLL_EXPORT uint32_t dvs_get_num_plot_info(int32_t session_id);
281
291DVS_DLL_EXPORT const struct dvs_part_info* dvs_get_part_info(int32_t session_id, uint32_t index);
292
308DVS_DLL_EXPORT dvs_ret dvs_get_part_id(int32_t session_id, const char* name, uint32_t* id);
309
319DVS_DLL_EXPORT const struct dvs_var_info* dvs_get_var_info(int32_t session_id, uint32_t index);
320
336DVS_DLL_EXPORT dvs_ret dvs_get_var_id(int32_t session_id, const char* name, uint32_t* id);
337
347DVS_DLL_EXPORT const struct dvs_plot_info* dvs_get_plot_info(int32_t session_id, uint32_t index);
348
364DVS_DLL_EXPORT dvs_ret dvs_get_plot_id(int32_t session_id, const char* name, uint32_t* id);
365
374DVS_DLL_EXPORT dvs_ret dvs_end_init(int32_t session_id);
375
386DVS_DLL_EXPORT dvs_ret dvs_begin_update(int32_t session_id, uint32_t update_num, uint32_t rank, uint32_t chunk, float time);
387
402DVS_DLL_EXPORT dvs_ret dvs_update_copy_previous_part(int32_t session_id, uint32_t part_id, const char* options);
403
415DVS_DLL_EXPORT dvs_ret dvs_update_nodes(int32_t session_id, uint32_t part_id, const float* x, const float* y, const float* z, uint32_t num_values);
416
459(
460 int32_t session_id,
461 uint32_t part_id,
462 const uint32_t global_ijk_max[3],
463 const uint32_t local_ijk_min[3],
464 const uint32_t local_ijk_max[3],
465 const float origin[3],
466 const float dir_i[3],
467 const float dir_j[3],
468 const float dir_k[3],
469 const float* i_vals,
470 const float* j_vals,
471 const float* k_vals
472);
473
504(
505 int32_t session_id,
506 uint32_t part_id,
507 const uint32_t global_ijk_max[3],
508 const uint32_t local_ijk_min[3],
509 const uint32_t local_ijk_max[3],
510 const float* x_vals,
511 const float* y_vals,
512 const float* z_vals
513);
514
529DVS_DLL_EXPORT dvs_ret dvs_update_elements(int32_t session_id, uint32_t part_id, enum dvs_element_type type, const uint32_t* indices, uint32_t num_indices);
530
550(
551 int32_t session_id,
552 uint32_t part_id,
553 enum dvs_element_type type,
554 const uint32_t* nodes_per_polygon,
555 uint32_t nodes_per_polygon_size,
556 const uint32_t* indices,
557 uint32_t indices_size
558);
559
575(
576 int32_t session_id,
577 uint32_t part_id,
578 enum dvs_element_type type,
579 const uint32_t* faces_per_element,
580 uint32_t faces_per_element_size,
581 const uint32_t* nodes_per_face,
582 uint32_t nodes_per_face_size,
583 const uint32_t* indices,
584 uint32_t indices_size
585);
586
595DVS_DLL_EXPORT dvs_ret dvs_update_var_case_scalar(int32_t session_id, uint32_t var_id, float scalar);
596
606DVS_DLL_EXPORT dvs_ret dvs_update_var_part_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, float scalar);
607
616DVS_DLL_EXPORT dvs_ret dvs_update_var_case_vector(int32_t session_id, uint32_t var_id, const float* vec);
617
627DVS_DLL_EXPORT dvs_ret dvs_update_var_part_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, const float* vec);
628
640DVS_DLL_EXPORT dvs_ret dvs_update_var_element_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const float* scalars, uint32_t num_vals);
641
653DVS_DLL_EXPORT dvs_ret dvs_update_var_element_scalar_int64(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const int64_t* scalars, uint32_t num_vals);
654
665DVS_DLL_EXPORT dvs_ret dvs_update_var_node_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, const float* scalars, uint32_t num_vals);
666
677DVS_DLL_EXPORT dvs_ret dvs_update_var_node_scalar_int64(int32_t session_id, uint32_t var_id, uint32_t part_id, const int64_t* scalars, uint32_t num_vals);
678
693DVS_DLL_EXPORT dvs_ret dvs_update_var_element_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const float* values, uint32_t num_values);
694
708DVS_DLL_EXPORT dvs_ret dvs_update_var_node_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, const float* values, uint32_t num_values);
709
722DVS_DLL_EXPORT dvs_ret dvs_update_plot(int32_t session_id, uint32_t plot_id, const float* x_values, const float* y_values, uint32_t num_values);
723
730DVS_DLL_EXPORT dvs_ret dvs_end_update(int32_t session_id);
731
753DVS_DLL_EXPORT dvs_ret dvs_delete_item(int32_t session_id, uint32_t update_num, uint32_t rank, const char* filter);
754
760DVS_DLL_EXPORT dvs_ret dvs_print_stats(int32_t session_id);
761
768DVS_DLL_EXPORT dvs_ret dvs_session_shutdown(int32_t session_id);
769
777DVS_DLL_EXPORT void dvs_session_shutdown_all();
778
783DVS_DLL_EXPORT void dvs_shutdown();
784
792DVS_DLL_EXPORT dvs_ret dvs_server_create(const char* server_uri, int32_t* server_id);
793
806DVS_DLL_EXPORT dvs_ret dvs_server_set_option(int32_t server_id, const char* key, const char* value);
807
821DVS_DLL_EXPORT dvs_ret dvs_server_start(int32_t server_id, uint32_t server_number, uint32_t local_ranks);
822
830DVS_DLL_EXPORT dvs_ret dvs_server_started(int32_t server_id, uint32_t* running);
831
840 DVS_DLL_EXPORT dvs_ret dvs_server_timestep_count(int32_t server_id, uint32_t* num_pending, uint32_t* num_complete);
841
848DVS_DLL_EXPORT dvs_ret dvs_server_shutdown(int32_t server_id);
849
854DVS_DLL_EXPORT void dvs_server_shutdown_all();
855
874DVS_DLL_EXPORT dvs_ret dvs_server_get_uri(int32_t server_id, char* uri, uint32_t* size);
875
876#ifdef __cplusplus
877} /* End of extern "C" */
878#endif /* __cplusplus */
879
880#endif //_DYNAMIC_VISUALIZATION_STORE_API_
DVS_DLL_EXPORT dvs_ret dvs_update_var_element_scalar_int64(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const int64_t *scalars, uint32_t num_vals)
Update a field of int64 scalars on elements.
DVS_DLL_EXPORT dvs_ret dvs_update_elements(int32_t session_id, uint32_t part_id, enum dvs_element_type type, const uint32_t *indices, uint32_t num_indices)
Update elements for a specific part and element type.
DVS_DLL_EXPORT dvs_ret dvs_server_create(const char *server_uri, int32_t *server_id)
Create a Dynamic Visualization Store server instance for the client to connect.
DVS_DLL_EXPORT dvs_ret dvs_update_var_part_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, const float *vec)
Update value of part scalar.
DVS_DLL_EXPORT dvs_ret dvs_add_var_info(int32_t session_id, const struct dvs_var_info *vars, uint32_t num_vars)
Add var info for simulation.
DVS_DLL_EXPORT dvs_ret dvs_update_nodes_parallelepiped(int32_t session_id, uint32_t part_id, const uint32_t global_ijk_max[3], const uint32_t local_ijk_min[3], const uint32_t local_ijk_max[3], const float origin[3], const float dir_i[3], const float dir_j[3], const float dir_k[3], const float *i_vals, const float *j_vals, const float *k_vals)
Update the nodes for a parallelepiped structured part.
DVS_DLL_EXPORT dvs_ret dvs_server_get_uri(int32_t server_id, char *uri, uint32_t *size)
Return the URI of the requested server.
DVS_DLL_EXPORT dvs_ret dvs_set_unit_system(int32_t session_id, const char *system)
Set a unit system (optional but recommended)
DVS_DLL_EXPORT dvs_ret dvs_print_stats(int32_t session_id)
This will be deprecated, just placeholder for printing out stats that the client is collecting for pr...
DVS_DLL_EXPORT dvs_ret dvs_get_var_id(int32_t session_id, const char *name, uint32_t *id)
Get the ID being used by the client for the named var.
DVS_DLL_EXPORT dvs_ret dvs_begin_init(int32_t session_id, const char *dataset_name, uint32_t current_rank, uint32_t total_ranks, uint32_t num_chunks)
begin setup of rank
DVS_DLL_EXPORT dvs_ret dvs_get_plot_id(int32_t session_id, const char *name, uint32_t *id)
Get the ID being used by the client for the named plot.
DVS_DLL_EXPORT dvs_ret dvs_update_plot(int32_t session_id, uint32_t plot_id, const float *x_values, const float *y_values, uint32_t num_values)
Update the data for a plot.
DVS_DLL_EXPORT dvs_ret dvs_add_part_info(int32_t session_id, const struct dvs_part_info *parts, uint32_t num_parts)
Add part info for simulation.
DVS_DLL_EXPORT dvs_ret dvs_delete_item(int32_t session_id, uint32_t update_num, uint32_t rank, const char *filter)
Delete an item.
DVS_DLL_EXPORT uint32_t dvs_get_num_part_info(int32_t session_id)
Get the number of dvs_part_info objects for this client session.
DVS_DLL_EXPORT const struct dvs_part_info * dvs_get_part_info(int32_t session_id, uint32_t index)
Get the dvs_part_info object for this index.
DVS_DLL_EXPORT dvs_ret dvs_update_elements_polygon(int32_t session_id, uint32_t part_id, enum dvs_element_type type, const uint32_t *nodes_per_polygon, uint32_t nodes_per_polygon_size, const uint32_t *indices, uint32_t indices_size)
Update N-SIDED elements.
DVS_DLL_EXPORT dvs_ret dvs_update_var_node_scalar_int64(int32_t session_id, uint32_t var_id, uint32_t part_id, const int64_t *scalars, uint32_t num_vals)
Update a field of int64 scalars on nodes.
DVS_DLL_EXPORT dvs_ret dvs_update_nodes(int32_t session_id, uint32_t part_id, const float *x, const float *y, const float *z, uint32_t num_values)
Update nodes for a specific part.
void(* dvs_log_func)(void *, const char *)
Function pointer for logging methods.
DVS_DLL_EXPORT void dvs_shutdown()
Shuts down the api, performing any necessary cleanup, also calls dvs_server_shutdown_all() if any ser...
DVS_DLL_EXPORT dvs_ret dvs_update_var_part_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, float scalar)
Update value of part scalar.
DVS_DLL_EXPORT const struct dvs_var_info * dvs_get_var_info(int32_t session_id, uint32_t index)
Get the dvs_var_info object for this index.
DVS_DLL_EXPORT dvs_ret dvs_update_var_node_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)
Update a field of vectors on nodes.
DVS_DLL_EXPORT dvs_ret dvs_server_started(int32_t server_id, uint32_t *running)
Check to see if a server was started with this server_num.
DVS_DLL_EXPORT uint32_t dvs_get_num_plot_info(int32_t session_id)
Get the number of dvs_plot_info objects for this client session.
DVS_DLL_EXPORT dvs_ret dvs_server_start(int32_t server_id, uint32_t server_number, uint32_t local_ranks)
Start a Dynamic Visualization Store server in a separate thread to receive data from solver node.
DVS_DLL_EXPORT dvs_ret dvs_begin_update(int32_t session_id, uint32_t update_num, uint32_t rank, uint32_t chunk, float time)
Method to begin an update.
DVS_DLL_EXPORT dvs_ret dvs_update_var_element_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const float *scalars, uint32_t num_vals)
Update a field of scalars on elements.
DVS_DLL_EXPORT dvs_ret dvs_update_var_case_vector(int32_t session_id, uint32_t var_id, const float *vec)
Update value of case vector.
DVS_DLL_EXPORT const char * dvs_get_version()
Get the current version of the built library.
DVS_DLL_EXPORT dvs_ret dvs_connect(int32_t server_id, enum dvs_client_flags flags, const char *secret, int32_t *session_id)
Connect to dvs server.
DVS_DLL_EXPORT dvs_ret dvs_session_shutdown(int32_t session_id)
Shutdown session.
DVS_DLL_EXPORT void dvs_server_shutdown_all()
Shutdown all server threads.
DVS_DLL_EXPORT const struct dvs_plot_info * dvs_get_plot_info(int32_t session_id, uint32_t index)
Get the dvs_plot_info object for this index.
DVS_DLL_EXPORT dvs_ret dvs_end_init(int32_t session_id)
end the initialization of the rank
DVS_DLL_EXPORT dvs_ret dvs_add_metadata(int32_t session_id, const char *const metadata_keys[], const char *const metadata_vals[], uint32_t num_metadata_pairs)
Add metadata for the current dataset.
DVS_DLL_EXPORT dvs_ret dvs_server_shutdown(int32_t server_id)
Shutdown this server thread.
DVS_DLL_EXPORT uint32_t dvs_get_num_var_info(int32_t session_id)
Get the number of dvs_var_info objects for this client session.
DVS_DLL_EXPORT dvs_ret dvs_update_var_case_scalar(int32_t session_id, uint32_t var_id, float scalar)
Update value of case scalar.
DVS_DLL_EXPORT void dvs_session_shutdown_all()
Shutdown all connected sessions.
DVS_DLL_EXPORT dvs_ret dvs_server_timestep_count(int32_t server_id, uint32_t *num_pending, uint32_t *num_complete)
Query a Dynamic Visualization Store server as to the number of timesteps it contains.
DVS_DLL_EXPORT dvs_ret dvs_register_log_func(int32_t session_id, void *user_data, dvs_log_func func, enum dvs_log_flags flags)
Register logging function for client to call (optional but recommended)
DVS_DLL_EXPORT dvs_ret dvs_end_update(int32_t session_id)
Call to end the update for this timestep/rank/chunk.
DVS_DLL_EXPORT dvs_ret dvs_server_set_option(int32_t server_id, const char *key, const char *value)
Add an option to the server.
DVS_DLL_EXPORT dvs_ret dvs_update_var_node_scalar(int32_t session_id, uint32_t var_id, uint32_t part_id, const float *scalars, uint32_t num_vals)
Update a field of scalars on nodes.
DVS_DLL_EXPORT dvs_ret dvs_get_part_id(int32_t session_id, const char *name, uint32_t *id)
Get the ID being used by the client for the named part.
DVS_DLL_EXPORT dvs_ret dvs_update_copy_previous_part(int32_t session_id, uint32_t part_id, const char *options)
Copy data from the previous timestep before applying other data.
DVS_DLL_EXPORT dvs_ret dvs_update_var_element_vector(int32_t session_id, uint32_t var_id, uint32_t part_id, enum dvs_element_type type, const float *values, uint32_t num_values)
Update a field of vectors on elements.
DVS_DLL_EXPORT dvs_ret dvs_update_nodes_curvilinear(int32_t session_id, uint32_t part_id, const uint32_t global_ijk_max[3], const uint32_t local_ijk_min[3], const uint32_t local_ijk_max[3], const float *x_vals, const float *y_vals, const float *z_vals)
Update the nodes for a curvilinear structured part.
DVS_DLL_EXPORT dvs_ret dvs_add_plot_info(int32_t session_id, const struct dvs_plot_info *plots, uint32_t num_plots)
Add plot info for simulation.
DVS_DLL_EXPORT dvs_ret dvs_update_elements_polyhedral(int32_t session_id, uint32_t part_id, enum dvs_element_type type, const uint32_t *faces_per_element, uint32_t faces_per_element_size, const uint32_t *nodes_per_face, uint32_t nodes_per_face_size, const uint32_t *indices, uint32_t indices_size)
Update N-FACED Elements.
Contains enums used in C/C++ API.
dvs_log_flags
Flags to control logging filters.
dvs_client_flags
Flags for specific server setup.
dvs_element_type
List of macro generated enums.
dvs_var_location
What variable is associated with.
dvs_var_type
Data type of variable.
Contains errors used in the DVS C/C++ API.
int32_t dvs_ret
Return value of methods, TODO.
C API for using Dynamic Visualization Store.
Struct holding information for a part's definition.
char ** _metadata_vals
UTF-8 Compatible value, each array should be null terminate.
char * _name
UTF-8 Compatible name of part [null terminated], max name length visible in GUI == 79,...
uint8_t _structured
Currently Unused.
uint32_t _id
Unique identifier for part, MUST BE > 0.
uint32_t _metadata_num_pairs
Number of arrays in _metadata_keys/_metadata_vals.
char ** _metadata_keys
UTF-8 Compatible key , each array should be null terminated.
uint8_t _chunking
1 if using chunks
Struct holding information for a plot's definition.
char * _name
UTF-8 Compatible name for plot, must be unique from other plot names.
uint32_t _metadata_num_pairs
Number of arrays in _metadata_keys/_metadata_vals.
char * _y_axis_units
///< UTF-8 Compatible unit type, see: https://nexusdemo.ensight.com/docs/python/html/ENS_UNITSSchema....
char ** _metadata_vals
UTF-8 Compatible value, each array should be null terminated.
char ** _metadata_keys
UTF-8 Compatible key , each array should be null terminated.
char * _x_axis_title
UTF-8 Compatible x axis title.
uint32_t _id
Unique id for plot.
char * _x_axis_units
///< UTF-8 Compatible unit type, see: https://nexusdemo.ensight.com/docs/python/html/ENS_UNITSSchema....
char * _y_axis_title
UTF-8 Compatible y axis title.
Struct holding information for a variable's definiton.
char * _unit_label
UTF-8 Compatible label, see: https://nexusdemo.ensight.com/docs/python/html/ENS_UNITSSchema....
char * _unit
UTF-8 Compatible unit type, see: https://nexusdemo.ensight.com/docs/python/html/ENS_UNITSSchema....
enum dvs_var_type _type
Type of variable, see dvs_var_type enum (dynamic_visualization_store_enums.h)
char ** _metadata_keys
UTF-8 Compatible key , each array should be null terminated.
uint32_t _metadata_num_pairs
Number of arrays in _metadata_keys/_metadata_vals.
uint32_t _id
Unique id for variable.
char ** _metadata_vals
UTF-8 Compatible value, each array should be null terminated.
enum dvs_var_location _location
Location of variable (case/part/element/node), see dvs_var_location enum (dynamic_visualization_store...
char * _name
UTF-8 Compatible name of variable [null terminated], max name length visible in the GUI == 49,...

Connect with Ansys