AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxModel::GranularFieldPostProcessor Class Reference

Class for calculating different granular fields. More...

#include <GranularFieldPostProcessor.h>

+ Inheritance diagram for agxModel::GranularFieldPostProcessor:

Public Member Functions

 GranularFieldPostProcessor (agx::Physics::GranularBodySystem *gbs, const agx::Vec3u &voxelCount, const agx::Vec3 &halfExtents)
 GranularFieldPostProcessor that computes voxel discretized granular fields for a given granular body system inside a rectangular volume.
 
bool addField (agxModel::GranularField *gf)
 Adds a new field.
 
bool calculateFields ()
 Sorts particles into voxels and calculate the fields that are added to this class.
 
void createDebugVisualization (agxSDK::Simulation *simulation)
 Set position of the field volume in world coordinates.
 
agxModel::GranularField * getField (const agx::String &name)
 Get a field added to the GranularFieldPostProcessor.
 
const agxModel::GranularFieldRefVector & getFields ()
 
agx::Frame * getFrame ()
 
agx::Physics::GranularBodySystem * getGranularBodySystem ()
 
agx::Vec3 getHalfExtents ()
 
agx::Vec3u getVoxelCount ()
 
agx::Vec3 getVoxelSize ()
 
agx::Real getVoxelVolume ()
 
bool removeField (const agx::String &name)
 Remove field with this name.
 
void setPosition (const agx::Vec3 &pos)
 Set position of the field volume in world coordinates.
 
void setRotation (const agx::Quat &quat)
 Set rotation of the field volume in world coordinates.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Public Attributes

agxData::BufferRef m_particleInfo
 
agxData::BufferRef m_particleVoxelIndices
 
agxData::BufferRef m_particleVoxelWeights
 

Protected Member Functions

virtual ~GranularFieldPostProcessor ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Class for calculating different granular fields.

The fields are discretized into voxels and every particle in the system is sorted into voxels together with a weight. The field value in every voxel is then the weighted sum of the particles in that voxel.

Definition at line 42 of file GranularFieldPostProcessor.h.

Constructor & Destructor Documentation

◆ GranularFieldPostProcessor()

agxModel::GranularFieldPostProcessor::GranularFieldPostProcessor ( agx::Physics::GranularBodySystem *  gbs,
const agx::Vec3u &  voxelCount,
const agx::Vec3 &  halfExtents 
)

GranularFieldPostProcessor that computes voxel discretized granular fields for a given granular body system inside a rectangular volume.

Parameters
gbs- Granular body system for the field
voxelCount- How many voxel in each dimension to fit inside the volume
halfExtents- Half size of volumes sides

◆ ~GranularFieldPostProcessor()

virtual agxModel::GranularFieldPostProcessor::~GranularFieldPostProcessor ( )
protectedvirtual

Member Function Documentation

◆ addField()

bool agxModel::GranularFieldPostProcessor::addField ( agxModel::GranularField *  gf)

Adds a new field.

This allocates memory in the field class given the shape of the field defined in this class

Parameters
gf- GranularField that should be calculated by the GranularFieldPostProcessor

◆ calculateFields()

bool agxModel::GranularFieldPostProcessor::calculateFields ( )

Sorts particles into voxels and calculate the fields that are added to this class.

Returns
- true if successful

◆ createDebugVisualization()

void agxModel::GranularFieldPostProcessor::createDebugVisualization ( agxSDK::Simulation *  simulation)

Set position of the field volume in world coordinates.

Parameters
simulation- simulation

◆ getField()

agxModel::GranularField * agxModel::GranularFieldPostProcessor::getField ( const agx::String &  name)

Get a field added to the GranularFieldPostProcessor.

Parameters
name- Name of the field to get
Returns
field or nullptr if the field was not added

◆ getFields()

const agxModel::GranularFieldRefVector & agxModel::GranularFieldPostProcessor::getFields ( )
Returns
a vector of all the fields

◆ getFrame()

agx::Frame * agxModel::GranularFieldPostProcessor::getFrame ( )
Returns
frame for the field

◆ getGranularBodySystem()

agx::Physics::GranularBodySystem * agxModel::GranularFieldPostProcessor::getGranularBodySystem ( )
Returns
the granular body system.

◆ getHalfExtents()

agx::Vec3 agxModel::GranularFieldPostProcessor::getHalfExtents ( )
Returns
half extents of the volume

◆ getVoxelCount()

agx::Vec3u agxModel::GranularFieldPostProcessor::getVoxelCount ( )
Returns
voxel count

◆ getVoxelSize()

agx::Vec3 agxModel::GranularFieldPostProcessor::getVoxelSize ( )
Returns
the size of one voxel

◆ getVoxelVolume()

agx::Real agxModel::GranularFieldPostProcessor::getVoxelVolume ( )
Returns
Voxel volume

◆ removeField()

bool agxModel::GranularFieldPostProcessor::removeField ( const agx::String &  name)

Remove field with this name.

Parameters
name- Remove granularField with this name

◆ setPosition()

void agxModel::GranularFieldPostProcessor::setPosition ( const agx::Vec3 &  pos)

Set position of the field volume in world coordinates.

Parameters
pos- position in world coordinates

◆ setRotation()

void agxModel::GranularFieldPostProcessor::setRotation ( const agx::Quat &  quat)

Set rotation of the field volume in world coordinates.

Parameters
quat- rotation in world coordinates

Member Data Documentation

◆ m_particleInfo

agxData::BufferRef agxModel::GranularFieldPostProcessor::m_particleInfo

Definition at line 145 of file GranularFieldPostProcessor.h.

◆ m_particleVoxelIndices

agxData::BufferRef agxModel::GranularFieldPostProcessor::m_particleVoxelIndices

Definition at line 146 of file GranularFieldPostProcessor.h.

◆ m_particleVoxelWeights

agxData::BufferRef agxModel::GranularFieldPostProcessor::m_particleVoxelWeights

Definition at line 147 of file GranularFieldPostProcessor.h.


The documentation for this class was generated from the following file: