chrono::utils::ChMixtureIngredient Class Reference

Description

Encapsulation of an ingredient of one of the supported types in a mixture.

Such an object defines size, mass properties and material properties, all of which can be constant for all mixture components of this type or else obtained from associated truncated normal distributions. In addition, a mixture ingredient defines the ratio of this particular type in the containing mixture.

The components of an object size are interpreted based on the ingredient type:

  • SPHERE: x = radius (y and z are ignored)
  • ELLIPSOID: semi-axes in the x, y, and z directions
  • BOX: half-lengths in the x, y, and z directions
  • CYLINDER: x = radius, y = height (z is ignored); the cylinder axis is along z
  • CONE: x = base radius, z = height (y is ignored); the cone axis is along z
  • CAPSULE: x = radius, z = length of the cylindrical portion (y is ignored); the capsule axis is along z

The mass and inertia of a generated body are those of its collision shape with the ingredient density.

#include <ChUtilsGenerators.h>

Classes

class  AddBodyCallback
 Class to be used as a callback interface for some user-defined action to be taken each time the generator creates and adds a body based on this mixture ingredient to the system. More...
 

Public Member Functions

 ChMixtureIngredient (ChGenerator *generator, MixtureType type, double ratio)
 
void SetDefaultMaterial (std::shared_ptr< ChContactMaterial > mat)
 
void SetDefaultDensity (double density)
 
void SetDefaultSize (const ChVector3d &size)
 Set a constant size for all objects created from this ingredient. More...
 
void SetDistributionFriction (float friction_mean, float friction_stddev, float friction_min, float friction_max)
 
void SetDistributionCohesion (float cohesion_mean, float cohesion_stddev, float cohesion_min, float cohesion_max)
 
void SetDistributionYoung (float young_mean, float young_stddev, float young_min, float young_max)
 
void SetDistributionPoisson (float poisson_mean, float poisson_stddev, float poisson_min, float poisson_max)
 
void SetDistributionRestitution (float restitution_mean, float restitution_stddev, float restitution_min, float restitution_max)
 
void SetDistributionDensity (double density_mean, double density_stddev, double density_min, double density_max)
 
void SetDistributionSize (double size_mean, double size_stddev, const ChVector3d &size_min, const ChVector3d &size_max)
 Draw the size of objects created from this ingredient from a truncated normal distribution. More...
 
void RegisterAddBodyCallback (std::shared_ptr< AddBodyCallback > callback)
 Specify a callback object to be used each time a body is generated using this mixture ingredient specification.
 

Friends

class ChGenerator
 

Member Function Documentation

◆ SetDefaultSize()

void chrono::utils::ChMixtureIngredient::SetDefaultSize ( const ChVector3d &  size)

Set a constant size for all objects created from this ingredient.

See the class description for the meaning of the size components for each ingredient type.

◆ SetDistributionSize()

void chrono::utils::ChMixtureIngredient::SetDistributionSize ( double  size_mean,
double  size_stddev,
const ChVector3d &  size_min,
const ChVector3d &  size_max 
)

Draw the size of objects created from this ingredient from a truncated normal distribution.

Each size component is sampled independently from the normal distribution with given mean and standard deviation, truncated to the range given by the corresponding components of 'size_min' and 'size_max'. See the class description for the meaning of the size components for each ingredient type.


The documentation for this class was generated from the following files:
  • /builds/uwsbel/chrono/src/chrono/utils/ChUtilsGenerators.h
  • /builds/uwsbel/chrono/src/chrono/utils/ChUtilsGenerators.cpp