Use particle radius in Particle Body Force API
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.
Best 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 Job1
Answers
-
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 Job1