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

# IRockyVicinityPair Struct Reference

`#include <rocky_vicinity_pair_api.hpp>`

## Public Member Functions

| Type | Name |
| - | - |
| ROCKY\_FUNCTIONS [IRockyParticle](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle.md) | [get\_home\_particle](#a6453667273c56febeed7c2806fa4a516) () const |
| ROCKY\_FUNCTIONS [IRockyParticle](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle.md) | [get\_near\_particle](#a1085098207fdb2d038dcf55d10c318e1) () const |
| ROCKY\_FUNCTIONS [IRockyGeometryTriangle](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyGeometryTriangle.md) | [get\_near\_triangle](#a3d83f2759c519cadcd1a4a4199be6bb1) () const |
| ROCKY\_FUNCTIONS bool | [is\_particle\_particle](#a4e8173adc82c91c5d26edd8b0100c2f3) () const |
| ROCKY\_FUNCTIONS bool | [is\_particle\_triangle](#ad5120c027dba90895cf9d05d99e54e7d) () const |
| ROCKY\_FUNCTIONS double | [get\_distance](#a34b7e627e2b53650ec7a6b230528ee6f) () const |
| ROCKY\_FUNCTIONS double | [get\_squared\_distance](#ac697ba9682008871b110a31c8be3a48b) () const |

## Detailed Description

The [`IRockyVicinityPair`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyVicinityPair) class models the vicinity between two distinct simulation entities (particles or triangles) and provide methods to allow the computation of vicinity conditions depending on the custom model that one is implementing.

## Member Function Documentation

### get\_distance()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyVicinityPair::get_distance() const
```

**Returns**

The distance between the centroids of the two entities in the vicinity.

### get\_home\_particle()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyParticle IRockyVicinityPair::get_home_particle() const
```

**Returns**

An [`IRockyParticle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle) object representing the *home* particle. This object gives access to several instantaneous properties associated to that particle.

### get\_near\_particle()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyParticle IRockyVicinityPair::get_near_particle() const
```

**Returns**

An [`IRockyParticle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyParticle) object representing the *near* particle. This object gives access to several instantaneous properties associated to that particle.

### get\_near\_triangle()

```cpp theme={null}
ROCKY_FUNCTIONS IRockyGeometryTriangle IRockyVicinityPair::get_near_triangle() const
```

**Returns**

An [`IRockyGeometryTriangle`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyGeometryTriangle) object representing the *near* triangle. This object gives access to several instantaneous properties associated to that triangle.

### get\_squared\_distance()

```cpp theme={null}
ROCKY_FUNCTIONS double IRockyVicinityPair::get_squared_distance() const
```

> [!WARNING]
>
> This method performs better than [`IRockyVicinityPair`](https://developer.synopsys.com/docs/rocky/rocky-solver-sdk/2025-r2/structIRockyVicinityPair) because it don't require a computational costly computation of a square root of the squared distance between entities centroids.

**Returns**

The squared distance between the centroids of the two entities in the vicinity.

### is\_particle\_particle()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyVicinityPair::is_particle_particle() const
```

**Returns**

True if the pair represents a particle-to-particle vicinity, false otherwise.

### is\_particle\_triangle()

```cpp theme={null}
ROCKY_FUNCTIONS bool IRockyVicinityPair::is_particle_triangle() const
```

**Returns**

True if the pair represents a particle-to-triangle vicinity, false otherwise.
