18 #ifndef AGX_GRANULARDATAEXPORTER_H
19 #define AGX_GRANULARDATAEXPORTER_H
144 return m_startingParticleGeometryImpactContacts;
149 return m_startingParticlePairImpactContacts;
237 class
AGXPHYSICS_EXPORT GranularDataExporter::ContactDataExporter : public GranularDataExporter::IDataExporter
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXPHYSICS_EXPORT
Data storage for a collection of entity instances of a specified EntityModel.
Derive from this class to implement a listener for simulation step events.
Class that can be used to extract data from elements in a simulation within a specified bound.
Class used to extract data from a granular journal, in the form of writing contact and particle data ...
virtual void onParticleDestroyed(agx::Index id) override
virtual ~IDataFileWriter()
virtual agx::String getHeader() override
Each FileWriter implementation implements a different header, since different data is exported.
IndexHashSet m_startingParticleGeometryImpactContacts
virtual void _exportPostStep(const IndexHashSet &destroyedParticles)=0
void finalizeExport(GranularDataExporter *exporter)
Called during the last steps of the export.
void writeOutputString(const agx::String &output)
IDataExporter(agx::Physics::GranularBodySystem *system)
Constructor.
IndexHashSet getStartingParticleGeometryImpacts()
Returns the indices for the particle-geometry impact contacts currently stored in the storage.
void setAnalysisBox(agx::AnalysisBox *box)
Sets the AnalysisBox that should be used by the exporter.
void writeContact(const detail::ParticleGeometryContactInformation &contact)
Writes particle information to file.
virtual ~ContactDataExporter()
virtual void _finalizeExport(GranularDataExporter *exporter) override
virtual GranularDataExporter::ExporterDataType getType() const override
Returns the type of the exporter, which is overridden by child classes.
void writeParticleInformation(const detail::ParticleInformation &info)
Writes particle information to file.
void exportPostStep(const IndexHashSet &destroyedParticles)
Manually called by the exporter parent when performing pre export step.
virtual void handleParticleDestroyed(agx::Index particleId) override
Is called when a particle is destroyed in the simulation.
IDataFileWriter(const agx::String &filePrefix, const agx::String &postFix, const agx::String &separator)
Constructor for creating the file writer.
static agx::String convertExportDataTypeToFilename(ExporterDataType exportDataType)
Convert export data type to filename.
void exportPreStep(const IndexHashSet &destroyedParticles)
Manually called by the exporter parent when performing pre export step.
IndexHashSet m_startingParticlePairImpactContacts
virtual void handleParticleDestroyed(agx::Index particleId)
Callback that is called when a particle is destroyed.
void exportContactInformation(const detail::ParticlePairContactInformation &information)
virtual void onParticleCreated(agx::Index id) override
agx::Physics::GranularBodySystem * m_system
virtual void _finalizeExport(GranularDataExporter *exporter)=0
std::ofstream m_outStream
IDataExporterRef m_dataExporter
virtual ~GranularDataExporter()
virtual ~ContactDataWriter()
ParticleDataExporter(agx::Physics::GranularBodySystem *system)
Constructor.
virtual void _exportPreStep(const IndexHashSet &destroyedParticles)=0
ContactDataExporter(agx::Physics::GranularBodySystem *system)
Default constructor.
virtual agx::String getHeader()=0
Each FileWriter implementation implements a different header, since different data is exported.
virtual ~ParticleDataExporter()
IDataFileWriterRef m_fileWriter
ParticleImpactDataTable m_particleImpactDataTable
ContactDataWriter(const agx::String &filePrefix, const agx::String &postFix, const agx::String &separator)
Constructor for creating the file writer.
virtual void pre(const agx::TimeStamp &) override
Pre step function.
IndexHashSet getStartingParticlePairImpacts()
Returns the indices for the particle-particle impact contacts currently stored in the storage.
agx::String generateTimeStamp() const
void setExporterType(ExporterDataType type)
Sets the exporter type, i.e which type of data that should be exported.
virtual void _exportPreStep(const IndexHashSet &destroyedParticles) override
virtual GranularDataExporter::ExporterDataType getType() const =0
Returns the type of the exporter, which is overridden by child classes.
virtual void createExportFile(const agx::String &filename)=0
Sets and creates a file with the given path where the exporter writes information.
ExporterDataType
Export Data Type.
agx::Real getAccumulatedImpactEnergyFromParticle(agx::Index particleId)
IndexHashSet m_exportedParticles
void init()
Initializes the exporter.
void updateStartingContactIds()
void exportContactInformation(const detail::ParticleGeometryContactInformation &information)
void updateParticleEnergyTable()
virtual void _exportPostStep(const IndexHashSet &destroyedParticles) override
bool hasAnalysisBox() const
virtual void post(const agx::TimeStamp &) override
Post step function.
agx::AnalysisBox * m_analysisBox
void finalizeAfterSimulation()
Function that is called manually after the simulation is done.
void writeParticleInformation(const detail::ParticleInformation &information)
void writeContact(const detail::ParticlePairContactInformation &contact)
Writes particle information to file.
ParticleDataWriter(const agx::String &filePrefix, const agx::String &postFix, const agx::String &separator)
Constructor for creating the file writer.
agx::String m_completeName
virtual ~ParticleDataWriter()
virtual void createExportFile(const agx::String &filename) override
Creates the file which the contact data should be written to.
void writeToFile(const agx::String &file)
Sets and creates a file with the given path where the exporter writes information.
GranularDataExporter(agx::Physics::GranularBodySystem *system)
Constructor of GranularDataExporter.
Inheritance with partial specialization due to bug with ref_ptr containers.
A basic particle system that contains all the storages and buffers required for basic operation and a...
Base class providing referencing counted objects.
Particle EventListener that can be inherited and overridden in order to listen to particle events.
#define DOXYGEN_END_INTERNAL_BLOCK()
#define DOXYGEN_START_INTERNAL_BLOCK()
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AGXPHYSICS_EXPORT agx::Physics::ParticlePairContactData * getParticlePairImpacts(agx::Physics::GranularBodySystem *system)
AGXPHYSICS_EXPORT agxData::EntityStorage * getParticlePairImpactsStorage(agx::Physics::GranularBodySystem *system)
AGXPHYSICS_EXPORT void addGranularImpactCustomBuffers(agx::ParticleSystem *system)
AGXPHYSICS_EXPORT agx::Physics::ParticleGeometryContactData * getParticleGeometryImpacts(agx::Physics::GranularBodySystem *system)
AGXPHYSICS_EXPORT agxData::EntityStorage * getParticleGeometryImpactsStorage(agx::Physics::GranularBodySystem *system)