Skip to main content

Post-processing tools 2023 R2

dynamic_visualization_store_api.h File Reference

Last update: 17.04.2023

C API for using Dynamic Visualization Store. More...

#include <stdint.h>
#include "dynamic_visualization_store_enums.h"
#include "dynamic_visualization_store_error_codes.h"
#include "dynamic_visualization_store_version.h"
#include "include/dvs_import_export.h"

Go to the source code of this file.

Classes

struct  dvs_part_info
 Struct holding information for a part's definition. More...
 
struct  dvs_var_info
 Struct holding information for a variable's definiton. More...
 
struct  dvs_plot_info
 Struct holding information for a plot's definition. More...
 

Typedefs

typedef void(* dvs_log_func) (void *, const char *)
 Function pointer for logging methods. More...
 

Functions

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. More...
 
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) More...
 
DVS_DLL_EXPORT const char * dvs_get_version ()
 Get the current version of the built library. More...
 
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 More...
 
DVS_DLL_EXPORT dvs_ret dvs_set_unit_system (int32_t session_id, const char *system)
 Set a unit system (optional but recommended) More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
DVS_DLL_EXPORT const struct dvs_part_infodvs_get_part_info (int32_t session_id, uint32_t index)
 Get the dvs_part_info object for this index. More...
 
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. More...
 
DVS_DLL_EXPORT const struct dvs_var_infodvs_get_var_info (int32_t session_id, uint32_t index)
 Get the dvs_var_info object for this index. More...
 
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. More...
 
DVS_DLL_EXPORT const struct dvs_plot_infodvs_get_plot_info (int32_t session_id, uint32_t index)
 Get the dvs_plot_info object for this index. More...
 
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. More...
 
DVS_DLL_EXPORT dvs_ret dvs_end_init (int32_t session_id)
 end the initialization of the rank More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
DVS_DLL_EXPORT dvs_ret dvs_end_update (int32_t session_id)
 Call to end the update for this timestep/rank/chunk. More...
 
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. More...
 
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 prototyping. More...
 
DVS_DLL_EXPORT dvs_ret dvs_session_shutdown (int32_t session_id)
 Shutdown session. More...
 
DVS_DLL_EXPORT void dvs_session_shutdown_all ()
 Shutdown all connected sessions. More...
 
DVS_DLL_EXPORT void dvs_shutdown ()
 Shuts down the api, performing any necessary cleanup, also calls dvs_server_shutdown_all() if any servers are currently running.
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
DVS_DLL_EXPORT dvs_ret dvs_server_shutdown (int32_t server_id)
 Shutdown this server thread. More...
 
DVS_DLL_EXPORT void dvs_server_shutdown_all ()
 Shutdown all server threads.
 

Detailed Description

C API for using Dynamic Visualization Store.

Setup the initial connection and needed information

1.) Call dvs_server_create()
2.) Call dvs_connect()
3.) Provide a logging method (dvs_register_log_func()) (optional)
4.) Begin initialization (dvs_begin_init())
5.) Set unit system (dvs_set_unit_system()) (optional)
6.) Add information about all parts if applicable (dvs_add_part_info())
7.) Add information about all variables if applicable (dvs_add_var_info()) (optional)
8.) Add information about all plots if applicable (dvs_add_plot_info()) (optional)
9.) End initialization (dvs_end_init())

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

1.) Begin the update (dvs_begin_update())
2.) For Each Part
        Update mesh/nodes (dvs_update_nodes())
3.) For Each Element Type
        Update Element (dvs_update_elements())
4.) For Each Variable
        If location on case or part use corresponding update methods i.e. dvs_update_var_case_scalar(),
        dvs_update_var_case_vector(), dvs_update_var_part_scalar(), dvs_update_var_part_vector()

        If location element or node use corresponding update methods i.e. dvs_update_var_element_scalar(),
        dvs_update_var_element_vector(), dvs_update_var_node_scalar, dvs_update_var_node_vector()
4.) For Each Plot
         Update plot values (dvs_update_plot())
5.) End update (dvs_end_update())

On application shutdown let the API shut itself down

1.) Call dvs_shutdown() to cleanup data structures

Definition in file dynamic_visualization_store_api.h.

Typedef Documentation

◆ dvs_log_func

typedef void(* dvs_log_func) (void *, const char *)

Function pointer for logging methods.

void* param is for data to be sent back to logging method, might be NULL

Definition at line 143 of file dynamic_visualization_store_api.h.

Function Documentation

◆ dvs_add_metadata()

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.

Errors:

  • DVS_NONE: Success
  • DVS_PARAM_NULL: Method called with NULL params or num_metadata_pairs == 0
  • DVS_CLIENT_INVALID_TRANSPORT: Internal error, should not happen
  • DVS_TRANSPORT_NULL_INVALID_SERVER: Internal error, should not happen
  • DVS_VERSION_MISMATCH: Client version out of date with server version, update server and client to match
  • DVS_VERSION_UNKNOWN: Unable to determine server version, update the server to match the client
  • DVS_TRANSPORT_SERVICE_FAILURE: Normally caused by server call retry time out or invalid secret key
Parameters
session_idid for session created by dvs_connect()
metadata_keysstring array of UTF-8 Compatible string keys, each string should be null terminated
metadata_valsstring array of UTF-8 Compatible string values, each string should be null terminated
num_metadata_pairsnumber of key/value pairs in the arrays
Returns
dvs_ret DVS_NONE on success, otherwise see method description

◆ dvs_add_part_info()

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.

Note: These cannot be changed once dvs_end_init() is called

Parameters
session_idid for session created by dvs_connect()
[in]partsthis solver handles
num_partssize of parts array, maximum number of parts (2^30)
Returns
dvs_ret TODO

◆ dvs_add_plot_info()

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.

NOTE: These cannot be changed once end_init() is called.

Parameters
session_idid for session created by dvs_connect()
[in]plotsplots this solver handles
num_plotssize of plots array
Returns
dvs_ret TODO

◆ dvs_add_var_info()

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.

Note: These cannot be changed once dvs_end_init() is called

Parameters
session_idid for session created by dvs_connect()
[in]varsvariables definitions which will be sent from this compute node
num_varssize of var array
Returns
dvs_ret TODO

◆ dvs_begin_init()

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

Parameters
session_idid for session created by dvs_connect()
dataset_namename for dataset
current_rankRank this solver is processing (zero based)
total_ranksTotal number of ranks across solver nodes
num_chunksNumber of chunks for this rank (usually 1)
Returns
dvs_ret TODO

◆ dvs_begin_update()

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.

Parameters
session_idid for session created by dvs_connect()
update_numupdate number of this update, must be monotonically increasing
rankthe rank we are sending an update for (zero based)
chunkthe chunk number this update is for (zero based)
timetime in seconds this update is for
Returns
dvs_ret TODO

◆ dvs_connect()

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.

This call will connect to a server that has been created using dvs_server_create() If server is being created locally dvs_server_start() must be called before connecting.

Parameters
server_idid of server created by dvs_server_create()
flagsflags for client setup see dvs_client_flags (dynamic_visualization_store_enums.h)
[in]secretshared secret to use for client, can be NULL
[out]session_iddynamic id created for connection, used for client dvs calls
Returns
0 on success, otherwise -1

◆ dvs_delete_item()

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.

This call must be called by every rank similarly to how begin_update happens.

Currently this will only allow for timesteps to be deleted. In the future it can be expanded to all objects via the filter mechanism (see Query Stanzas). Currently this supports the operands of eq, gt, gte, lt, lte. Example: To delete all timesteps >= time 1.1 the filter would be "/timestep.time/gte/1.1//" .

It also currently only supports one statement so /timestep.time/gt/1.1//and/timestep.time/lt/2.1// is not valid as of version 1.1.0.

Note: The update number should be monotonically increasing with the begin_update calls

Parameters
session_idid for session created by dvs_connect()
update_numupdate number of this update, must be monotonically increasing
rankrank making this call
filterfilter for the item(s) to delete see detailed description for more info
Returns
dvs_ret TODO

◆ dvs_end_init()

DVS_DLL_EXPORT dvs_ret dvs_end_init ( int32_t  session_id)

end the initialization of the rank

This must be called to let server know initialization for this rank is complete

Parameters
session_idid for session created by dvs_connect()
Returns
dvs_ret TODO

◆ dvs_end_update()

DVS_DLL_EXPORT dvs_ret dvs_end_update ( int32_t  session_id)

Call to end the update for this timestep/rank/chunk.

Parameters
session_idid for session created by dvs_connect()
Returns
dvs_ret TODO

◆ dvs_get_num_part_info()

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.

Note: This checks the local client session information, does not contact server

Parameters
session_idwhich client session id to check
Returns
uint32_t number of dvs_part_info objects, or 0 on error

◆ dvs_get_num_plot_info()

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.

Note: This checks the local client session information, does not contact server

Parameters
session_idwhich client session id to check
Returns
uint32_t number of dvs_plot_info objects, or 0 on error

◆ dvs_get_num_var_info()

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.

Note: This checks the local client session information, does not contact server

Parameters
session_idwhich client session id to check
Returns
uint32_t number of dvs_var_info objects, or 0 on error

◆ dvs_get_part_id()

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.

Errors: DVS_NONE: Success DVS_INVALID_NAME: No object with name found DVS_ID_NO_VALID_SESSION: No session found matching session_id DVS_ID_INVALID_TYPE: Session id is of wrong type (possibly server) DVS_PARAM_NULL: Null param passed in

Parameters
[in]session_idwhich client session id to check
[in]namethe name of the part to search for
[out]idUINT32_MAX on failure, otherwise the id of the part for this client
Returns
DVS_NONE on success, else see method description

◆ dvs_get_part_info()

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.

Note: This checks the local client session information, does not contact server

Parameters
session_idwhich client session id to check
indexindex of the dvs_part_info object to retrieve
Returns
const dvs_part_info* object found or NULL on not found or error

◆ dvs_get_plot_id()

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.

Errors: DVS_NONE: Success DVS_INVALID_NAME: No object with name found DVS_ID_NO_VALID_SESSION: No session found matching session_id DVS_ID_INVALID_TYPE: Session id is of wrong type (possibly server) DVS_PARAM_NULL: Null param passed in

Parameters
[in]session_idwhich client session id to check
[in]namethe name of the plot to search for
[out]idUINT32_MAX on failure, otherwise the id of the plot for this client
Returns
DVS_NONE on success, else see method description

◆ dvs_get_plot_info()

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.

Note: This checks the local client session information, does not contact server

Parameters
session_idwhich client session id to check
indexindex of the dvs_plot_info object to retrieve
Returns
const dvs_plot_info* object found or NULL on not found or error

◆ dvs_get_var_id()

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.

Errors: DVS_NONE: Success DVS_INVALID_NAME: No object with name found DVS_ID_NO_VALID_SESSION: No session found matching session_id DVS_ID_INVALID_TYPE: Session id is of wrong type (possibly server) DVS_PARAM_NULL: Null param passed in

Parameters
[in]session_idwhich client session id to check
[in]namethe name of the var to search for
[out]idUINT32_MAX on failure, otherwise the id of the var for this client
Returns
DVS_NONE on success, else see method description

◆ dvs_get_var_info()

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.

Note: This checks the local client session information, does not contact server

Parameters
session_idwhich client session id to check
indexindex of the dvs_var_info object to retrieve
Returns
const dvs_var_info* object found or NULL on not found or error

◆ dvs_get_version()

DVS_DLL_EXPORT const char* dvs_get_version ( )

Get the current version of the built library.

This gets the current semantic version of the DVS library. Can be checked against DVS_CURRENT_API_VERSION in dynamic_visualization_store_version.h

This version follows semantic versioning of MAJOR.MINOR.PATCH. Any change to MAJOR or MINOR should be considered incompatible and the library should be updated.

Returns
const* the current version of the built library

◆ dvs_print_stats()

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 prototyping.

Parameters
session_idid for session created by dvs_connect()

◆ dvs_register_log_func()

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)

Will not see any logging messages if not registered

Parameters
session_idid for session created by dvs_connect()
user_datauser data that will be passed into dvs_log_func calls
funcfunction pointer for logging (see dvs_log_func)
flagswhich items to be logged, see dvs_log_flags (dynamic_visualization_store_enums.h)
Returns
dvs_ret TODO

◆ dvs_server_create()

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.

Parameters
server_uriURI of server to create of the format protocol://hostname:port, i.e. grpc://localhost:50055 or null:// see Server URIs for more info.
[out]server_idunique id dynamically created for this server, -1 if failure
Returns
0 on success, else TODO

◆ dvs_server_set_option()

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.

These options are used on server startup. Setting an option after a server is started will do nothing until the server is restarted (not common). See Server Options.

Parameters
server_idid of server from dvs_server_create()
[in]keyKey for option to add, MAX LENGTH 2048
[in]valueValue for option, MAX LENGTH 2048
Returns
0 on success, else TODO

◆ dvs_server_shutdown()

DVS_DLL_EXPORT dvs_ret dvs_server_shutdown ( int32_t  server_id)

Shutdown this server thread.

Parameters
server_idid of server from dvs_server_create()
Returns
0 on success, else TODO

◆ dvs_server_start()

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.

server_number is used by the DVS server, for each group of servers this number should be unique and monotonically increasing with no gaps (valid: 0, 1, 2 invalid: 0, 2)

local_ranks is used to determine how many clients will be connecting to this server

Parameters
server_idid of server from dvs_server_create()
server_numberThe server number (zero based) for this server, should be unique for each server in this server group.
local_ranksNumber of local ranks this server will handle.
Returns
0 if server started, else TODO

◆ dvs_server_started()

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.

Parameters
server_idid of server from dvs_server_create()
[out]running1 if running, else 0
Returns
0 on success, else TODO

◆ dvs_server_timestep_count()

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.

Parameters
server_idid of server from dvs_server_create()
[out]num_pendingThe number of incomplete timesteps currently in the server
[out]num_completeThe number of complete timesteps currently in the server
Returns
0 on success, else TODO

◆ dvs_session_shutdown()

DVS_DLL_EXPORT dvs_ret dvs_session_shutdown ( int32_t  session_id)

Shutdown session.

Parameters
session_idid for session created by dvs_connect()
Returns
dvs_ret TODO

◆ dvs_session_shutdown_all()

DVS_DLL_EXPORT void dvs_session_shutdown_all ( )

Shutdown all connected sessions.

All previously returned session_id's from dvs_connect will be invalid once this call is made.

◆ dvs_set_unit_system()

DVS_DLL_EXPORT dvs_ret dvs_set_unit_system ( int32_t  session_id,
const char *  system 
)

Set a unit system (optional but recommended)

Note: This cannot be changed once dvs_end_init() is called

Parameters
session_idid for session created by dvs_connect()
systemUTF-8 compatible unit system see: https://nexusdemo.ensight.com/docs/python/html/ENS_UNITSSchema.html
Returns
dvs_ret TODO

◆ dvs_update_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.

This will update the elements for a part. The number of indices needed will vary depending on the type and the num_elements. I.E. if updating triangles with 3 elements the indices array should be of size 9 (3 triangles with 3 indices)

Parameters
session_idid for session created by dvs_connect()
part_idunique id of part to update elements for (must match parts added with dvs_add_part_info)
typeelement type of elements to update (points, triangles, quads, etc.)
indicesnode indices for each element, for ordering info per element type see EnSight's User Manual, section 9.2.3 Supported EnSight Gold Elements
num_indicesthe size of the indices array
Returns
ret_val TODO

◆ dvs_update_elements_polygon()

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.

This method will send over a list of arbitrarily sized polygons. The nodes_per_polygon param is an array containing the size of each polygon. I.E. if sending a quadrangle, and a 25 sided element the nodes_per_polygon array might look like [4, 25]. The size of the indices array would be 4+25=29 in this example where the first 4 items in the indices array would correspond to the first item in the nodes_per_polygon array, the next 25 items in the indices array would correspond to the second item in the nodes_per_polygon array

Parameters
session_idid for session created by dvs_connect()
part_idunique id of part to update elements for (must match parts added with dvs_add_part_info)
typeelement type of elements to update (N_SIDED_POLYGON or N_SIDED_POLYGON_GHOST)
nodes_per_polygonArray containing number of nodes in each element/polygon
nodes_per_polygon_sizesize of nodes_per_polygon array
indicesArray of node indices for the polygons described in nodes_per_polygon
indices_sizeSize of indices array
Returns
dvs_ret TODO

◆ dvs_update_elements_polyhedral()

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.

Parameters
session_idid for session created by dvs_connect()
part_idunique id of part to update elements for (must match parts added with dvs_add_part_info)
typeelement type of elements to update (CONVEX_POLYHEDRON or CONVEX_POLYHEDRON_GHOST)
faces_per_elementArray of how many faces are in each element
faces_per_element_sizesize of faces_per_element array
nodes_per_faceArray of how many nodes each face contains
nodes_per_face_sizesize of nodes_per_face array
indicesNode indices for elements
indices_sizesize of node indices
Returns
dvs_ret TODO

◆ dvs_update_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.

Parameters
session_idid for session created by dvs_connect()
part_idthe id of part we are updating nodes for
[in]xarray of x components for nodes
[in]yarray of y components for nodes
[in]zarray of z components for nodes
num_valuesnumber of values in individual x/y/z arrays (max nodes in part 2^31)
Returns
dvs_ret TODO

◆ dvs_update_nodes_curvilinear()

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.

A curvilinear structured part is represented by the global IJK grid across ranks, the local sub-block's IJK rank, and the actual XYZ values for each IJK grid point in the local grid.

Local IJK Dimensions: The min/max represent a local sub-block from the overall global grid. This could be the entire range if not splitting the grid into multiple ranks or a specific slice. For example you could have a 2ix3jx4k grid where it was split across the I dimension. One rank would specify min/max IJK as min:[0,0,0], max:[0,2,3], the other rank would specify min/max IJK as min:[1,0,0], max:[1,2,3]. If sending the data all as one rank it would be the full range of: min:[0,0,0], max:[1,2,3]

IJK Vals: These specify the actual XYZ location for each IJK value in the grid. The order of these should be by the fastest changing dimension being I, the next being J, and the next being K. I.E. for a 2x2x2 grid the x_vals array would contain the X component for IJK values: [i0 j0 k0][i1 j0 k0][i0 j1 k0][i1 j1 k0][i0 j0 k1][i1 j0 k1][i0 j1 k1][i1 j1 k1].

Note: iblanking information is sent via dvs_update_var_node_scalar() using DVS_STRUCTURED_IBLANKED_NODES as the variable id

Note: Ghost element information is sent via dvs_update_var_element_scalar() using DVS_STRUCTURED_GHOST_ELEMENTS as the variable id

Parameters
[in]session_idid for session created by dvs_connect()
[in]part_idthe id of part we are updating nodes for
[in]global_ijk_maxThe one based global ijk max of the mesh across all ranks
[in]local_ijk_minthe zero based local sub-block ijk min for this rank
[in]local_ijk_maxthe zero based local sub-block ijk max for this rank
x_valsThe actual X component for each IJK value for the local sub block (size (iMax-iMin+1)*(jMax-jMin+1)*(kMax-kMin+1))
y_valsThe actual Y component for each IJK value for the local sub block (size (iMax-iMin+1)*(jMax-jMin+1)*(kMax-kMin+1))
z_valsThe actual Z component for each IJK value for the local sub block (size (iMax-iMin+1)*(jMax-jMin+1)*(kMax-kMin+1))
Returns
dvs_ret TODO

◆ dvs_update_nodes_parallelepiped()

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.

A parallelepiped structured part is represented by the global IJK grid across ranks, the local sub-block's IJK range, the ogigin of the IJK sub-block, the normalized direction (unit) vectors for each IJK dimension, and the absolute distances for each IJK index from the origin of this sub-block.

Global IJK Max: for a 2x3x4 grid would be: [2 3 4]

Local IJK Dimensions: The min/max represent a local sub-block from the overall global grid. This could be the entire range if not splitting the grid into multiple ranks or a specific slice. For example you could have a 2ix3jx4k grid where it was split across the I dimension. One rank would specify min/max IJK as min:[0,0,0], max:[0,2,3], the other rank would specify min/max IJK as min:[1,0,0], max:[1,2,3]. If sending the data all as one rank it would be the full range of: min:[0,0,0], max:[1,2,3]

Direction (Unit) Vectors: These represent the XYZ orientation of each IJK axis. I.E. if I==X J==Y K==Z the vectors would be dir_i: [1 0 0], dir_j: [0 1 0], dir_k: [0 0 1]

IJK Vals: These specify the absolute distance from the XYZ origin in each IJK direction(specified by the direction vectors). So if the distance was 1 between every I index, 2 between every J index, and 3 in between every K index the arrays would look like: i_vals: [0 1 2 3 4 5....] j_vals: [0 2 4 6 8 10....] k_vals: [0 3 6 9 12 15....]

Note: iblanking information is sent via dvs_update_var_node_scalar() using DVS_STRUCTURED_IBLANKED_NODES as the variable id

Note: Ghost element information is sent via dvs_update_var_element_scalar() using DVS_STRUCTURED_GHOST_ELEMENTS as the variable id

Parameters
[in]session_idid for session created by dvs_connect()
[in]part_idthe id of part we are updating nodes for
[in]global_ijk_maxThe one based global ijk max of the mesh across all ranks
[in]local_ijk_minthe zero based local sub-block ijk min for this rank
[in]local_ijk_maxthe zero based local sub-block ijk max for this rank
[in]originthe XYZ origin of this local ijk block
[in]dir_iThe normalized XYZ direction vector for the i dimension
[in]dir_jThe normalized XYZ direction vector for the j dimension
[in]dir_kThe normalized XYZ direction vector for the k dimension
[in]i_valsThe absolute distance vector for each i index from the local sub block's origin of size iMax-iMin+1
[in]j_valsThe absolute distance vector for each j index from the local sub block's origin of size jMax-jMin+1
[in]k_valsThe absolute distance vector for each k index from the local sub block's origin of size kMax-kMin+1
Returns
dvs_ret TODO

◆ dvs_update_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.

Update the data for a plot, the size of the x_values and y_values should match and be the same as num_values

Parameters
session_idid for session created by dvs_connect()
plot_idid of plot to update matching plot_infos sent with dvs_add_plot_info
[in]x_valuesarray of x axis values
[in]y_valuesarray of y axis values
num_valuessize of arrays
Returns
dvs_ret TODO

◆ dvs_update_var_case_scalar()

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.

Parameters
session_idid for session created by dvs_connect()
var_idunique id of variable to update (must match var added with dvs_add_var_info)
scalarvalue to update
Returns
dvs_ret TODO

◆ dvs_update_var_case_vector()

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.

Parameters
session_idid for session created by dvs_connect()
var_idunique id of variable to update (must match var added with dvs_add_var_info)
[in]vecarray of x,y,z values (size 3)
Returns
dvs_ret TODO

◆ dvs_update_var_element_scalar()

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.

Parameters
session_idid for session created by dvs_connect()
var_idunique id for variable to update (must match var added with dvs_add_var_info)
part_idunique id for part element is associated with (must match parts added with dvs_add_part_info)
typeelement type to update
[in]scalarsarray of scalars
num_valsnumber of values in scalar array
Returns
dvs_ret TODO

◆ dvs_update_var_element_vector()

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.

Updates a field of vectors on elements, the size of all coordinate arrays must be the same.

Parameters
session_idid for session created by dvs_connect()
var_idunique id for variable to update (must match var added with dvs_add_var_info)
part_idunique id for part to update (must match parts added with dvs_add_part_info)
typeelement type to update
[in]valuesarray of values to udpate, should be the size of number of elements * 3, values are XYZ XYZ XYZ.......... XYZ
num_valuessize of values array
Returns
dvs_ret TODO

◆ dvs_update_var_node_scalar()

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.

Parameters
session_idid for session created by dvs_connect()
var_idunique id for variable to update (must match var added with dvs_add_var_info)
part_idunique id for part nodes are associated with (must match parts added with dvs_add_part_info)
[in]scalarsarray of scalars to set on variable
num_valsnumber of values in scalar array
Returns
dvs_ret TODO

◆ dvs_update_var_node_vector()

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.

Updates a field of vectors on nodes, the size of all coordinate arrays must be the same.

Parameters
session_idid for session created by dvs_connect()
var_idunique id for variable to update (must match var added with dvs_add_var_info)
part_idunique id for part to update (must match parts added with dvs_add_part_info)
[in]valuesarray of values to udpate, should be the size of number of nodes * 3, values are XYZ XYZ XYZ.......... XYZ
num_valuessize of values array
Returns
dvs_ret TODO

◆ dvs_update_var_part_scalar()

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.

Parameters
session_idid for session created by dvs_connect()
var_idunique id of variable to update (must match var added with dvs_add_var_info)
part_idunique id of part associated with (must match parts added with dvs_add_part_info)
scalarvalue to update
Returns
dvs_ret TODO

◆ dvs_update_var_part_vector()

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.

Parameters
session_idid for session created by dvs_connect()
var_idunique id of variable to update (must match var added with dvs_add_var_info)
part_idunique id of part associated with (must match parts added with dvs_add_part_info)
[in]vecarray of x,y,z values (size 3)
Returns
dvs_ret TODO