    

 ## On this page

  

 

 # mapping:apply mechanical native mapping

 Last update: 31.07.2026 

**Version: 0.0.0**

## Description

Maps source data from source mesh to target mesh (computes interpolation).This operator needs to be used with the prepare mechanical native mapping associated one.

## 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[source\_mesh](#input_0)Required[`abstract_meshed_region`](../../core-concepts/dpf-types.md#meshed-region)**1**[source\_mesh\_id](#input_1)Required[`int32`](../../core-concepts/dpf-types.md#standard-types)**2**[target\_mesh](#input_2)Required[`abstract_meshed_region`](../../core-concepts/dpf-types.md#meshed-region)**3**[target\_mesh\_id](#input_3)Required[`int32`](../../core-concepts/dpf-types.md#standard-types)**4**[mapping\_manager\_data](#input_4)Required**5**[source\_data](#input_5)Required[`fields_container`](../../core-concepts/dpf-types.md#fields-container)**6**[target\_scoping](#input_6)[`scoping`](../../core-concepts/dpf-types.md#scoping)**9**[threads\_user\_requested](#input_9)[`int32`](../../core-concepts/dpf-types.md#standard-types)<a id="input_0"></a>

### source\_mesh (Pin 0)

- **Required:** Yes
- **Expected type(s):** [`abstract_meshed_region`](../../core-concepts/dpf-types.md#meshed-region)

Source mesh

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

### source\_mesh\_id (Pin 1)

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

Source mesh id

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

### target\_mesh (Pin 2)

- **Required:** Yes
- **Expected type(s):** [`abstract_meshed_region`](../../core-concepts/dpf-types.md#meshed-region)

Target mesh

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

### target\_mesh\_id (Pin 3)

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

Target mesh id

<a id="input_4"></a>

### mapping\_manager\_data (Pin 4)

- **Required:** Yes
- **Expected type(s):**

<a id="input_5"></a>

### source\_data (Pin 5)

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

Source data

<a id="input_6"></a>

### target\_scoping (Pin 6)

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

Target scoping the result will be scoped on

<a id="input_9"></a>

### threads\_user\_requested (Pin 9)

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

Number of threads to be used to parallelize apply operations. Default: 1 (run in series).

## 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[mapped\_data](#output_0)[`fields_container`](../../core-concepts/dpf-types.md#fields-container)**1**[apply\_output](#output_1)<a id="output_0"></a>

### mapped\_data (Pin 0)

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

Mapped data

<a id="output_1"></a>

### apply\_output (Pin 1)

- **Expected type(s):**

A Map containing the outputs of the interpolation as a key value pair

## 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**: mapping

**Plugin**: N/A

**Scripting name**: apply\_mechanical\_native\_mapping

**Full name**: mapping.apply\_mechanical\_native\_mapping

**Internal name**: mechanical\_native\_mapping::apply

**License**: any\_dpf\_supported\_increments

## 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("mechanical_native_mapping::apply"); // operator instantiation
op.connect(0, my_source_mesh);
op.connect(1, my_source_mesh_id);
op.connect(2, my_target_mesh);
op.connect(3, my_target_mesh_id);
op.connect(4, my_mapping_manager_data);
op.connect(5, my_source_data);
op.connect(6, my_target_scoping);
op.connect(9, my_threads_user_requested);
ansys::dpf::FieldsContainer my_mapped_data = op.getOutput<ansys::dpf::FieldsContainer>(0);
 my_apply_output = op.getOutput<>(1);

```

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

op = dpf.operators.mapping.apply_mechanical_native_mapping() # operator instantiation
op.inputs.source_mesh.connect(my_source_mesh)
op.inputs.source_mesh_id.connect(my_source_mesh_id)
op.inputs.target_mesh.connect(my_target_mesh)
op.inputs.target_mesh_id.connect(my_target_mesh_id)
op.inputs.mapping_manager_data.connect(my_mapping_manager_data)
op.inputs.source_data.connect(my_source_data)
op.inputs.target_scoping.connect(my_target_scoping)
op.inputs.threads_user_requested.connect(my_threads_user_requested)
my_mapped_data = op.outputs.mapped_data()
my_apply_output = op.outputs.apply_output()

```

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

op = dpf.operators.mapping.apply_mechanical_native_mapping() # operator instantiation
op.inputs.source_mesh.Connect(my_source_mesh)
op.inputs.source_mesh_id.Connect(my_source_mesh_id)
op.inputs.target_mesh.Connect(my_target_mesh)
op.inputs.target_mesh_id.Connect(my_target_mesh_id)
op.inputs.mapping_manager_data.Connect(my_mapping_manager_data)
op.inputs.source_data.Connect(my_source_data)
op.inputs.target_scoping.Connect(my_target_scoping)
op.inputs.threads_user_requested.Connect(my_threads_user_requested)
my_mapped_data = op.outputs.mapped_data.GetData()
my_apply_output = op.outputs.apply_output.GetData()

```

  
## Changelog

- Version 0.0.0: Initial release.