GEOS
StencilDataCollection.hpp
Go to the documentation of this file.
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 TotalEnergies
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 
20 #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_CELLTOCELLDATACOLLECTOR_HPP_
21 #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_CELLTOCELLDATACOLLECTOR_HPP_
22 
25 namespace geos
26 {
27 
28 class FlowSolverBase;
29 class MeshLevel;
30 class FluxApproximationBase;
31 
40 {
41 public:
42 
48  StencilDataCollection( const string & name,
49  dataRepository::Group * const parent );
50 
52  static string catalogName() { return "CellToCellDataCollection"; }
53 
61  virtual bool execute( real64 const time_n,
62  real64 const dt,
63  integer const cycleNumber,
64  integer const eventCounter,
65  real64 const eventProgress,
66  DomainPartition & domain ) override;
67 
71  {
72  static constexpr char const * solverNameString() { return "flowSolverName"; }
73  static constexpr char const * meshNameString() { return "meshBody"; }
74  static constexpr char const * cellAGlobalIdString() { return "cellAGlobalId"; }
75  static constexpr char const * cellBGlobalIdString() { return "cellBGlobalId"; }
76  static constexpr char const * transmissibilityABString() { return "transmissibilityAB"; }
77  static constexpr char const * transmissibilityBAString() { return "transmissibilityBA"; }
78  };
79 
80  class Kernel;
81 
86  {
87  real64 m_transmissibility[2];
88  localIndex m_regionId[2];
89  localIndex m_subRegionId[2];
90  localIndex m_elementId[2];
91  };
92 
93 private:
94 
95  using Base = TaskBase;
97 
101  struct ConnectionData
102  {
103  real64 m_transmissibility[2];
104  globalIndex m_globalId[2];
105 
106 
112  static ConnectionData fromKernel( KernelConnectionData const & kernelData,
113  LocalToGlobalMap const & localToGlobalMap );
114 
121  bool operator<( ConnectionData const & other ) const
122  {
123  return m_globalId[0] != other.m_globalId[0] ?
124  m_globalId[0] < other.m_globalId[0] :
125  m_globalId[1] < other.m_globalId[1];
126  }
127  };
128 
129  array1d< globalIndex > m_cellAGlobalId;
130  array1d< globalIndex > m_cellBGlobalId;
131  array1d< real64 > m_transmissibilityAB;
132  array1d< real64 > m_transmissibilityBA;
133 
135  string m_meshName;
137  string m_solverName;
138 
140  FlowSolverBase const * m_solver = nullptr;
142  MeshLevel const * m_meshLevel = nullptr;
144  FluxApproximationBase const * m_discretization = nullptr;
145 
146 
147 
148  void postInputInitialization() override;
149 
155  void initializePostInitialConditionsPostSubGroups() override;
156 
164  template< typename STENCILWRAPPER_T >
165  array1d< KernelConnectionData > gatherConnectionData( STENCILWRAPPER_T const & stencilWrapper ) const;
166 
173  void storeConnectionData( string_view stencilName,
174  arrayView1d< KernelConnectionData > const & kernelData );
175 
176  void logStoredConnections( string_view stencilName );
177 };
178 
179 
180 } /* namespace geos */
181 
182 #endif /* SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_CELLTOCELLDATACOLLECTOR_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
StencilDataCollection(const string &name, dataRepository::Group *const parent)
Constructor for the statistics class.
static string catalogName()
Accessor for the catalog name.
TaskBase(string const &name, Group *const parent)
Constructor.
virtual bool execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Main extension point of executable targets.
bool operator<(InputFlags const left, InputFlags const right)
Comparison operator for InputFlags enumeration.
Definition: InputFlags.hpp:163
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:87
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:84
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:81
std::string_view string_view
String type.
Definition: DataTypes.hpp:93
Element-element connection data extracted from the kernel.