Skip to main content

Post-processing tools 2024 R1

dvs_client_interface

Last update: 16.07.2025
Go to the documentation of this file.
1/* *************************************************************
2 * Copyright 2017-2018 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 ___DVS_DYNAMIC_VISUALIZATION_STORE_CLIENT_INTERFACE___
17#define ___DVS_DYNAMIC_VISUALIZATION_STORE_CLIENT_INTERFACE___
18
62#include <string>
63
66#include "logger_interface.h"
67
68#include "include/dvs_import_export.h"
69
70namespace DVS
71{
80 class IClient
81 {
82 public:
83
84
85 IClient() = default;
86 virtual ~IClient() = default;
87 IClient(IClient&&) = default;
88 IClient& operator=(IClient&&) = default;
89 IClient(const IClient&) = default;
90 IClient& operator=(const IClient&) = default;
91
102 virtual void set_logger(ILogger* logger) = 0;
103
114 virtual const char* get_version() = 0;
115
125 virtual dvs_ret begin_init(const char* dataset_name, uint32_t current_rank, uint32_t total_ranks, uint32_t num_chunks) = 0;
126
135 virtual dvs_ret set_unit_system(const char* system) = 0;
136
154 virtual dvs_ret add_metadata(const char* const keys[], const char* const vals[], uint32_t num_metadata_pairs) = 0;
155
165 virtual dvs_ret add_part_info(const dvs_part_info* part_info, uint32_t num_parts) = 0;
166
176 virtual dvs_ret add_var_info(const dvs_var_info* var_info, uint32_t num_vars) = 0;
177
187 virtual dvs_ret add_plot_info(const dvs_plot_info* plot_info, uint32_t num_plots) = 0;
188
197 virtual uint32_t get_num_parts() const = 0;
198
207 virtual uint32_t get_num_vars() const = 0;
208
217 virtual uint32_t get_num_plots() const = 0;
218
228 virtual const dvs_part_info* get_part_info(uint32_t index) const = 0;
229
244 virtual dvs_ret get_part_id(const std::string& name, uint32_t& id) const = 0;
245
255 virtual const dvs_var_info* get_var_info(uint32_t index) const = 0;
256
271 virtual dvs_ret get_var_id(const std::string& name, uint32_t& id) const = 0;
272
282 virtual const dvs_plot_info* get_plot_info(uint32_t index) const = 0;
283
298 virtual dvs_ret get_plot_id(const std::string& name, uint32_t& id) const = 0;
299
307 virtual dvs_ret end_init() = 0;
308
318 virtual dvs_ret begin_update(uint32_t update_num, uint32_t rank, uint32_t chunk, float time) = 0;
319
333 virtual dvs_ret update_copy_previous_part(uint32_t part_id, const char* options) = 0;
334
345 virtual dvs_ret update_nodes(uint32_t part_id, const float* x, const float* y, const float* z, uint32_t num_values) = 0;
346
388 (
389 uint32_t part_id,
390 const uint32_t global_ijk_max[3],
391 const uint32_t local_ijk_min[3],
392 const uint32_t local_ijk_max[3],
393 const float origin[3],
394 const float dir_i[3],
395 const float dir_j[3],
396 const float dir_k[3],
397 const float* i_vals,
398 const float* j_vals,
399 const float* k_vals
400 ) = 0;
401
431 (
432 uint32_t part_id,
433 const uint32_t global_ijk_max[3],
434 const uint32_t local_ijk_min[3],
435 const uint32_t local_ijk_max[3],
436 const float* x_vals,
437 const float* y_vals,
438 const float* z_vals
439 ) = 0;
440
454 virtual dvs_ret update_elements(uint32_t part_id, dvs_element_type type, const uint32_t* indices, uint32_t num_indices) = 0;
455
474 (
475 uint32_t part_id,
476 dvs_element_type type,
477 const uint32_t* nodes_per_polygon,
478 uint32_t nodes_per_polygon_size,
479 const uint32_t* indices,
480 uint32_t indices_size
481 ) = 0;
482
497 (
498 uint32_t part_id,
499 dvs_element_type type,
500 const uint32_t* faces_per_element,
501 uint32_t faces_per_element_size,
502 const uint32_t* nodes_per_face,
503 uint32_t nodes_per_face_size,
504 const uint32_t* indices,
505 uint32_t indices_size
506 ) = 0;
507
508
518 virtual dvs_ret update_var_case(dvs_var_type var_type, uint32_t var_id, const float* values, uint32_t num_values) = 0;
519
530 virtual dvs_ret update_var_part(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float* values, uint32_t num_values) = 0;
531
543 virtual dvs_ret update_var_element(dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float* values, uint32_t num_values) = 0;
544
556 virtual dvs_ret update_var_element(dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const int64_t* values, uint32_t num_values) = 0;
557
568 virtual dvs_ret update_var_node(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float* values, uint32_t num_values) = 0;
569
581 virtual dvs_ret update_var_node(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const int64_t* values, uint32_t num_values) = 0;
582
595 virtual dvs_ret update_var_field(dvs_var_location location, dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float* values, uint32_t num_values) = 0;
596
610 virtual dvs_ret update_var_field(dvs_var_location location, dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const int64_t* values, uint32_t num_values) = 0;
611
621 virtual dvs_ret update_plot(uint32_t plot_id, const float* x_values, const float* y_values, uint32_t num_values) = 0;
622
628 virtual dvs_ret end_update() = 0;
629
648 virtual dvs_ret delete_item(uint32_t update_num, uint32_t rank, const char* filter) = 0;
649 };
650
659 DVS_DLL_EXPORT DVS::IClient* CREATE_CLIENT_INSTANCE(DVS::IServer* server, dvs_client_flags flags, const char* secret);
660
666 DVS_DLL_EXPORT void DESTROY_CLIENT_INSTANCE(DVS::IClient* destroy);
667}
668
669#endif //___DVS_DYNAMIC_VISUALIZATION_STORE_CLIENT_INTERFACE___
API for solvers to use to send data to EnSight servers.
virtual void set_logger(ILogger *logger)=0
Set the logger interface to use.
virtual dvs_ret update_nodes_structured(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)=0
Update the nodes for a parallelepiped structured part.
virtual dvs_ret add_plot_info(const dvs_plot_info *plot_info, uint32_t num_plots)=0
Add plot information for session.
virtual dvs_ret set_unit_system(const char *system)=0
Set the unit system we are using for this session (optional)
IClient(IClient &&)=default
default
virtual dvs_ret update_var_field(dvs_var_location location, dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)=0
Update var field values (nodal or elemental)
virtual dvs_ret update_copy_previous_part(uint32_t part_id, const char *options)=0
Copy data from the previous timestep before applying other data.
virtual dvs_ret update_elements(uint32_t part_id, dvs_element_type type, const uint32_t *indices, uint32_t num_indices)=0
Update elements for a specific part and element type.
virtual dvs_ret get_part_id(const std::string &name, uint32_t &id) const =0
Get the ID being used by the client for the named part.
virtual dvs_ret get_plot_id(const std::string &name, uint32_t &id) const =0
Get the ID being used by the client for the named plot.
virtual dvs_ret delete_item(uint32_t update_num, uint32_t rank, const char *filter)=0
Delete an item.
virtual dvs_ret add_part_info(const dvs_part_info *part_info, uint32_t num_parts)=0
Add part information for session.
virtual dvs_ret end_update()=0
Call to end the update for this timestep/rank/chunk.
IClient()=default
default
virtual dvs_ret update_var_element(dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const int64_t *values, uint32_t num_values)=0
Update elemental scalar 64bit variable values *.
virtual const dvs_plot_info * get_plot_info(uint32_t index) const =0
Get the dvs_plot_info object for a specific index.
virtual dvs_ret update_elements_polyhedral(uint32_t part_id, 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)=0
Update N-FACED Elements.
IClient(const IClient &)=default
support copying
virtual uint32_t get_num_plots() const =0
Get the number of dvs_plot_info objects this client has stored.
virtual dvs_ret add_var_info(const dvs_var_info *var_info, uint32_t num_vars)=0
Add variable information for session.
virtual uint32_t get_num_vars() const =0
Get the number of dvs_var_info objects this client has stored.
virtual dvs_ret update_nodes(uint32_t part_id, const float *x, const float *y, const float *z, uint32_t num_values)=0
Update nodes for a specific part.
virtual dvs_ret update_var_field(dvs_var_location location, dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const int64_t *values, uint32_t num_values)=0
Update var field values (nodal or elemental) Extend support to handle 64 bit integer variable values.
virtual dvs_ret update_var_case(dvs_var_type var_type, uint32_t var_id, const float *values, uint32_t num_values)=0
Update case variable.
IClient & operator=(const IClient &)=default
default
virtual const dvs_part_info * get_part_info(uint32_t index) const =0
Get the dvs_part_info object for a specific index.
IClient & operator=(IClient &&)=default
default
virtual const char * get_version()=0
Get the version of the client API.
virtual dvs_ret end_init()=0
Finish initialization for this rank.
virtual dvs_ret update_var_part(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)=0
Update part vector variable.
virtual dvs_ret add_metadata(const char *const keys[], const char *const vals[], uint32_t num_metadata_pairs)=0
Add metadata for the current dataset.
virtual ~IClient()=default
default
virtual dvs_ret begin_update(uint32_t update_num, uint32_t rank, uint32_t chunk, float time)=0
Method to begin an update.
virtual dvs_ret get_var_id(const std::string &name, uint32_t &id) const =0
Get the ID being used by the client for the named var.
virtual dvs_ret update_elements_polygon(uint32_t part_id, dvs_element_type type, const uint32_t *nodes_per_polygon, uint32_t nodes_per_polygon_size, const uint32_t *indices, uint32_t indices_size)=0
Update N-SIDED elements.
virtual dvs_ret update_var_node(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const int64_t *values, uint32_t num_values)=0
Update nodal variable values Extend support to handle 64 bit values
virtual dvs_ret update_var_node(dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)=0
Update nodal variable values.
virtual dvs_ret update_var_element(dvs_element_type elem_type, dvs_var_type var_type, uint32_t var_id, uint32_t part_id, const float *values, uint32_t num_values)=0
Update elemental scalar variable values.
virtual dvs_ret update_nodes_structured(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)=0
Update the nodes for a curvilinear structured part.
virtual uint32_t get_num_parts() const =0
Get the number of dvs_part_info objects this client has stored.
virtual const dvs_var_info * get_var_info(uint32_t index) const =0
Get the dvs_var_info object for a specific index.
virtual dvs_ret update_plot(uint32_t plot_id, const float *x_values, const float *y_values, uint32_t num_values)=0
Update plot data for plot.
virtual dvs_ret begin_init(const char *dataset_name, uint32_t current_rank, uint32_t total_ranks, uint32_t num_chunks)=0
Begins initialization for this rank.
Interface for a logger to be used by DVS::IClient.
Interface class used to run a dynamic data server in a thread accepting incoming client connections.
DVS_DLL_EXPORT DVS::IClient * CREATE_CLIENT_INSTANCE(DVS::IServer *server, dvs_client_flags flags, const char *secret)
Factory method to create a dynamic data client interface instance.
DVS_DLL_EXPORT void DESTROY_CLIENT_INSTANCE(DVS::IClient *destroy)
Destruction method for a client created with CREATE_CLIENT_INSTANCE.
C++ Server API for using Dynamic Visualization Store Server.
C API for using Dynamic Visualization Store.
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.
int32_t dvs_ret
Return value of methods, TODO.
Logger Interface Class.
Struct holding information for a part's definition.
Struct holding information for a plot's definition.
Struct holding information for a variable's definiton.

Connect with Ansys