GEOSX
PackCollection.hpp
Go to the documentation of this file.
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 Total, S.A
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 
19 #ifndef GEOSX_PackCollection_HPP_
20 #define GEOSX_PackCollection_HPP_
21 
23 
24 namespace geosx
25 {
32 {
33 public:
38  PackCollection ( string const & name, Group * parent );
39 
44  static string CatalogName() { return "PackCollection"; }
45 
47  void InitializePostSubGroups( Group * const group ) override;
48 
50  virtual HistoryMetadata getMetadata( ProblemManager & problemManager, localIndex collectionIdx ) override;
51 
53  virtual const string & getTargetName( ) const override
54  {
55  return m_fieldName;
56  }
57 
68  virtual void updateSetsIndices( DomainPartition & domain ) override final;
69 
76  void filterGhostIndices( localIndex const setIndex,
78  arrayView1d< integer const > const & ghostRank );
79 
81  struct viewKeysStruct
82  {
83  static constexpr auto objectPath = "objectPath";
84  static constexpr auto fieldName = "fieldName";
85  static constexpr auto setNames = "setNames";
86  static constexpr auto minSetSize = "minSetSize";
87  } keys;
89 
90 protected:
97 
99  virtual void collect( DomainPartition & domain,
100  real64 const time_n,
101  real64 const dt,
102  localIndex const collectionIdx,
103  buffer_unit_type * & buffer ) override;
104 
105 private:
106  // todo : replace this with a vector of references to the actual set sortedarrays (after packing rework to allow sorted arrays to be used
107  // for indexing)
109  std::vector< array1d< localIndex > > m_setsIndices;
111  string m_objectPath;
113  string m_fieldName;
115  string_array m_setNames;
117  localIndex m_minimumSetSize;
118 };
119 
120 }
121 #endif
virtual HistoryMetadata getMetadata(ProblemManager &problemManager, localIndex collectionIdx) override
Get the metadata for what this collector collects.
ObjectManagerBase const * getTargetObject(DomainPartition &domain)
Get the target object from which to collect time history data.
virtual void updateSetsIndices(DomainPartition &domain) override final
Update the indices related to the sets being collected.
static string CatalogName()
Catalog name interface.
This class serves to provide a "view" of a multidimensional array.
Definition: ArrayView.hpp:67
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
virtual const string & getTargetName() const override
Get the name of the object being targeted for collection.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
PackCollection(string const &name, Group *parent)
Constructor.
virtual void collect(DomainPartition &domain, real64 const time_n, real64 const dt, localIndex const collectionIdx, buffer_unit_type *&buffer) override
Collect history information into the provided buffer. Typically called from HistoryCollection::Execut...
signed char buffer_unit_type
Type stored in communication buffers.
Definition: DataTypes.hpp:146
void filterGhostIndices(localIndex const setIndex, array1d< localIndex > &set, arrayView1d< integer const > const &ghostRank)
Filters out ghost rank indices from setIndices to be collected.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
This is the class handling the operation flow of the problem being ran in GEOSX.
void InitializePostSubGroups(Group *const group) override
Called by Initialize() after to initializing sub-Groups.
struct containing the view access keys to be bound with class data member
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
Definition: Array.hpp:55
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...