rocky_api_functions
Last update: 17.07.2025 3// Includes =======================================================================================
8// Forward declarations ===========================================================================
26// Functions Prototypes ===========================================================================
40typedef double(__stdcall *compute_timestep_f_type)(const IRockyTimestepData ×tep_data, void *data);
42typedef double(__stdcall *compute_adhesive_distances_f_type)(IRockyAdhesiveDistanceData &adhesive_distance_data, void *data);
46typedef void(__stdcall *initialize_cuda_f_type)(const IRockyModel &model, void *host_data, int device_id, void *&device_data);
48typedef void(__stdcall *tear_down_cuda_f_type)(const IRockyModel &model, int device_id, void *device_data);
50typedef void(__stdcall *sync_cuda_data_f_type)(const IRockyModel &model, void *host_data, int device_id, void *device_data);
52typedef void(__stdcall* initialize_particle_f_type)(const IRockyModel& model, IRockyParticleHost& particle, void* data);
54typedef void(__stdcall* initialize_triangle_f_type)(const IRockyModel& model, IRockyGeometryTriangleHost& triangle, void* data);
56typedef void(__stdcall *initialize_breakage_f_type)(const IRockyBreakableParticle& breakable_particle, void* data);
58typedef void(__stdcall* setup_output_properties_f_type)(const IRockyModel& model, IRockyOutputPropertyCollection& output_property_collection, void* data);
66typedef double(__stdcall* output_particles_f_type)(const IRockyModel& model, const IRockyParticleHost& particle, int property_id, void* data);
68typedef double(__stdcall* output_triangles_f_type)(const IRockyModel& model, const IRockyGeometryTriangleHost& triangle, int property_id, void* data);
71typedef void(__stdcall *contacts_f_type)(IRockyDeviceModel &model, IRockyContact &contact, void *data);
73typedef void(__stdcall* cuda_contacts_kernel_f_type)(IRockyModel& model, void** plugin_devices_data);
75typedef void(__stdcall *triangle_wear_f_type)(IRockyContact& contact, double& wear_volume, void* data);
81typedef void(__stdcall* adhesion_forces_f_type)(IRockyContact& contact, IRockyAdhesionOutputData& output_data, void* data);
83typedef void(__stdcall* cuda_adhesion_forces_kernel_f_type)(IRockyModel& model, void** plugin_devices_data);
86typedef void(__stdcall *particles_f_type)(IRockyDeviceModel &model, IRockyParticle &particle, void *data);
88typedef void(__stdcall *cuda_particles_kernel_f_type)(IRockyModel &model, void **plugin_devices_data);
91typedef void(__stdcall* triangles_f_type)(IRockyDeviceModel& model, IRockyBoundaryTriangle& triangle, void* data);
93typedef void(__stdcall* cuda_triangles_kernel_f_type)(IRockyModel& model, void** plugin_devices_data);
96typedef void(__stdcall* instantaneous_breakage_f_type)(IRockyParticle& particle, bool& broken, void* data);
98typedef void(__stdcall* cuda_instantaneous_breakage_kernel_f_type)(IRockyModel& model, void** plugin_devices_data);
100typedef void(__stdcall* fragments_distribution_f_type)(IRockyBreakableParticle& particle, std::vector<double>& distribution, void* data);
103typedef void(__stdcall *joints_f_type)(IRockyDeviceModel &model, IRockyJoint &joint, void *data);
105typedef void(__stdcall *cuda_joints_kernel_f_type)(IRockyModel &model, void **plugin_devices_data);
107typedef void(__stdcall *joint_forces_f_type)(IRockyJoint &joint, IRockyJointOutputData& output_data, void *data);
109typedef void(__stdcall *cuda_joint_forces_kernel_f_type)(IRockyModel &model, void **plugin_devices_data);
114typedef void(__stdcall* cuda_joint_breakage_kernel_f_type)(IRockyModel &model, void **plugin_devices_data);
117typedef void(__stdcall *geometries_motion_f_type)(IRockyModel &model, IRockyGeometriesMotionData &motion, void *data);
119// Extra macros for Frictional Contact Forces ------------------------------------------------------
134// UDF =============================================================================================
141// Initialization ---------------------------------------------------------------------------------
158 extern "C" ROCKYAPI_EXPORT double compute_timestep(const IRockyTimestepData ×tep_data, void *data)
175 DEPRECATED_WARNING("'ROCKY_PLUGIN_COMPUTE_ADHESIVE_DISTANCES' hook is deprecated. Now you can set adhesive distances in ROCKY_PLUGIN_INITIALIZE or ROCKY_PLUGIN_BEGIN_ITERATION") \
183 extern "C" ROCKYAPI_EXPORT void finish_cuda(const IRockyModel &model, int device_id, void *device_data)
203 const IRockyModel& model, IRockyOutputPropertyCollection& output_property_collection, void* data)
205// Iteration ---------------------------------------------------------------------------------------
220// Output ------------------------------------------------------------------------------------------
247// Search ------------------------------------------------------------------------------------------
256// Force -------------------------------------------------------------------------------------------
329// Move --------------------------------------------------------------------------------------------
362// Adhesive forces ---------------------------------------------------------------------------------------
374// Joint forces ------------------------------------------------------------------------------------------
380 void COMPUTE_JOINT_FORCES_NAME(IRockyJoint &joint, IRockyJointOutputData& output_data, void *data) {
386// Joint breakage ----------------------------------------------------------------------------------
398// Instantaneous breakage --------------------------------------------------------------------------
410// Fragments size distribution ---------------------------------------------------------------------
414#define ROCKY_PLUGIN_COMPUTE_FRAGMENTS_SIZE_DISTRIBUTION(breakable_particle, distribution, data) \
416 void COMPUTE_SIZE_DISTRIBUTION_NAME(IRockyBreakableParticle &breakable_particle, std::vector<double>& distribution, void *data) {
420// Boundaries wear ---------------------------------------------------------------------------------
426 void COMPUTE_BOUNDARIES_WEAR_NAME(IRockyContact &triangle_contact, double& wear_volume, void *data) {
432// Thermal -----------------------------------------------------------------------------------------
455// Geometry motion ---------------------------------------------------------------------------------
457 extern "C" ROCKYAPI_EXPORT void compute_geometries_motion(IRockyModel &model, IRockyGeometriesMotionData &motion, void *data)
459// CUDA ============================================================================================
534 // Search --------------------------------------------------------------------------------------
539 // Force ---------------------------------------------------------------------------------------
580 // Move ----------------------------------------------------------------------------------------
609// Contact adhesive forces -------------------------------------------------------------------------
634// Joint forces ------------------------------------------------------------------------------------
678// Instantaneous breakage --------------------------------------------------------------------------
701// Boundaries wear ---------------------------------------------------------------------------------
724// Contact Data Gathering --------------------------------------------------------------------------
747// Thermal -----------------------------------------------------------------------------------------
Definition rocky_timestep_api.h:189
Definition rocky_plugin_data.h:112
Definition rocky_timestep_api.h:152
Definition rocky_contact_output_data_api.hpp:303
Definition rocky_particle_api.hpp:649
Definition rocky_contact_api.hpp:46
Definition rocky_model_api.hpp:19
Definition rocky_boundary_api.hpp:684
Definition rocky_boundary_api.hpp:285
Definition rocky_boundary_api.hpp:134
Definition rocky_joint_api.hpp:32
Definition rocky_api.h:60
Definition rocky_output_collections_api.hpp:555
Definition rocky_particle_api.hpp:766
Definition rocky_particle_api.hpp:27