16 #ifndef GEOS_MESH_GENERATORS_CELLBLOCKUTILITIES_HPP_
17 #define GEOS_MESH_GENERATORS_CELLBLOCKUTILITIES_HPP_
22 #include "common/GEOS_RAJA_Interface.hpp"
31 template<
typename T >
43 T
const & toCellIndex_ )
103 template<
typename POLICY,
typename T,
typename COMP = std::equal_to<> >
107 localIndex const numNodes = sortedLists.size();
108 array1d< localIndex > uniqueValueOffsets( numNodes + 1 );
111 arrayView1d< localIndex >
const numUniqueValuesView = uniqueValueOffsets.toView();
112 forAll< POLICY >( numNodes, [sortedLists, numUniqueValuesView, comp=std::forward< COMP >( comp )](
localIndex const i )
114 arraySlice1d< T const >
const list = sortedLists[ i ];
115 forEqualRanges( list.begin(), list.end(), [&](
auto,
auto )
117 ++numUniqueValuesView[ i + 1 ];
122 RAJA::inclusive_scan_inplace< POLICY >( RAJA::make_span( uniqueValueOffsets.data(), uniqueValueOffsets.size() ) );
123 return uniqueValueOffsets;
Lightweight non-owning wrapper over a contiguous range of elements.
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
LvArray::ArrayOfArraysView< T, INDEX_TYPE const, CONST_SIZES, LvArray::ChaiBuffer > ArrayOfArraysView
View of array of variable-sized arrays. See LvArray::ArrayOfArraysView for details.
array1d< localIndex > computeUniqueValueOffsets(ArrayOfArraysView< T const > const &sortedLists, COMP &&comp={})
Find and count ranges of repeated values in an array of sorted arrays and compute offsets.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
localIndex getFaceNodes(ElementType const elementType, localIndex const elemIdx, localIndex const faceNumber, arrayView2d< localIndex const, cells::NODE_MAP_USD > const &elementToNodes, Span< localIndex > const faceNodes)
Get the local indices of the nodes in a face of the element.
localIndex buildEdgeMaps(localIndex numNodes, ArrayOfArraysView< localIndex const > const &faceToNodeMap, ArrayOfArrays< localIndex > &faceToEdgeMap, ArrayOfArrays< localIndex > &edgeToFaceMap, array2d< localIndex > &edgeToNodeMap)
Free function that generates face to edges, edge to faces and edge to nodes mappings.
ElementType
Denotes type of cell/element shape.
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Array< T, 1 > array1d
Alias for 1D array.
LvArray::ArrayOfArrays< T, INDEX_TYPE, LvArray::ChaiBuffer > ArrayOfArrays
Array of variable-sized arrays. See LvArray::ArrayOfArrays for details.
Container for maps from a mesh object (node, edge or face) to cells.
ToCellRelation(T &&toBlockIndex_, T &&toCellIndex_)
Constructor from moved values.
T toCellIndex
Map containing cell indices, same shape as above.
ToCellRelation(T const &toBlockIndex_, T const &toCellIndex_)
Constructor by values.
T toBlockIndex
Map containing a list of cell block indices for each object.