20 #ifndef GEOSX_FINITEVOLUME_FLUXSTENCIL_HPP_ 21 #define GEOSX_FINITEVOLUME_FLUXSTENCIL_HPP_ 24 #include "codingUtilities/Utilities.hpp" 34 template<
typename INDEX,
typename WEIGHT >
86 INDEX
const *
const indices,
87 WEIGHT
const *
const weights,
125 template<
typename INDEX,
typename WEIGHT >
130 template<
typename INDEX,
typename WEIGHT >
135 reserve( numConn, avgStencilSize );
138 template<
typename INDEX,
typename WEIGHT >
141 return m_connections.size();
144 template<
typename INDEX,
typename WEIGHT >
148 m_connections.reserve( numConn );
149 m_connections.reserveValues( numConn * avgStencilSize );
152 template<
typename INDEX,
typename WEIGHT >
154 INDEX
const *
const indices,
155 WEIGHT
const *
const weights,
163 entries[i] = { indices[i], weights[i] };
166 m_connections.appendArray( entries.begin(), entries.end() );
167 m_connectorIndices[connectorIndex] = m_connections.size() - 1;
170 template<
typename INDEX,
typename WEIGHT >
174 executeOnMapValue( m_connectorIndices, connectorIndex, [&](
localIndex const connectionListIndex )
176 Entry *
const entries = m_connections[connectionListIndex];
177 for(
localIndex i = 0; i < m_connections.sizeOfArray( connectionListIndex ); ++i )
186 template<
typename INDEX,
typename WEIGHT >
195 #endif //GEOSX_FINITEVOLUME_FLUXSTENCIL_HPP_ StackArray< T, 1, MAXSIZE > stackArray1d
Alias for 1D stack array.
WEIGHT weight_type
Alias for WEIGHT.
Structure containing the index and the weight of the single edge in the stencil graph.
INDEX index_type
Alias for INDEX.
static localIndex constexpr MAX_STENCIL_SIZE
Maximum number of points in a stencil (required to use static arrays in kernels). ...
Base template for ordered and unordered maps.
This class implements an array of arrays like object with contiguous storage.
localIndex numConnections() const
Return the size of the stencil collection (i.e. number of connections).
void add(localIndex const numPts, INDEX const *const indices, WEIGHT const *const weights, localIndex const connectorIndex)
Add data for one connection.
This class provides a view into an array of arrays like object.
static localIndex constexpr NUM_POINT_IN_FLUX
Number of points the flux is between (normally 2).
bool zero(localIndex const connectorIndex)
Zero out connections.
std::ptrdiff_t localIndex
Local index type (for indexing objects within an MPI partition).
void compress()
Called after adding connections is done to compress the data.
#define GEOSX_ERROR_IF(EXP, msg)
Conditionally raise a hard error and terminate the program.
ArrayOfArraysView< Entry const, true > getConnections() const
Return the connections.
void reserve(localIndex const numConn, localIndex const avgStencilSize)
Resize the collection.