GEOSX
BoundaryStencil.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 Total, S.A
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 GEOSX_FINITEVOLUME_BOUNDARYSTENCIL_HPP_
20 #define GEOSX_FINITEVOLUME_BOUNDARYSTENCIL_HPP_
21 
22 #include "StencilBase.hpp"
23 #include "codingUtilities/traits.hpp"
24 
25 namespace geosx
26 {
27 
33 {
36 
38  using IndexContainerViewType = traits::ViewType< IndexContainerType >;
39 
41  using IndexContainerViewConstType = traits::ViewTypeConst< IndexContainerType >;
42 
45 
47  using WeightContainerViewType = traits::ViewType< WeightContainerType >;
48 
50  using WeightContainerViewConstType = traits::ViewTypeConst< WeightContainerType >;
51 
53  static constexpr localIndex NUM_POINT_IN_FLUX = 2;
54 
56  static constexpr localIndex MAX_STENCIL_SIZE = 2;
57 };
58 
65 class BoundaryStencil : public StencilBase< BoundaryStencil_Traits, BoundaryStencil >,
67 {
68 public:
69 
73  struct Order
74  {
75  static constexpr localIndex ELEM = 0;
76  static constexpr localIndex FACE = 1;
77  };
78 
81 
82  virtual void add( localIndex const numPts,
83  localIndex const * const elementRegionIndices,
84  localIndex const * const elementSubRegionIndices,
85  localIndex const * const elementIndices,
86  real64 const * const weights,
87  localIndex const connectorIndex ) override final;
88 
92  virtual localIndex size() const override final
93  { return m_elementRegionIndices.size( 0 ); }
94 
100  constexpr localIndex stencilSize( localIndex const index ) const
101  {
102  GEOSX_UNUSED_VAR( index )
103  return MAX_STENCIL_SIZE;
104  }
105 
106 };
107 
108 }
109 
110 #endif //GEOSX_FINITEVOLUME_BOUNDARYSTENCIL_HPP_
traits::ViewType< WeightContainerType > WeightContainerViewType
The array view type for the stencil weights.
traits::ViewTypeConst< IndexContainerType > IndexContainerViewConstType
The array view to const type for the stencil indices.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
Defines the order of element/face in the stencil.
traits::ViewType< IndexContainerType > IndexContainerViewType
The array view type for the stencil indices.
#define GEOSX_UNUSED_VAR(...)
Mark an unused variable and silence compiler warnings.
Definition: GeosxMacros.hpp:78
virtual localIndex size() const override final
Give the number of stencil entries.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
traits::ViewTypeConst< WeightContainerType > WeightContainerViewConstType
The array view to const type for the stencil weights.
constexpr void add(DST_VECTOR &&LVARRAY_RESTRICT_REF dstVector, SRC_VECTOR const &LVARRAY_RESTRICT_REF srcVector)
Add srcVector to dstVector.
This class provides a fixed dimensional resizeable array interface in addition to an interface simila...
Definition: Array.hpp:55
constexpr localIndex stencilSize(localIndex const index) const
Gives the number of points in a stencil entry.
static constexpr localIndex MAX_STENCIL_SIZE
Maximum number of points in a stencil (this is 2 for TPFA)
static constexpr localIndex NUM_POINT_IN_FLUX
Number of points the flux is between (always 2 for TPFA)