18 #ifndef AGX_GRANULARDATAEXPORTER_H
19 #define AGX_GRANULARDATAEXPORTER_H
72 static agx::String convertExportDataTypeToFilename(ExporterDataType exportDataType);
110 void setExporterType(ExporterDataType
type);
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);
197 virtual void createExportFile(
const agx::String& filename) = 0;
207 virtual ~IDataExporter();
211 virtual void _exportPreStep(
const IndexHashSet& destroyedParticles) = 0;
213 virtual void _exportPostStep(
const IndexHashSet& destroyedParticles) = 0;
216 bool hasAnalysisBox()
const;
237 class
AGXPHYSICS_EXPORT GranularDataExporter::ContactDataExporter : public GranularDataExporter::IDataExporter
244 virtual void handleParticleDestroyed(
agx::Index particleId)
override;
250 virtual void createExportFile(
const agx::String& filename)
override;
260 void exportContactInformation(
const detail::ParticlePairContactInformation& information);
262 void exportContactInformation(
const detail::ParticleGeometryContactInformation& information);
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;
313 void writeParticleInformation(
const detail::ParticleInformation& information);
315 void updateParticleEnergyTable();
341 virtual ~IDataFileWriter();
345 void generateFileNames();
385 virtual ~ParticleDataWriter();
410 void writeContact(
const detail::ParticleGeometryContactInformation& contact);
416 void writeContact(
const detail::ParticlePairContactInformation& contact);
419 virtual ~ContactDataWriter();
void AGXPHYSICS_EXPORT init()
Initialize agx.
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::HashSet< agx::Index > IndexHashSet
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)
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