Skip to main content

Rocky Solver SDK 2025 R2

rocky_model

Last update: 16.07.2025
1// (C) 2024 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
2#pragma once
3
4// Includes =======================================================================================
5#include <rocky20/device/device_model.hpp>
6#include <rocky20/api/rocky_point_cloud_api.hpp>
7#include <rocky20/api/rocky_pair_scalars.hpp>
8#include <rocky20/api/rocky_boundary_scalars.hpp>
9
10// ================================================================================================
11// RockyDeviceModel
12// ================================================================================================
13struct RockyDeviceModel
14{
15 ROCKY_FUNCTIONS const cuda_solver_dimensions & get_dimensions() const
16 {
17 return *(this->model->dims);
18 }
19
20 double current_time = 0.0;
21
22 ROCKY_FUNCTIONS double get_timestep() const
23 {
24 return this->model->gen->dt;
25 }
26
27 ROCKY_FUNCTIONS double get_current_time() const
28 {
29 return this->current_time;
30 }
31
32 ROCKY_FUNCTIONS double3 get_gravity() const
33 {
34 return this->model->gen->get_gravity(this->current_time);
35 }
36
37 ROCKY_FUNCTIONS void set_gravity(const double3& gravity)
38 {
39 this->model->gen->set_gravity(gravity);
40 }
41
42 SDeviceModel *model;
43};

Connect with Ansys