How to get particle all neighbor infos and current particle force in particle body force API
Answers
-
Hi Raheem,
You can use python script to extract Particle force and Bonded particle position
1) To get particle force you can use the following function
deck.timestep[].particle[].getXForce()
deck.timestep[].particle[].getYForce()
deck.timestep[].particle[].getZForce()
2) To get bonded Particle position you can below functions
deck.timestep[].bond.getPositions()
However you can do different ways to get particle positions for your reference edempy document is attached.
The same document can be found in EDEM installation directory as well.
Thanks,
Prasad A
0 -
Prasad Avilala_20558 said:
Hi Raheem,
You can use python script to extract Particle force and Bonded particle position
1) To get particle force you can use the following function
deck.timestep[].particle[].getXForce()
deck.timestep[].particle[].getYForce()
deck.timestep[].particle[].getZForce()
2) To get bonded Particle position you can below functions
deck.timestep[].bond.getPositions()
However you can do different ways to get particle positions for your reference edempy document is attached.
The same document can be found in EDEM installation directory as well.
Thanks,
Prasad A
Hi Prasad
Actually I want to add some new particle body force in API, I know what you described in edempy.
For example, I know the ID of specified particles, how to get the position in api C++ code, I guess may relatios with particleCustomProperties->getValue, but I don't know how to do it in my user defined code.
Thanks
Raheem
0 -
Raheem Sterling_22474 said:
Hi Prasad
Actually I want to add some new particle body force in API, I know what you described in edempy.
For example, I know the ID of specified particles, how to get the position in api C++ code, I guess may relatios with particleCustomProperties->getValue, but I don't know how to do it in my user defined code.
Thanks
Raheem
Hi Raheem,
Here is the example code to get the particle position also I am attaching an relevant example
case study to understand about the particle generation
Thanks,
Prasad A
0 -
Prasad Avilala_20558 said:
Hi Raheem,
Here is the example code to get the particle position also I am attaching an relevant example
case study to understand about the particle generation
Thanks,
Prasad A
Thank you very much, it really helps a lot!
I think what made me introuble was that I didn't find 'ParticleList', which class include this 'ParticleList' method or instance?
0 -
Raheem Sterling_22474 said:
Thank you very much, it really helps a lot!
I think what made me introuble was that I didn't find 'ParticleList', which class include this 'ParticleList' method or instance?
Hi Raheem,
Particle List is defined in "CParticleList.h" header file.
Also, sharing one more example about how to debug. Please go through this tutorial which will help you to understand how to debug about each function.
Thanks,
Prasad A
0 -
Prasad Avilala_20558 said:
Hi Raheem,
Particle List is defined in "CParticleList.h" header file.
Also, sharing one more example about how to debug. Please go through this tutorial which will help you to understand how to debug about each function.
Thanks,
Prasad A
Hi Prasad,
Thanks for your help, I learned a lot about ParticleManager in EDEM, I guess I can solve my problem.
Raheem
0 -
Raheem Sterling_22474 said:
Hi Prasad,
Thanks for your help, I learned a lot about ParticleManager in EDEM, I guess I can solve my problem.
Raheem
Just to add, CParticleList.h is not an EDEM header, that's specific to that one example.
You can access the force acting on the particle within externalForce( ) via results.force
Richard
0