GEOSX
HistoryCollection.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2019 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2019 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2019 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All right reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
15 #ifndef GEOS_FILEIO_TIMEHISTORY_HISTORYCOLLECTION_HPP_
16 #define GEOS_FILEIO_TIMEHISTORY_HISTORYCOLLECTION_HPP_
17 
18 #include "dataRepository/BufferOpsDevice.hpp"
20 #include "events/tasks/TaskBase.hpp"
21 #include "mesh/DomainPartition.hpp"
22 
23 #include <functional>
24 
25 namespace geos
26 {
27 
28 using namespace dataRepository;
29 
35 class HistoryCollection : public TaskBase
36 {
37 public:
39  HistoryCollection( string const & name, Group * parent ):
40  TaskBase( name, parent )
41  {}
42 
44  using BufferProvider = std::function< buffer_unit_type * ( localIndex ) >;
46  using TimeBufferProvider = std::function< buffer_unit_type *() >;
47 
49  void initializePostSubGroups() override {};
50 
55  virtual localIndex numCollectors() const = 0;
56 
63  virtual HistoryMetadata getMetaData( DomainPartition const & domain, localIndex collectionIdx ) const = 0;
64 
69  virtual const string & getTargetName() const = 0;
70 
78  virtual void registerBufferProvider( localIndex collectionIdx, BufferProvider bufferProvider ) = 0;
79 
84  virtual HistoryMetadata getTimeMetaData() const = 0;
85 
92  virtual void registerTimeBufferProvider( TimeBufferProvider timeBufferProvider ) = 0;
93 
98  virtual localIndex numMetaDataCollectors() const = 0;
99 
106 };
107 
108 }
109 
110 #endif
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
virtual HistoryMetadata getMetaData(DomainPartition const &domain, localIndex collectionIdx) const =0
Get the metadata for what this collector collects.
virtual const string & getTargetName() const =0
Get the name of the object being targeted for collection.
void initializePostSubGroups() override
Forwarding public initializing function...
virtual localIndex numCollectors() const =0
Get the number of discrete collection operations this collector conducts.
std::function< buffer_unit_type *() > TimeBufferProvider
Type of time buffer provider.
virtual localIndex numMetaDataCollectors() const =0
Get the number of collectors of meta-information (set indices, etc) writing time-independent informat...
std::function< buffer_unit_type *(localIndex) > BufferProvider
Type of buffer provider.
virtual HistoryCollection & getMetaDataCollector(localIndex metaIdx)=0
Get a collector of meta-information for this collector.
virtual void registerBufferProvider(localIndex collectionIdx, BufferProvider bufferProvider)=0
Register a callback that provides the current head of the time history data buffer.
HistoryCollection(string const &name, Group *parent)
Constructor.
virtual HistoryMetadata getTimeMetaData() const =0
Get a metadata object relating the the Time variable itself.
virtual void registerTimeBufferProvider(TimeBufferProvider timeBufferProvider)=0
Register a callback that gives the current head of the time data buffer.
A minimal class to specify information about time history information being collected and output.
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:149
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125