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

Base class for a GranularField. More...

#include <GranularFields.h>

+ Inheritance diagram for agxModel::GranularField:

Public Member Functions

 GranularField (agx::UInt dimensions, agx::String name)
 GranularField base class.
 
virtual ~GranularField ()
 Virtual destructor.
 
virtual bool addToField (agx::UInt index, ParticleWeightPair *pair)
 Implement this method in derived classes to define how the particle weight pair should be added to the field element with index index.
 
bool allocateField ()
 Allocate memory for the field.
 
virtual bool calculateFieldElement (agx::UInt)
 Implement this method in derived class to do a final computation on the field when all the particles have been added.
 
void clearField ()
 Clear the field.
 
agx::Real * getFieldData ()
 Get ptr to field data.
 
agx::Vec4u getFieldShape ()
 Get the shape of the field.
 
agx::UInt getFieldSize ()
 Get the field size.
 
agxModel::GranularFieldPostProcessor * getGranularFieldPostProcessor ()
 Get the granular field post processor.
 
agx::String getName ()
 Get field name.
 
const agx::Vector< agx::String > & getRequiredFields ()
 Get the names of the fields that this field depends on.
 
void setGranularFieldPostProcesser (agxModel::GranularFieldPostProcessor *pp)
 Set GranularFieldPostProcessor.
 
- 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.
 

Protected Attributes

agx::Vector< agx::Real > m_field
 
agx::Vec4u m_fieldShape
 
agx::String m_name
 
agx::Vector< agx::String > m_requiredFields
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- 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.
 

Detailed Description

Base class for a GranularField.

Inherit from this when implementing new fields

Definition at line 44 of file GranularFields.h.

Constructor & Destructor Documentation

◆ GranularField()

agxModel::GranularField::GranularField ( agx::UInt  dimensions,
agx::String  name 
)

GranularField base class.

Parameters
dimensions- How many dimension the one field element has. Mass field has dimensions=1 and Velocity field dimensions=3
name- Field name

◆ ~GranularField()

virtual agxModel::GranularField::~GranularField ( )
virtual

Virtual destructor.

Member Function Documentation

◆ addToField()

virtual bool agxModel::GranularField::addToField ( agx::UInt  index,
ParticleWeightPair *  pair 
)
virtual

Implement this method in derived classes to define how the particle weight pair should be added to the field element with index index.

Parameters
index- What voxel to add the particle field data to
pair- The particle and the its weight
Returns
- true if successful

Reimplemented in agxModel::GranularMomentumField, agxModel::GranularMassField, agxModel::GranularVelocityField, and agxModel::GranularCustomBufferField.

◆ allocateField()

bool agxModel::GranularField::allocateField ( )

Allocate memory for the field.

Returns
- true if successful

◆ calculateFieldElement()

virtual bool agxModel::GranularField::calculateFieldElement ( agx::UInt  )
virtual

Implement this method in derived class to do a final computation on the field when all the particles have been added.

Possible to use if the field depends on other fields to be computed first.

Returns
- true if successful

Reimplemented in agxModel::GranularMomentumField, agxModel::GranularMassField, agxModel::GranularVelocityField, and agxModel::GranularCustomBufferField.

◆ clearField()

void agxModel::GranularField::clearField ( )

Clear the field.

◆ getFieldData()

agx::Real * agxModel::GranularField::getFieldData ( )

Get ptr to field data.

Returns
ptr to field data

◆ getFieldShape()

agx::Vec4u agxModel::GranularField::getFieldShape ( )

Get the shape of the field.

x, y, z is the number of voxels the fields granular postprocessor have. w is number of dimensions for the field.

Returns
- field shape

◆ getFieldSize()

agx::UInt agxModel::GranularField::getFieldSize ( )

Get the field size.

That is, the number of voxels in the field times the number of field elements.

Returns
- field size

◆ getGranularFieldPostProcessor()

agxModel::GranularFieldPostProcessor * agxModel::GranularField::getGranularFieldPostProcessor ( )

Get the granular field post processor.

Returns
- GranularFieldPostProcessor

◆ getName()

agx::String agxModel::GranularField::getName ( )

Get field name.

Returns
- field name

◆ getRequiredFields()

const agx::Vector< agx::String > & agxModel::GranularField::getRequiredFields ( )

Get the names of the fields that this field depends on.

Returns
- Vector of required fields

◆ setGranularFieldPostProcesser()

void agxModel::GranularField::setGranularFieldPostProcesser ( agxModel::GranularFieldPostProcessor *  pp)

Set GranularFieldPostProcessor.

Parameters
pp- Set the granularFieldPostProcessor for this granularField

Member Data Documentation

◆ m_field

agx::Vector<agx::Real> agxModel::GranularField::m_field
protected

Definition at line 132 of file GranularFields.h.

◆ m_fieldShape

agx::Vec4u agxModel::GranularField::m_fieldShape
protected

Definition at line 131 of file GranularFields.h.

◆ m_name

agx::String agxModel::GranularField::m_name
protected

Definition at line 134 of file GranularFields.h.

◆ m_requiredFields

agx::Vector<agx::String> agxModel::GranularField::m_requiredFields
protected

Definition at line 133 of file GranularFields.h.


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