    

 ## On this page

  

 

 # rocky\_model\_api

 Last update: 16.07.2025 

<a id="l00001" name="l00001"></a> 1// (C) 2024 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.

<a id="l00002" name="l00002"></a> 2\#pragma once

<a id="l00003" name="l00003"></a> 3 

<a id="l00004" name="l00004"></a> 4// Includes =======================================================================================

<a id="l00005" name="l00005"></a> 5\#include "rocky\_model.hpp"

<a id="l00006" name="l00006"></a> 6\#include "rocky\_particle\_api.hpp"

<a id="l00007" name="l00007"></a> 7 

<a id="l00008" name="l00008"></a> 8// ================================================================================================

<a id="l00009" name="l00009"></a> 9// IRockyDeviceModel

<a id="l00010" name="l00010"></a> 10// ================================================================================================

<a id="l00011" name="l00011"></a> 11 

<a id="l00019" name="l00019"></a>[ 19](structIRockyDeviceModel.xhtml)struct [IRockyDeviceModel](structIRockyDeviceModel.xhtml)

<a id="l00020" name="l00020"></a> 20{

<a id="l00021" name="l00021"></a> 21 

<a id="l00025" name="l00025"></a> 25 ROCKY_FUNCTIONS double [get\_timestep](structIRockyDeviceModel.xhtml#ab03adbadfc1d2a7a8f3a1f849be73d1a)() const;

<a id="l00026" name="l00026"></a> 26 

<a id="l00030" name="l00030"></a> 30 ROCKY_FUNCTIONS double [get\_current\_time](structIRockyDeviceModel.xhtml#a089a84ac233a433ac17ac46fbbb229b3)() const;

<a id="l00031" name="l00031"></a> 31 

<a id="l00039" name="l00039"></a> 39 ROCKY_FUNCTIONS double3 [get\_gravity](structIRockyDeviceModel.xhtml#ac59cb9db0136afc98b82bfb07573101a)() const;

<a id="l00040" name="l00040"></a> 40 

<a id="l00048" name="l00048"></a> 48 ROCKY_FUNCTIONS void [set\_gravity](structIRockyDeviceModel.xhtml#a9980c5362764f3bf7a159ccd7865d947)(const double3&amp; gravity);

<a id="l00049" name="l00049"></a> 49 

<a id="l00065" name="l00065"></a> 65 ROCKY_FUNCTIONS [IRockyCloudPoint](structIRockyCloudPoint.xhtml) [get\_particle\_cloud\_point](structIRockyDeviceModel.xhtml#ac4d4eb7321ad6815176bda70de368c17)(

<a id="l00066" name="l00066"></a> 66 int point_cloud_index, const [IRockyParticle](structIRockyParticle.xhtml) &amp;particle);

<a id="l00067" name="l00067"></a> 67 

<a id="l00075" name="l00075"></a> 75 ROCKY_FUNCTIONS [IRockyPairScalars](structIRockyPairScalars.xhtml) [get\_pair\_scalars](structIRockyDeviceModel.xhtml#a380db6692ee5fe3c15b52d62cef723cd)(int pair_index);

<a id="l00076" name="l00076"></a> 76 

<a id="l00084" name="l00084"></a> 84 ROCKY_FUNCTIONS [IRockyGeometryScalars](structIRockyGeometryScalars.xhtml) [get\_geometry\_scalars](structIRockyDeviceModel.xhtml#a9bd2b236ca0c6f7859924b0ed588c584)(int geometry_index);

<a id="l00085" name="l00085"></a> 85 

<a id="l00088" name="l00088"></a> 88 [[deprecated("Use get\_timestep() instead.")]]

<a id="l00089" name="l00089"></a> 89 ROCKY_FUNCTIONS double get_time_step() const;

<a id="l00090" name="l00090"></a> 90 

<a id="l00091" name="l00091"></a> 91 RockyDeviceModel _impl;

<a id="l00092" name="l00092"></a> 92 

<a id="l00094" name="l00094"></a> 94};



<a id="l00095" name="l00095"></a> 95 

<a id="l00096" name="l00096"></a> 96// deprecated

<a id="l00097" name="l00097"></a> 97inline

<a id="l00098" name="l00098"></a> 98ROCKY_FUNCTIONS double IRockyDeviceModel::get_time_step() const

<a id="l00099" name="l00099"></a> 99{

<a id="l00100" name="l00100"></a> 100 return this-&gt;_impl.get_timestep();

<a id="l00101" name="l00101"></a> 101}

<a id="l00102" name="l00102"></a> 102 

<a id="l00103" name="l00103"></a> 103inline

<a id="l00104" name="l00104"></a>[ 104](structIRockyDeviceModel.xhtml#ab03adbadfc1d2a7a8f3a1f849be73d1a)ROCKY_FUNCTIONS double [IRockyDeviceModel::get\_timestep](structIRockyDeviceModel.xhtml#ab03adbadfc1d2a7a8f3a1f849be73d1a)() const

<a id="l00105" name="l00105"></a> 105{

<a id="l00106" name="l00106"></a> 106 return this-&gt;_impl.get_timestep();

<a id="l00107" name="l00107"></a> 107}



<a id="l00108" name="l00108"></a> 108 

<a id="l00109" name="l00109"></a> 109inline

<a id="l00110" name="l00110"></a>[ 110](structIRockyDeviceModel.xhtml#a089a84ac233a433ac17ac46fbbb229b3)ROCKY_FUNCTIONS double [IRockyDeviceModel::get\_current\_time](structIRockyDeviceModel.xhtml#a089a84ac233a433ac17ac46fbbb229b3)() const

<a id="l00111" name="l00111"></a> 111{

<a id="l00112" name="l00112"></a> 112 return this-&gt;_impl.get_current_time();

<a id="l00113" name="l00113"></a> 113}



<a id="l00114" name="l00114"></a> 114 

<a id="l00115" name="l00115"></a> 115inline

<a id="l00116" name="l00116"></a>[ 116](structIRockyDeviceModel.xhtml#ac59cb9db0136afc98b82bfb07573101a)ROCKY_FUNCTIONS double3 [IRockyDeviceModel::get\_gravity](structIRockyDeviceModel.xhtml#ac59cb9db0136afc98b82bfb07573101a)() const

<a id="l00117" name="l00117"></a> 117{

<a id="l00118" name="l00118"></a> 118 return this-&gt;_impl.get_gravity();

<a id="l00119" name="l00119"></a> 119}



<a id="l00120" name="l00120"></a> 120 

<a id="l00121" name="l00121"></a> 121inline

<a id="l00122" name="l00122"></a>[ 122](structIRockyDeviceModel.xhtml#a9980c5362764f3bf7a159ccd7865d947)ROCKY_FUNCTIONS void [IRockyDeviceModel::set\_gravity](structIRockyDeviceModel.xhtml#a9980c5362764f3bf7a159ccd7865d947)(const double3&amp; gravity)

<a id="l00123" name="l00123"></a> 123{

<a id="l00124" name="l00124"></a> 124 this-&gt;_impl.set_gravity(gravity);

<a id="l00125" name="l00125"></a> 125}



<a id="l00126" name="l00126"></a> 126 

<a id="l00127" name="l00127"></a> 127inline ROCKY_FUNCTIONS [IRockyCloudPoint](structIRockyCloudPoint.xhtml)

<a id="l00128" name="l00128"></a>[ 128](structIRockyDeviceModel.xhtml#ac4d4eb7321ad6815176bda70de368c17)[IRockyDeviceModel::get\_particle\_cloud\_point](structIRockyDeviceModel.xhtml#ac4d4eb7321ad6815176bda70de368c17)(int point_cloud_index, const [IRockyParticle](structIRockyParticle.xhtml)&amp; particle)

<a id="l00129" name="l00129"></a> 129{

<a id="l00130" name="l00130"></a> 130 auto point_cloud = this-&gt;_impl.model-&gt;point_clouds + point_cloud_index;

<a id="l00131" name="l00131"></a> 131 int point_index = this-&gt;_impl.model-&gt;particle_scalars-&gt;get_scalar&lt;int&gt;(

<a id="l00132" name="l00132"></a> 132 point_cloud-&gt;particle_scalars_index, particle._impl.particle_index);

<a id="l00133" name="l00133"></a> 133 return [IRockyCloudPoint](structIRockyCloudPoint.xhtml)(point_cloud, point_index);

<a id="l00134" name="l00134"></a> 134}



<a id="l00135" name="l00135"></a> 135 

<a id="l00136" name="l00136"></a>[ 136](structIRockyDeviceModel.xhtml#a380db6692ee5fe3c15b52d62cef723cd)inline ROCKY_FUNCTIONS [IRockyPairScalars](structIRockyPairScalars.xhtml) [IRockyDeviceModel::get\_pair\_scalars](structIRockyDeviceModel.xhtml#a380db6692ee5fe3c15b52d62cef723cd)(int pair_index)

<a id="l00137" name="l00137"></a> 137{

<a id="l00138" name="l00138"></a> 138 return [IRockyPairScalars](structIRockyPairScalars.xhtml)(*this-&gt;_impl.model-&gt;pair_scalars, pair_index);

<a id="l00139" name="l00139"></a> 139}



<a id="l00140" name="l00140"></a> 140 

<a id="l00141" name="l00141"></a>[ 141](structIRockyDeviceModel.xhtml#a9bd2b236ca0c6f7859924b0ed588c584)inline ROCKY_FUNCTIONS [IRockyGeometryScalars](structIRockyGeometryScalars.xhtml) [IRockyDeviceModel::get\_geometry\_scalars](structIRockyDeviceModel.xhtml#a9bd2b236ca0c6f7859924b0ed588c584)(int geometry_index)

<a id="l00142" name="l00142"></a> 142{

<a id="l00143" name="l00143"></a> 143 return [IRockyGeometryScalars](structIRockyGeometryScalars.xhtml)(*this-&gt;_impl.model-&gt;boundary_scalars, geometry_index);

<a id="l00144" name="l00144"></a> 144}



[IRockyCloudPoint](structIRockyCloudPoint.xhtml)

**Definition** rocky_point_cloud_api.hpp:16



[IRockyDeviceModel](structIRockyDeviceModel.xhtml)

**Definition** rocky_model_api.hpp:20



[IRockyDeviceModel::get\_current\_time](structIRockyDeviceModel.xhtml#a089a84ac233a433ac17ac46fbbb229b3)

ROCKY_FUNCTIONS double get_current_time() const

**Definition** rocky_model_api.hpp:110



[IRockyDeviceModel::get\_pair\_scalars](structIRockyDeviceModel.xhtml#a380db6692ee5fe3c15b52d62cef723cd)

ROCKY_FUNCTIONS IRockyPairScalars get_pair_scalars(int pair_index)

**Definition** rocky_model_api.hpp:136



[IRockyDeviceModel::set\_gravity](structIRockyDeviceModel.xhtml#a9980c5362764f3bf7a159ccd7865d947)

ROCKY_FUNCTIONS void set_gravity(const double3 &amp;gravity)

**Definition** rocky_model_api.hpp:122



[IRockyDeviceModel::get\_geometry\_scalars](structIRockyDeviceModel.xhtml#a9bd2b236ca0c6f7859924b0ed588c584)

ROCKY_FUNCTIONS IRockyGeometryScalars get_geometry_scalars(int geometry_index)

**Definition** rocky_model_api.hpp:141



[IRockyDeviceModel::get\_timestep](structIRockyDeviceModel.xhtml#ab03adbadfc1d2a7a8f3a1f849be73d1a)

ROCKY_FUNCTIONS double get_timestep() const

**Definition** rocky_model_api.hpp:104



[IRockyDeviceModel::get\_particle\_cloud\_point](structIRockyDeviceModel.xhtml#ac4d4eb7321ad6815176bda70de368c17)

ROCKY_FUNCTIONS IRockyCloudPoint get_particle_cloud_point(int point_cloud_index, const IRockyParticle &amp;particle)

**Definition** rocky_model_api.hpp:128



[IRockyDeviceModel::get\_gravity](structIRockyDeviceModel.xhtml#ac59cb9db0136afc98b82bfb07573101a)

ROCKY_FUNCTIONS double3 get_gravity() const

**Definition** rocky_model_api.hpp:116



[IRockyGeometryScalars](structIRockyGeometryScalars.xhtml)

**Definition** rocky_boundary_scalars.hpp:97



[IRockyPairScalars](structIRockyPairScalars.xhtml)

**Definition** rocky_pair_scalars.hpp:101



[IRockyParticle](structIRockyParticle.xhtml)

**Definition** rocky_particle_api.hpp:28