EDEM API: Particle Body Force – Handling strings with the GPU API

jerrinjobs
jerrinjobs
Altair Employee
edited December 2023 in Altair Exchange

Overview

Attached you will find an example of how to handle strings when working with the GPU API. The short version is you handle everything that deals with strings on the CPU and use parameterData as a proxy when working with the GPU.

Pre-Requisite

The example deck was made from scratch using EDEM 2023.0, so those running that version or later should be able to open the deck.

Usage/Installation Instructions

The example considers two particles and applies a torque to one, based on the particle type. Although you only need externalForce() and getParticleParameterData() to make this work, I’ve added an intermediate function, isExampleParticle(), to highlight that both these functions need to work with the same string. This intermediate function is not necessary but hopefully reinforces the idea that the strings used in externalForce() and getParticleParameterData() should match.