Questions about cylinder sampler

13 views
Skip to first unread message

Yves Eric Maxime Robert

unread,
Jun 20, 2022, 2:11:25 PMJun 20
to ProjectChrono
Hello,

I write because I observed some weird behavior with the random sampler in cylinders.
I attached a very simple test which samples particles with a given radius (1), in a disk of a given radius as well (20).

When running it and print the distance to [0,0], I obtain values that are well above 20.
Looking at the source code of the sampler, I do not really understand why. Do you have a clue of what I might be doing wrong?

Best regards,
Yves 


test_sampler.cpp

Radu Serban

unread,
Jun 20, 2022, 2:48:57 PMJun 20
to ProjectChrono

Yves,

 

You have a bug on this line:

auto points = sampler.SampleCylinderZ((0.,0.,z_cylinder), r_cylinder, 0.0);

 

It should be:

auto points = sampler.SampleCylinderZ(ChVector<float>(0.,0.,z_cylinder), r_cylinder, 0.0);

 

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/fb695b77-75d5-441b-a0f9-805304b22de4n%40googlegroups.com.

Yves Eric Maxime Robert

unread,
Jun 26, 2022, 5:23:51 AMJun 26
to ProjectChrono
Hello,

Thank you, it makes sense.

Yves
Reply all
Reply to author
Forward
0 new messages