    

 ## On this page

  

 

 # IRockyVicinityPair Struct Reference

 Last update: 16.07.2025 

`#include <<a class="el" href="rocky__vicinity__pair__api_8hpp_source.xhtml">rocky_vicinity_pair_api.hpp</a>>`

## <a id="pub-methods" name="pub-methods"></a>Public Member Functions

ROCKY\_FUNCTIONS [IRockyParticle](structIRockyParticle.xhtml) [get\_home\_particle](#a6453667273c56febeed7c2806fa4a516) () const ROCKY\_FUNCTIONS [IRockyParticle](structIRockyParticle.xhtml) [get\_near\_particle](#a1085098207fdb2d038dcf55d10c318e1) () const ROCKY\_FUNCTIONS [IRockyGeometryTriangle](structIRockyGeometryTriangle.xhtml) [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 <a id="details" name="details"></a>## Detailed Description

The `<a class="el" href="structIRockyVicinityPair.xhtml">IRockyVicinityPair</a>` 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

<a id="a34b7e627e2b53650ec7a6b230528ee6f" name="a34b7e627e2b53650ec7a6b230528ee6f"></a>## [◆ ](#a34b7e627e2b53650ec7a6b230528ee6f)get\_distance()

 ROCKY\_FUNCTIONS double IRockyVicinityPair::get\_distance  ( )  const

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



<a id="a6453667273c56febeed7c2806fa4a516" name="a6453667273c56febeed7c2806fa4a516"></a>## [◆ ](#a6453667273c56febeed7c2806fa4a516)get\_home\_particle()

 ROCKY\_FUNCTIONS [IRockyParticle](structIRockyParticle.xhtml) IRockyVicinityPair::get\_home\_particle  ( )  const

ReturnsAn `<a class="el" href="structIRockyParticle.xhtml">IRockyParticle</a>` object representing the *home* particle. This object gives access to several instantaneous properties associated to that particle. 



<a id="a1085098207fdb2d038dcf55d10c318e1" name="a1085098207fdb2d038dcf55d10c318e1"></a>## [◆ ](#a1085098207fdb2d038dcf55d10c318e1)get\_near\_particle()

 ROCKY\_FUNCTIONS [IRockyParticle](structIRockyParticle.xhtml) IRockyVicinityPair::get\_near\_particle  ( )  const

ReturnsAn `<a class="el" href="structIRockyParticle.xhtml">IRockyParticle</a>` object representing the *near* particle. This object gives access to several instantaneous properties associated to that particle. 



<a id="a3d83f2759c519cadcd1a4a4199be6bb1" name="a3d83f2759c519cadcd1a4a4199be6bb1"></a>## [◆ ](#a3d83f2759c519cadcd1a4a4199be6bb1)get\_near\_triangle()

 ROCKY\_FUNCTIONS [IRockyGeometryTriangle](structIRockyGeometryTriangle.xhtml) IRockyVicinityPair::get\_near\_triangle  ( )  const

ReturnsAn `<a class="el" href="structIRockyGeometryTriangle.xhtml">IRockyGeometryTriangle</a>` object representing the *near* triangle. This object gives access to several instantaneous properties associated to that triangle. 



<a id="ac697ba9682008871b110a31c8be3a48b" name="ac697ba9682008871b110a31c8be3a48b"></a>## [◆ ](#ac697ba9682008871b110a31c8be3a48b)get\_squared\_distance()

 ROCKY\_FUNCTIONS double IRockyVicinityPair::get\_squared\_distance  ( )  const

AttentionThis method performs better than `<a class="el" href="structIRockyVicinityPair.xhtml">IRockyVicinityPair</a>` because it don't require a computational costly computation of a square root of the squared distance between entities centroids. ReturnsThe squared distance between the centroids of the two entities in the vicinity. 



<a id="a4e8173adc82c91c5d26edd8b0100c2f3" name="a4e8173adc82c91c5d26edd8b0100c2f3"></a>## [◆ ](#a4e8173adc82c91c5d26edd8b0100c2f3)is\_particle\_particle()

 ROCKY\_FUNCTIONS bool IRockyVicinityPair::is\_particle\_particle  ( )  const

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



<a id="ad5120c027dba90895cf9d05d99e54e7d" name="ad5120c027dba90895cf9d05d99e54e7d"></a>## [◆ ](#ad5120c027dba90895cf9d05d99e54e7d)is\_particle\_triangle()

 ROCKY\_FUNCTIONS bool IRockyVicinityPair::is\_particle\_triangle  ( )  const

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