🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

how could i get geometry name in gpu api programming?

User: "骁黄_21750"
Altair Community Member
Updated by 骁黄_21750

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

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "Stephen Cole"
    Altair Employee
    Updated by Stephen Cole

    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