|
AGXDynamics
2.31.1.0
|
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. More... | |
| virtual | ~GranularField () |
| Virtual destructor. More... | |
| 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. More... | |
| bool | allocateField () |
| Allocate memory for the field. More... | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| 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. More... | |
| void | clearField () |
| Clear the field. More... | |
| agx::Real * | getFieldData () |
| Get ptr to field data. More... | |
| agx::Vec4u | getFieldShape () |
| Get the shape of the field. More... | |
| agx::UInt | getFieldSize () |
| Get the field size. More... | |
| agxModel::GranularFieldPostProcessor * | getGranularFieldPostProcessor () |
| Get the granular field post processor. More... | |
| agx::String | getName () |
| Get field name. More... | |
| int | getReferenceCount () const |
| const agx::Vector< agx::String > | getRequiredFields () |
| Get the names of the fields that this field depends on. More... | |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| void | setGranularFieldPostProcesser (agxModel::GranularFieldPostProcessor *pp) |
| Set GranularFieldPostProcessor. More... | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| agx::Vector< agx::Real > | m_field |
| agx::Vec4u | m_fieldShape |
| Mutex | m_mutex |
| agx::String | m_name |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| agx::Vector< agx::String > | m_requiredFields |
Base class for a GranularField.
Inherit from this when implementing new fields
Definition at line 44 of file GranularFields.h.
| agxModel::GranularField::GranularField | ( | agx::UInt | dimensions, |
| agx::String | name | ||
| ) |
GranularField base class.
| dimensions | - How many dimension the one field element has. Mass field has dimensions=1 and Velocity field dimensions=3 |
| name | - Field name |
|
virtual |
Virtual destructor.
|
virtual |
Implement this method in derived classes to define how the particle weight pair should be added to the field element with index index.
| index | - What voxel to add the particle field data to |
| pair | - The particle and the its weight |
Reimplemented in agxModel::GranularCustomBufferField, agxModel::GranularVelocityField, agxModel::GranularMassField, and agxModel::GranularMomentumField.
| bool agxModel::GranularField::allocateField | ( | ) |
Allocate memory for the field.
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), and agx::InternalData::getOrCreate().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
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.
Reimplemented in agxModel::GranularCustomBufferField, agxModel::GranularVelocityField, agxModel::GranularMassField, and agxModel::GranularMomentumField.
| void agxModel::GranularField::clearField | ( | ) |
Clear the field.
|
protectedinherited |
|
staticprotectedinherited |
| agx::Real* agxModel::GranularField::getFieldData | ( | ) |
Get ptr to field data.
| 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.
| agx::UInt agxModel::GranularField::getFieldSize | ( | ) |
Get the field size.
That is, the number of voxels in the field times the number of field elements.
| agxModel::GranularFieldPostProcessor* agxModel::GranularField::getGranularFieldPostProcessor | ( | ) |
Get the granular field post processor.
| agx::String agxModel::GranularField::getName | ( | ) |
Get field name.
|
inherited |
| const agx::Vector<agx::String> agxModel::GranularField::getRequiredFields | ( | ) |
Get the names of the fields that this field depends on.
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::Buffer::getElement(), and agx::Object::getResource().
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
Referenced by agxData::Val< UInt >::Val().
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
| void agxModel::GranularField::setGranularFieldPostProcesser | ( | agxModel::GranularFieldPostProcessor * | pp | ) |
Set GranularFieldPostProcessor.
| pp | - Set the granularFieldPostProcessor for this granularField |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
staticinherited |
|
protected |
Definition at line 132 of file GranularFields.h.
|
protected |
Definition at line 131 of file GranularFields.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
protected |
Definition at line 134 of file GranularFields.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protected |
Definition at line 133 of file GranularFields.h.