Skip to main content

Post-processing tools 2023 R2

DVS::IElementBlock Class Reference

Last update: 17.04.2023

Element Block Interface for DVS Reader API. More...

#include <dvs_element_block_interface.h>

Inheritance diagram for DVS::IElementBlock:
DVS::IHashDVS::IVarHash

Public Member Functions

 IElementBlock ()=default
 default
 
virtual ~IElementBlock ()=default
 default
 
 IElementBlock (IElementBlock &&)=default
 default
 
IElementBlockoperator= (IElementBlock &&)=default
 default
 
 IElementBlock (const IElementBlock &)=default
 support copying
 
IElementBlockoperator= (const IElementBlock &)=default
 default
 
virtual dvs_element_type get_element_type () const =0
 Get the element type for this block. More...
 
virtual bool get_is_ghost () const =0
 Get if this element block is composed of ghost elements. More...
 
virtual dvs_ret get_num_variables (uint32_t &num_vars) const =0
 Get the number of elemental variables this element block has data for. More...
 
virtual const DVS::IVarget_variable (uint32_t index) const =0
 Get the variable definition associates with the elemental variable for this index. More...
 
virtual dvs_ret get_variable_data (uint32_t index, uint32_t *num_values, float *array)=0
 Get the variable data on this mesh chunk by index. More...
 
virtual dvs_ret get_variable_data (const IVar *var, uint32_t *num_values, float *array)=0
 Get the variable data on this mesh chunk by by variable definition. More...
 
virtual dvs_ret get_nodes_per_element (uint32_t &nodes_per_element) const =0
 Get the number of nodes per basic unstructured element. More...
 
virtual dvs_ret get_num_elements (uint32_t &num_elements) const =0
 Get the number of elements for this block. More...
 
virtual dvs_ret get_connectivity_size (uint32_t &indices_size)=0
 Get the size of the connectivity array. More...
 
virtual dvs_ret get_connectivity (uint32_t *indices)=0
 Get the connectivity for basic unstructured element types. More...
 
virtual dvs_ret get_connectivity_polygon_size (uint32_t &nodes_per_polygon_size, uint32_t &indices_size)=0
 Get the size of the connectivity arrays for polygon elements. More...
 
virtual dvs_ret get_connectivity_polygon (uint32_t *nodes_per_polygon, uint32_t *indices)=0
 Get the connectivity information for polygonal element blocks. More...
 
virtual dvs_ret get_connectivity_polyhedral_size (uint32_t &faces_per_element_size, uint32_t &nodes_per_face_size, uint32_t &indices_size)=0
 Get size of the connectivity arrays for polyhedral elements. More...
 
virtual dvs_ret get_connectivity_polyhedral (uint32_t *faces_per_element, uint32_t *nodes_per_face, uint32_t *indices)=0
 Get the connectivity information for polyhedral element blocks. More...
 
- Public Member Functions inherited from DVS::IHash
 IHash ()=default
 default
 
virtual ~IHash ()=default
 default
 
 IHash (IHash &&)=default
 default
 
IHashoperator= (IHash &&)=default
 default
 
 IHash (const IHash &)=default
 support copying
 
IHashoperator= (const IHash &)=default
 default
 
virtual uint32_t get_hash_size () const =0
 Get the size of the hash to use with IHash::get_hash() More...
 
virtual dvs_ret get_hash (char *hash) const =0
 Get the hash of the data. More...
 
- Public Member Functions inherited from DVS::IVarHash
 IVarHash ()=default
 default
 
virtual ~IVarHash ()=default
 default
 
 IVarHash (IVarHash &&)=default
 default
 
IVarHashoperator= (IVarHash &&)=default
 default
 
 IVarHash (const IVarHash &)=default
 support copying
 
IVarHashoperator= (const IVarHash &)=default
 default
 
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() More...
 
virtual uint32_t get_var_hash_size (const IVar *var) const =0
 Get the size of the hash to use with IVarHash::get_var_hash() More...
 
virtual dvs_ret get_var_hash (uint32_t index, char *hash) const =0
 Get the hash of the variable data. More...
 
virtual dvs_ret get_var_hash (const IVar *var, char *hash) const =0
 Get the hash of the variable data. More...
 

Detailed Description

Element Block Interface for DVS Reader API.

Element blocks contain the connectivity and variable data for elements. There is one element block per element type the mesh block has data available for.

Note: Structured data's connectivity is implicit and the element block only contains variable information for elements. Structured data is also different for ghost elements as the ghost elements are represented as an elemental variable instead of as an element block as unstructured data represents it. We might want to change this in future versions so structured data is better aligned with unstructured data in DVS but currently this is how the information is represented. See DVS::IHash and DVS::IVarHash for the hash object interface.

Definition at line 51 of file dvs_element_block_interface.h.

Member Function Documentation

◆ get_connectivity()

virtual dvs_ret DVS::IElementBlock::get_connectivity ( uint32_t *  indices)
pure virtual

Get the connectivity for basic unstructured element types.

This method returns the connectivity array for a basic unstructured element. If retrieving the indices array it should be of size indices_size returned from get_connectivity_size().

Error Codes:

  • DVS_NONE: No error
  • DVS_INVALID_ELEMENT_TYPE: This element block is not a basic unstructured type
  • DVS_INVALID_CACHE: Loading cache failed, possibly invalid cache or invalid permissions
  • DVS_DATA_FAILED_LOAD: There was a failure loading data, data is either empty or missing
Parameters
[out]indicesIf not nullptr should be of size indices_size from get_connectivity_size()
Returns
dvs_ret DVS_NONE on no error, see the method documentation for errors

◆ get_connectivity_polygon()

virtual dvs_ret DVS::IElementBlock::get_connectivity_polygon ( uint32_t *  nodes_per_polygon,
uint32_t *  indices 
)
pure virtual

Get the connectivity information for polygonal element blocks.

This method returns the different connectivity arrays for polygonal elements. The size of the arrays to allocate should be retrieved through the method get_connectivity_polygon_size().

Polygonal elements are described by 2 arrays. nodes_per_polygon is the number of nodes for each element. indices is the connectivity array for each element. So a square might look like: nodes_per_polygon: [4] (of size 1) indices: [0, 1, 2, 3] (of size 4)

Error Codes:

  • DVS_NONE: No error
  • DVS_INVALID_ELEMENT_TYPE: This element block is not a basic unstructured type
  • DVS_INVALID_CACHE: Loading cache failed, possibly invalid cache or invalid permissions
  • DVS_DATA_FAILED_LOAD: There was a failure loading data, data is either empty or missing
Parameters
[out]nodes_per_polygonan ouput array of size nodes_per_polygon_size from get_connectivity_polygon_size()
[out]indicesan output array of size indices_size from get_connectivity_polygon_size()
Returns
dvs_ret DVS_NONE on no error, see the method documentation for errors

◆ get_connectivity_polygon_size()

virtual dvs_ret DVS::IElementBlock::get_connectivity_polygon_size ( uint32_t &  nodes_per_polygon_size,
uint32_t &  indices_size 
)
pure virtual

Get the size of the connectivity arrays for polygon elements.

This method returns the size of the connectivity arrays for polygon elements. This should be used to allocate array sizes for use with get_connectivity_polygon().

nodes_per_polygon_size is the total number of elements for this element type indices_size is the size of the total connectivity array

Error Codes:

  • DVS_NONE: No error
  • DVS_INVALID_ELEMENT_TYPE: This element block is not a basic unstructured type
Parameters
[out]nodes_per_polygon_sizethe number of nodes per polygon, this is also the total number of elements
[out]indices_sizethe total size of the connectivity array
Returns
dvs_ret DVS_NONE on no error, see the method documentation for errors

◆ get_connectivity_polyhedral()

virtual dvs_ret DVS::IElementBlock::get_connectivity_polyhedral ( uint32_t *  faces_per_element,
uint32_t *  nodes_per_face,
uint32_t *  indices 
)
pure virtual

Get the connectivity information for polyhedral element blocks.

This method returns the different connectivity arrays for polyhedral elements. The size of the arrays to allocate should be retrieved through the method get_connectivity_polygon_size().

Polyhedral elements are described by 3 arrays. faces_per_element is the number of faces each individual element is made up of. Nodes per face is the number of nodes within each respective face. And the indices array of the connectivity of each face. So a cube might look like: faces_per_element: [6] (of size 1) nodes_per_face: [4,4,4,4,4,4] (of size 6) indices: [0,1,2,3 ..... ] (of size 24)

Error Codes:

  • DVS_NONE: No error
  • DVS_INVALID_ELEMENT_TYPE: This element block is not a basic unstructured type
  • DVS_INVALID_CACHE: Loading cache failed, possibly invalid cache or invalid permissions
  • DVS_DATA_FAILED_LOAD: There was a failure loading data, data is either empty or missing
Parameters
[out]faces_per_elementand output array of size faces_per_element_size from get_connectivity_polyhedral_size()
[out]nodes_per_facean output array of size nodes_per_face_size from get_connectivity_polyhedral_size()
[out]indicesan output array of size indices_size from get_connectivity_polyhedral_size()
Returns
dvs_ret DVS_NONE on no error, see the method documentation for errors

◆ get_connectivity_polyhedral_size()

virtual dvs_ret DVS::IElementBlock::get_connectivity_polyhedral_size ( uint32_t &  faces_per_element_size,
uint32_t &  nodes_per_face_size,
uint32_t &  indices_size 
)
pure virtual

Get size of the connectivity arrays for polyhedral elements.

This method returns the size of the connectivity arrays for polyhedral elements. This should be used to allocate array sizes for use with get_connectivity_polyhedral().

Error Codes:

  • DVS_NONE: No error
  • DVS_INVALID_ELEMENT_TYPE: This element block is not a basic unstructured type
Parameters
[out]faces_per_element_sizethe number of faces per element, this is also the total number of elements
[out]nodes_per_face_sizethe number of nodes for each face in an element
[out]indices_sizethe total number of indices in the connectivity array
Returns
dvs_ret DVS_NONE on no error, see the method documentation for errors

◆ get_connectivity_size()

virtual dvs_ret DVS::IElementBlock::get_connectivity_size ( uint32_t &  indices_size)
pure virtual

Get the size of the connectivity array.

This method returns the size of the connectivity array in the param indices_size. This should be used to get the connectivity via get_connectivity()

Error Codes:

  • DVS_NONE: No error
  • DVS_INVALID_ELEMENT_TYPE: This element block is not a basic unstructured type
Parameters
[out]indices_sizethe size of the connectivity array for this element block
Returns
dvs_ret DVS_NONE on no error, see the method documentation for errors

◆ get_element_type()

virtual dvs_element_type DVS::IElementBlock::get_element_type ( ) const
pure virtual

Get the element type for this block.

Returns
dvs_element_type the element type for this block

◆ get_is_ghost()

virtual bool DVS::IElementBlock::get_is_ghost ( ) const
pure virtual

Get if this element block is composed of ghost elements.

This method returns if the element block is composed of ghost elements. Note: This is only for unstructured data, structured data ghost elements are stored within an elemental variable (DVS_STRUCTURED_GHOST_ELEMENTS)

Returns
true if unstructured ghost elements

◆ get_nodes_per_element()

virtual dvs_ret DVS::IElementBlock::get_nodes_per_element ( uint32_t &  nodes_per_element) const
pure virtual

Get the number of nodes per basic unstructured element.

This method is invalid for polygonal and polyhedral elements

Error Codes:

  • DVS_NONE: No error
  • DVS_INVALID_ELEMENT_TYPE: Returned for polygonal/polyhedral data
  • DVS_UNKNOWN: Unknown new type, should not happen
Parameters
[out]nodes_per_elementthe number of nodes per element
Returns
dvs_ret DVS_NONE on no error, otherwise see method documentation

◆ get_num_elements()

virtual dvs_ret DVS::IElementBlock::get_num_elements ( uint32_t &  num_elements) const
pure virtual

Get the number of elements for this block.

Parameters
[out]num_elementsthe number of elements for this block
Returns
dvs_ret DVS_NONE on no error

◆ get_num_variables()

virtual dvs_ret DVS::IElementBlock::get_num_variables ( uint32_t &  num_vars) const
pure virtual

Get the number of elemental variables this element block has data for.

This method is intended to be used in conjunction with get_variable() and get_variable_data() to retrieve elemental variable data.

Errors:

  • DVS_NONE: Success
Parameters
[out]num_varsif success, returns the number of variables on this element block
Returns
DVS_NONE on success, else see method description

◆ get_variable()

virtual const DVS::IVar* DVS::IElementBlock::get_variable ( uint32_t  index) const
pure virtual

Get the variable definition associates with the elemental variable for this index.

This method retrieves the variable that is associated with the elemental variable of the mesh chunk at a specific index in range [0,get_num_variables()-1]

Parameters
[in]indexindex of variable definition to get in range [0, get_num_variables()-1]
Returns
DVS::IVar* nullptr if out of range, otherwise the variable associated with the index

◆ get_variable_data() [1/2]

virtual dvs_ret DVS::IElementBlock::get_variable_data ( const IVar var,
uint32_t *  num_values,
float *  array 
)
pure virtual

Get the variable data on this mesh chunk by by variable definition.

This method retrieves the elemental variable data based on a specific variable definitions.

Error Codes:

  • DVS_NONE: No error
  • DVS_PARAM_INVALID_VAR: Bad (or null) variable object passed into method
  • DVS_PARAM_INVALID_VAR_ID: Mesh chunk does not have data for var passed in.
  • DVS_PARAM_NULL: All parameters are null. Method will do nothing.
  • DVS_INVALID_CACHE: Cache is unable to be read. Bad location or permissions
  • DVS_INVALID_HASH: Hash of variable data is invalid. There is a problem with the data
  • DVS_DATA_FAILED_LOAD: Data hash in metadata is missing from blockstore. Bad cache or permissions?
Parameters
[in]varthe variable definition to retrieve elemental variable data for
[out]num_valuesif not nullptr returns the number of values to allocate for array
[out]arrayif not nullptr should be of size num_values
Returns
dvs_ret DVS_NONE on no error, otherwise see method description

◆ get_variable_data() [2/2]

virtual dvs_ret DVS::IElementBlock::get_variable_data ( uint32_t  index,
uint32_t *  num_values,
float *  array 
)
pure virtual

Get the variable data on this mesh chunk by index.

This method retrieves elemental variable data based on an index in range [0,get_num_variables()-1]. To retrieve the variable definition associated with the index call get_variable().

Error Codes:

  • DVS_NONE: No error
  • DVS_PARAM_NULL: All parameters are null. Method will do nothing.
  • DVS_PARAM_OUT_OF_BOUNDS: Index out of bounds of [0, get_num_variables()-1]
  • DVS_PARAM_INVALID_VAR: Invalid variable found at index, should not happen
  • DVS_PARAM_INVALID_VAR_ID: Invalid variable id found at index, should not happen
  • DVS_INVALID_CACHE: Cache is unable to be read. Bad location or permissions
  • DVS_INVALID_HASH: Hash of variable data is invalid. There is a problem with the data
  • DVS_DATA_FAILED_LOAD: Data hash in metadata is missing from blockstore. Bad cache or permissions?
Parameters
[in]indexindex of the variable data in range [0,get_num_variables()-1]
[out]num_valuesif not nullptr returns the number of values to allocate for array
[out]arrayif not nullptr must be of size num_values
Returns
dvs_ret DVS_NONE on no error, otherwise see method description

The documentation for this class was generated from the following file: