    

 ## On this page

  

 

 # IRockyParticleHost Struct Reference

 Last update: 17.07.2025 

`#include <<a class="el" href="rocky__particle__api_8hpp_source.xhtml">rocky_particle_api.hpp</a>>`

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

double [get\_original\_volume](structIRockyParticleHost.xhtml#add7a3f8b7dba238add5ecfdee139acdb) () const double [get\_original\_solid\_volume](structIRockyParticleHost.xhtml#af76866e13dbf69fbfd426852a9e21c36) () const int [get\_material\_index](structIRockyParticleHost.xhtml#af4ec43778fa07b66072fbaa4aee18610) () const double [get\_equivalent\_diameter](structIRockyParticleHost.xhtml#a5e52a50ea3dbc5b60da1c238141b5afb) () const [IRockyMaterial](structIRockyMaterial.xhtml) [get\_material](structIRockyParticleHost.xhtml#a6044e78b75c3721beeba25b84eacd71b) () const double3 [get\_centroid\_position](structIRockyParticleHost.xhtml#abae259f977de47fccdca78f6bc2372bb) () const double [get\_original\_mass](structIRockyParticleHost.xhtml#ad82707a32ee8ebe4027b058b826e2d32) () const double [get\_size](structIRockyParticleHost.xhtml#ac34b4f3510097e7387b000838703b028) () const double [get\_release\_time](structIRockyParticleHost.xhtml#ac3ba8bc7577f65c66c5be6e0e08c3c19) () const double [get\_cgm\_scale\_factor](structIRockyParticleHost.xhtml#a4c893d6e3f9e6782b321d1a83514c1f0) () const int [get\_tag](structIRockyParticleHost.xhtml#a3d0328eb18856e3120730d0151e6801d) () const bool [is\_released](structIRockyParticleHost.xhtml#ad76a0dcd79d1d14afb7323220fe6b8cc) () const bool [is\_element](structIRockyParticleHost.xhtml#afc51932894666b7743f6109cf46ca07a) () const bool [is\_assembly](structIRockyParticleHost.xhtml#a6c3f1e0a3df5f1fffc124c982d6a793f) () const size\_t [get\_number\_of\_assembly\_parts](structIRockyParticleHost.xhtml#a25e3ed57098b86c2020628039d361cbe) () const [IRockyMaterial](structIRockyMaterial.xhtml) [get\_assembly\_part\_material](structIRockyParticleHost.xhtml#ab51842eff963f1aff610a41827fcfaf4) (size\_t part\_id) const [IRockyParticleScalars](structIRockyParticleScalars.xhtml) [get\_scalars](structIRockyParticleHost.xhtml#ae7ae6a9877d1bb00cd6f41054657bdb5) () <a id="details" name="details"></a>## Detailed Description

`<a class="el" href="structIRockyParticleHost.xhtml">IRockyParticleHost</a>` is an interface for the internal particle object in Rocky. A particle object is the code representation of an individual particle in a Rocky simulation. It has several access methods to particle-related properties, as well as *particle scalars*, which are special variables that store values per particle that are preserved between time iterations. The main difference in relation to `<a class="el" href="structIRockyParticle.xhtml">IRockyParticle</a>` is that all `<a class="el" href="structIRockyParticleHost.xhtml">IRockyParticleHost</a>`'s property and variable values have their original dimensions as defined within the project, and its data resides within host memory (DRAM).



## Member Function Documentation

<a id="ab51842eff963f1aff610a41827fcfaf4" name="ab51842eff963f1aff610a41827fcfaf4"></a>## [◆ ](#ab51842eff963f1aff610a41827fcfaf4)get\_assembly\_part\_material()

 [IRockyMaterial](structIRockyMaterial.xhtml) IRockyParticleHost::get\_assembly\_part\_material  ( size\_t  *part\_id*)  const

Parameters part\_idThe index of an assembly part. ReturnsAn `<a class="el" href="structIRockyMaterial.xhtml">IRockyMaterial</a>` object that gives access to the values of physical properties associated to the material from which the assembly part referent to `part_id` is made. 



<a id="abae259f977de47fccdca78f6bc2372bb" name="abae259f977de47fccdca78f6bc2372bb"></a>## [◆ ](#abae259f977de47fccdca78f6bc2372bb)get\_centroid\_position()

 double3 IRockyParticleHost::get\_centroid\_position  ( )  const

ReturnsThe Cartesian coordinates of the current position of the particle's centroid. 



<a id="a4c893d6e3f9e6782b321d1a83514c1f0" name="a4c893d6e3f9e6782b321d1a83514c1f0"></a>## [◆ ](#a4c893d6e3f9e6782b321d1a83514c1f0)get\_cgm\_scale\_factor()

 double IRockyParticleHost::get\_cgm\_scale\_factor  ( )  const

ReturnsThe particle's Coarse-grain Modeling (CGM) scale factor. 



<a id="a5e52a50ea3dbc5b60da1c238141b5afb" name="a5e52a50ea3dbc5b60da1c238141b5afb"></a>## [◆ ](#a5e52a50ea3dbc5b60da1c238141b5afb)get\_equivalent\_diameter()

 double IRockyParticleHost::get\_equivalent\_diameter  ( )  const

ReturnsThe equivalent diameter of the particle, which is defined as the diameter of a sphere of volume equal to the particle's volume. 



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

 [IRockyMaterial](structIRockyMaterial.xhtml) IRockyParticleHost::get\_material  ( )  const

ReturnsAn `<a class="el" href="structIRockyMaterial.xhtml">IRockyMaterial</a>` object that gives access to the values of physical properties associated to the material from which the particle is made. 



<a id="af4ec43778fa07b66072fbaa4aee18610" name="af4ec43778fa07b66072fbaa4aee18610"></a>## [◆ ](#af4ec43778fa07b66072fbaa4aee18610)get\_material\_index()

 int IRockyParticleHost::get\_material\_index  ( )  const

ReturnsThe material index associated to the particle 



<a id="a25e3ed57098b86c2020628039d361cbe" name="a25e3ed57098b86c2020628039d361cbe"></a>## [◆ ](#a25e3ed57098b86c2020628039d361cbe)get\_number\_of\_assembly\_parts()

 size\_t IRockyParticleHost::get\_number\_of\_assembly\_parts  ( )  const

ReturnsThe number of parts that compose the assembly. 



<a id="ad82707a32ee8ebe4027b058b826e2d32" name="ad82707a32ee8ebe4027b058b826e2d32"></a>## [◆ ](#ad82707a32ee8ebe4027b058b826e2d32)get\_original\_mass()

 double IRockyParticleHost::get\_original\_mass  ( )  const

ReturnsThe original value of the particle's mass. 



<a id="af76866e13dbf69fbfd426852a9e21c36" name="af76866e13dbf69fbfd426852a9e21c36"></a>## [◆ ](#af76866e13dbf69fbfd426852a9e21c36)get\_original\_solid\_volume()

 double IRockyParticleHost::get\_original\_solid\_volume  ( )  const

ReturnsThe original value of the particle's solid volume, which is the volume of the solid matrix if the particle is porous. Otherwise, this function will return the same value that the `get_original_volume` function. 



<a id="add7a3f8b7dba238add5ecfdee139acdb" name="add7a3f8b7dba238add5ecfdee139acdb"></a>## [◆ ](#add7a3f8b7dba238add5ecfdee139acdb)get\_original\_volume()

 double IRockyParticleHost::get\_original\_volume  ( )  const

ReturnsThe original value of the particle's volume. If the particle is porous, this function will return the original total volume of the particle, that is, the sum of the volumes of the solid matrix and the porous space. 



<a id="ac3ba8bc7577f65c66c5be6e0e08c3c19" name="ac3ba8bc7577f65c66c5be6e0e08c3c19"></a>## [◆ ](#ac3ba8bc7577f65c66c5be6e0e08c3c19)get\_release\_time()

 double IRockyParticleHost::get\_release\_time  ( )  const

ReturnsThe time particle was released. 



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

 [IRockyParticleScalars](structIRockyParticleScalars.xhtml) IRockyParticleHost::get\_scalars  ( ) 

ReturnsAn `<a class="el" href="structIRockyParticleScalars.xhtml">IRockyParticleScalars</a>` object, that gives access to all particle scalars variables defined in the project. 



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

 double IRockyParticleHost::get\_size  ( )  const

ReturnsThe current value of the particle's size. 



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

 int IRockyParticleHost::get\_tag  ( )  const

ReturnsThe tag value inherited from the tags assigned to the segments of a custom fiber, if the `<a class="el" href="structIRockyParticleHost.xhtml">IRockyParticleHost</a>` object represents an element of a custom fiber. The values of those tags must be specified in the column labeled "tag" in the csv file that defines the geometry of a custom fiber. All elements that arise from the subdivision of a given segment inherit the tag value assigned to that segment. If tags are not defined for a custom fiber or if this function is used with particles which are not elements of a custom fiber, this function will return -1. 



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

 bool IRockyParticleHost::is\_assembly  ( )  const

ReturnsTrue if the given particle is an assembly, false otherwise. 



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

 bool IRockyParticleHost::is\_element  ( )  const

ReturnsTrue if the given particle is an element within a flexible particle, false otherwise. 



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

 bool IRockyParticleHost::is\_released  ( )  const

ReturnsA `true` value if the particle was released into the simulation domain, `false` otherwise.