chrono::particlefactory::ChParticleEventFlowInRectangle Class Reference

## Description

Trigger an event each time a particle flows into a rectangle.

Rectangle is defined with a coordinate system, in the center, and two X Y sizes. This is triggered only if the particle is flowing from positive Z to negative Z. Note! there is a 'margin' parameter that must be greater than zero: only particles that in the neighborhood of the rectangle (less distant than the margin) are considered, to save computational time. Too small margin might miss some fast-travelin particles, so margin should be at least 'max particle speed' * dt.

#include <ChParticleEventTrigger.h>

Inheritance diagram for chrono::particlefactory::ChParticleEventFlowInRectangle:
Collaboration diagram for chrono::particlefactory::ChParticleEventFlowInRectangle:

## Public Member Functions

ChParticleEventFlowInRectangle (double mXsize=1, double mYsize=1)

virtual bool TriggerEvent (std::shared_ptr< ChBody > mbody, ChSystem &msystem)
This function triggers the a particle event according to the fact the the particle is crossing a rectangle. More...

virtual void SetupPostProcess (ChSystem &msystem)
Children classes might optionally implement this. More...

Public Member Functions inherited from chrono::particlefactory::ChParticleEventTrigger
virtual void SetupPreProcess (ChSystem &msystem)
Children classes might optionally implement this. More...

## Public Attributes

double Xsize

double Ysize

double margin

ChCoordsys rectangle_csys

ChVector last_intersectionUV

## Protected Attributes

std::unordered_map< size_t, _particle_last_pos > last_positions

## Member Function Documentation

 virtual void chrono::particlefactory::ChParticleEventFlowInRectangle::SetupPostProcess ( ChSystem & msystem )
virtual

Children classes might optionally implement this.

The ChParticleProcessor will call this once, after each ProcessParticles()

Reimplemented from chrono::particlefactory::ChParticleEventTrigger.

 virtual bool chrono::particlefactory::ChParticleEventFlowInRectangle::TriggerEvent ( std::shared_ptr< ChBody > mbody, ChSystem & msystem )
virtual

This function triggers the a particle event according to the fact the the particle is crossing a rectangle.