GEOSX
FaceElementStencil.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_FACEELEMENTSTENCIL_HPP_
20 #define GEOSX_FINITEVOLUME_FACEELEMENTSTENCIL_HPP_
21 
22 #include "StencilBase.hpp"
23 
24 namespace geosx
25 {
26 
28 // TODO remove! This option allows for the creation of new mass inside a newly
29 // created FaceElement. The new mass will be equal to:
30 // creationMass = defaultDensity * defaultAperture * faceArea.
31 // If 0, then the beginning of step density is artificially set to zero...which
32 // may cause some newton convergence problems.
33 #define ALLOW_CREATION_MASS 1
34 
35 
36 // TODO remove! This option sets the pressure in a newly created FaceElement to
37 // be the lowest value of all attached non-new FaceElements.
38 #define SET_CREATION_PRESSURE 1
39 
40 // TODO remove! This option sets the nodal displacements attached a newly
41 // created FaceElement to some scalar fraction of the aperture of the
42 // lowest attached non-new FaceElements.
43 #define SET_CREATION_DISPLACEMENT 0
44 
52 {
55 
58 
61 
64 
67 
70 
72  static localIndex constexpr NUM_POINT_IN_FLUX = 6;
73 
75  static localIndex constexpr MAX_STENCIL_SIZE = 6;
76 };
77 
83 class FaceElementStencil : public StencilBase< FaceElementStencil_Traits, FaceElementStencil >,
85 {
86 public:
87 
92 
93  virtual void move( LvArray::MemorySpace const space ) override final;
94 
95  virtual void add( localIndex const numPts,
96  localIndex const * const elementRegionIndices,
97  localIndex const * const elementSubRegionIndices,
98  localIndex const * const elementIndices,
99  real64 const * const weights,
100  localIndex const connectorIndex ) override final;
101 
108  void add( localIndex const numPts,
109  R1Tensor const * const cellCenterToEdgeCenter,
110  localIndex const connectorIndex );
111 
116  virtual localIndex size() const override final
117  { return m_elementRegionIndices.size(); }
118 
125  { return m_elementRegionIndices.sizeOfArray( index ); }
126 
132  { return m_cellCenterToEdgeCenters.toViewConst(); }
133 
134 private:
135 
136  ArrayOfArrays< R1Tensor > m_cellCenterToEdgeCenters;
137 
138 };
139 
140 } /* namespace geosx */
141 
142 #endif /* GEOSX_FINITEVOLUME_FACEELEMENTSTENCIL_HPP_ */
This class implements an array of arrays like object with contiguous storage.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
This class provides a view into an array of arrays like object.
Lightweight wrapper around a c-array.
Definition: Tensor.hpp:29
static localIndex constexpr MAX_STENCIL_SIZE
Maximum number of points in a stencil.
ArrayOfArraysView< R1Tensor const > getCellCenterToEdgeCenters() const
Give the array of vectors pointing from the cell center to the edge center.
MemorySpace
An enum containing the available memory spaces.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
localIndex stencilSize(localIndex index) const
Give the number of stencil entries for the provided index.
constexpr void add(DST_VECTOR &&LVARRAY_RESTRICT_REF dstVector, SRC_VECTOR const &LVARRAY_RESTRICT_REF srcVector)
Add srcVector to dstVector.
virtual localIndex size() const override final
Return the stencil size.
static localIndex constexpr NUM_POINT_IN_FLUX
Number of points the flux is between (normally 2)