    

 ## On this page

  

 

 # composite:nearest\_neighbor\_operator

 Last update: 31.07.2026 

**Version: 0.0.0**

## Description

Go through all elements of the source mesh and find the n nearest neighbors in the target mesh. The distance is computed from element center to element center.

## Inputs

InputNameExpected type(s)Description**Pin 0**   
Requiredsource\_mesh[`abstract_meshed_region`](../../core-concepts/dpf-types.md#meshed-region)Meshed region with the elements for which the nearest neighbors should be found.**Pin 1**   
Requiredtarget\_mesh[`abstract_meshed_region`](../../core-concepts/dpf-types.md#meshed-region)Mesh with the target elements.**Pin 2**   
Requirednumber\_of\_neighbors[`int32`](../../core-concepts/dpf-types.md#standard-types)Number of neighbors to be found.## Outputs

OutputNameExpected type(s)Description**Pin 0**neighbors\_source\_to\_target[`property_field`](../../core-concepts/dpf-types.md#property-field)Property field with an entry for each element ID of the source mesh with the element ID(s) of the neighbors of the target mesh. See output neighbors\_target\_to\_source for the inverse result (Pin 1).**Pin 1**neighbors\_target\_to\_source[`property_field`](../../core-concepts/dpf-types.md#property-field)Property field with an entry for each element ID of the target mesh with the element ID(s) of the neighbors of the source mesh. The field contains only the elements which have neighbors. See output neighbors\_source\_to\_target for the inverse result (Pin 0)## Configurations

NameExpected type(s)Default valueDescription**mutex**[`bool`](../../core-concepts/dpf-types.md#standard-types)falseIf this option is set to true, the shared memory is prevented from being simultaneously accessed by multiple threads.## Scripting

**Category**: composite

**Plugin**: composite

**Scripting name**: nearest\_neighbor\_operator

**Full name**: composite.nearest\_neighbor\_operator

**Internal name**: composite::nearest\_neighbor\_operator

**License**: None

## Changelog

- Version 0.0.0: Initial release.