Use particle radius in Particle Body Force API

Yangyang_Shen
Yangyang_Shen Altair Community Member
edited May 3 in Community Q&A

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

Tagged:

Best Answer

  • jerrinjobs
    jerrinjobs
    Altair Employee
    edited May 3 Answer ✓

    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

Answers

  • jerrinjobs
    jerrinjobs
    Altair Employee
    edited May 3 Answer ✓

    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