Skip to main content

Rocky Solver SDK 2025 R2

api_device_triangles

Last update: 16.07.2025
1// (C) 2024 ANSYS, Inc. Unauthorized use, distribution, or duplication is prohibited.
2#pragma once
3
4#include <rocky20/api/rocky_model_api.hpp>
5
6namespace device
7{
8
9template <class backend, typename Callable>
10__global__ void execute_triangles_function(
11 SDeviceModel* device_data, double current_time,
12 Callable triangle_f_ptr,
13 void* udf_data
14)
15{
16 IRockyDeviceModel device_model_api;
17 device_model_api._impl.model = device_data;
18 device_model_api._impl.current_time = current_time;
19
20 const cuda_general& general = device_data->get_general();
21
22 int thread_start, thread_step, thread_stop;
23 backend::ThreadIteration(thread_start, thread_step, thread_stop, general.ntrn_active);
24 for (int i = thread_start; i < thread_stop; i += thread_step)
25 {
26 IRockyBoundaryTriangle triangle_api(i, device_data);
27 triangle_f_ptr(device_model_api, triangle_api, udf_data);
28 }
29}
30
31} // namespace device
Definition rocky_model_api.hpp:20
Definition rocky_boundary_api.hpp:146

Connect with Ansys