GEOS
HistoryCollection.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
16 #ifndef GEOS_FILEIO_TIMEHISTORY_HISTORYCOLLECTION_HPP_
17 #define GEOS_FILEIO_TIMEHISTORY_HISTORYCOLLECTION_HPP_
18 
19 #include "dataRepository/BufferOpsDevice.hpp"
22 #include "mesh/DomainPartition.hpp"
23 
24 #include <functional>
25 
26 namespace geos
27 {
28 
35 {
36 public:
38  HistoryCollection( string const & name, Group * parent ):
39  TaskBase( name, parent )
40  {}
41 
43  using BufferProvider = std::function< buffer_unit_type * ( localIndex ) >;
45  using TimeBufferProvider = std::function< buffer_unit_type *() >;
46 
48  void initializePostSubGroups() override {};
49 
54  virtual localIndex numCollectors() const = 0;
55 
62  virtual HistoryMetadata getMetaData( DomainPartition const & domain, localIndex collectionIdx ) const = 0;
63 
68  virtual const string & getTargetName() const = 0;
69 
77  virtual void registerBufferProvider( localIndex collectionIdx, BufferProvider bufferProvider ) = 0;
78 
83  virtual HistoryMetadata getTimeMetaData() const = 0;
84 
91  virtual void registerTimeBufferProvider( TimeBufferProvider timeBufferProvider ) = 0;
92 
97  virtual localIndex numMetaDataCollectors() const = 0;
98 
105 };
106 
107 }
108 
109 #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.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:109