18 #ifndef AGX_GRANULARDATAEXPORTER_H 19 #define AGX_GRANULARDATAEXPORTER_H 115 void finalizeAfterSimulation();
120 virtual void onParticleCreated(
agx::Index id)
override;
122 virtual void onParticleDestroyed(
agx::Index id)
override;
124 void updateStartingContactIds();
144 return m_startingParticleGeometryImpactContacts;
149 return m_startingParticlePairImpactContacts;
173 void exportPreStep(
const IndexHashSet& destroyedParticles);
179 void exportPostStep(
const IndexHashSet& destroyedParticles);
185 virtual void handleParticleDestroyed(
agx::Index particleId);
191 void finalizeExport(GranularDataExporter * exporter);
197 virtual void createExportFile(
const agx::String& filename) = 0;
207 virtual ~IDataExporter();
209 virtual void _finalizeExport(GranularDataExporter * exporter) = 0;
211 virtual void _exportPreStep(
const IndexHashSet& destroyedParticles) = 0;
213 virtual void _exportPostStep(
const IndexHashSet& destroyedParticles) = 0;
216 bool hasAnalysisBox()
const;
230 AGX_FORCE_INLINE bool GranularDataExporter::IDataExporter::hasAnalysisBox()
const {
return m_analysisBox !=
nullptr; }
244 virtual void handleParticleDestroyed(
agx::Index particleId)
override;
250 virtual void createExportFile(
const agx::String& filename)
override;
265 virtual ~ContactDataExporter();
267 virtual void _finalizeExport(GranularDataExporter * exporter)
override;
269 virtual void _exportPreStep(
const IndexHashSet& destroyedParticles)
override;
271 virtual void _exportPostStep(
const IndexHashSet& destroyedParticles)
override;
287 virtual void handleParticleDestroyed(
agx::Index particleId)
override;
293 virtual void createExportFile(
const agx::String& filename)
override;
303 virtual ~ParticleDataExporter();
307 virtual void _finalizeExport(GranularDataExporter * exporter)
override;
309 virtual void _exportPreStep(
const IndexHashSet& destroyedParticles)
override;
311 virtual void _exportPostStep(
const IndexHashSet& destroyedParticles)
override;
315 void updateParticleEnergyTable();
341 virtual ~IDataFileWriter();
345 void generateFileNames();
385 virtual ~ParticleDataWriter();
419 virtual ~ContactDataWriter();
void AGXPHYSICS_EXPORT init()
Initialize AGX Dynamics API including thread resources and must be executed before using the AGX API...
AGXCORE_EXPORT Type * getType(const agx::String &name)
agx::AnalysisBox * m_analysisBox
Derive from this class to implement a listener for simulation step events.
std::ofstream m_outStream
Data storage for a collection of entity instances of a specified EntityModel.
AGXPHYSICS_EXPORT void addGranularImpactCustomBuffers(agx::ParticleSystem *system)
agx::Physics::GranularBodySystem * m_system
IDataFileWriterRef m_fileWriter
IndexHashSet getStartingParticleGeometryImpacts()
Returns the indices for the particle-geometry impact contacts currently stored in the storage...
#define AGXPHYSICS_EXPORT
IDataExporter(agx::Physics::GranularBodySystem *system)
Constructor.
#define AGX_DECLARE_POINTER_TYPES(type)
Class used to extract data from a granular journal, in the form of writing contact and particle data ...
agx::String m_completeName
Base class providing referencing counted objects.
AGXPHYSICS_EXPORT agxData::EntityStorage * getParticleGeometryImpactsStorage(agx::Physics::GranularBodySystem *system)
IndexHashSet getStartingParticlePairImpacts()
Returns the indices for the particle-particle impact contacts currently stored in the storage...
A basic particle system that contains all the storages and buffers required for basic operation and a...
AGXPHYSICS_EXPORT agxData::EntityStorage * getParticlePairImpactsStorage(agx::Physics::GranularBodySystem *system)
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
IDataFileWriter(const agx::String &filePrefix, const agx::String &postFix, const agx::String &separator)
Constructor for creating the file writer.
ExporterDataType
Export Data Type.
IndexHashSet m_exportedParticles
AGXPHYSICS_EXPORT agx::Physics::ParticleGeometryContactData * getParticleGeometryImpacts(agx::Physics::GranularBodySystem *system)
Particle EventListener that can be inherited and overridden in order to listen to particle events...
ParticleImpactDataTable m_particleImpactDataTable
Class that can be used to extract data from elements in a simulation within a specified bound...
IDataExporterRef m_dataExporter
IndexHashSet m_startingParticlePairImpactContacts
Inheritance with partial specialization due to bug with ref_ptr containers.
AGXPHYSICS_EXPORT agx::Physics::ParticlePairContactData * getParticlePairImpacts(agx::Physics::GranularBodySystem *system)
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
IndexHashSet m_startingParticleGeometryImpactContacts