Skip to main content

Post-processing tools 2023 R2

dvs_client_interface.h File Reference

Last update: 17.04.2023

C++ Client API for using the Dynamic Visualization Store. More...

#include <string>
#include "dvs_server_interface.h"
#include "dynamic_visualization_store_api.h"
#include "logger_interface.h"
#include "include/dvs_import_export.h"

Go to the source code of this file.

Classes

class  DVS::IClient
 API for solvers to use to send data to EnSight servers. More...
 

Functions

DVS_DLL_EXPORT DVS::IClientDVS::CREATE_CLIENT_INSTANCE (DVS::IServer *server, dvs_client_flags flags, const char *secret)
 Factory method to create a dynamic data client interface instance. More...
 
DVS_DLL_EXPORT void DVS::DESTROY_CLIENT_INSTANCE (DVS::IClient *destroy)
 Destruction method for a client created with CREATE_CLIENT_INSTANCE. More...
 

Detailed Description

C++ Client API for using the Dynamic Visualization Store.

Setup the initial connection and needed information

1.) Instantiate DVS::IServer using DVS::CREATE_SERVER_INSTANCE() method
 1a.) If running a server within this process call setup options (DVS::IServer::set_options()), see documentation for available options
 1b.) If running a server within this process call startup (DVS::IServer::startup()) to begin running server
2.) Instantiate DVS::IClient using DVS::CREATE_CLIENT_INSTANCE() method and DVS::IServer created in step 1
3.) Provide a logging method (DVS::IClient::set_logger()) (optional)
4.) Begin initialization (DVS::IClient::begin_init())
5.) Set unit system (DVS::IClient::set_unit_system()) (optional)
6.) Add information about all parts if applicable (DVS::IClient::add_part_info())
7.) Add information about all variables if applicable (DVS::IClient::add_var_info()) (optional)
8.) Add information about all plots if applicable (DVS::IClient::add_plot_info()) (optional)
9.) End initialization (DVS::IClient::end_init())

Now at the end of each timestep we can push data to the ensight server

1.) Begin the update (DVS::IClient::begin_update())
2.) For Each Part
        Update mesh/nodes (DVS::IClient::update_nodes())
3.) For Each Element Type
        Update Element (DVS::IClient::update_elements(), DVS::IClient::update_elements_polygon(), DVS::IClient::update_elements_polyhedral())
4.) For Each Variable
        If location on case or part use corresponding update methods i.e. DVS::IClient::update_var_case(),
        DVS::IClient::update_var_case()

        If location element or node use corresponding update methods i.e. DVS::IClient::update_var_element(),
        DVS::IClient::update_var_node(), DVS::IClient::update_var_field()
4.) For Each Plot
         Update plot values (DVS::IClient::update_plot())
5.) End update (DVS::IClient::end_update())

On application shutdown let the API shut itself down

1.) Destroy instance of DVS::IClient using DVS::DESTROY_CLIENT_INSTANCE() method

Definition in file dvs_client_interface.h.

Function Documentation

◆ CREATE_CLIENT_INSTANCE()

DVS_DLL_EXPORT DVS::IClient* DVS::CREATE_CLIENT_INSTANCE ( DVS::IServer server,
dvs_client_flags  flags,
const char *  secret 
)

Factory method to create a dynamic data client interface instance.

Parameters
serverServer instance to connect to
flagsconfig flags for client setup see dvs_client_flags (dynamic_visualization_store_enums.h)
[in]secretsecret shared secret to use to connect to server, can be empty
Returns
DVS::IClient* instance of a dvs client, (nullptr if failure), must be destroyed with DESTROY_CLIENT_INSTANCE

◆ DESTROY_CLIENT_INSTANCE()

DVS_DLL_EXPORT void DVS::DESTROY_CLIENT_INSTANCE ( DVS::IClient destroy)

Destruction method for a client created with CREATE_CLIENT_INSTANCE.

Parameters
destroyInstance of a client to destroy