> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# libuserd::Part Class Reference

Part of [LibUserd](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/group__userd.md)

`#include <libuserd_interface.h>`

Inheritance diagram for libuserd::Part:

![](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/ensight/ensight-apis/2025-r2/classlibuserd_1_1_part.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=e2f16da91ddfd5e85c52f2f527ebba34)

## Public Member Functions

| Type | Name |
| - | - |
| ErrorCode | [num\_nodes](#a48324a72d09fac731b637ce90aa5b5d0) (std::size\_t \&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\< ElementType, std::size\_t > \&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 \&nodes\_per\_polygon\_size, size\_t \&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 \&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](#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 \&transform) override rigid\_body\_transform |

## Friends

| Type | Name |
| - | - |
| class | [Reader](#a35cb182752752c74a30050705acc3c06) |

## Detailed Description

This class represents a part (block of mesh).

Definition at line [146](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/libuserd__interface_8h_source) of file [libuserd\_interface.h](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/libuserd__interface_8h_source).

## Member Function Documentation

### element\_conn()

```cpp theme={null}
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:

```cpp theme={null}
num_elements[elem_type]*nodes_per_element(elem_type)
```

integers.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | ElementType | elem\_type The element type to get the connectivity for |
| \[out] | uint32\_t | \* connectivity The output connectivity values |
| \[in] | int32\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### element\_conn\_nfaced()

```cpp theme={null}
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**

| Direction | Name | Description |
| - | - | - |
| \[in] | ElementType | elem\_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\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### element\_conn\_nfaced\_size()

```cpp theme={null}
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()](#a499d69983d495e7a684c7cacbc6fbbd6) can be called with the proper I/O buffers.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | ElementType | elem\_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\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### element\_conn\_nsided()

```cpp theme={null}
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**

| Direction | Name | Description |
| - | - | - |
| \[in] | ElementType | elem\_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\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### element\_conn\_nsided\_size()

```cpp theme={null}
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()](#a3bb838bb71b6278f0a0ecb4b97a34728) can be called with the proper I/O buffers.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | ElementType | elem\_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\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### nodes()

```cpp theme={null}
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**

| Direction | Name | Description |
| - | - | - |
| \[in,out] | float | \* xyz \[x1,y1,z1,x2,y2,z2,...] |
| \[in] | int32\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### num\_elements()

```cpp theme={null}
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**

| Direction | Name | Description |
| - | - | - |
| \[out] | std::map\<ElementType,std::size\_t> | & elements For a given element type, how many elements are there |
| \[in] | int32\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### num\_nodes()

```cpp theme={null}
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**

| Direction | Name | Description |
| - | - | - |
| \[out] | std::size\_t | & num\_coords The number of nodes |
| \[in] | int32\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

### rigid\_body\_transform()

```cpp theme={null}
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**

| Direction | Name | Description |
| - | - | - |
| \[out] | struct | RigidBodyTransform & transform The current transformation |

**Returns**

ErrorCode will return UNAVAILABLE if it does not exist (and a "unity" transform is returned)

### variable\_values()

```cpp theme={null}
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**

| Direction | Name | Description |
| - | - | - |
| \[in] | const | [Variable](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/classlibuserd_1_1_variable.md) \* var The variable to get the values for |
| \[in] | ElementType | elem\_type The element type |
| \[in] | bool | complex If the variable supports complex, pick the real or complex portion |
| \[in] | uint32\_t | component For vector and tensor variables, the component to return |
| \[out] | float | \* array the returned values |
| \[in] | int32\_t | rank The rank number to return values for. Unimplemented, use 0. |

**Returns**

ErrorCode

## Friends And Related Symbol Documentation

### Reader

```cpp theme={null}
friend class Reader
```

`friend`

Definition at line [301](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/libuserd__interface_8h_source) of file [libuserd\_interface.h](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/libuserd__interface_8h_source).

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

* D:/ANSYSDev/Product-src/ensight/server/userd/include/[libuserd\_interface.h](https://developer.synopsys.com/docs/ensight/ensight-apis/2025-r2/libuserd__interface_8h_source)
