GPU API for particle replacment

Dazhao Gou_20984
Dazhao Gou_20984 Altair Community Member
edited November 2021 in Community Q&A

Hi all,

I have tried to update my previous code to GPU. But my previous breakage model is based on the contacts, once the contact of the particle is larger than the criterion, the particle will be replaced by a number of particles.  I have seen the header file of the IPluginContactModelV3_1_0.h, but it does not include the function: processParticleOfInterest, which is used for treating the marked particle in GPU or CPU.

Besides, the function: "markParticleOfInterest" in GPU code seems not to work in "ParticleReplacementBreakage_v3_1_0CalculateForce", because the type of  “SApiContactModelParticleManager” and "SApiExternalForceParticleManager" is different if I use the "markParticleOfInterest" in GPU.

Can you tell me how to mark the particle in the ParticleReplacementBreakage_v3_1_0CalculateForce for GPU part, thank you!

 

Regards,

Dazhao

Tagged:

Answers

  • Stephen Cole
    Stephen Cole
    Altair Employee
    edited November 2021

    Hi Dazhao,

     

    I would recommend reviewing the spray coating model which is a Contact Model that uses the mark particle for removal function on the OpenCL GPU:

    https://community.altair.com/community?id=kb_article_view&sysparm_article=KB0113663

     

    For Contacts you want:

    markForRemovalParticle1(contactModelParticleManager);

    or

    markForRemovalParticle2(contactModelParticleManager);

    Element1 (Particle1) out of a contact pair is always a particle, Element2 could be a particle or a geometry, so only use markForRemovalParticle2 if you first have checked element2 is a particle. The example code above has this check built in.

     

    Regards

    Stephen