test_dvs_reader
Last update: 16.07.2025
Go to the documentation of this file.
55 fprintf( stdout, "%s: Name: %s Type: %i\n", object_name.c_str(), object->get_name(), object->get_type() );
60 fprintf(stdout, "Key: %s, Val:%s ", object->get_metadata_key(metadata_idx), object->get_metadata_value(metadata_idx));
73 var->get_name(), var->get_var_type(), var->get_var_location(), var->get_unit_dimension(), var->get_unit_label());
78 fprintf(stdout, "Key: %s, Val:%s ", var->get_metadata_key(metadata_idx), var->get_metadata_value(metadata_idx));
164 fprintf(stderr, " -cache_uri str The URI for the reader to use for the cache. Default: No cache\n");
165 fprintf(stderr, " -server_uri str The URI for the reader to connect to a running DVS server. Default: no server\n");
166 fprintf(stderr, " -server n r v Start a server using server number [n], expecting [r] local ranks for DVS connections to connect to with verbosity [v]. Local Rank Min/Max: 1/1000. Defaults to 0 1 0\n");
167 fprintf(stderr, " -server_filter A filter to apply to the query generated from the DVS server");
168 fprintf(stderr, " -all_coords Print the full coordinates for the mesh chunks iterated over (not a good idea for large datasets)\n");
169 fprintf(stderr, " -all_conn Print the full connectivity for the element blocks iterated over (not a good idea for large datasets)\n");
170 fprintf(stderr, " -all_vars Print the full variable values for mesh chunks and element blocks (not a good idea for large datasets)\n");
182 std::unique_ptr<DVS::IQuery, std::function<void(DVS::IQuery*)>> dataset_query(DVS::CREATE_QUERY_INSTANCE(),
195 dataset_query->set_logger(new DVS::LoggerVerbose(nullptr, dvs_verbosity::DVS_VERBOSE, &logging_function));
400 fprintf(stdout, "Key: %s, Val: %s\n", dataset->get_metadata_key(cur_pair), dataset->get_metadata_value(cur_pair));
488 fprintf(stdout, "Size of coords arrays: X(I): %d Y(J): %d Z(K): %d\n", num_coords[0], num_coords[1], num_coords[2]);
534 fprintf(stdout, "LocalIJKMin: %f %f %f\n", local_ijk_min[0], local_ijk_min[1], local_ijk_min[2]);
535 fprintf(stdout, "LocalIJKMax: %f %f %f\n", local_ijk_max[0], local_ijk_max[1], local_ijk_max[2]);
536 fprintf(stdout, "GlobalIJKMax: %f %f %f\n", global_ijk_max[0], global_ijk_max[1], global_ijk_max[2]);
585 fprintf(stdout, "LocalIJKMin: %f %f %f\n", local_ijk_min[0], local_ijk_min[1], local_ijk_min[2]);
586 fprintf(stdout, "LocalIJKMax: %f %f %f\n", local_ijk_max[0], local_ijk_max[1], local_ijk_max[2]);
587 fprintf(stdout, "GlobalIJKMax: %f %f %f\n", global_ijk_max[0], global_ijk_max[1], global_ijk_max[2]);
632 if (nodal_var_hash_1.empty() || DVS_NONE != mesh_chunk->get_var_hash(var_index, &(nodal_var_hash_1[0]))) {
635 if (nodal_var_hash_2.empty() || DVS_NONE != mesh_chunk->get_var_hash(var, &(nodal_var_hash_2[0]))) {
642 fprintf(stdout, "Nodal Var: %s, Num Values: %u, Hash: %s\n", var->get_name(), num_var_values, nodal_var_hash_1.c_str());
679 if (DVS_NONE != mesh_chunk->get_variable_size(var_index, num_var_values, DVS::VAR_TYPE::FLOAT)) {
683 std::string nodal_var_hash_1(mesh_chunk->get_var_hash_size(var_index, DVS::VAR_TYPE::FLOAT), 0);
685 if (nodal_var_hash_1.empty() || DVS_NONE != mesh_chunk->get_var_hash(var_index, &(nodal_var_hash_1[0]), DVS::VAR_TYPE::FLOAT)) {
688 if (nodal_var_hash_2.empty() || DVS_NONE != mesh_chunk->get_var_hash(var, &(nodal_var_hash_2[0]))) {
695 fprintf(stdout, "Nodal Var: %s, Num Values: %u, Hash: %s\n", var->get_name(), num_var_values, nodal_var_hash_1.c_str());
732 if (DVS_NONE != mesh_chunk->get_variable_size(var_index, num_var_values, DVS::VAR_TYPE::INT64)) {
736 std::string nodal_var_hash_1(mesh_chunk->get_var_hash_size(var_index, DVS::VAR_TYPE::INT64), 0);
738 if (nodal_var_hash_1.empty() || DVS_NONE != mesh_chunk->get_var_hash(var_index, &(nodal_var_hash_1[0]), DVS::VAR_TYPE::INT64)) {
741 if (nodal_var_hash_2.empty() || DVS_NONE != mesh_chunk->get_var_hash(var, &(nodal_var_hash_2[0]))) {
748 fprintf(stdout, "Nodal Var: %s, Num Values: %u, Hash: %s\n", var->get_name(), num_var_values, nodal_var_hash_1.c_str());
814 if (DVS_NONE != elem_block->get_connectivity_polygon_size(nodes_per_polygon_size, indices_size)) {
822 fprintf(stdout, "- Unstructured Polygon Element: Type: %i, Ghost: %u, Number of Elements: %u, Nodes Per Poly: %u, Indices Size: %u, Hash: %s\n",
823 elem_type, elem_block->get_is_ghost(), num_elements, nodes_per_polygon_size, indices_size, conn_hash.c_str());
874 if (DVS_NONE != elem_block->get_connectivity_polyhedral_size(faces_per_elem_size, nodes_per_face_size, indices_size)) {
883 fprintf(stdout, "- Unstructured Polyhedral Element: Type: %i, Ghost: %u, Number of Elements: %u, FPE: %u NPF: %u Indices: %u, Hash: %s\n",
884 elem_type, elem_block->get_is_ghost(), num_elements, faces_per_elem_size, nodes_per_face_size, indices_size, conn_hash.c_str());
950 fprintf(stdout, "- Structured Element: Type: %i NPE: %u Hash: %s\n", elem_type, nodes_per_element, conn_hash.c_str());
994 fprintf(stdout, "- Unstructured Basic Element: Type: %i, Ghost: %u, Number of Elements: %u, Nodes Per Elem: %u, Indices Size: %u, Hash: %s\n",
995 elem_type, elem_block->get_is_ghost(), num_elements, nodes_per_elem, indices_size, conn_hash.c_str());
1035 if (elem_var_hash_1.empty() || DVS_NONE != elem_block->get_var_hash(var_index, &(elem_var_hash_1[0]))) {
1038 if (elem_var_hash_2.empty() || DVS_NONE != elem_block->get_var_hash(var, &(elem_var_hash_2[0]))) {
1044 fprintf(stdout, "Elemental Var: %s, Num Values: %u, Hash: %s\n", var->get_name(), num_elem_var_values, elem_var_hash_1.c_str());
1073 if (DVS_NONE != elem_block->get_num_variables(num_elemental_vars_floats, DVS::VAR_TYPE::FLOAT)) {
1083 if (DVS_NONE != elem_block->get_variable_size(var_index, num_elem_var_values, DVS::VAR_TYPE::FLOAT)) {
1086 std::string elem_var_hash_1(elem_block->get_var_hash_size(var_index, DVS::VAR_TYPE::FLOAT), 0);
1088 if (elem_var_hash_1.empty() || DVS_NONE != elem_block->get_var_hash(var_index, &(elem_var_hash_1[0]), DVS::VAR_TYPE::FLOAT)) {
1091 if (elem_var_hash_2.empty() || DVS_NONE != elem_block->get_var_hash(var, &(elem_var_hash_2[0]))) {
1097 fprintf(stdout, "Elemental Var: %s, Num Values: %u, Hash: %s\n", var->get_name(), num_elem_var_values, elem_var_hash_1.c_str());
1126 if (DVS_NONE != elem_block->get_num_variables(num_elemental_vars_int64s, DVS::VAR_TYPE::INT64)) {
1136 if (DVS_NONE != elem_block->get_variable_size(var_index, num_elem_var_values, DVS::VAR_TYPE::INT64)) {
1139 std::string elem_var_hash_1(elem_block->get_var_hash_size(var_index, DVS::VAR_TYPE::INT64), 0);
1141 if (elem_var_hash_1.empty() || DVS_NONE != elem_block->get_var_hash(var_index, &(elem_var_hash_1[0]), DVS::VAR_TYPE::INT64)) {
1144 if (elem_var_hash_2.empty() || DVS_NONE != elem_block->get_var_hash(var, &(elem_var_hash_2[0]))) {
1150 fprintf(stdout, "Elemental Var: %s, Num Values: %u, Hash: %s\n", var->get_name(), num_elem_var_values, elem_var_hash_1.c_str());
virtual uint32_t get_num_ranks() const =0
Get the number of ranks for the dataset.
virtual uint32_t get_num_plots() const =0
Get the number of plots for this datasets.
virtual uint32_t get_num_chunks_per_rank() const =0
Get the size of the chunks_per_rank array for get_chunks_per_rank()
virtual uint32_t get_num_parts() const =0
Get the number of parts for this dataset.
virtual const DVS::IObject * get_plot(uint32_t index) const =0
Get the plot object.
virtual dvs_ret get_ranks(uint32_t *ranks) const =0
Get an array of the ranks for this dataset query.
virtual uint32_t get_num_variables() const =0
Get the number of variables for this dataset.
virtual const DVS::IObject * get_part(uint32_t index) const =0
Get a part by index.
virtual const char * get_unit_system() const =0
Get the unit system of the dataset.
virtual dvs_ret get_chunks_per_rank(uint32_t *chunks_per_rank) const =0
Get the number of chunks for each rank.
virtual uint32_t get_hash_size() const =0
Get the size of the hash to use with IHash::get_hash()
virtual dvs_ret get_num_variables(uint32_t &num_vars, VAR_TYPE type=VAR_TYPE::FLOAT) const =0
Get the number of nodal variables this mesh chunk has data for, based on the specified type.
virtual dvs_ret get_coords_size(uint32_t &component_size)=0
Get the size of each coordinate component for unstructured meshes.
virtual dvs_ret get_coords_interleaved(float *coords)=0
Get the coords for a unstructured meshes interleaved in a single array.
virtual const DVS::IVar * get_variable(uint32_t index, VAR_TYPE type=VAR_TYPE::FLOAT) const =0
Get the variable definition associates with the nodal variable for this index and the specified type.
virtual dvs_ret get_element_block_types(dvs_element_type *element_types) const =0
Get an array of the element block types for this mesh chunk.
virtual dvs_ret get_coords_curv_interleaved(float local_ijk_min[3], float local_ijk_max[3], float global_ijk_max[3], float *coords)=0
Get the coords for structured curvilinear meshes interleaved in a single array.
virtual dvs_ret get_num_element_blocks(uint32_t &num_elem_blocks) const =0
Get the number of element blocks for this mesh chunk.
virtual dvs_ret get_variable_size(uint32_t index, uint32_t &num_values, VAR_TYPE type=VAR_TYPE::FLOAT) const =0
Get the variable size via the index and specified type.
virtual dvs_ret get_coords_curv_size(uint32_t &component_size)=0
Get the size of each coordinate component for structured curvilinear meshes.
virtual dvs_ret get_coords(float *x_coords, float *y_coords, float *z_coords)=0
Get the coordinates for an unstructured mesh.
virtual DVS::IElementBlock * get_element_block_by_type(dvs_element_type type)=0
Get the element block by element type.
virtual dvs_ret get_coords_curv(float local_ijk_min[3], float local_ijk_max[3], float global_ijk_max[3], float *x_coords, float *y_coords, float *z_coords)=0
Get coordinate data for a structured curvilinear mesh.
virtual dvs_ret get_coords_parallele(float origin[3], float dir_vec_i[3], float dir_vec_j[3], float dir_vec_k[3], float local_ijk_min[3], float local_ijk_max[3], float global_ijk_max[3], float *i_vals, float *j_vals, float *k_vals)=0
Get the ijk mesh information for structured parallelepiped mesh chunks.
virtual const DVS::IObject * get_object() const =0
Get the object definiton this mesh chunk is associated with.
virtual dvs_ret get_coords_parallele_size(uint32_t &i_vals_size, uint32_t &j_vals_size, uint32_t &k_vals_size)=0
Get the size of each ijk component for structured parallelpiped meshes.
virtual dvs_ret get_variable_data(uint32_t index, float *array) const =0
Get the variable data by index.
virtual const char * get_metadata_key(uint32_t index) const =0
Get the metadata key by index.
virtual uint32_t get_num_metadata() const =0
Get the number of metadata objects.
virtual const char * get_metadata_value(uint32_t index) const =0
Get the metadata value by index.
virtual const DVS::IDataset * get_dataset() const =0
Get the reference dataset for this object.
Interface class used to run a dynamic data server in a thread accepting incoming client connections.
Definition dvs_server_interface.h:60
virtual void set_option(const char *key, const char *value)=0
Set a specific option on the server, these are used during startup See See Server Options.
virtual dvs_ret get_timestep_count(uint32_t &num_pending, uint32_t &num_complete) const =0
return the current number of pending and complete timesteps in the server
virtual dvs_ret startup_unthreaded(uint32_t server_number, uint32_t local_ranks)=0
Startup a server manually without threads.
virtual DVS::IQuery * create_query(const std::string &filter=std::string(), DVS::IQuery *parent=nullptr)=0
Create a DVS query instance. This will inherit the DVS server reader instance.
virtual dvs_ret get_var_hash(uint32_t index, char *hash, VAR_TYPE type=VAR_TYPE::FLOAT) const =0
Get the hash of the variable data.
virtual uint32_t get_var_hash_size(uint32_t index, VAR_TYPE type=VAR_TYPE::FLOAT) const =0
Get the size of the hash to use with IVarHash::get_var_hash()
virtual const char * get_metadata_value(uint32_t index) const =0
Get the metadata value base on the index.
virtual uint32_t get_num_metadata() const =0
Get the num metadata values on this var.
virtual const char * get_unit_dimension() const =0
Get the unit dimensions as string.
virtual dvs_var_location get_var_location() const =0
Get the var location.
virtual uint32_t get_float_count_per_value() const =0
Get the number of floats per value.
virtual const char * get_unit_label() const =0
Get the unit label as string.
virtual const DVS::IDataset * get_dataset() const =0
Get the reference dataset for this var.
virtual const char * get_metadata_key(uint32_t index) const =0
Get a metadata key based on the index.
C++ Server API for using Dynamic Visualization Store Server.
@ DVS_VERBOSE
Displays informational messages, warnings, errors.
Definition dynamic_visualization_store_enums.h:86
@ ELEMENT
This is a field variable per each element of a part.
Definition dynamic_visualization_store_enums.h:20
@ NODE
This is a field variable per each node of a part's mesh.
Definition dynamic_visualization_store_enums.h:19
@ CASE
This is a variable for an entire case (i.e. dataset)
Definition dynamic_visualization_store_enums.h:22
int32_t dvs_ret
Return value of methods, TODO.
Definition dynamic_visualization_store_error_codes.h:32
#define DVS_NONE
No detected error has occurred.
Verbosity based logger for DVS.
int main(int argc, char **argv)
Main method of test reader application.
Definition test_dvs_reader.cpp:93