Simulation

18 views
Skip to first unread message

Mohammad Wasfi

unread,
Aug 24, 2022, 2:11:33 AM8/24/22
to ProjectChrono
Hello,

I am trying to perform a simulation where I create two spheres that can be used to obtain the forces that these spheres experience when pushed towards or pulled from each other. Initially, I tried to initiate a GPU bed with only one sphere in it, then import another sphere using a mesh object, and then try to drop the mesh sphere on the other share generated by the sampler. However, it seems that samplers such as the PD sampler are not able to generate one sphere only. I was wondering if there is a sample code that could help with this simulation or if anyone could suggest some ways to do that,

Thank you so much in advance,

Ruochun Zhang

unread,
Aug 24, 2022, 4:07:27 PM8/24/22
to ProjectChrono
Hi Mohammad,

If you just wish to load in one sphere or a small amount of spheres which you know explicitly the locations of, then you can just explicitly give the positions and don't have to use a sampler: after all, a sampler just gives a vector the XYZ (coordinates) of spheres filling up the domain anyway. You can do something like this for example, to add 2 spheres:

ChVector<float> Sphere1(X1, Y1, Z1);
ChVector<float> Sphere2(X2, Y2, Z2);
std::vector<ChVector<float>> initialPos;
initialPos.push_back(Sphere1);
initialPos.push_back(Sphere2);
gpu_sys.SetParticles(initialPos);

Thank you,
Ruochun
Reply all
Reply to author
Forward
0 new messages