chrono::particlefactory::ChRandomShapeCreatorSpheres Class Reference

Description

Class for generating spheres with variable radius and density.

By default uses constant distributions (all spheres with default radius 0.01) but you can provide your distributions.

#include <ChRandomShapeCreator.h>

Inheritance diagram for chrono::particlefactory::ChRandomShapeCreatorSpheres:
Collaboration diagram for chrono::particlefactory::ChRandomShapeCreatorSpheres:

Public Member Functions

virtual std::shared_ptr< ChBodyRandomGenerate (ChCoordsys<> mcoords) override
 Function that creates a random ChBody particle each time it is called. More...
 
void SetDiameterDistribution (std::shared_ptr< ChDistribution > mdistr)
 Set the statistical distribution for the random diameter.
 
void SetDensityDistribution (std::shared_ptr< ChDistribution > mdistr)
 Set the statistical distribution for the random density.
 
- Public Member Functions inherited from chrono::particlefactory::ChRandomShapeCreator
virtual std::shared_ptr< ChBodyRandomGenerateAndCallbacks (ChCoordsys<> mcoords)
 This function does RandomGenerate and also executes the the custom callback, if provided. More...
 
void SetCallbackPostCreation (ChCallbackPostCreation *mc)
 Set the callback function to execute at each each particle generation.
 
void SetAddCollisionShape (bool addcoll)
 Set if the created particles must include the collision shape(s). More...
 
void SetAddVisualizationAsset (bool addvisual)
 Set if the created particles must include the visualization asset(s). More...
 

Additional Inherited Members

- Protected Attributes inherited from chrono::particlefactory::ChRandomShapeCreator
ChCallbackPostCreationcallback_post_creation
 
bool add_collision_shape
 
bool add_visualization_asset
 

Member Function Documentation

virtual std::shared_ptr<ChBody> chrono::particlefactory::ChRandomShapeCreatorSpheres::RandomGenerate ( ChCoordsys<>  mcoords)
overridevirtual

Function that creates a random ChBody particle each time it is called.

Implements chrono::particlefactory::ChRandomShapeCreator.