Skip to main content

Rocky Solver SDK 2026 R1

Structure IRockySPHElementHost

Last update: 09.03.2026

#include <rocky_sph_element_api.hpp>

IRockySPHElementHost is the host counterpart of IRockySPHElement. Both share the same data, the main difference between them is that the data of IRockySPHElementHost resides within the host memory; therefore, it is used exclusively within initialization hooks, which are executed always in the host.

!> Attention
This class is deprecated in favor of IRockySPHElement and will be removed in Rocky version 25.2

Inherits from:

Members

Public functions

Function get_linked_dem_particle

IRockyParticleHost IRockySPHElementHost::get_linked_dem_particle(IRockyModel &model) const

Returns:

An IRockyParticleHost object representing the DEM particle linked to the SPH particle, if the latter is actually a DEM-coupled SPH element.

Parameters:

Return type: IRockyParticleHost

Function is_dem_coupled

bool IRockySPHElementHost::is_dem_coupled() const

Returns:

True, if the SPH element is placed inside a DEM particle in order to model the interaction between the fluid flow and the DEM particles. False, otherwise.

Return type: bool

Function get_density

float IRockySPHElementHost::get_density() const

Returns:

The current value of density calculated for the SPH element.

Return type: float

Function get_pressure

float IRockySPHElementHost::get_pressure() const

Returns:

The current value of the pressure at the location coincident with the SPH element.

Return type: float

Function get_release_time

float IRockySPHElementHost::get_release_time() const

Returns:

The time at which the SPH element entered into the simulation.

Return type: float

Function get_position

float3 IRockySPHElementHost::get_position() const

Returns:

The Cartesian coordinates of the point at which the SPH element is currently located.

Return type: float3

Function get_velocity

float3 IRockySPHElementHost::get_velocity() const

Returns:

The velocity vector at which the SPH element is currently moving, expressed in Cartesian coordinates.

Return type: float3

Function get_normal

float3 IRockySPHElementHost::get_normal() const

Returns:

An approximation of the normal vector to a free surface, if the SPH element is located near one, for use on the implementation of custom surface tension models. This vector is obtained by using the standard continuum approximation of interfaces, which is based on the gradient of the so called color function. In this approximation, an interface has a finite thickness over which the color function varies smoothly between zero and one. Because of this, a normal vector is calculated for every SPH element in the solution domain. However, only elements located near a free surface will have a normal vector with length significantly different from zero. It is worth noting that this vector is not normalized, therefore, its length will vary from one element to another. Moreover, these normal vectors are calculated internally only if a surface tension model is active in the simulation, therefore, a runtime error will be generated if this method is used otherwise.

Return type: float3

Function get_force

float3 IRockySPHElementHost::get_force() const

Returns:

The resultant of the forces currently acting over the SPH element, expressed in Cartesian coordinates. If this method is called before the stage of force calculation, a zero vector will be returned.

Return type: float3

Function get_acceleration

float3 IRockySPHElementHost::get_acceleration() const

Returns:

The current acceleration resultant vector of the SPH element, expressed in Cartesian coordinates. If this method is called before the stage of force calculation, a zero vector will be returned.

Return type: float3

Function get_scalars

IRockySPHElementScalars IRockySPHElementHost::get_scalars()

Returns:

An IRockySPHElementScalars object that gives access to all SPH element scalars variables defined in the project.

Return type: IRockySPHElementScalars

Function get_strain_rate_tensor

ROCKY_FUNCTIONS SymmetricTensor< float > IRockySPHElementHost::get_strain_rate_tensor()

Returns:

A SymmetricTensor object that represents the strain rate tensor of the element. To get strain rate, please enable the Gradient Velocity Scalars by calling IRockySPHElementScalarsModel::enable_gradient_velocity() at setup hook.

Return type: ROCKY_FUNCTIONS SymmetricTensor< float >

Connect with Ansys