Use particle radius in Particle Body Force API

User: "Yangyang_Shen"
Altair Community Member
Updated by Yangyang_Shen

Hi. I'm writing a particle body force API that needs to use particle radius in my calculation: Y = A * particle.radius + B; 

But when compiling, I get the error: class "NExternalForceTypesV3_0_0::SParticle" has no member "radius" 

So particle.radius is not in the function namespace NExternalForceTypesV3_0_0.

Can I include particle.radius, similar to other properties (i.e. mass, volume) ? See screenshot below for the new line in the red box. 

image

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "jerrinjobs"
    Altair Employee
    Accepted Answer
    Updated by jerrinjobs

    Hi Yangyang

    It is highly recommended to not change the header files for the API. You can use the volume information of the particle, and calculate the radius from it.

    radius = pow (3.*particle.volume/(PI*4.),1./3.);

    Hope this helps.

    Thanks,
    Jerrin Job