AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxTerrain::CompactionController Class Reference

Controller that handles compaction in the terrain from generated terrain contacts in TerrainContactGenerator The controller features two methods that calculate stress depth propagation in the terrain soil: BOUSSINESQ - Two part method that calculates the stress field by combining the calculated surface stress and subsoil stress based on the surface contact point loads. More...

#include <CompactionController.h>

+ Inheritance diagram for agxTerrain::CompactionController:

Public Types

enum  CompactionMethod { DENSITY_LOG10, VOID_RATIO_LN }
 
enum  StressCalculationMethod { BOUSSINESQ, UNIFORM_DISK }
 

Public Member Functions

 CompactionController (Terrain *terrain)
 Construct given terrain instance. More...
 
 CompactionController ()
 
bool applyCompactionFromSurfaceForce (const agx::Vec2i &voxelXY, agx::Real surfaceForce, agx::Real contactTime)
 Create compaction from an artificially applied surface force. 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
 
CompactionMethod getCompactionMethod () const
 Get the compaction method used when calculating compaction. More...
 
const agx::HashSet< agx::Vec2i > & getCompressedTerrainIndices () const
 Get the indices that has been compressed this time step after the post step of the compactionController. More...
 
int getReferenceCount () const
 
agx::Real getStressInVoxel (const agx::Vec3i &voxelIndex) const
 Get the current active stress in the specified voxelIndex. More...
 
StressCalculationMethod getStressMethod () const
 Get the stress method used when calculating compaction. More...
 
template<typename T >
bool is () const
 Subclass test. More...
 
void onPost ()
 The onPost function updates compaction from terrain contacts. 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 setCompactionMethod (CompactionMethod compactionMethod)
 Set the compaction method used when calculating compaction. More...
 
void setStressMethod (StressCalculationMethod stressMethod)
 Set the stress method used when calculating compaction. 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

virtual ~CompactionController ()
 
void allocateObserverVector () const
 
agx::Real calculateTotalSubSoilStress (const agx::Vec3 &voxelPoint, bool voxelSurfacecIsInContactArea, const TerrainContact::SurfaceForceVector &pointForces) const
 
agx::Bool compactColumnWithPointForces (const agx::Vec2i &voxelXY, const TerrainContact::SurfaceForceVector &pointForces, agx::Real surfaceStress, bool voxelSurfacecIsInContactArea, agx::Real minDepth, agx::Real maxDepth, agx::Real currentContactTime)
 
agx::Bool compactColumnWithPointForcesUniformDiskLoad (const agx::Vec2i &voxelXY, agx::Real surfaceStress, agx::Real loadRadius, agx::Real currentContactTime)
 
void debugRenderStressInNode (const agx::Vec3 &position, agx::Real stress) const
 
void deleteUsingDeleteHandler () const
 
bool doCompactionInVoxel (const agx::Vec3i &voxelIndex, agx::Real compactionStress, agx::Real timeFactor)
 
TerrainMassController * getMassController () const
 
void handleCompactionFromTerrainContactsBoussinesq (const TerrainContactRefVector &contacts)
 
void handleCompactionFromTerrainContactsUniformDisk (const TerrainContactRefVector &contacts)
 
void updateCompactionFromTerrainContacts (const TerrainContactRefVector &contacts)
 Update compaction from terrain contacts using the chosen stress method. More...
 

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

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Controller that handles compaction in the terrain from generated terrain contacts in TerrainContactGenerator The controller features two methods that calculate stress depth propagation in the terrain soil: BOUSSINESQ - Two part method that calculates the stress field by combining the calculated surface stress and subsoil stress based on the surface contact point loads.

UNIFORM_DISK - Simple method that approximates the stress propagation by assuming that the surface stress is applied by a circular uniform disk of voxel area in each voxel active in the terrain contact.

Definition at line 48 of file CompactionController.h.

Member Enumeration Documentation

Enumerator
DENSITY_LOG10 
VOID_RATIO_LN 

Definition at line 57 of file CompactionController.h.

Enumerator
BOUSSINESQ 
UNIFORM_DISK 

Definition at line 51 of file CompactionController.h.

Constructor & Destructor Documentation

agxTerrain::CompactionController::CompactionController ( Terrain *  terrain)

Construct given terrain instance.

agxTerrain::CompactionController::CompactionController ( )
virtual agxTerrain::CompactionController::~CompactionController ( )
protectedvirtual

Member Function Documentation

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
bool agxTerrain::CompactionController::applyCompactionFromSurfaceForce ( const agx::Vec2i &  voxelXY,
agx::Real  surfaceForce,
agx::Real  contactTime 
)

Create compaction from an artificially applied surface force.

Parameters
voxelXY- The 2D terrain coordinate in voxel space
surfaceForce- The surface force to apply on the surface
contactTime- The contact time that should be used when calculating the relaxation time factor
Returns
True if the terrain was compacted from the applied force
template<typename T >
T* agx::Referenced::as ( )
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().

template<typename T >
const T* agx::Referenced::as ( ) const
inherited
template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
agx::Real agxTerrain::CompactionController::calculateTotalSubSoilStress ( const agx::Vec3 &  voxelPoint,
bool  voxelSurfacecIsInContactArea,
const TerrainContact::SurfaceForceVector &  pointForces 
) const
protected
agx::Bool agxTerrain::CompactionController::compactColumnWithPointForces ( const agx::Vec2i &  voxelXY,
const TerrainContact::SurfaceForceVector &  pointForces,
agx::Real  surfaceStress,
bool  voxelSurfacecIsInContactArea,
agx::Real  minDepth,
agx::Real  maxDepth,
agx::Real  currentContactTime 
)
protected
agx::Bool agxTerrain::CompactionController::compactColumnWithPointForcesUniformDiskLoad ( const agx::Vec2i &  voxelXY,
agx::Real  surfaceStress,
agx::Real  loadRadius,
agx::Real  currentContactTime 
)
protected
void agxTerrain::CompactionController::debugRenderStressInNode ( const agx::Vec3 &  position,
agx::Real  stress 
) const
protected
void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
bool agxTerrain::CompactionController::doCompactionInVoxel ( const agx::Vec3i &  voxelIndex,
agx::Real  compactionStress,
agx::Real  timeFactor 
)
protected
CompactionMethod agxTerrain::CompactionController::getCompactionMethod ( ) const

Get the compaction method used when calculating compaction.

const agx::HashSet<agx::Vec2i>& agxTerrain::CompactionController::getCompressedTerrainIndices ( ) const

Get the indices that has been compressed this time step after the post step of the compactionController.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
TerrainMassController* agxTerrain::CompactionController::getMassController ( ) const
protected
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::Real agxTerrain::CompactionController::getStressInVoxel ( const agx::Vec3i &  voxelIndex) const

Get the current active stress in the specified voxelIndex.

Parameters
voxelIndex- The specified voxel index.
Returns
The current stress active in the voxel given by the specified voxel index.
StressCalculationMethod agxTerrain::CompactionController::getStressMethod ( ) const

Get the stress method used when calculating compaction.

void agxTerrain::CompactionController::handleCompactionFromTerrainContactsBoussinesq ( const TerrainContactRefVector &  contacts)
protected
void agxTerrain::CompactionController::handleCompactionFromTerrainContactsUniformDisk ( const TerrainContactRefVector &  contacts)
protected
template<typename T >
bool agx::Referenced::is ( ) const
inherited
void agxTerrain::CompactionController::onPost ( )

The onPost function updates compaction from terrain contacts.

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

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().

void agxTerrain::CompactionController::setCompactionMethod ( CompactionMethod  compactionMethod)

Set the compaction method used when calculating compaction.

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

void agxTerrain::CompactionController::setStressMethod ( StressCalculationMethod  stressMethod)

Set the stress method used when calculating compaction.

Parameters
stressMethod- The stress method to used when calculating compaction
void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

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.

void agx::Referenced::unreference_nodelete ( ) const
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.

void agxTerrain::CompactionController::updateCompactionFromTerrainContacts ( const TerrainContactRefVector &  contacts)
protected

Update compaction from terrain contacts using the chosen stress method.

Triggered in onPost.

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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