    

 ## On this page

  

 

 # logic:elementary data selector (field)

 Last update: 31.07.2026 

**Version: 0.0.0**

## Description

Creates a scalar/vector field based on the selected elementary data.

## Inputs

This table lists the input pins for this operator. Input pins define the data that the operator requires to perform its operation. Some inputs are required, while others are optional and provide additional configuration. Each parameter is detailed in the sections that follow the table.

Pin numberNameStatusExpected type(s)0[field](#input_0)Required[`field`](../../core-concepts/dpf-types.md#field), [`fields_container`](../../core-concepts/dpf-types.md#fields-container)**1**[elementary\_data\_index](#input_1)Required[`int32`](../../core-concepts/dpf-types.md#standard-types), [`vector<int32>`](../../core-concepts/dpf-types.md#standard-types)**2**[default\_value](#input_2)[`double`](../../core-concepts/dpf-types.md#standard-types)**3**[elementary\_data\_index\_2](#input_3)[`int32`](../../core-concepts/dpf-types.md#standard-types), [`vector<int32>`](../../core-concepts/dpf-types.md#standard-types)<a id="input_0"></a>

### field (Pin 0)

- **Required:** Yes
- **Expected type(s):** [`field`](../../core-concepts/dpf-types.md#field), [`fields_container`](../../core-concepts/dpf-types.md#fields-container)

<a id="input_1"></a>

### elementary\_data\_index (Pin 1)

- **Required:** Yes
- **Expected type(s):** [`int32`](../../core-concepts/dpf-types.md#standard-types), [`vector<int32>`](../../core-concepts/dpf-types.md#standard-types)

One or several elementary data index that will be extracted from the initial field. For field with nature matrix, this is the line indices to extract.

<a id="input_2"></a>

### default\_value (Pin 2)

- **Required:** No
- **Expected type(s):** [`double`](../../core-concepts/dpf-types.md#standard-types)

Set a default value for elementary data that do not exist.

<a id="input_3"></a>

### elementary\_data\_index\_2 (Pin 3)

- **Required:** No
- **Expected type(s):** [`int32`](../../core-concepts/dpf-types.md#standard-types), [`vector<int32>`](../../core-concepts/dpf-types.md#standard-types)

For field with nature matrix, this is the column indices to extract.

## Outputs

This table lists the output pins for this operator. Output pins provide the results of the operator's computation and can be connected to inputs of other operators or retrieved for further processing. Each output is detailed in the sections that follow the table.

Pin numberNameExpected type(s)0[field](#output_0)[`field`](../../core-concepts/dpf-types.md#field)<a id="output_0"></a>

### field (Pin 0)

- **Expected type(s):** [`field`](../../core-concepts/dpf-types.md#field)

## Configurations

This operator supports [configuration options](../../core-concepts/operator-configurations.md) that modify its behavior.

### [mutex](../../core-concepts/operator-configurations.md#mutex)

- **Expected type(s):** [`bool`](../../core-concepts/dpf-types.md#standard-types)
- **Default value:** false

If this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.

## Scripting

This operator can be accessed through scripting interfaces using these identifiers.

**Category**: logic

**Plugin**: core

**Scripting name**: elementary\_data\_selector

**Full name**: logic.elementary\_data\_selector

**Internal name**: elementary\_data\_selector

**License**: None

## Examples

These examples demonstrate how to use this operator in different programming environments. Each example shows how to instantiate the operator, connect the required inputs, and retrieve the output.

C++```cpp
#include "dpf_api.h"

ansys::dpf::Operator op("elementary_data_selector"); // operator instantiation
op.connect(0, my_field);
op.connect(1, my_elementary_data_index);
op.connect(2, my_default_value);
op.connect(3, my_elementary_data_index_2);
ansys::dpf::Field my_field = op.getOutput<ansys::dpf::Field>(0);

```

CPython```python
import ansys.dpf.core as dpf

op = dpf.operators.logic.elementary_data_selector() # operator instantiation
op.inputs.field.connect(my_field)
op.inputs.elementary_data_index.connect(my_elementary_data_index)
op.inputs.default_value.connect(my_default_value)
op.inputs.elementary_data_index_2.connect(my_elementary_data_index_2)
my_field = op.outputs.field()

```

IPython```python
import mech_dpf
import Ans.DataProcessing as dpf

op = dpf.operators.logic.elementary_data_selector() # operator instantiation
op.inputs.field.Connect(my_field)
op.inputs.elementary_data_index.Connect(my_elementary_data_index)
op.inputs.default_value.Connect(my_default_value)
op.inputs.elementary_data_index_2.Connect(my_elementary_data_index_2)
my_field = op.outputs.field.GetData()

```

  
## Changelog

- Version 0.0.0: Initial release.