GEOSX
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
geosx::HistoryCollection Class Referenceabstract

#include <TimeHistoryCollection.hpp>

Inheritance diagram for geosx::HistoryCollection:
Inheritance graph
[legend]

Public Member Functions

 HistoryCollection (string const &name, Group *parent)
 Constructor. More...
 
void initializePostSubGroups () override
 
virtual localIndex getCollectionCount () const
 Get the number of discrete collection operations this collector conducts. More...
 
virtual HistoryMetadata getMetadata (DomainPartition const &domain, localIndex collectionIdx)
 Get the metadata for what this collector collects. More...
 
virtual const stringgetTargetName () const =0
 Get the name of the object being targeted for collection. More...
 
virtual bool execute (real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
 Collects history data. More...
 
void registerBufferCall (localIndex collectionIdx, std::function< buffer_unit_type *() > bufferCall)
 Register a callback that gives the current head of the time history data buffer. More...
 
HistoryMetadata getTimeMetadata () const
 Get a metadata object relating the the Time variable itself. More...
 
void registerTimeBufferCall (std::function< buffer_unit_type *() > timeBufferCall)
 Register a callback that gives the current head of the time data buffer. More...
 
virtual localIndex getNumMetaCollectors () const
 Get the number of collectors of meta-information (set indices, etc) writing time-independent information during initialization. More...
 
virtual HistoryCollectiongetMetaCollector (localIndex metaIdx)
 Get a pointer to a collector of meta-information for this collector. More...
 
virtual void updateSetsIndices (DomainPartition &domain)=0
 Update the indices from the sets being collected. More...
 

Protected Member Functions

dataRepository::Group const * getTargetObject (DomainPartition const &domain, string const &objectPath)
 Retrieve the target object from the data repository. More...
 
virtual void collect (DomainPartition &domain, real64 const time_n, real64 const dt, localIndex const collectionIdx, buffer_unit_type *&buffer)=0
 Collect history information into the provided buffer. Typically called from HistoryCollection::execute . More...
 

Protected Attributes

bool m_targetIsMeshObject
 whether the target object is associated with mesh entities (fields, etc)
 
localIndex m_collectionCount
 The number of discrete collection operations described by metadata this collection collects.
 
std::function< buffer_unit_type *() > m_timeBufferCall
 Callbacks to get the current time buffer head to write time data into.
 
std::vector< std::function< buffer_unit_type *() > > m_bufferCalls
 Callbacks to get the current buffer head to write history data into.
 
std::vector< std::unique_ptr< HistoryCollection > > m_metaCollectors
 

Detailed Description

A task class for serializing time history data into a buffer for later I/O.

Definition at line 41 of file TimeHistoryCollection.hpp.

Constructor & Destructor Documentation

◆ HistoryCollection()

geosx::HistoryCollection::HistoryCollection ( string const &  name,
Group parent 
)
inline

Constructor.

Parameters
nameThe name of this Group.
parentThe parent Group.

Definition at line 45 of file TimeHistoryCollection.hpp.

Member Function Documentation

◆ collect()

virtual void geosx::HistoryCollection::collect ( DomainPartition domain,
real64 const  time_n,
real64 const  dt,
localIndex const  collectionIdx,
buffer_unit_type *&  buffer 
)
protectedpure virtual

Collect history information into the provided buffer. Typically called from HistoryCollection::execute .

Parameters
domainThe DomainPartition to collect time history on.
time_nThe current simulation time.
dtThe current simulation time delta.
collectionIdxThe index of the collection operation to collect from the targeted collection event.
bufferA properly-sized buffer to serialize history data into.

Implemented in geosx::PackCollection.

◆ execute()

virtual bool geosx::HistoryCollection::execute ( real64 const  time_n,
real64 const  dt,
integer const  cycleNumber,
integer const  eventCounter,
real64 const  eventProgress,
DomainPartition domain 
)
inlineoverridevirtual

Collects history data.

Definition at line 91 of file TimeHistoryCollection.hpp.

◆ getCollectionCount()

virtual localIndex geosx::HistoryCollection::getCollectionCount ( ) const
inlinevirtual

Get the number of discrete collection operations this collector conducts.

Returns
The number of collection operations for this collector.

Definition at line 63 of file TimeHistoryCollection.hpp.

◆ getMetaCollector()

virtual HistoryCollection& geosx::HistoryCollection::getMetaCollector ( localIndex  metaIdx)
inlinevirtual

Get a pointer to a collector of meta-information for this collector.

Parameters
metaIdxWhich of the meta-info collectors to return. (see HistoryCollection::getNumMetaCollectors( ) ).
Returns
A unique pointer to the HistoryCollection object used for meta-info collection. Intented to fall out of scope and desctruct immediately after being used to perform output during simulation initialization.

Definition at line 172 of file TimeHistoryCollection.hpp.

◆ getMetadata()

virtual HistoryMetadata geosx::HistoryCollection::getMetadata ( DomainPartition const &  domain,
localIndex  collectionIdx 
)
inlinevirtual

Get the metadata for what this collector collects.

Parameters
domainThe DomainPartition.
collectionIdxWhich collected item to get metadata for.
Returns
A HistoryMetadata object describing the history data being collected by this collector.

Reimplemented in geosx::PackCollection.

Definition at line 74 of file TimeHistoryCollection.hpp.

◆ getNumMetaCollectors()

virtual localIndex geosx::HistoryCollection::getNumMetaCollectors ( ) const
inlinevirtual

Get the number of collectors of meta-information (set indices, etc) writing time-independent information during initialization.

Returns
The number of collectors of meta-information for this collector.

Reimplemented in geosx::PackCollection.

Definition at line 160 of file TimeHistoryCollection.hpp.

◆ getTargetName()

virtual const string& geosx::HistoryCollection::getTargetName ( ) const
pure virtual

Get the name of the object being targeted for collection.

Returns
The collection target's name

Implemented in geosx::PackCollection.

◆ getTargetObject()

dataRepository::Group const* geosx::HistoryCollection::getTargetObject ( DomainPartition const &  domain,
string const &  objectPath 
)
inlineprotected

Retrieve the target object from the data repository.

Parameters
domainThe DomainPartition of the problem.
objectPathThe data repo path of the target object.
Returns
The target object as a Group
Note
If the object path is absolute this returns the target object by calling getGroupByPath. If the object path is relative, it searches relative to the mesh in the same way the fieldSpecification does, so any objectPath that works in fieldSpecification will also work here.

Definition at line 194 of file TimeHistoryCollection.hpp.

◆ getTimeMetadata()

HistoryMetadata geosx::HistoryCollection::getTimeMetadata ( ) const
inline

Get a metadata object relating the the Time variable itself.

Returns
A HistroyMetadata object describing the Time variable.

Definition at line 140 of file TimeHistoryCollection.hpp.

◆ registerBufferCall()

void geosx::HistoryCollection::registerBufferCall ( localIndex  collectionIdx,
std::function< buffer_unit_type *() >  bufferCall 
)
inline

Register a callback that gives the current head of the time history data buffer.

Parameters
collectionIdxWhich collection item to register the buffer callback for.
bufferCallA functional that when invoked returns a pointer to the head of a buffer at least large enough to serialize one timestep of history data into.
Note
This is typically meant to callback to BufferedHistoryIO::GetBufferHead( )

Definition at line 130 of file TimeHistoryCollection.hpp.

◆ registerTimeBufferCall()

void geosx::HistoryCollection::registerTimeBufferCall ( std::function< buffer_unit_type *() >  timeBufferCall)
inline

Register a callback that gives the current head of the time data buffer.

Parameters
timeBufferCallA functional that when invoked returns a pointer to the head of a buffer at least large enough to serialize one instance of the Time variable into.
Note
This is typically meant to callback to BufferedHistoryIO::GetBufferHead( )

Definition at line 151 of file TimeHistoryCollection.hpp.

◆ updateSetsIndices()

virtual void geosx::HistoryCollection::updateSetsIndices ( DomainPartition domain)
pure virtual

Update the indices from the sets being collected.

Parameters
domainThe DomainPartition of the problem.

Implemented in geosx::PackCollection.

Member Data Documentation

◆ m_metaCollectors

std::vector< std::unique_ptr< HistoryCollection > > geosx::HistoryCollection::m_metaCollectors
protected

The set of metadata collectors for this collector ( currently only used to collect coordinates of mesh objects when collecting field data )

Definition at line 251 of file TimeHistoryCollection.hpp.


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