test_dvs_reader.cpp
Last update: 17.04.2023
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));
131 fprintf(stderr, " -cache_uri str The URI for the reader to use for the cache. Default: No cache\n");
132 fprintf(stderr, " -all_coords Print the full coordinates for the mesh chunks iterated over (not a good idea for large datasets)\n");
133 fprintf(stderr, " -all_conn Print the full connectivity for the element blocks iterated over (not a good idea for large datasets)\n");
134 fprintf(stderr, " -all_vars Print the full variable values for mesh chunks and element blocks (not a good idea for large datasets)\n");
145 std::unique_ptr<DVS::IQuery, std::function<void(DVS::IQuery*)>> dataset_query(DVS::CREATE_QUERY_INSTANCE(),
147 dataset_query->set_logger(new DVS::LoggerVerbose(nullptr, dvs_verbosity::DVS_VERBOSE, &logging_function));
328 fprintf(stdout, "Key: %s, Val: %s\n", dataset->get_metadata_key(cur_pair), dataset->get_metadata_value(cur_pair));
416 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]);
462 fprintf(stdout, "LocalIJKMin: %f %f %f\n", local_ijk_min[0], local_ijk_min[1], local_ijk_min[2]);
463 fprintf(stdout, "LocalIJKMax: %f %f %f\n", local_ijk_max[0], local_ijk_max[1], local_ijk_max[2]);
464 fprintf(stdout, "GlobalIJKMax: %f %f %f\n", global_ijk_max[0], global_ijk_max[1], global_ijk_max[2]);
513 fprintf(stdout, "LocalIJKMin: %f %f %f\n", local_ijk_min[0], local_ijk_min[1], local_ijk_min[2]);
514 fprintf(stdout, "LocalIJKMax: %f %f %f\n", local_ijk_max[0], local_ijk_max[1], local_ijk_max[2]);
515 fprintf(stdout, "GlobalIJKMax: %f %f %f\n", global_ijk_max[0], global_ijk_max[1], global_ijk_max[2]);
560 if (nodal_var_hash_1.empty() || DVS_NONE != mesh_chunk->get_var_hash(var_index, &(nodal_var_hash_1[0]))) {
563 if (nodal_var_hash_2.empty() || DVS_NONE != mesh_chunk->get_var_hash(var, &(nodal_var_hash_2[0]))) {
570 fprintf(stdout, "Nodal Var: %s, Num Values: %u, Hash: %s\n", var->get_name(), num_var_values, nodal_var_hash_1.c_str());
630 if (DVS_NONE != elem_block->get_connectivity_polygon_size(nodes_per_polygon_size, indices_size)) {
638 fprintf(stdout, "- Unstructured Polygon Element: Type: %i, Ghost: %u, Number of Elements: %u, Nodes Per Poly: %u, Indices Size: %u, Hash: %s\n",
639 elem_type, elem_block->get_is_ghost(), num_elements, nodes_per_polygon_size, indices_size, conn_hash.c_str());
690 if (DVS_NONE != elem_block->get_connectivity_polyhedral_size(faces_per_elem_size, nodes_per_face_size, indices_size)) {
699 fprintf(stdout, "- Unstructured Polyhedral Element: Type: %i, Ghost: %u, Number of Elements: %u, FPE: %u NPF: %u Indices: %u, Hash: %s\n",
700 elem_type, elem_block->get_is_ghost(), num_elements, faces_per_elem_size, nodes_per_face_size, indices_size, conn_hash.c_str());
766 fprintf(stdout, "- Structured Element: Type: %i NPE: %u Hash: %s\n", elem_type, nodes_per_element, conn_hash.c_str());
810 fprintf(stdout, "- Unstructured Basic Element: Type: %i, Ghost: %u, Number of Elements: %u, Nodes Per Elem: %u, Indices Size: %u, Hash: %s\n",
811 elem_type, elem_block->get_is_ghost(), num_elements, nodes_per_elem, indices_size, conn_hash.c_str());
850 if (elem_var_hash_1.empty() || DVS_NONE != elem_block->get_var_hash(var_index, &(elem_var_hash_1[0]))) {
853 if (elem_var_hash_2.empty() || DVS_NONE != elem_block->get_var_hash(var, &(elem_var_hash_2[0]))) {
859 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 const DVS::IObject * get_plot(uint32_t index) const =0
Get the plot object.
virtual uint32_t get_num_plots() const =0
Get the number of plots for this datasets.
virtual const char * get_unit_system() const =0
Get the unit system of the dataset.
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_part(uint32_t index) const =0
Get a part by index.
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 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_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 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::IElementBlock * get_element_block_by_type(dvs_element_type type)=0
Get the element block by element type.
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_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_ret get_num_variables(uint32_t &num_vars) const =0
Get the number of nodal variables this mesh chunk has data for.
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 dvs_ret get_variable_data(uint32_t index, uint32_t *num_values, float *array)=0
Get the variable data by index.
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 const DVS::IObject * get_object() const =0
Get the object definiton this mesh chunk is associated with.
virtual const DVS::IVar * get_variable(uint32_t index) const =0
Get the variable definition associates with the nodal variable for this index.
Interface for part/plot objects for DVS Reader API.
Definition: dvs_object_interface.h:45
virtual uint32_t get_num_metadata() const =0
Get the number of metadata objects.
virtual const char * get_metadata_key(uint32_t index) const =0
Get the metadata key by index.
virtual const DVS::IDataset * get_dataset() const =0
Get the reference dataset for this object.
virtual const char * get_metadata_value(uint32_t index) const =0
Get the metadata value by index.
virtual dvs_ret get_var_hash(uint32_t index, char *hash) const =0
Get the hash of the variable data.
virtual uint32_t get_var_hash_size(uint32_t index) const =0
Get the size of the hash to use with IVarHash::get_var_hash()
virtual const char * get_metadata_key(uint32_t index) const =0
Get a metadata key based on the index.
virtual uint32_t get_num_metadata() const =0
Get the num metadata values on this var.
virtual const DVS::IDataset * get_dataset() const =0
Get the reference dataset for this var.
virtual const char * get_unit_label() const =0
Get the unit label as string.
virtual dvs_var_location get_var_location() const =0
Get the var location.
virtual const char * get_metadata_value(uint32_t index) const =0
Get the metadata value base on the index.
virtual uint32_t get_float_count_per_value() const =0
Get the number of floats per value.
virtual const char * get_unit_dimension() const =0
Get the unit dimensions as string.
DVS Reader API Query Interface.
@ 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:17
#define DVS_NONE
No detected error has occurred.
Definition: dynamic_visualization_store_error_codes.h:81
Verbosity based logger for DVS.
int main(int argc, char **argv)
Main method of test reader application.
Definition: test_dvs_reader.cpp:93