Skip to main content

Post-processing tools 2025 R1

dvs_mesh_chunk_interface

Last update: 16.07.2025
Go to the documentation of this file.
1/**************************************************************
2*
3* (C) 2022 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
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
24#ifndef ___DVS_MESH_CHUNK_INTERFACE_H___
25#define ___DVS_MESH_CHUNK_INTERFACE_H___
26
29
32#include "dvs_var_interface.h"
33#include "dvs_hash_interface.h"
35
36namespace DVS
37{
38
48class IMeshChunk : public DVS::IHash, public DVS::IVarHash
49{
50public:
51
52 IMeshChunk() = default;
53 virtual ~IMeshChunk() = default;
54 IMeshChunk(IMeshChunk&&) = default;
56 IMeshChunk(const IMeshChunk&) = default;
57 IMeshChunk& operator=(const IMeshChunk&) = default;
58
70
75 enum Axis
76 {
77 X = 0,
78 Y = 1,
79 Z = 2,
80 };
81
87 virtual MeshType get_type() const = 0;
88
94 virtual const DVS::IObject* get_object() const = 0;
95
101 virtual float get_time() const = 0;
102
108 virtual uint32_t get_rank() const = 0;
109
115 virtual uint32_t get_chunk() const = 0;
116
131 virtual dvs_ret get_coords_size(uint32_t& component_size) = 0;
132
155 virtual dvs_ret get_coords(float* x_coords, float* y_coords, float* z_coords) = 0;
156
175 virtual dvs_ret get_coords_interleaved(float* coords) = 0;
176
192 virtual dvs_ret get_coords_curv_size(uint32_t& component_size) = 0;
193
224 virtual dvs_ret get_coords_curv(float local_ijk_min[3], float local_ijk_max[3], float global_ijk_max[3],
225 float* x_coords, float* y_coords, float* z_coords) = 0;
226
254 virtual dvs_ret get_coords_curv_interleaved(float local_ijk_min[3], float local_ijk_max[3], float global_ijk_max[3],
255 float* coords) = 0;
256
274 virtual dvs_ret get_coords_parallele_size(uint32_t& i_vals_size, uint32_t& j_vals_size, uint32_t& k_vals_size) = 0;
275
311 virtual dvs_ret get_coords_parallele(float origin[3],
312 float dir_vec_i[3], float dir_vec_j[3], float dir_vec_k[3],
313 float local_ijk_min[3], float local_ijk_max[3], float global_ijk_max[3],
314 float* i_vals, float* j_vals, float* k_vals) = 0;
315
329 virtual dvs_ret get_num_variables(uint32_t& num_vars, VAR_TYPE type = VAR_TYPE::FLOAT) const = 0;
330
342 virtual const DVS::IVar* get_variable(uint32_t index, VAR_TYPE type = VAR_TYPE::FLOAT) const = 0;
343
358 virtual dvs_ret get_variable_size(uint32_t index, uint32_t& num_values, VAR_TYPE type = VAR_TYPE::FLOAT) const = 0;
359
373 virtual dvs_ret get_variable_size(const IVar* var, uint32_t& num_values) const = 0;
374
396 virtual dvs_ret get_variable_data(uint32_t index, float* array) const = 0;
397
419 virtual dvs_ret get_variable_data(uint32_t index, int64_t* array) const = 0;
420
440 virtual dvs_ret get_variable_data(const IVar* var, float* array) const = 0;
441
461 virtual dvs_ret get_variable_data(const IVar* var, int64_t* array) const = 0;
462
484 [[deprecated("Use dvs_ret get_variable_data(uint32_t index, float* array) instead.")]]
485 virtual dvs_ret get_variable_data(uint32_t index, uint32_t* num_values, float* array) = 0;
486
506 [[deprecated("Use dvs_ret get_variable_data(const IVar* var, float* array) instead.")]]
507 virtual dvs_ret get_variable_data(const IVar* var, uint32_t* num_values, float* array) = 0;
508
522 virtual dvs_ret get_num_element_blocks(uint32_t& num_elem_blocks) const = 0;
523
534 virtual dvs_ret get_element_block_types(dvs_element_type* element_types) const = 0;
535
546 virtual DVS::IElementBlock* get_element_block(uint32_t index) = 0;
547
562};
563
564} //namespace DVS
565
566#endif //___DVS_MESH_CHUNK_INTERFACE_H___
Element Block Interface for DVS Reader API.
Interface to get hash information from DVS objects.
Mesh Chunk Interface for DVS Reader API.
virtual ~IMeshChunk()=default
default
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_variable_data(const IVar *var, float *array) const =0
Get the variable data by variable.
virtual float get_time() const =0
Get the time for this mesh chunk.
Axis
The AXIS or IJK component to request.
@ X
The X axis (or i component for structured parts)
@ Z
The Z axis (or k component for structured parts)
@ Y
The X axis (or j component for structured parts)
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.
IMeshChunk & operator=(const IMeshChunk &)=default
default
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_variable_data(uint32_t index, int64_t *array) const =0
Get the variable data by index.
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 uint32_t get_chunk() const =0
Get the chunk for this mesh chunk.
virtual uint32_t get_rank() const =0
Get the rank for the mesh chunk.
IMeshChunk()=default
default
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.
IMeshChunk(IMeshChunk &&)=default
default
virtual DVS::IElementBlock * get_element_block_by_type(dvs_element_type type)=0
Get the element block by element type.
MeshType
The different mesh types allowed.
@ PARALLELEPIPED
Parallelepiped structured mesh data.
@ UNKNOWN
Unknown, a problem occurred.
@ CURVILINEAR
Curvilinear structured mesh data.
@ UNSTRUCTURED
Unstructured mesh data.
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.
IMeshChunk(const IMeshChunk &)=default
support copying
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_size(const IVar *var, uint32_t &num_values) const =0
Get the variable size by variable.
virtual MeshType get_type() const =0
Get the type of mesh chunk.
virtual dvs_ret get_variable_data(uint32_t index, uint32_t *num_values, float *array)=0
Get the variable data by index.
virtual const DVS::IObject * get_object() const =0
Get the object definiton this mesh chunk is associated with.
IMeshChunk & operator=(IMeshChunk &&)=default
default
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(const IVar *var, uint32_t *num_values, float *array)=0
Get the variable data by variable.
virtual dvs_ret get_variable_data(uint32_t index, float *array) const =0
Get the variable data by index.
virtual dvs_ret get_variable_data(const IVar *var, int64_t *array) const =0
Get the variable data by variable.
virtual DVS::IElementBlock * get_element_block(uint32_t index)=0
Get the element block by index.
Interface for part/plot objects for DVS Reader API.
Interface to get variable hash information from DVS objects.
Interface for variables for the DVS Reader API.
DVS Reader API Element Block Interface.
DVS Reader API Hash Interface.
DVS Reader API Object Interface.
DVS Reader API Variable Hash Interface.
DVS Reader API Variable Interface.
VAR_TYPE
Variable type enum definition.
Contains enums used in C/C++ API.
dvs_element_type
List of macro generated enums.
Contains errors used in the DVS C/C++ API.
int32_t dvs_ret
Return value of methods, TODO.

Connect with Ansys