    

 ## On this page

  

 

 # libuserd::Part Class Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="libuserd__interface_8h_source.html">libuserd_interface.h</a>>`

Inheritance diagram for libuserd::Part:

 ![](/sites/default/files/migrate-content/ensight_2025_r2_1/classlibuserd_1_1_part.png)



## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

ErrorCode [num\_nodes](#a48324a72d09fac731b637ce90aa5b5d0) (std::size\_t &amp;num\_coords, int32\_t rank=0) override num\_nodes   
 ErrorCode [nodes](#ae337fe703c9c443d86a40d9e5a65a6ce) (float \*xyz, int32\_t rank=0) override nodes   
 ErrorCode [num\_elements](#a791ecf9a4af64a24bf94c306e2df75ab) (std::map&lt; ElementType, std::size\_t &gt; &amp;elements, int32\_t rank=0) override num\_elements   
 ErrorCode [element\_conn](#aff4c1a7de4618b75a9d27ad612193b7a) (ElementType elem\_type, uint32\_t \*connectivity, int32\_t rank=0) override element\_conn   
 ErrorCode [element\_conn\_nsided\_size](#af47a502c2ad26e5ed6949235b6c8508b) (ElementType elem\_type, size\_t &amp;nodes\_per\_polygon\_size, size\_t &amp;nodes\_size, int32\_t rank=0) override element\_conn\_nsided\_size   
 ErrorCode [element\_conn\_nsided](#a3bb838bb71b6278f0a0ecb4b97a34728) (ElementType elem\_type, uint32\_t \*nodes\_per\_polygon, uint32\_t \*[nodes](#ae337fe703c9c443d86a40d9e5a65a6ce), int32\_t rank=0) override element\_conn\_nsided   
 ErrorCode [element\_conn\_nfaced\_size](#abdb57a83b718a4f13d0a25903961cf37) (ElementType elem\_type, size\_t &amp;faces\_per\_element\_size, size\_t &amp;nodes\_per\_face\_size, size\_t &amp;indices\_size, int32\_t rank=0) override element\_conn\_nfaced\_size   
 ErrorCode [element\_conn\_nfaced](#a499d69983d495e7a684c7cacbc6fbbd6) (ElementType elem\_type, uint32\_t \*faces\_per\_element, uint32\_t \*nodes\_per\_face, uint32\_t \*[nodes](#ae337fe703c9c443d86a40d9e5a65a6ce), int32\_t rank=0) override element\_conn\_nfaced   
 ErrorCode [variable\_values](#a60c19dcbef1d2441acd37b4152f702b6) (IVariable \*var, ElementType elem\_type, bool complex, uint32\_t component, float \*array, int32\_t rank=0) override variable\_values   
 ErrorCode [rigid\_body\_transform](#a475e1943462f64fe17929591ebc998a0) (struct RigidBodyTransform &amp;transform) override rigid\_body\_transform   
 ## <a id="friends" name="friends"></a>Friends

class [Reader](#a35cb182752752c74a30050705acc3c06) <a id="details" name="details"></a>## Detailed Description

This class represents a part (block of mesh).

Definition at line [146](libuserd__interface_8h_source.html#l00146) of file [libuserd\_interface.h](libuserd__interface_8h_source.html).



## Member Function Documentation

<a id="aff4c1a7de4618b75a9d27ad612193b7a" name="aff4c1a7de4618b75a9d27ad612193b7a"></a>## [◆ ](#aff4c1a7de4618b75a9d27ad612193b7a)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. ReturnsErrorCode 



<a id="a499d69983d495e7a684c7cacbc6fbbd6" name="a499d69983d495e7a684c7cacbc6fbbd6"></a>## [◆ ](#a499d69983d495e7a684c7cacbc6fbbd6)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. ReturnsErrorCode 



<a id="abdb57a83b718a4f13d0a25903961cf37" name="abdb57a83b718a4f13d0a25903961cf37"></a>## [◆ ](#abdb57a83b718a4f13d0a25903961cf37)element\_conn\_nfaced\_size()

 ErrorCode libuserd::Part::element\_conn\_nfaced\_size  ( ElementType *elem\_type*,    size\_t &amp; *faces\_per\_element\_size*,    size\_t &amp; *nodes\_per\_face\_size*,    size\_t &amp; *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()](#a499d69983d495e7a684c7cacbc6fbbd6 "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&amp; faces\_per\_element\_size The number of uint32\_t values in the faces\_per\_element buffer \[out\]size\_t&amp; nodes\_per\_face\_size The number of uint32\_t values in the nodes\_per\_face buffer \[out\]size\_t&amp; 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. ReturnsErrorCode 



<a id="a3bb838bb71b6278f0a0ecb4b97a34728" name="a3bb838bb71b6278f0a0ecb4b97a34728"></a>## [◆ ](#a3bb838bb71b6278f0a0ecb4b97a34728)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&amp; nodes\_per\_polygon Count of the number of nodes to consume for each polygon \[out\]uint32\_t&amp; nodes The list of nodes. \[in\]int32\_trank The rank number to return values for. Unimplemented, use 0. ReturnsErrorCode 



<a id="af47a502c2ad26e5ed6949235b6c8508b" name="af47a502c2ad26e5ed6949235b6c8508b"></a>## [◆ ](#af47a502c2ad26e5ed6949235b6c8508b)element\_conn\_nsided\_size()

 ErrorCode libuserd::Part::element\_conn\_nsided\_size  ( ElementType *elem\_type*,    size\_t &amp; *nodes\_per\_polygon\_size*,    size\_t &amp; *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()](#a3bb838bb71b6278f0a0ecb4b97a34728 "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&amp; nodes\_per\_polygon\_size The number of uint32\_t values in the nodes\_per\_polygon buffer \[out\]size\_t&amp; 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. ReturnsErrorCode 



<a id="ae337fe703c9c443d86a40d9e5a65a6ce" name="ae337fe703c9c443d86a40d9e5a65a6ce"></a>## [◆ ](#ae337fe703c9c443d86a40d9e5a65a6ce)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. ReturnsErrorCode 



<a id="a791ecf9a4af64a24bf94c306e2df75ab" name="a791ecf9a4af64a24bf94c306e2df75ab"></a>## [◆ ](#a791ecf9a4af64a24bf94c306e2df75ab)num\_elements()

 ErrorCode libuserd::Part::num\_elements  ( std::map&lt; ElementType, std::size\_t &gt; &amp; *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&lt;ElementType,std::size\_t&gt;&amp; elements For a given element type, how many elements are there \[in\]int32\_trank The rank number to return values for. Unimplemented, use 0. ReturnsErrorCode 



<a id="a48324a72d09fac731b637ce90aa5b5d0" name="a48324a72d09fac731b637ce90aa5b5d0"></a>## [◆ ](#a48324a72d09fac731b637ce90aa5b5d0)num\_nodes()

 ErrorCode libuserd::Part::num\_nodes  ( std::size\_t &amp; *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&amp; num\_coords The number of nodes \[in\]int32\_trank The rank number to return values for. Unimplemented, use 0. ReturnsErrorCode 



<a id="a475e1943462f64fe17929591ebc998a0" name="a475e1943462f64fe17929591ebc998a0"></a>## [◆ ](#a475e1943462f64fe17929591ebc998a0)rigid\_body\_transform()

 ErrorCode libuserd::Part::rigid\_body\_transform  ( struct RigidBodyTransform &amp; *transform*)   override 

rigid\_body\_transform

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

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



<a id="a60c19dcbef1d2441acd37b4152f702b6" name="a60c19dcbef1d2441acd37b4152f702b6"></a>## [◆ ](#a60c19dcbef1d2441acd37b4152f702b6)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\]const[Variable](classlibuserd_1_1_variable.html) \* 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. ReturnsErrorCode 



## Friends And Related Symbol Documentation

<a id="a35cb182752752c74a30050705acc3c06" name="a35cb182752752c74a30050705acc3c06"></a>## [◆ ](#a35cb182752752c74a30050705acc3c06)Reader

 friend class [Reader](classlibuserd_1_1_reader.html)  friend 

Definition at line [301](libuserd__interface_8h_source.html#l00301) of file [libuserd\_interface.h](libuserd__interface_8h_source.html).





---

The documentation for this class was generated from the following file:- D:/ANSYSDev/Product-src/ensight/server/userd/include/[libuserd\_interface.h](libuserd__interface_8h_source.html)