Skip to main content

EnSight 2025 R2

libuserd::Part Class Reference

Last update: 16.07.2025

#include <libuserd_interface.h>

Inheritance diagram for libuserd::Part:

Public Member Functions

ErrorCode num_nodes (std::size_t &num_coords, int32_t rank=0) override
 num_nodes
 
ErrorCode nodes (float *xyz, int32_t rank=0) override
 nodes
 
ErrorCode num_elements (std::map< ElementType, std::size_t > &elements, int32_t rank=0) override
 num_elements
 
ErrorCode element_conn (ElementType elem_type, uint32_t *connectivity, int32_t rank=0) override
 element_conn
 
ErrorCode element_conn_nsided_size (ElementType elem_type, size_t &nodes_per_polygon_size, size_t &nodes_size, int32_t rank=0) override
 element_conn_nsided_size
 
ErrorCode element_conn_nsided (ElementType elem_type, uint32_t *nodes_per_polygon, uint32_t *nodes, int32_t rank=0) override
 element_conn_nsided
 
ErrorCode element_conn_nfaced_size (ElementType elem_type, size_t &faces_per_element_size, size_t &nodes_per_face_size, size_t &indices_size, int32_t rank=0) override
 element_conn_nfaced_size
 
ErrorCode element_conn_nfaced (ElementType elem_type, uint32_t *faces_per_element, uint32_t *nodes_per_face, uint32_t *nodes, int32_t rank=0) override
 element_conn_nfaced
 
ErrorCode variable_values (IVariable *var, ElementType elem_type, bool complex, uint32_t component, float *array, int32_t rank=0) override
 variable_values
 
ErrorCode rigid_body_transform (struct RigidBodyTransform &transform) override
 rigid_body_transform
 

Friends

class Reader
 

Detailed Description

This class represents a part (block of mesh).

Definition at line 146 of file libuserd_interface.h.

Member Function Documentation

◆ element_conn()

ErrorCode libuserd::Part::element_conn ( ElementType elem_type,
uint32_t * connectivity,
int32_t rank = 0 )
override

element_conn

For all element types other than NFACED and NSIDED, return the connectivity (0-based node indices).

Note: connectivity must be allocated to at least:

num_elements[elem_type]*nodes_per_element(elem_type)

integers.

Parameters
[in]ElementTypeelem_type The element type to get the connectivity for
[out]uint32_t* connectivity The output connectivity values
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ element_conn_nfaced()

ErrorCode libuserd::Part::element_conn_nfaced ( ElementType elem_type,
uint32_t * faces_per_element,
uint32_t * nodes_per_face,
uint32_t * nodes,
int32_t rank = 0 )
override

element_conn_nfaced

Retrieve the nodal indices for a collection of NFACED elements.

Parameters
[in]ElementTypeelem_type The element type: NFACED or NFACED_GHOST
[out]uint32_t* faces_per_element For each element, the number of faces to be consumed
[out]uint32_t* nodes_per_face For each face, the number of nodes to be consumed
[out]uint32_t* nodes The list of nodes.
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ element_conn_nfaced_size()

ErrorCode libuserd::Part::element_conn_nfaced_size ( ElementType elem_type,
size_t & faces_per_element_size,
size_t & nodes_per_face_size,
size_t & indices_size,
int32_t rank = 0 )
override

element_conn_nfaced_size

Before an NFACED mesh can be read, the size of the faces_per_element, nodes_per_face and nodes arrays need to be determined. This methods computes the required size of these arrays so that element_conn_nfaced() can be called with the proper I/O buffers.

Parameters
[in]ElementTypeelem_type The element type: NFACED or NFACED_GHOST
[out]size_t& faces_per_element_size The number of uint32_t values in the faces_per_element buffer
[out]size_t& nodes_per_face_size The number of uint32_t values in the nodes_per_face buffer
[out]size_t& indices_size The number of uint32_t values in the nodes buffer
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ element_conn_nsided()

ErrorCode libuserd::Part::element_conn_nsided ( ElementType elem_type,
uint32_t * nodes_per_polygon,
uint32_t * nodes,
int32_t rank = 0 )
override

element_conn_nsided

Retrieve the nodal indices for a collection of NSIDED elements.

Parameters
[in]ElementTypeelem_type The element type: NSIDED or NSIDED_GHOST
[out]uint32_t& nodes_per_polygon Count of the number of nodes to consume for each polygon
[out]uint32_t& nodes The list of nodes.
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ element_conn_nsided_size()

ErrorCode libuserd::Part::element_conn_nsided_size ( ElementType elem_type,
size_t & nodes_per_polygon_size,
size_t & nodes_size,
int32_t rank = 0 )
override

element_conn_nsided_size

Before an NSIDED mesh can be read, the size of the nodes_per_polygon array and nodes array need to be determined. This methods computes the required size of these arrays so that element_conn_nsided() can be called with the proper I/O buffers.

Parameters
[in]ElementTypeelem_type The element type: NSIDED or NSIDED_GHOST
[out]size_t& nodes_per_polygon_size The number of uint32_t values in the nodes_per_polygon buffer
[out]size_t& nodes_size The number of uint32_t values in the nodes buffer
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ nodes()

ErrorCode libuserd::Part::nodes ( float * xyz,
int32_t rank = 0 )
override

nodes

Get the coordinates of the nodes.

Note: the xyz array needs to be allocated to num_coords()*3 floats.

Parameters
[in,out]float* xyz [x1,y1,z1,x2,y2,z2,...]
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ num_elements()

ErrorCode libuserd::Part::num_elements ( std::map< ElementType, std::size_t > & elements,
int32_t rank = 0 )
override

num_elements

Generate a map of the count of the number of elements of each supported type.

Parameters
[out]std::map<ElementType,std::size_t>& elements For a given element type, how many elements are there
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ num_nodes()

ErrorCode libuserd::Part::num_nodes ( std::size_t & num_coords,
int32_t rank = 0 )
override

num_nodes

The number of nodes in this part in the current timestep

Parameters
[out]std::size_t& num_coords The number of nodes
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

◆ rigid_body_transform()

ErrorCode libuserd::Part::rigid_body_transform ( struct RigidBodyTransform & transform)
override

rigid_body_transform

The rotation, translation, scale to be applied to this part at this timestep.

Parameters
[out]structRigidBodyTransform & transform The current transformation
Returns
ErrorCode will return UNAVAILABLE if it does not exist (and a "unity" transform is returned)

◆ variable_values()

ErrorCode libuserd::Part::variable_values ( IVariable * var,
ElementType elem_type,
bool complex,
uint32_t component,
float * array,
int32_t rank = 0 )
override

variable_values

Get the variable values for the current node, element or constant.

Note: array needs to be at least the number of nodes or elements (for the specified variable and elem_type). For part constants, only a single value is returned.

Parameters
[in]constVariable * var The variable to get the values for
[in]ElementTypeelem_type The element type
[in]boolcomplex If the variable supports complex, pick the real or complex portion
[in]uint32_tcomponent For vector and tensor variables, the component to return
[out]float* array the returned values
[in]int32_trank The rank number to return values for. Unimplemented, use 0.
Returns
ErrorCode

Friends And Related Symbol Documentation

◆ Reader

friend class Reader
friend

Definition at line 301 of file libuserd_interface.h.


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

Connect with Ansys