GEOS
StencilDataCollection.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_CELLTOCELLDATACOLLECTOR_HPP_
20 #define SRC_CORECOMPONENTS_PHYSICSSOLVERS_FLUIDFLOW_CELLTOCELLDATACOLLECTOR_HPP_
21 
24 
25 namespace geos
26 {
27 
36 {
37 public:
38 
44  StencilDataCollection( const string & name,
45  dataRepository::Group * const parent );
46 
48  static string catalogName() { return "CellToCellDataCollection"; }
49 
57  virtual bool execute( real64 const time_n,
58  real64 const dt,
59  integer const cycleNumber,
60  integer const eventCounter,
61  real64 const eventProgress,
62  DomainPartition & domain ) override;
63 
67  {
68  static constexpr char const * solverNameString() { return "flowSolverName"; }
69  static constexpr char const * meshNameString() { return "meshBody"; }
70  static constexpr char const * cellAGlobalIdString() { return "cellAGlobalId"; }
71  static constexpr char const * cellBGlobalIdString() { return "cellBGlobalId"; }
72  static constexpr char const * transmissibilityABString() { return "transmissibilityAB"; }
73  static constexpr char const * transmissibilityBAString() { return "transmissibilityBA"; }
74  };
75 
76  class Kernel;
77 
82  {
83  real64 m_transmissibility[2];
84  localIndex m_regionId[2];
85  localIndex m_subRegionId[2];
86  localIndex m_elementId[2];
87  };
88 
89 private:
90 
91  using Base = TaskBase;
93 
97  struct ConnectionData
98  {
99  real64 m_transmissibility[2];
100  globalIndex m_globalId[2];
101 
102 
108  static ConnectionData fromKernel( KernelConnectionData const & kernelData,
109  LocalToGlobalMap const & localToGlobalMap );
110 
117  bool operator<( ConnectionData const & other ) const
118  {
119  return m_globalId[0] != other.m_globalId[0] ?
120  m_globalId[0] < other.m_globalId[0] :
121  m_globalId[1] < other.m_globalId[1];
122  }
123  };
124 
125  array1d< globalIndex > m_cellAGlobalId;
126  array1d< globalIndex > m_cellBGlobalId;
127  array1d< real64 > m_transmissibilityAB;
128  array1d< real64 > m_transmissibilityBA;
129 
131  string m_meshName;
133  string m_solverName;
134 
136  FlowSolverBase const * m_solver = nullptr;
138  MeshLevel const * m_meshLevel = nullptr;
140  FluxApproximationBase const * m_discretization = nullptr;
141 
142 
143 
144  void postInputInitialization() override;
145 
151  void initializePostInitialConditionsPostSubGroups() override;
152 
160  template< typename STENCILWRAPPER_T >
161  array1d< KernelConnectionData > gatherConnectionData( STENCILWRAPPER_T const & stencilWrapper ) const;
162 
169  void storeConnectionData( string_view stencilName,
170  arrayView1d< KernelConnectionData > const & kernelData );
171 
172  void logStoredConnections( string_view stencilName );
173 };
174 
175 
176 } /* namespace geos */
177 
178 #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:88
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
std::string_view string_view
String type.
Definition: DataTypes.hpp:94
Element-element connection data extracted from the kernel.