Skip to main content

Post-processing tools 2025 R1

dvs_client_interface

Last update: 16.07.2025
Go to the documentation of this file.
1/* *************************************************************
2 * Copyright 2017-2024 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
346 uint32_t part_id,
347 const std::vector<float>& quaternion,
348 const std::vector<float>& displacement,
349 const std::vector<float>& cg_offset
350 ) = 0;
351
364 std::array<float, 3> axis_start,
365 std::array<float, 3> axis_end,
366 float relative_rotation_angle,
367 std::array<float, 4>& quaternion
368 ) = 0;
369
380 virtual dvs_ret update_nodes(uint32_t part_id, const float* x, const float* y, const float* z, uint32_t num_values) = 0;
381
423 (
424 uint32_t part_id,
425 const uint32_t global_ijk_max[3],
426 const uint32_t local_ijk_min[3],
427 const uint32_t local_ijk_max[3],
428 const float origin[3],
429 const float dir_i[3],
430 const float dir_j[3],
431 const float dir_k[3],
432 const float* i_vals,
433 const float* j_vals,
434 const float* k_vals
435 ) = 0;
436
466 (
467 uint32_t part_id,
468 const uint32_t global_ijk_max[3],
469 const uint32_t local_ijk_min[3],
470 const uint32_t local_ijk_max[3],
471 const float* x_vals,
472 const float* y_vals,
473 const float* z_vals
474 ) = 0;
475
489 virtual dvs_ret update_elements(uint32_t part_id, dvs_element_type type, const uint32_t* indices, uint32_t num_indices) = 0;
490
509 (
510 uint32_t part_id,
511 dvs_element_type type,
512 const uint32_t* nodes_per_polygon,
513 uint32_t nodes_per_polygon_size,
514 const uint32_t* indices,
515 uint32_t indices_size
516 ) = 0;
517
532 (
533 uint32_t part_id,
534 dvs_element_type type,
535 const uint32_t* faces_per_element,
536 uint32_t faces_per_element_size,
537 const uint32_t* nodes_per_face,
538 uint32_t nodes_per_face_size,
539 const uint32_t* indices,
540 uint32_t indices_size
541 ) = 0;
542
543
553 virtual dvs_ret update_var_case(dvs_var_type var_type, uint32_t var_id, const float* values, uint32_t num_values) = 0;
554
565 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;
566
578 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;
579
591 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;
592
603 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;
604
616 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;
617
630 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;
631
645 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;
646
656 virtual dvs_ret update_plot(uint32_t plot_id, const float* x_values, const float* y_values, uint32_t num_values) = 0;
657
663 virtual dvs_ret end_update() = 0;
664
683 virtual dvs_ret delete_item(uint32_t update_num, uint32_t rank, const char* filter) = 0;
684 };
685
694 DVS_DLL_EXPORT DVS::IClient* CREATE_CLIENT_INSTANCE(DVS::IServer* server, dvs_client_flags flags, const char* secret);
695
701 DVS_DLL_EXPORT void DESTROY_CLIENT_INSTANCE(DVS::IClient* destroy);
702}
703
704#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_part_rigid_body_motion(uint32_t part_id, const std::vector< float > &quaternion, const std::vector< float > &displacement, const std::vector< float > &cg_offset)=0
Update the rigid body motion for a part.
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 convert_rotation_to_quaternion(std::array< float, 3 > axis_start, std::array< float, 3 > axis_end, float relative_rotation_angle, std::array< float, 4 > &quaternion)=0
Utility API to convert a rigid body rotation described by the rotation axis and the angle of rotation...
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