chrono::particlefactory::ChParticleProcessor Class Reference

Description

Class that can be used to process particles.

It uses two 'tools' that can be plugged in: 1) an object inherited from ChParticleEventTrigger, that decides IF an event must be triggered (there are ready-to-use triggers such as trigger if inside a box, if older than X, etc., or you can implement your own) 2) an object inherited from ChParticleProcessEvent, the performs an action if the event is triggered (there are ready-to-use event processors such as remove particle, etc.) Note: by default, the default trigger is ChParticleEventTriggerNever and the default particle event processor is ChParticleProcessEventDoNothing, so the default behavior is 'do nothing', so you must plug in more sophisticated ones after you create the ChParticleProcessor and before you use it.

#include <ChParticleProcessor.h>

Inheritance diagram for chrono::particlefactory::ChParticleProcessor:

Public Member Functions

virtual int ProcessParticles (ChSystem &msystem)
 This function process particles according to some rule, defined by plugging appropriate ChParticleEventTrigger and ChParticleProcessEvent. More...
 
void SetEventTrigger (std::shared_ptr< ChParticleEventTrigger > mtrigger)
 Use this function to plug in an event trigger.
 
void SetParticleEventProcessor (std::shared_ptr< ChParticleProcessEvent > mproc)
 Use this function to plug in a particle event processor.
 

Protected Attributes

std::shared_ptr
< ChParticleEventTrigger
trigger
 
std::shared_ptr
< ChParticleProcessEvent
particle_processor
 

Member Function Documentation

virtual int chrono::particlefactory::ChParticleProcessor::ProcessParticles ( ChSystem msystem)
virtual

This function process particles according to some rule, defined by plugging appropriate ChParticleEventTrigger and ChParticleProcessEvent.

Returns the number of processed particles (those that triggered events.)