AGX Dynamics  2.35.0.1
agx::GranularDataExporter Class Referenceabstract

Class used to extract data from a granular journal, in the form of writing contact and particle data to file. More...

#include <GranularDataExporter.h>

+ Inheritance diagram for agx::GranularDataExporter:

Public Types

typedef agx::observer_ptr< const ContactDataExporter > ContactDataExporterConstObserver
 
typedef agx::ref_ptr< const ContactDataExporter > ContactDataExporterConstRef
 
typedef agx::observer_ptr< ContactDataExporter > ContactDataExporterObserver
 
typedef agx::ref_ptr< ContactDataExporter > ContactDataExporterRef
 
typedef agx::observer_ptr< const ContactDataWriter > ContactDataWriterConstObserver
 
typedef agx::ref_ptr< const ContactDataWriter > ContactDataWriterConstRef
 
typedef agx::observer_ptr< ContactDataWriter > ContactDataWriterObserver
 
typedef agx::ref_ptr< ContactDataWriter > ContactDataWriterRef
 
enum  ExporterDataType { PARTICLE_DATA , CONTACT_DATA }
 Export Data Type. More...
 
typedef agx::observer_ptr< const IDataExporter > IDataExporterConstObserver
 
typedef agx::ref_ptr< const IDataExporter > IDataExporterConstRef
 
typedef agx::observer_ptr< IDataExporter > IDataExporterObserver
 
typedef agx::ref_ptr< IDataExporter > IDataExporterRef
 
typedef agx::observer_ptr< const IDataFileWriter > IDataFileWriterConstObserver
 
typedef agx::ref_ptr< const IDataFileWriter > IDataFileWriterConstRef
 
typedef agx::observer_ptr< IDataFileWriter > IDataFileWriterObserver
 
typedef agx::ref_ptr< IDataFileWriter > IDataFileWriterRef
 
typedef agx::observer_ptr< const ParticleDataExporter > ParticleDataExporterConstObserver
 
typedef agx::ref_ptr< const ParticleDataExporter > ParticleDataExporterConstRef
 
typedef agx::observer_ptr< ParticleDataExporter > ParticleDataExporterObserver
 
typedef agx::ref_ptr< ParticleDataExporter > ParticleDataExporterRef
 
typedef agx::observer_ptr< const ParticleDataWriter > ParticleDataWriterConstObserver
 
typedef agx::ref_ptr< const ParticleDataWriter > ParticleDataWriterConstRef
 
typedef agx::observer_ptr< ParticleDataWriter > ParticleDataWriterObserver
 
typedef agx::ref_ptr< ParticleDataWriter > ParticleDataWriterRef
 
- Public Types inherited from agxSDK::StepEventListener
enum  ActivationMask {
  STEP_NONE = 0x0 , PRE_COLLIDE = 0x1 , PRE_STEP = 0x2 , POST_STEP = 0x4 ,
  LAST_STEP = 0x8 , DEFAULT = PRE_STEP | POST_STEP , ALL = PRE_COLLIDE | PRE_STEP | POST_STEP | LAST_STEP
}
 Defines the event states for which a listener will be activated, a mask can be bitwise OR:ed from these members. More...
 
- Public Types inherited from agxSDK::EventListener
enum  Type { UNDEFINED_TYPE , STEP_EVENT_LISTENER , CONTACT_EVENT_LISTENER , GUI_EVENT_LISTENER }
 Type of EventListener. More...
 
- Public Types inherited from agx::Component
typedef Event2< Component *, Object * > ObjectEvent
 Event when adding removing child objects. More...
 
typedef Callback1< Object * > TraverseCallback
 
- Public Types inherited from agx::Object
typedef agx::observer_ptr< const Event > EventConstObserver
 
typedef agx::ref_ptr< const Event > EventConstRef
 
typedef agx::observer_ptr< Event > EventObserver
 
typedef agx::Vector< EventObserver > EventObserverVector
 
typedef agx::VectorPOD< Event * > EventPtrVector
 
typedef agx::ref_ptr< Event > EventRef
 
typedef agx::Vector< EventRef > EventRefVector
 

Public Member Functions

 GranularDataExporter (agx::Physics::GranularBodySystem *system)
 Constructor of GranularDataExporter. More...
 
 ContactDataExporter (agx::Physics::GranularBodySystem *system)
 Default constructor. More...
 
 ContactDataWriter (const agx::String &filePrefix, const agx::String &postFix, const agx::String &separator)
 Constructor for creating the file writer. More...
 
virtual void createExportFile (const agx::String &filename) override
 Creates the file which the contact data should be written to. More...
 
virtual void createExportFile (const agx::String &filename) override
 Creates the file which the particle data should be written to. More...
 
virtual void createExportFile (const agx::String &filename)=0
 Sets and creates a file with the given path where the exporter writes information. More...
 
void exportPostStep (const IndexHashSet &destroyedParticles)
 Manually called by the exporter parent when performing pre export step. More...
 
void exportPreStep (const IndexHashSet &destroyedParticles)
 Manually called by the exporter parent when performing pre export step. More...
 
void finalizeAfterSimulation ()
 Function that is called manually after the simulation is done. More...
 
void finalizeExport (GranularDataExporter *exporter)
 Called during the last steps of the export. More...
 
virtual GranularDataExporter::ExporterDataType getType () const =0
 Returns the type of the exporter, which is overridden by child classes. More...
 
virtual GranularDataExporter::ExporterDataType getType () const override
 Returns the type of the exporter, which is overridden by child classes. More...
 
virtual GranularDataExporter::ExporterDataType getType () const override
 Returns the type of the exporter, which is overridden by child classes. More...
 
virtual void handleParticleDestroyed (agx::Index particleId)
 Callback that is called when a particle is destroyed. More...
 
virtual void handleParticleDestroyed (agx::Index particleId) override
 Is called when a particle is destroyed in the simulation. More...
 
virtual void handleParticleDestroyed (agx::Index particleId) override
 Called when a particle is destroyed. More...
 
 IDataExporter (agx::Physics::GranularBodySystem *system)
 Constructor. More...
 
 IDataFileWriter (const agx::String &filePrefix, const agx::String &postFix, const agx::String &separator)
 Constructor for creating the file writer. More...
 
void init ()
 Initializes the exporter. More...
 
 ParticleDataExporter (agx::Physics::GranularBodySystem *system)
 Constructor. More...
 
 ParticleDataWriter (const agx::String &filePrefix, const agx::String &postFix, const agx::String &separator)
 Constructor for creating the file writer. More...
 
virtual void post (const agx::TimeStamp &) override
 Post step function. More...
 
virtual void pre (const agx::TimeStamp &) override
 Pre step function. More...
 
void setAnalysisBox (agx::AnalysisBox *box)
 Sets the AnalysisBox that should be used by the exporter. More...
 
void setAnalysisBox (agx::AnalysisBox *box)
 Sets the analysis box to be used in the exporter. More...
 
void setExporterType (ExporterDataType type)
 Sets the exporter type, i.e which type of data that should be exported. More...
 
void writeContact (const detail::ParticleGeometryContactInformation &contact)
 Writes particle information to file. More...
 
void writeContact (const detail::ParticlePairContactInformation &contact)
 Writes particle information to file. More...
 
void writeParticleInformation (const detail::ParticleInformation &info)
 Writes particle information to file. More...
 
void writeToFile (const agx::String &file)
 Sets and creates a file with the given path where the exporter writes information. More...
 
- Public Member Functions inherited from agxSDK::StepEventListener
 StepEventListener (int mask=DEFAULT)
 Default constructor, sets the default activation mask to all (POST_STEP and PRE_STEP) events. More...
 
const char * getClassName () const override
 
agxStream::StorageAgent * getStorageAgent () const override
 
virtual void last (const agx::TimeStamp &time)
 Called after a step is taken in the simulation Implement this method in the derived class to get callbacks. More...
 
virtual void preCollide (const agx::TimeStamp &time)
 Called before collision detection is performed in the simulation Implement this method in the derived class to get callbacks. More...
 
virtual void restore (agxStream::InputArchive &in) override
 
virtual void setMask (int mask) override
 Specifies a bitmask which determines which event types will activate this listener. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 
- Public Member Functions inherited from agxSDK::EventListener
virtual void addNotification ()
 Called when this listener is added to the simulation. More...
 
int getMask () const
 
agx::UInt32 getPriority () const
 
Simulation * getSimulation ()
 
const Simulation * getSimulation () const
 
Type getType () const
 
bool isEnabled () const
 
virtual void removeNotification ()
 Called when this listener is removed from the simulation. More...
 
void setEnable (bool enable)
 Specify whether the listener should react at all at events. More...
 
- Public Member Functions inherited from agx::Component
 Component (const agx::Name &name=agx::Name(), agx::Model *model=agx::Component::ClassModel(), agx::Device *device=nullptr)
 
virtual void addObject (agx::Object *object, bool assignContext=true)
 Add an object to the component. More...
 
virtual String autoComplete (const String &partialName, StringVector &matchingNames) const
 
virtual void buildNavigationTree (agxJson::Value &eNode) const override
 
void configure (Model *model)
 
virtual void configure (TiXmlElement *eComponent) override
 
agx::Device * getDevice ()
 
template<typename T >
T * getDevice ()
 
const agx::Device * getDevice () const
 
template<typename T >
const T * getDevice () const
 
size_t getNumObjects (const agx::Name &name) const
 
agx::Object * getObject (const agx::Name &name, agx::Model *model, size_t index=0)
 
const agx::Object * getObject (const agx::Name &name, agx::Model *model, size_t index=0) const
 
agx::Object * getObject (const agx::Name &name, size_t index=0)
 
template<typename T >
T * getObject (const agx::Name &name, size_t index=0)
 
const agx::Object * getObject (const agx::Name &name, size_t index=0) const
 
template<typename T >
const T * getObject (const agx::Name &name, size_t index=0) const
 
const agx::ObjectRefVector & getObjects () const
 
template<typename T >
void getObjects (agx::ObjectPtrVector &result, bool recursive=false) const
 
void getObjects (agx::ObjectPtrVector &result, const agx::Model *model, bool recursive=false) const
 
virtual Object * getResourceImpl (const Path &path, agx::Model *model) override
 
virtual void printSubtree () const override
 
void printSubtree (std::ostream &stream, int depth=0) const
 
virtual void rebind () override
 
void removeAllObjects ()
 Remove all components. More...
 
virtual void removeObject (agx::Object *object)
 Remove an object from the component. More...
 
void removeObject (const agx::Name &name, size_t index=0)
 Remove an object with a specified name (and optional index) from the component. More...
 
virtual void snapshot (TiXmlNode *eParent, const String &directory) const override
 
void traverse (ComponentVisitor *)
 
void traverse (const TraverseCallback &callback)
 
- Public Member Functions inherited from agx::Object
 Object (const Name &name=Name(), Model *model=Object::ClassModel())
 
void addListener (EventListener *listener)
 
agx::String fullName () const
 
agx::String fullPath () const
 
agx::String fullPath (const agx::Object *root) const
 
template<typename T >
T * getAutoScopedResource (const agx::Path &path)
 
template<typename T >
const T * getAutoScopedResource (const agx::Path &path) const
 
agx::Object * getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::Object * getAutoScopedResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::Object * getContext ()
 
template<typename T >
T * getContext ()
 
const agx::Object * getContext () const
 
template<typename T >
const T * getContext () const
 
agx::UInt32 getId () const
 
const agx::Name & getImplementationName () const
 
agx::Model * getModel ()
 
const agx::Model * getModel () const
 
const agx::Name & getName () const
 
agx::Object * getNextSibling ()
 
const agx::Object * getNextSibling () const
 
agx::Path getPath () const
 
agx::Path getPath (const agx::Object *root) const
 
template<typename T >
T * getResource (const agx::Path &path)
 
template<typename T >
const T * getResource (const agx::Path &path) const
 
agx::Object * getResource (const agx::Path &path, agx::Model *model=nullptr)
 
const agx::Object * getResource (const agx::Path &path, agx::Model *model=nullptr) const
 
agx::Object * getRootContext ()
 
const agx::Object * getRootContext () const
 
bool hasListener (EventListener *listener)
 
bool hasParent (const agx::Object *node) const
 
bool isUnique () const
 
void removeListener (EventListener *listener)
 
virtual void save (TiXmlElement *) const
 
virtual void setContext (agx::Object *context)
 
void setId (UInt32 id)
 
void setModel (agx::Model *model)
 Set the object model (handled automatically). More...
 
void setName (const agx::Name &name)
 Set the name of the object. More...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
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
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. 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 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...
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings. More...
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object. More...
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
- Public Member Functions inherited from agx::detail::ParticleEventListener
 ParticleEventListener (agx::Physics::GranularBodySystem *system)
 
IndexHashSet getDestroyedParticles () const
 Returns the currently destroyed particles registered from the coupled GranularBodySystem. More...
 

Static Public Member Functions

static agx::String convertExportDataTypeToFilename (ExporterDataType exportDataType)
 Convert export data type to filename. More...
 
- Static Public Member Functions inherited from agxSDK::StepEventListener
static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
- Static Public Member Functions inherited from agxSDK::EventListener
static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
- Static Public Member Functions inherited from agx::Component
static Component * _load (TiXmlElement *eComponent, Device *device)
 
static agx::Model * ClassModel ()
 
static Component * load (const Path &path, const Name &implementation, Device *device, const Path &_namespace=Path())
 
static Component * load (const String &path, const Path &_namespace=Path())
 
static Component * load (const String &path, Device *device, const Path &_namespace=Path())
 
static Component * load (TiXmlElement *eComponent, Device *device)
 
- Static Public Member Functions inherited from agx::Object
static agx::Model * ClassModel ()
 
static agx::String generateName (const agx::String &bindPath)
 
static const HashSet< Object * > & getActiveObjects ()
 
static bool getEnableRebind ()
 Should rebinding be allowed? Right now a global setting. More...
 
static Object * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type, const String &attribute, const String &value)
 
static Object * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
template<typename T >
static T * load (const String &path, Device *device, const String &type="", size_t instance=0)
 
static void load (const String &path, Device *device, ObjectPtrVector &loadedObjects)
 
static Object * load (TiXmlElement *eObject, Device *device)
 
template<typename T >
static T * load (TiXmlElement *eObject, Device *device)
 
static TiXmlDocument openDocument (const String &path)
 
static void setEnableRebind (bool flag)
 Sets if rebinding of objects should be allowed (Right now a global setting). More...
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More...
 

Protected Member Functions

virtual ~ContactDataExporter ()
 
virtual ~ContactDataWriter ()
 
virtual ~GranularDataExporter ()
 
virtual ~IDataExporter ()
 
virtual ~IDataFileWriter ()
 
virtual ~ParticleDataExporter ()
 
virtual ~ParticleDataWriter ()
 
virtual void _exportPostStep (const IndexHashSet &destroyedParticles) override
 
virtual void _exportPostStep (const IndexHashSet &destroyedParticles) override
 
virtual void _exportPostStep (const IndexHashSet &destroyedParticles)=0
 
virtual void _exportPreStep (const IndexHashSet &destroyedParticles) override
 
virtual void _exportPreStep (const IndexHashSet &destroyedParticles) override
 
virtual void _exportPreStep (const IndexHashSet &destroyedParticles)=0
 
virtual void _finalizeExport (GranularDataExporter *exporter) override
 
virtual void _finalizeExport (GranularDataExporter *exporter) override
 
virtual void _finalizeExport (GranularDataExporter *exporter)=0
 
void exportContactInformation (const detail::ParticleGeometryContactInformation &information)
 
void exportContactInformation (const detail::ParticlePairContactInformation &information)
 
void generateFileNames ()
 
agx::String generateTimeStamp () const
 
agx::Real getAccumulatedImpactEnergyFromParticle (agx::Index particleId)
 
virtual agx::String getHeader () override
 Each FileWriter implementation implements a different header, since different data is exported. More...
 
virtual agx::String getHeader () override
 
virtual agx::String getHeader ()=0
 Each FileWriter implementation implements a different header, since different data is exported. More...
 
IndexHashSet getStartingParticleGeometryImpacts ()
 Returns the indices for the particle-geometry impact contacts currently stored in the storage. More...
 
IndexHashSet getStartingParticlePairImpacts ()
 Returns the indices for the particle-particle impact contacts currently stored in the storage. More...
 
bool hasAnalysisBox () const
 
virtual void onParticleCreated (agx::Index id) override
 
virtual void onParticleDestroyed (agx::Index id) override
 
void updateParticleEnergyTable ()
 
void updateStartingContactIds ()
 
void writeOutputString (const agx::String &output)
 
void writeParticleInformation (const detail::ParticleInformation &information)
 
- Protected Member Functions inherited from agxSDK::StepEventListener
virtual ~StepEventListener ()
 Destructor. More...
 
- Protected Member Functions inherited from agxSDK::EventListener
 EventListener (Type type=UNDEFINED_TYPE)
 Default constructor. More...
 
virtual ~EventListener ()
 Destructor. More...
 
void setSimulation (Simulation *simulation)
 Set the associated simulation for this EventListener. More...
 
- Protected Member Functions inherited from agx::Component
virtual ~Component ()
 
String expandAutoCompletionMatch (const String &query, const StringVector &matchingNames) const
 
void setDevice (Device *device)
 
- Protected Member Functions inherited from agx::Object
virtual ~Object ()
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor. More...
 
 Serializable (const Serializable &other)
 Copy constructor. More...
 
void generateUuid ()
 
- Protected Member Functions inherited from agx::detail::ParticleEventListener
virtual ~ParticleEventListener ()
 
void clearDestroyedParticles ()
 
bool particleIsDestroyed (agx::Index id)
 

Protected Attributes

agx::AnalysisBox * m_analysisBox
 
agx::String m_completeName
 
IDataExporterRef m_dataExporter
 
IndexHashSet m_exportedParticles
 
agx::String m_fileprefix
 
IDataFileWriterRef m_fileWriter
 
std::ofstream m_outStream
 
ParticleImpactDataTable m_particleImpactDataTable
 
agx::String m_postFix
 
agx::String m_separator
 
IndexHashSet m_startingParticleGeometryImpactContacts
 
IndexHashSet m_startingParticlePairImpactContacts
 
agx::Physics::GranularBodySystem * m_system
 
- Protected Attributes inherited from agxSDK::EventListener
bool m_enabled
 
int m_mask
 
agx::UInt32 m_priority
 
Type m_type
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Public Attributes inherited from agx::Component
ObjectEvent addObjectEvent
 
ObjectEvent removeObjectEvent
 
- Static Protected Member Functions inherited from agx::Referenced
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...
 

Detailed Description

Class used to extract data from a granular journal, in the form of writing contact and particle data to file.

IDataFileWriter implementation for contact data.

IDataFileWriter implementation for particle data.

Base class for creating and writing export data to file.

ParticleDataExporter that exports particle data to a file.

ContactDataExporter exports the impact contacts stored in the GranularBodySystem written by the GranularImpactDataWriter.

Abstract class for data exporters used in the GranularDataExporter.

This is currently used in the QT post process viewer to export contact impact data for post processing in external tools.

Usage:

Connect the GranularDataExporter to a simulation by adding it to a simulation.

impactExporter = new agx::GranularDataExporter(system); impactExporter->setExporterType(exportType); impactExporter->writeToFile(writeFileName); simulation->add(impactExporter);

impactExporter->init()

<Do simulation stepping...>

imapctExporter->finalizeAfterSimulation()

Is inherited by child classes exporting a certain set of data. Every exporter writes their data to a file.

It writes this contact information to a file.

Is created and managed by the IDataExporter classes.

Definition at line 52 of file GranularDataExporter.h.

Member Typedef Documentation

◆ ContactDataExporterConstObserver

◆ ContactDataExporterConstRef

◆ ContactDataExporterObserver

◆ ContactDataExporterRef

◆ ContactDataWriterConstObserver

◆ ContactDataWriterConstRef

◆ ContactDataWriterObserver

◆ ContactDataWriterRef

◆ IDataExporterConstObserver

◆ IDataExporterConstRef

◆ IDataExporterObserver

◆ IDataExporterRef

◆ IDataFileWriterConstObserver

◆ IDataFileWriterConstRef

◆ IDataFileWriterObserver

◆ IDataFileWriterRef

◆ ParticleDataExporterConstObserver

◆ ParticleDataExporterConstRef

◆ ParticleDataExporterObserver

◆ ParticleDataExporterRef

◆ ParticleDataWriterConstObserver

◆ ParticleDataWriterConstRef

◆ ParticleDataWriterObserver

◆ ParticleDataWriterRef

Member Enumeration Documentation

◆ ExporterDataType

Export Data Type.

Enumerator
PARTICLE_DATA 
CONTACT_DATA 

Definition at line 65 of file GranularDataExporter.h.

Constructor & Destructor Documentation

◆ GranularDataExporter()

agx::GranularDataExporter::GranularDataExporter ( agx::Physics::GranularBodySystem *  system)

Constructor of GranularDataExporter.

Parameters
systemthe GranularBodySystem that the exporter will take information from.

◆ ~GranularDataExporter()

virtual agx::GranularDataExporter::~GranularDataExporter ( )
protectedvirtual

◆ ~IDataExporter()

virtual agx::GranularDataExporter::~IDataExporter ( )
protectedvirtual

◆ ~ContactDataExporter()

virtual agx::GranularDataExporter::~ContactDataExporter ( )
protectedvirtual

◆ ~ParticleDataExporter()

virtual agx::GranularDataExporter::~ParticleDataExporter ( )
protectedvirtual

◆ ~IDataFileWriter()

virtual agx::GranularDataExporter::~IDataFileWriter ( )
protectedvirtual

◆ ~ParticleDataWriter()

virtual agx::GranularDataExporter::~ParticleDataWriter ( )
protectedvirtual

◆ ~ContactDataWriter()

virtual agx::GranularDataExporter::~ContactDataWriter ( )
protectedvirtual

Member Function Documentation

◆ _exportPostStep() [1/3]

virtual void agx::GranularDataExporter::_exportPostStep ( const IndexHashSet &  destroyedParticles)
overrideprotectedvirtual

◆ _exportPostStep() [2/3]

virtual void agx::GranularDataExporter::_exportPostStep ( const IndexHashSet &  destroyedParticles)
overrideprotectedvirtual

◆ _exportPostStep() [3/3]

virtual void agx::GranularDataExporter::_exportPostStep ( const IndexHashSet &  destroyedParticles)
protectedpure virtual

◆ _exportPreStep() [1/3]

virtual void agx::GranularDataExporter::_exportPreStep ( const IndexHashSet &  destroyedParticles)
overrideprotectedvirtual

◆ _exportPreStep() [2/3]

virtual void agx::GranularDataExporter::_exportPreStep ( const IndexHashSet &  destroyedParticles)
overrideprotectedvirtual

◆ _exportPreStep() [3/3]

virtual void agx::GranularDataExporter::_exportPreStep ( const IndexHashSet &  destroyedParticles)
protectedpure virtual

◆ _finalizeExport() [1/3]

virtual void agx::GranularDataExporter::_finalizeExport ( GranularDataExporter *  exporter)
overrideprotectedvirtual

◆ _finalizeExport() [2/3]

virtual void agx::GranularDataExporter::_finalizeExport ( GranularDataExporter *  exporter)
overrideprotectedvirtual

◆ _finalizeExport() [3/3]

virtual void agx::GranularDataExporter::_finalizeExport ( GranularDataExporter *  exporter)
protectedpure virtual

◆ ContactDataExporter()

agx::GranularDataExporter::ContactDataExporter ( agx::Physics::GranularBodySystem *  system)

Default constructor.

◆ ContactDataWriter()

agx::GranularDataExporter::ContactDataWriter ( const agx::String &  filePrefix,
const agx::String &  postFix,
const agx::String &  separator 
)

Constructor for creating the file writer.

File is created upon class construction.

Parameters
filePrefixThe file prefix of the data file.
postFixThe file postfix for the data file.
separatorseparator token that is used to separate the data entries in the export file.

◆ convertExportDataTypeToFilename()

static agx::String agx::GranularDataExporter::convertExportDataTypeToFilename ( ExporterDataType  exportDataType)
static

Convert export data type to filename.

◆ createExportFile() [1/3]

virtual void agx::GranularDataExporter::createExportFile ( const agx::String &  filename)
overridevirtual

Creates the file which the contact data should be written to.

Parameters
filenamethe name of the that should be create for the impact data.

◆ createExportFile() [2/3]

virtual void agx::GranularDataExporter::createExportFile ( const agx::String &  filename)
overridevirtual

Creates the file which the particle data should be written to.

Parameters
filenamethe name of the that should be create for the particle data.

◆ createExportFile() [3/3]

virtual void agx::GranularDataExporter::createExportFile ( const agx::String &  filename)
pure virtual

Sets and creates a file with the given path where the exporter writes information.

Parameters
filenamethe complete path to the file that should be created.

◆ exportContactInformation() [1/2]

void agx::GranularDataExporter::exportContactInformation ( const detail::ParticleGeometryContactInformation &  information)
protected

◆ exportContactInformation() [2/2]

void agx::GranularDataExporter::exportContactInformation ( const detail::ParticlePairContactInformation &  information)
protected

◆ exportPostStep()

void agx::GranularDataExporter::exportPostStep ( const IndexHashSet &  destroyedParticles)

Manually called by the exporter parent when performing pre export step.

Parameters
destroyedParticlesParticles destroyed in the current time step of the exporter.

◆ exportPreStep()

void agx::GranularDataExporter::exportPreStep ( const IndexHashSet &  destroyedParticles)

Manually called by the exporter parent when performing pre export step.

Parameters
destroyedParticlesParticles destroyed in the current time step of the exporter.

◆ finalizeAfterSimulation()

void agx::GranularDataExporter::finalizeAfterSimulation ( )

Function that is called manually after the simulation is done.

Finalizes the data export.

◆ finalizeExport()

void agx::GranularDataExporter::finalizeExport ( GranularDataExporter *  exporter)

Called during the last steps of the export.

Parameters
exporterThe exporter object.

◆ generateFileNames()

void agx::GranularDataExporter::generateFileNames ( )
protected

◆ generateTimeStamp()

agx::String agx::GranularDataExporter::generateTimeStamp ( ) const
protected

◆ getAccumulatedImpactEnergyFromParticle()

agx::Real agx::GranularDataExporter::getAccumulatedImpactEnergyFromParticle ( agx::Index  particleId)
protected

◆ getHeader() [1/3]

virtual agx::String agx::GranularDataExporter::getHeader ( )
overrideprotectedvirtual

Each FileWriter implementation implements a different header, since different data is exported.

◆ getHeader() [2/3]

virtual agx::String agx::GranularDataExporter::getHeader ( )
overrideprotectedvirtual

◆ getHeader() [3/3]

virtual agx::String agx::GranularDataExporter::getHeader ( )
protectedpure virtual

Each FileWriter implementation implements a different header, since different data is exported.

◆ getStartingParticleGeometryImpacts()

IndexHashSet agx::GranularDataExporter::getStartingParticleGeometryImpacts ( )
protected

Returns the indices for the particle-geometry impact contacts currently stored in the storage.

Definition at line 142 of file GranularDataExporter.h.

◆ getStartingParticlePairImpacts()

IndexHashSet agx::GranularDataExporter::getStartingParticlePairImpacts ( )
protected

Returns the indices for the particle-particle impact contacts currently stored in the storage.

Definition at line 147 of file GranularDataExporter.h.

◆ getType() [1/3]

virtual GranularDataExporter::ExporterDataType agx::GranularDataExporter::getType ( ) const
pure virtual

Returns the type of the exporter, which is overridden by child classes.

Each exporter type exports different information.

Returns
The exporter type.

◆ getType() [2/3]

virtual GranularDataExporter::ExporterDataType agx::GranularDataExporter::getType ( ) const
overridevirtual

Returns the type of the exporter, which is overridden by child classes.

Each exporter type exports different information.

Returns
The exporter type, which in this case is CONTACT_DATA.

◆ getType() [3/3]

virtual GranularDataExporter::ExporterDataType agx::GranularDataExporter::getType ( ) const
overridevirtual

Returns the type of the exporter, which is overridden by child classes.

Each exporter type exports different information.

Returns
The exporter type, which in this case is PARTICLE_DATA.

◆ handleParticleDestroyed() [1/3]

virtual void agx::GranularDataExporter::handleParticleDestroyed ( agx::Index  particleId)
virtual

Callback that is called when a particle is destroyed.

Parameters
particleId- Particle destroyed in the current time step of the exporter.

◆ handleParticleDestroyed() [2/3]

virtual void agx::GranularDataExporter::handleParticleDestroyed ( agx::Index  particleId)
overridevirtual

Is called when a particle is destroyed in the simulation.

◆ handleParticleDestroyed() [3/3]

virtual void agx::GranularDataExporter::handleParticleDestroyed ( agx::Index  particleId)
overridevirtual

Called when a particle is destroyed.

Parameters
particleIdID of the particle that is destroyed.

◆ hasAnalysisBox()

bool agx::GranularDataExporter::hasAnalysisBox ( ) const
protected

◆ IDataExporter()

agx::GranularDataExporter::IDataExporter ( agx::Physics::GranularBodySystem *  system)

Constructor.

◆ IDataFileWriter()

agx::GranularDataExporter::IDataFileWriter ( const agx::String &  filePrefix,
const agx::String &  postFix,
const agx::String &  separator 
)

Constructor for creating the file writer.

File is created upon class construction.

Parameters
filePrefixThe file prefix of the data file.
postFixThe file postfix for the data file.
separatorseparator token that is used to separate the data entries in the export file.

◆ init()

void agx::GranularDataExporter::init ( )

Initializes the exporter.

Needs to be called before the exporter is run.

◆ onParticleCreated()

virtual void agx::GranularDataExporter::onParticleCreated ( agx::Index  id)
overrideprotectedvirtual

◆ onParticleDestroyed()

virtual void agx::GranularDataExporter::onParticleDestroyed ( agx::Index  id)
overrideprotectedvirtual

◆ ParticleDataExporter()

agx::GranularDataExporter::ParticleDataExporter ( agx::Physics::GranularBodySystem *  system)

Constructor.

◆ ParticleDataWriter()

agx::GranularDataExporter::ParticleDataWriter ( const agx::String &  filePrefix,
const agx::String &  postFix,
const agx::String &  separator 
)

Constructor for creating the file writer.

File is created upon class construction.

Parameters
filePrefixThe file prefix of the data file.
postFixThe file postfix for the data file.
separatorseparator token that is used to separate the data entries in the export file.

◆ post()

virtual void agx::GranularDataExporter::post ( const agx::TimeStamp &  )
overridevirtual

Post step function.

Reimplemented from agxSDK::StepEventListener.

◆ pre()

virtual void agx::GranularDataExporter::pre ( const agx::TimeStamp &  )
overridevirtual

Pre step function.

Reimplemented from agxSDK::StepEventListener.

◆ setAnalysisBox() [1/2]

void agx::GranularDataExporter::setAnalysisBox ( agx::AnalysisBox *  box)

Sets the AnalysisBox that should be used by the exporter.

If the box is enabled, only objects within the bound of the specified AnalysisBox will be exported.

Parameters
boxThe AnalysisBox object that should be used when determining what objects that should be exported.

◆ setAnalysisBox() [2/2]

void agx::GranularDataExporter::setAnalysisBox ( agx::AnalysisBox *  box)

Sets the analysis box to be used in the exporter.

If the analysis box is enabled, only data entities placed inside the box will be exported.

Parameters
boxThe analysis box to be used in the exporter.

◆ setExporterType()

void agx::GranularDataExporter::setExporterType ( ExporterDataType  type)

Sets the exporter type, i.e which type of data that should be exported.

Currently supported data is particles and particle impact contacts stored in the journal under GranularBodySystem.

Parameters
typeDetermines the type of data that should be exported.

◆ updateParticleEnergyTable()

void agx::GranularDataExporter::updateParticleEnergyTable ( )
protected

◆ updateStartingContactIds()

void agx::GranularDataExporter::updateStartingContactIds ( )
protected

◆ writeContact() [1/2]

void agx::GranularDataExporter::writeContact ( const detail::ParticleGeometryContactInformation &  contact)

Writes particle information to file.

Parameters
contactParticle information that should be written to file.

◆ writeContact() [2/2]

void agx::GranularDataExporter::writeContact ( const detail::ParticlePairContactInformation &  contact)

Writes particle information to file.

Parameters
contactParticle information that should be written to file.

◆ writeOutputString()

void agx::GranularDataExporter::writeOutputString ( const agx::String &  output)
protected

◆ writeParticleInformation() [1/2]

void agx::GranularDataExporter::writeParticleInformation ( const detail::ParticleInformation &  info)

Writes particle information to file.

Parameters
infoParticle information that should be written to file.

◆ writeParticleInformation() [2/2]

void agx::GranularDataExporter::writeParticleInformation ( const detail::ParticleInformation &  information)
protected

◆ writeToFile()

void agx::GranularDataExporter::writeToFile ( const agx::String &  file)

Sets and creates a file with the given path where the exporter writes information.

Parameters
filethe complete path to the file that should be created.

Member Data Documentation

◆ m_analysisBox

agx::AnalysisBox* agx::GranularDataExporter::m_analysisBox
protected

Definition at line 224 of file GranularDataExporter.h.

◆ m_completeName

agx::String agx::GranularDataExporter::m_completeName
protected

Definition at line 360 of file GranularDataExporter.h.

◆ m_dataExporter

IDataExporterRef agx::GranularDataExporter::m_dataExporter
protected

Definition at line 137 of file GranularDataExporter.h.

◆ m_exportedParticles

IndexHashSet agx::GranularDataExporter::m_exportedParticles
protected

Definition at line 225 of file GranularDataExporter.h.

◆ m_fileprefix

agx::String agx::GranularDataExporter::m_fileprefix
protected

Definition at line 357 of file GranularDataExporter.h.

◆ m_fileWriter

IDataFileWriterRef agx::GranularDataExporter::m_fileWriter
protected

Definition at line 223 of file GranularDataExporter.h.

◆ m_outStream

std::ofstream agx::GranularDataExporter::m_outStream
protected

Definition at line 361 of file GranularDataExporter.h.

◆ m_particleImpactDataTable

ParticleImpactDataTable agx::GranularDataExporter::m_particleImpactDataTable
protected

Definition at line 323 of file GranularDataExporter.h.

◆ m_postFix

agx::String agx::GranularDataExporter::m_postFix
protected

Definition at line 358 of file GranularDataExporter.h.

◆ m_separator

agx::String agx::GranularDataExporter::m_separator
protected

Definition at line 359 of file GranularDataExporter.h.

◆ m_startingParticleGeometryImpactContacts

IndexHashSet agx::GranularDataExporter::m_startingParticleGeometryImpactContacts
protected

Definition at line 138 of file GranularDataExporter.h.

◆ m_startingParticlePairImpactContacts

IndexHashSet agx::GranularDataExporter::m_startingParticlePairImpactContacts
protected

Definition at line 139 of file GranularDataExporter.h.

◆ m_system

agx::Physics::GranularBodySystem * agx::GranularDataExporter::m_system
protected

Definition at line 136 of file GranularDataExporter.h.


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