GEOSX
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
geos::HistoryCollectionBase Class Referenceabstract

Intermediate class for code factorisation. It mainly deals with collector and buffer management. It delegates the actual collection to derived classes. More...

#include <HistoryCollectionBase.hpp>

Inheritance diagram for geos::HistoryCollectionBase:
Inheritance graph
[legend]

Public Member Functions

 HistoryCollectionBase (string const &name, Group *parent)
 Constructor. More...
 
void initializePostSubGroups () override
 
localIndex numCollectors () const override
 Get the number of discrete collection operations this collector conducts. More...
 
virtual bool execute (real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
 
void registerBufferProvider (localIndex collectionIdx, BufferProvider bufferProvider) override
 Register a callback that provides the current head of the time history data buffer. More...
 
HistoryMetadata getTimeMetaData () const override
 Get a metadata object relating the the Time variable itself. More...
 
void registerTimeBufferProvider (TimeBufferProvider timeBufferProvider) override
 Register a callback that gives the current head of the time data buffer. More...
 
HistoryCollectiongetMetaDataCollector (localIndex metaIdx) override
 Get a collector of meta-information for this collector. More...
 
- Public Member Functions inherited from geos::HistoryCollection
 HistoryCollection (string const &name, Group *parent)
 Constructor. More...
 
void initializePostSubGroups () override
 Forwarding public initializing function...
 
virtual HistoryMetadata getMetaData (DomainPartition const &domain, localIndex collectionIdx) const =0
 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 localIndex numMetaDataCollectors () const =0
 Get the number of collectors of meta-information (set indices, etc) writing time-independent information during initialization. More...
 

Protected Member Functions

const dataRepository::GroupgetTargetObject (DomainPartition const &domain, string const &objectPath) const
 Retrieve the target object from the data repository. More...
 
virtual void collect (DomainPartition const &domain, 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.
 
TimeBufferProvider m_timeBufferProvider
 Callbacks to get the current time buffer head to write time data into.
 
std::vector< BufferProviderm_bufferProviders
 Callbacks to get the current buffer head to write history data into.
 
std::vector< std::unique_ptr< HistoryCollection > > m_metaDataCollectors
 The set of metadata collectors for this collector. More...
 

Additional Inherited Members

- Public Types inherited from geos::HistoryCollection
using BufferProvider = std::function< buffer_unit_type *(localIndex) >
 Type of buffer provider.
 
using TimeBufferProvider = std::function< buffer_unit_type *() >
 Type of time buffer provider.
 

Detailed Description

Intermediate class for code factorisation. It mainly deals with collector and buffer management. It delegates the actual collection to derived classes.

Definition at line 32 of file HistoryCollectionBase.hpp.

Constructor & Destructor Documentation

◆ HistoryCollectionBase()

geos::HistoryCollectionBase::HistoryCollectionBase ( string const &  name,
Group parent 
)
inline

Constructor.

Parameters
nameThe name of this Group.
parentThe parent Group.

Definition at line 36 of file HistoryCollectionBase.hpp.

Member Function Documentation

◆ collect()

virtual void geos::HistoryCollectionBase::collect ( DomainPartition const &  domain,
localIndex const  collectionIdx,
buffer_unit_type *&  buffer 
)
protectedpure virtual

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

Parameters
[in]domainThe DomainPartition to collect time history on.
[in]collectionIdxThe index of the collection operation to collect from the targeted collection event.
[in,out]bufferA properly-sized buffer to serialize history data into.

◆ getMetaDataCollector()

HistoryCollection& geos::HistoryCollectionBase::getMetaDataCollector ( localIndex  metaIdx)
overridevirtual

Get a collector of meta-information for this collector.

Parameters
[in]metaIdxWhich of the meta-info collectors to return. (see HistoryCollection::numMetaDataCollectors()).
Returns
A mutable reference.

Implements geos::HistoryCollection.

◆ getTargetObject()

const dataRepository::Group* geos::HistoryCollectionBase::getTargetObject ( DomainPartition const &  domain,
string const &  objectPath 
) const
protected

Retrieve the target object from the data repository.

Parameters
[in]domainThe DomainPartition of the problem.
[in]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.

◆ getTimeMetaData()

HistoryMetadata geos::HistoryCollectionBase::getTimeMetaData ( ) const
overridevirtual

Get a metadata object relating the the Time variable itself.

Returns
A HistroyMetadata object describing the Time variable.

Implements geos::HistoryCollection.

◆ numCollectors()

localIndex geos::HistoryCollectionBase::numCollectors ( ) const
overridevirtual

Get the number of discrete collection operations this collector conducts.

Returns
The number of collection operations for this collector.

Implements geos::HistoryCollection.

◆ registerBufferProvider()

void geos::HistoryCollectionBase::registerBufferProvider ( localIndex  collectionIdx,
BufferProvider  bufferProvider 
)
overridevirtual

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

Parameters
[in]collectionIdxWhich collection item to register the buffer callback for.
[in]bufferProviderA functional that when invoked returns a pointer to the head of a buffer at least large enough to serialize one time step of history data into.
Note
This is typically meant to callback to BufferedHistoryIO::getBufferHead()

Implements geos::HistoryCollection.

◆ registerTimeBufferProvider()

void geos::HistoryCollectionBase::registerTimeBufferProvider ( TimeBufferProvider  timeBufferProvider)
overridevirtual

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

Parameters
[in]timeBufferProviderA 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()

Implements geos::HistoryCollection.

Member Data Documentation

◆ m_metaDataCollectors

std::vector< std::unique_ptr< HistoryCollection > > geos::HistoryCollectionBase::m_metaDataCollectors
protected

The set of metadata collectors for this collector.

Note
Currently only used to collect coordinates of mesh objects when collecting field data.

Definition at line 120 of file HistoryCollectionBase.hpp.


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