19 #ifndef GEOSX_TimeHistoryCollection_HPP_ 20 #define GEOSX_TimeHistoryCollection_HPP_ 26 #include "dataRepository/BufferOpsDevice.hpp" 32 using namespace dataRepository;
45 m_collectionCount( 1 ),
54 m_bufferCalls.resize( m_collectionCount );
63 return m_collectionCount;
83 virtual const string & getTargetName( )
const = 0;
93 real64 const eventProgress,
94 Group * domain )
override 99 for(
localIndex collectionIdx = 0; collectionIdx < getCollectionCount(); ++collectionIdx )
104 "History collection buffer retrieval function is unassigned, did you declare a related TimeHistoryOutput event?" );
108 DomainPartition & domainPart = dynamicCast< DomainPartition & >( *domain );
109 updateSetsIndices( domainPart );
110 collect( domainPart, time_n, dt, collectionIdx, buffer );
112 int rank = MpiWrapper::Comm_rank();
113 if( rank == 0 && m_timeBufferCall )
116 memcpy( timeBuffer, &time_n,
sizeof(time_n) );
129 GEOSX_ERROR_IF( collectionIdx >= this->getCollectionCount( ),
"Invalid collection index specified." );
130 m_bufferCalls[collectionIdx] = bufferCall;
150 m_timeBufferCall = timeBufferCall;
174 return std::unique_ptr< HistoryCollection >( nullptr );
void registerBufferCall(localIndex collectionIdx, std::function< buffer_unit_type *() > bufferCall)
Register a callback that gives the current head of the time history data buffer.
localIndex m_collectionCount
The number of discrete collection operations described by metadata this collection collects...
double real64
64-bit floating point type.
virtual std::unique_ptr< HistoryCollection > getMetaCollector(ProblemManager &problemManager, localIndex metaIdx)
Get a pointer to a collector of meta-information for this collector.
virtual void Execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, Group *domain) override
Collects history data.
void InitializePostSubGroups(Group *const group) override
Called by Initialize() after to initializing sub-Groups.
signed char buffer_unit_type
Type stored in communication buffers.
std::int32_t integer
Signed integer type.
virtual HistoryMetadata getMetadata(ProblemManager &problemManager, localIndex collectionIdx)
Get the metadata for what this collector collects.
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
This is the class handling the operation flow of the problem being ran in GEOSX.
void registerTimeBufferCall(std::function< buffer_unit_type *() > timeBufferCall)
Register a callback that gives the current head of the time data buffer.
virtual localIndex getNumMetaCollectors() const
Get the number of collectors of meta-information (set indices, etc) writing time-independent informat...
std::vector< std::function< buffer_unit_type *() > > m_bufferCalls
Callbacks to get the current buffer head to write history data into.
HistoryCollection(string const &name, Group *parent)
Constructor.
#define GEOSX_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
HistoryMetadata getTimeMetadata() const
Get a metadata object relating the the Time variable itself.
std::function< buffer_unit_type *() > m_timeBufferCall
Callbacks to get the current time buffer head to write time data into.
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
A minimal class to specify information about time history information being collected and output...
virtual localIndex getCollectionCount() const
Get the number of discrete collection operations this collector conducts.