Closed dineshadepu closed 2 weeks ago
Please take a look the wiki for more information on how the particle data is stored: https://github.com/ECP-copa/Cabana/wiki/Core-AoSoA
The relevant detail that may fix the issues you're seeing is
We recommend listing larger data types first and like types sequentially to ensure a minimal amount of storage of tuple data. Storage sizes of tuple data (even for the SoA and AoS examples above) can vary depending on the order of the data members due to padding to satisfy alignment requirements.
This describes how this can help performance, but it may be necessary for correctness with sufficiently complex particle data. I'll try to rewrite to be more clear
Also - please note that this complex of an example makes it difficult to understand your issue. A truly minimal working example is almost always the quickest way to get help
Thanks you. Sorry, I couldn't put the question properly. I understood the problem. Will close now.
Hi all,
There's a bug in Cabana if the position variable isn't the first property when creating the Array-of-Structs-of-Arrays (AoSoA) type for the Nearest Neighbor Particle System (NNPS). To explain this better, I have created an example where I study the collision of two particles, where the collision among these two particles is handled using discrete element method (DEM). I have made the contact interaction among these particles simple, so that we can focus on the problem at the place.
In the above code, while creating the rigid body data type, i.e.,
RigidBodyDataType
, I used the following order.Please pay attention here, that, if I have put position property as my first one. I am successfull at compiling the above program and in running it using standard cabana code. I get proper results. This can be done by
/examples/ex01 0.002 10
But if, I change the
position
type while creating theRigidBodyDataType
, to a 2nd place, I get a following bugCode to reproduce the above bug is:
Please look at the
AoSoA
type, I changed here,I couldn't come across this in the
Cabana
documentation. Am I doing anything wrong here, or is this something to keep in mind while creating ourAoSoA
types?Thank you for looking into this :) .