Skip to main content

Post-processing tools 2023 R2

dvs_client_interface.h

Last update: 17.04.2023
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 
64 #include "dvs_server_interface.h"
66 #include "logger_interface.h"
67 
68 #include "include/dvs_import_export.h"
69 
70 namespace 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 
330  virtual dvs_ret update_nodes(uint32_t part_id, const float* x, const float* y, const float* z, uint32_t num_values) = 0;
331 
373  (
374  uint32_t part_id,
375  const uint32_t global_ijk_max[3],
376  const uint32_t local_ijk_min[3],
377  const uint32_t local_ijk_max[3],
378  const float origin[3],
379  const float dir_i[3],
380  const float dir_j[3],
381  const float dir_k[3],
382  const float* i_vals,
383  const float* j_vals,
384  const float* k_vals
385  ) = 0;
386 
416  (
417  uint32_t part_id,
418  const uint32_t global_ijk_max[3],
419  const uint32_t local_ijk_min[3],
420  const uint32_t local_ijk_max[3],
421  const float* x_vals,
422  const float* y_vals,
423  const float* z_vals
424  ) = 0;
425 
439  virtual dvs_ret update_elements(uint32_t part_id, dvs_element_type type, const uint32_t* indices, uint32_t num_indices) = 0;
440 
459  (
460  uint32_t part_id,
461  dvs_element_type type,
462  const uint32_t* nodes_per_polygon,
463  uint32_t nodes_per_polygon_size,
464  const uint32_t* indices,
465  uint32_t indices_size
466  ) = 0;
467 
482  (
483  uint32_t part_id,
484  dvs_element_type type,
485  const uint32_t* faces_per_element,
486  uint32_t faces_per_element_size,
487  const uint32_t* nodes_per_face,
488  uint32_t nodes_per_face_size,
489  const uint32_t* indices,
490  uint32_t indices_size
491  ) = 0;
492 
493 
503  virtual dvs_ret update_var_case(dvs_var_type var_type, uint32_t var_id, const float* values, uint32_t num_values) = 0;
504 
515  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;
516 
528  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;
529 
540  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;
541 
554  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;
555 
565  virtual dvs_ret update_plot(uint32_t plot_id, const float* x_values, const float* y_values, uint32_t num_values) = 0;
566 
572  virtual dvs_ret end_update() = 0;
573 
592  virtual dvs_ret delete_item(uint32_t update_num, uint32_t rank, const char* filter) = 0;
593  };
594 
603  DVS_DLL_EXPORT DVS::IClient* CREATE_CLIENT_INSTANCE(DVS::IServer* server, dvs_client_flags flags, const char* secret);
604 
610  DVS_DLL_EXPORT void DESTROY_CLIENT_INSTANCE(DVS::IClient* destroy);
611 }
612 
613 #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.
IClient & operator=(IClient &&)=default
default
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 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 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_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
IClient & operator=(const IClient &)=default
default
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_case(dvs_var_type var_type, uint32_t var_id, const float *values, uint32_t num_values)=0
Update case variable.
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 const char * get_version()=0
Get the version of the client API.
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 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_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_part_info * get_part_info(uint32_t index) const =0
Get the dvs_part_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 void DESTROY_CLIENT_INSTANCE(DVS::IClient *destroy)
Destruction method for a client created with CREATE_CLIENT_INSTANCE.
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.
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.