how could i get geometry name in gpu api programming?

骁黄_21750
骁黄_21750 Altair Community Member
edited June 2022 in Community Q&A

Hi,

i want to get geometry name in gpu api programming,  and I seem to have found a related function. But when I tried, I found that the following 2 index did not refer to the name of geometry. What does the meaning of these two indexes? how could i get geometry name in gpu api programming?

Thanks!
image

Tagged:

Answers

  • Stephen Cole
    Stephen Cole
    Altair Employee
    edited June 2022

    Hi,

     

    The GPU API doesn't support strings so you have to convert the name to an int in the CPU and then pass this integer to the GPU code.

     

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

    The example above does the same for Particle name, you would have to change from getParticleParameterData to getGeoemtryParameterData to conver the names to integers in the CPU and then pass to the GPU for use in the code.

     

    In CCustomContactModel.cpp under getParticleParameterData it checks if the particle name is 'spray' and if so assigns this a value of 1.

     

    Then in SprayCoating_v3_3_0.cu we use getParameterData() for element1 and element2 to find the value of this for the specific particle. If it's a 1 then we know this is a spray particle.


    Regards

    Stephen