17 #ifndef AGX_GRANULARIMPACTANALYSIS_H
18 #define AGX_GRANULARIMPACTANALYSIS_H
85 class ParticleStorageListener :
public agxData::EntityStorage::EventListener,
public agx::Referenced
99 virtual ~ParticleStorageListener();
229 ImpactDataSimulationWriter&
operator=(
const ImpactDataSimulationWriter&) =
delete;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Type-specific Array used for fast access into the data held by a Buffer.
Accessor to a entity instance stored in a EntityStorage, to allow SOA (structure of arrays) data to b...
Data storage for a collection of entity instances of a specified EntityModel.
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Derive from this class to implement a listener for simulation step events.
agxSDK::Simulation * m_simulation
agxData::EntityStorageRef m_particlePairStorage
void writeContactInformation(const detail::ParticlePairContactInformation &contact)
Writes data from a contact to the granular body system.
ParticleGeometryTimeTable m_activeParticleGeometryPairs
virtual void pre(const agx::TimeStamp &) override
Pre-step of the GranularImpactDataWriter.
GranularImpactDataWriter(agx::Physics::GranularBodySystem *system, agx::Real recordThreshold=1E-3)
Constructor for the GranularImpactDataWriter.
agx::HashTable< agx::Physics::GranularBody::GranularGranularPair, agx::TimeStamp > ParticlePairTimeTable
void initParticleBuffers()
static const char *const IMPACT_BUFFER
virtual void post(const agx::TimeStamp &) override
Post-step of the GranularImpactDataWriter.
void addNotification(agxSDK::Simulation *simulation)
Function that will trigger when attached to a simulation.
agx::RealVector RealContainer
void createJournalBindings(agx::Journal *journal)
Initializes the journal bindings.
agxData::EntityStorageRef m_particleGeometryStorage
agx::Physics::GranularBody::GranularGranularPair ParticlePairKey
ImpactDataSimulationWriterRef m_impactDataSimulationWriter
static const char *const PARTICLEPAIRCONTACT_BUFFER
size_t getNumParticlePairImpacts() const
Returns the particle pair impacts.
static const char *const CONTACTENERGY_BUFFER
void writeParticleContactInfo(agx::Index id, agx::Real contactEnergy)
virtual void removeNotification() override
Called when this listener is removed from the simulation.
IndexHashSet m_destroyedId
ImpactDataSimulationWriter(agx::Physics::GranularBodySystem *system)
Constructor for the ImpactDataSimulationWriter.
ImpactDataSimulationWriter & operator=(const ImpactDataSimulationWriter &)=delete
virtual ~ImpactDataSimulationWriter()
static const char *const PARTICLEGEOMETRYCONTACT_BUFFER
void removeNotification(agxSDK::Simulation *simulation)
Function that will trigger when attached to a simulation.
static const char *const ACCUMULATED_IMPACT_BUFFER
virtual ~GranularImpactDataWriter()
agx::Physics::GranularBodySystem * m_system
void journalAttachedCallback(agxSDK::Simulation *simulation, agx::Journal *journal)
void writeContactInformation(const detail::ParticleGeometryContactInformation &contact)
Writes data from a contact to the granular body system.
virtual void addNotification() override
Called when this listener is added to the simulation.
agxSDK::Simulation::JournalAttachEvent::CallbackType m_journalAttachedCallback
agx::Physics::GranularBody::GranularGeometryPair ParticleGeometryKey
agx::HashTable< agx::Physics::GranularBody::GranularGeometryPair, agx::TimeStamp > ParticleGeometryTimeTable
size_t getNumParticleGeometryImpacts() const
Returns the particle geometry impacts.
ParticlePairTimeTable m_activeParticlePairs
Inheritance with partial specialization due to bug with ref_ptr containers.
Pointer to a entity instance of type Physics.ParticleGeometryContact.
Pointer to a entity instance of type Physics.ParticlePairContact.
Base class providing referencing counted objects.
A std::pair, with both elements of the same type, and symmetric so (a, b) == (b, a)
Particle EventListener that can be inherited and overridden in order to listen to particle events.
virtual void onParticleDestroyed(agx::Index id)=0
void clearDestroyedParticles()
virtual ~ParticleEventListener()
ParticleEventListener(agx::Physics::GranularBodySystem *system)
bool particleIsDestroyed(agx::Index id)
virtual void onParticleCreated(agx::Index id)=0
IndexHashSet getDestroyedParticles() const
Returns the currently destroyed particles registered from the coupled GranularBodySystem.
std::pair< GranularBodyPtr, GeometryPtr > GranularGeometryPair
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
agx::Physics::ParticleGeometryContactPtr contactPtr
agx::Real accumulatedEnergy
agx::Physics::ParticlePairContactPtr contactPtr