api_omp_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/device/api_device_triangles.hpp> 5#include <rocky20/device/omp_backend.hpp> 6 7namespace rocky::omp 8{ 9 10void dispatch_triangles_kernel( 11 IRockyModel &model, 12 triangles_f_type h_triangle_f_ptr, 13 void *udf_data 14) 15{ 16 if (model.get_number_of_active_triangles() <= 0) 17 return; 18 19 SDeviceModel *device_data = model.get_device_data(0); 20 21 #pragma omp parallel num_threads(model.get_number_of_processes()) 22 { 23 device::execute_triangles_function<OMPBackend>( 24 device_data, 25 model.get_current_time(), 26 Function2Functor<triangles_f_type> { h_triangle_f_ptr }, 27 udf_data); 28 } 29} 30 31} // namespace rocky::omp IRockyModelDefinition rocky_api.h:58 IRockyModel::get_number_of_active_trianglesint get_number_of_active_triangles()Definition rocky_api.cpp:158 IRockyModel::get_current_timedouble get_current_time() constDefinition rocky_api.cpp:143