> ## 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.

# utility:merge meshes

**Version: 0.0.0**

## Description

Take a set of meshes and assemble them in a unique 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 number | Name | Status | Expected type(s) |
| - | - | - | - |
| **-201** | [naive\_merge\_elements](#input_-201) | | [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types) |
| **-200** | [should\_merge\_named\_selections](#input_-200) | | [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types) |
| **0** | [meshes](#input_0) | Required | `vector<shared_ptr<abstract_meshed_region>>`, [`abstract_meshed_region`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#meshed-region), [`meshes_container`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#meshes-container) |
| **101** | [merge\_method](#input_101) | | [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types) |
| **102** | [box\_size](#input_102) | | [`double`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types) |
| **103** | [remove\_duplicate\_elements](#input_103) | | [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types) |

### naive\_merge\_elements (Pin -201)

* **Required:** No
* **Expected type(s):** [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types)

If true, merge the elemental Property Fields of the input meshes assuming that there is no repetition in their scoping ids. Default is false.

### should\_merge\_named\_selections (Pin -200)

* **Required:** No
* **Expected type(s):** [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types)

For certain types of files (such as RST), scoping from names selection does not need to be merged.If this pin is true, the merge occurs. If this pin is false, the merge does not occur. Default is true.

### meshes (Pin 0)

* **Required:** Yes
* **Expected type(s):** `vector<shared_ptr<abstract_meshed_region>>`, [`abstract_meshed_region`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#meshed-region), [`meshes_container`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#meshes-container)

A vector of meshed region to merge or meshed region from pin 0 to ...

### merge\_method (Pin 101)

* **Required:** No
* **Expected type(s):** [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types)

0: merge by distance, 1: merge by node id (default)

### box\_size (Pin 102)

* **Required:** No
* **Expected type(s):** [`double`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types)

Box size used when merging by distance. Default value is 1e-12.

### remove\_duplicate\_elements (Pin 103)

* **Required:** No
* **Expected type(s):** [`int32`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types)

0: keep duplicate elements (default), 1: remove duplicate elements

## 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 number | Name | Expected type(s) |
| - | - | - |
| **0** | [merges\_mesh](#output_0) | [`abstract_meshed_region`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#meshed-region) |

### merges\_mesh (Pin 0)

* **Expected type(s):** [`abstract_meshed_region`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#meshed-region)

## Configurations

This operator supports [configuration options](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/operator-configurations.md) that modify its behavior.

### [mutex](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/operator-configurations.md#mutex)

* **Expected type(s):** [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types)
* **Default value:** false

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

### [read\_inputs\_in\_parallel](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/operator-configurations.md#read_inputs_in_parallel)

* **Expected type(s):** [`bool`](https://developer.synopsys.com/docs/dpf/dpf-framework/core-concepts/dpf-types#standard-types)
* **Default value:** false

If this option is set to true, the operator's inputs will be evaluated in parallel.

## Scripting

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

**Category**: utility

**Plugin**: core

**Scripting name**: merge\_meshes

**Full name**: utility.merge\_meshes

**Internal name**: merge::mesh

**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.

<details>
  <summary>C++</summary>

  ```cpp theme={null}
  #include "dpf_api.h"

  ansys::dpf::Operator op("merge::mesh"); // operator instantiation
  op.connect(-201, my_naive_merge_elements);
  op.connect(-200, my_should_merge_named_selections);
  op.connect(0, my_meshes);
  op.connect(101, my_merge_method);
  op.connect(102, my_box_size);
  op.connect(103, my_remove_duplicate_elements);
  ansys::dpf::MeshedRegion my_merges_mesh = op.getOutput<ansys::dpf::MeshedRegion>(0);
  ```
</details>

<details>
  <summary>CPython</summary>

  ```python theme={null}
  import ansys.dpf.core as dpf

  op = dpf.operators.utility.merge_meshes() # operator instantiation
  op.inputs.naive_merge_elements.connect(my_naive_merge_elements)
  op.inputs.should_merge_named_selections.connect(my_should_merge_named_selections)
  op.inputs.meshes1.connect(my_meshes1)
  op.inputs.meshes2.connect(my_meshes2)
  op.inputs.merge_method.connect(my_merge_method)
  op.inputs.box_size.connect(my_box_size)
  op.inputs.remove_duplicate_elements.connect(my_remove_duplicate_elements)
  my_merges_mesh = op.outputs.merges_mesh()
  ```
</details>

<details>
  <summary>IPython</summary>

  ```python theme={null}
  import mech_dpf
  import Ans.DataProcessing as dpf

  op = dpf.operators.utility.merge_meshes() # operator instantiation
  op.inputs.naive_merge_elements.Connect(my_naive_merge_elements)
  op.inputs.should_merge_named_selections.Connect(my_should_merge_named_selections)
  op.inputs.meshes.Connect(my_meshes)
  op.inputs.merge_method.Connect(my_merge_method)
  op.inputs.box_size.Connect(my_box_size)
  op.inputs.remove_duplicate_elements.Connect(my_remove_duplicate_elements)
  my_merges_mesh = op.outputs.merges_mesh.GetData()
  ```
</details>

## Changelog

* Version 0.0.0: Initial release.
