From 5e2e3758ac6234efec50555767271e8994aa6b23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkovsky@mmg.fjfi.cvut.cz>
Date: Thu, 23 Dec 2021 16:04:43 +0100
Subject: [PATCH] Fixed typos: indeces -> indices

---
 src/TNL/Algorithms/sort.h                     |  2 +-
 src/TNL/Meshes/Geometry/getDecomposedMesh.h   | 38 +++++++-------
 src/TNL/Meshes/Geometry/getPlanarMesh.h       | 50 +++++++++----------
 .../initializer/EntityInitializer.h           |  2 +-
 src/TNL/Meshes/Readers/VTKReader.h            |  2 +-
 src/UnitTests/Meshes/MeshGeometryTest.h       |  8 +--
 src/UnitTests/Meshes/MeshTest.h               |  4 +-
 7 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/src/TNL/Algorithms/sort.h b/src/TNL/Algorithms/sort.h
index 131561760e..e5df3b2769 100644
--- a/src/TNL/Algorithms/sort.h
+++ b/src/TNL/Algorithms/sort.h
@@ -117,7 +117,7 @@ void sort( Array& array, const Compare& compare, const Sorter& sorter = Sorter{}
  *  ```
  *  auto compare = [=] __cuda_callable__ ( const Index& a , const Index& b ) -> bool { return .... };
  *  ```
- * \tparam Swap is a lambda function for swaping of two elements which are ordered wrong way. Both elements are represented by indeces as well.  It supposed to
+ * \tparam Swap is a lambda function for swaping of two elements which are ordered wrong way. Both elements are represented by indices as well.  It supposed to
  *  be defined as:
  * ```
  * auto swap = [=] __cuda_callable__ (  const Index& a , const Index& b ) mutable { swap( ....); };
diff --git a/src/TNL/Meshes/Geometry/getDecomposedMesh.h b/src/TNL/Meshes/Geometry/getDecomposedMesh.h
index 2a75772fc4..d5a370960b 100644
--- a/src/TNL/Meshes/Geometry/getDecomposedMesh.h
+++ b/src/TNL/Meshes/Geometry/getDecomposedMesh.h
@@ -40,27 +40,27 @@ decomposeMesh( const Mesh< MeshConfig, Devices::Host >& inMesh )
    using PointType = typename TriangleMesh::PointType;
    using EntityDecomposer = EntityDecomposer< MeshConfig, Topologies::Polygon, DecomposerVersion >;
    constexpr int CellDimension = TriangleMesh::getMeshDimension();
-   
+
    MeshBuilder meshBuilder;
 
    const GlobalIndexType inPointsCount = inMesh.template getEntitiesCount< 0 >();
    const GlobalIndexType inCellsCount = inMesh.template getEntitiesCount< CellDimension >();
 
    // Find the number of output points and cells as well as
-   // starting indeces at which every cell will start writing new decomposed points and cells
+   // starting indices at which every cell will start writing new decomposed points and cells
    using IndexPair = std::pair< GlobalIndexType, GlobalIndexType >;
-   Array< IndexPair, Devices::Host > indeces( inCellsCount + 1 );
+   Array< IndexPair, Devices::Host > indices( inCellsCount + 1 );
    auto setCounts = [&] ( GlobalIndexType i ) {
       const auto cell = inMesh.template getEntity< CellDimension >( i );
-      indeces[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( cell );
+      indices[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( cell );
    };
    ParallelFor< Devices::Host >::exec( GlobalIndexType{ 0 }, inCellsCount, setCounts );
-   indeces[ inCellsCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
+   indices[ inCellsCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
    auto reduction = [] ( const IndexPair& a, const IndexPair& b ) -> IndexPair {
       return { a.first + b.first, a.second + b.second };
    };
-   inplaceExclusiveScan( indeces, 0, indeces.getSize(), reduction, std::make_pair( 0, 0 ) );
-   const auto& reduceResult = indeces[ inCellsCount ];
+   inplaceExclusiveScan( indices, 0, indices.getSize(), reduction, std::make_pair( 0, 0 ) );
+   const auto& reduceResult = indices[ inCellsCount ];
    const GlobalIndexType outPointsCount = inPointsCount + reduceResult.first;
    const GlobalIndexType outCellsCount = reduceResult.second;
    meshBuilder.setEntitiesCount( outPointsCount, outCellsCount );
@@ -74,7 +74,7 @@ decomposeMesh( const Mesh< MeshConfig, Devices::Host >& inMesh )
    // Decompose each cell
    auto decomposeCell = [&] ( GlobalIndexType i ) mutable {
       const auto cell = inMesh.template getEntity< CellDimension >( i );
-      const auto& indexPair = indeces[ i ];
+      const auto& indexPair = indices[ i ];
 
       // Lambda for adding new points
       GlobalIndexType setPointIndex = inPointsCount + indexPair.first;
@@ -109,7 +109,7 @@ getDecomposedMesh( const Mesh< MeshConfig, Devices::Host >& inMesh )
 {
    using TriangleMeshConfig = TriangleConfig< MeshConfig >;
    using TriangleMesh = Mesh< TriangleMeshConfig, Devices::Host >;
-   
+
    TriangleMesh outMesh;
    auto meshBuilder = decomposeMesh< DecomposerVersion >( inMesh );
    meshBuilder.build( outMesh );
@@ -142,27 +142,27 @@ decomposeMesh( const Mesh< MeshConfig, Devices::Host >& inMesh )
    using PointType = typename TetrahedronMesh::PointType;
    using EntityDecomposer = EntityDecomposer< MeshConfig, Topologies::Polyhedron, DecomposerVersion, SubdecomposerVersion >;
    constexpr int CellDimension = TetrahedronMesh::getMeshDimension();
-   
+
    MeshBuilder meshBuilder;
 
    const GlobalIndexType inPointsCount = inMesh.template getEntitiesCount< 0 >();
    const GlobalIndexType inCellsCount = inMesh.template getEntitiesCount< CellDimension >();
 
    // Find the number of output points and cells as well as
-   // starting indeces at which every cell will start writing new decomposed points and cells
+   // starting indices at which every cell will start writing new decomposed points and cells
    using IndexPair = std::pair< GlobalIndexType, GlobalIndexType >;
-   Array< IndexPair, Devices::Host > indeces( inCellsCount + 1 );
+   Array< IndexPair, Devices::Host > indices( inCellsCount + 1 );
    auto setCounts = [&] ( GlobalIndexType i ) {
       const auto cell = inMesh.template getEntity< CellDimension >( i );
-      indeces[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( cell );
+      indices[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( cell );
    };
    ParallelFor< Devices::Host >::exec( GlobalIndexType{ 0 }, inCellsCount, setCounts );
-   indeces[ inCellsCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
+   indices[ inCellsCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
    auto reduction = [] ( const IndexPair& a, const IndexPair& b ) -> IndexPair {
       return { a.first + b.first, a.second + b.second };
    };
-   inplaceExclusiveScan( indeces, 0, indeces.getSize(), reduction, std::make_pair( 0, 0 ) );
-   const auto& reduceResult = indeces[ inCellsCount ];
+   inplaceExclusiveScan( indices, 0, indices.getSize(), reduction, std::make_pair( 0, 0 ) );
+   const auto& reduceResult = indices[ inCellsCount ];
    const GlobalIndexType outPointsCount = inPointsCount + reduceResult.first;
    const GlobalIndexType outCellsCount = reduceResult.second;
    meshBuilder.setEntitiesCount( outPointsCount, outCellsCount );
@@ -176,7 +176,7 @@ decomposeMesh( const Mesh< MeshConfig, Devices::Host >& inMesh )
    // Decompose each cell
    auto decomposeCell = [&] ( GlobalIndexType i ) mutable {
       const auto cell = inMesh.template getEntity< CellDimension >( i );
-      const auto& indexPair = indeces[ i ];
+      const auto& indexPair = indices[ i ];
 
       // Lambda for adding new points
       GlobalIndexType setPointIndex = inPointsCount + indexPair.first;
@@ -212,7 +212,7 @@ getDecomposedMesh( const Mesh< MeshConfig, Devices::Host > & inMesh )
 {
    using TetrahedronMeshConfig = TetrahedronConfig< MeshConfig >;
    using TetrahedronMesh = Mesh< TetrahedronMeshConfig, Devices::Host >;
-   
+
    TetrahedronMesh outMesh;
    auto meshBuilder = decomposeMesh< DecomposerVersion, SubDecomposerVersion >( inMesh );
    meshBuilder.build( outMesh );
@@ -220,4 +220,4 @@ getDecomposedMesh( const Mesh< MeshConfig, Devices::Host > & inMesh )
 }
 
 } // namespace Meshes
-} // namespace TNL
\ No newline at end of file
+} // namespace TNL
diff --git a/src/TNL/Meshes/Geometry/getPlanarMesh.h b/src/TNL/Meshes/Geometry/getPlanarMesh.h
index 8dba1133d5..c26ebe66fa 100644
--- a/src/TNL/Meshes/Geometry/getPlanarMesh.h
+++ b/src/TNL/Meshes/Geometry/getPlanarMesh.h
@@ -46,25 +46,25 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
    const GlobalIndexType inCellsCount = inMesh.template getEntitiesCount< CellDimension >();
 
    // Find the number of output points and cells as well as
-   // starting indeces at which every cell will start writing new points and cells
+   // starting indices at which every cell will start writing new points and cells
    using IndexPair = std::pair< GlobalIndexType, GlobalIndexType >;
-   Array< IndexPair, Devices::Host > indeces( inCellsCount + 1 );
+   Array< IndexPair, Devices::Host > indices( inCellsCount + 1 );
    auto setCounts = [&] ( GlobalIndexType i ) {
       const auto cell = inMesh.template getEntity< CellDimension >( i );
       if( isPlanar( inMesh, cell, precision ) ) {
-         indeces[ i ] = { 0, 1 }; // cell is not decomposed (0 extra points, 1 cell)
+         indices[ i ] = { 0, 1 }; // cell is not decomposed (0 extra points, 1 cell)
       }
       else {
-         indeces[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( cell );
+         indices[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( cell );
       }
    };
    ParallelFor< Devices::Host >::exec( GlobalIndexType{ 0 }, inCellsCount, setCounts );
-   indeces[ inCellsCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
+   indices[ inCellsCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
    auto reduction = [] ( const IndexPair& a, const IndexPair& b ) -> IndexPair {
       return { a.first + b.first, a.second + b.second };
    };
-   inplaceExclusiveScan( indeces, 0, indeces.getSize(), reduction, std::make_pair( 0, 0 ) );
-   const auto& reduceResult = indeces[ inCellsCount ];
+   inplaceExclusiveScan( indices, 0, indices.getSize(), reduction, std::make_pair( 0, 0 ) );
+   const auto& reduceResult = indices[ inCellsCount ];
    const GlobalIndexType outPointsCount = inPointsCount + reduceResult.first;
    const GlobalIndexType outCellsCount = reduceResult.second;
    meshBuilder.setEntitiesCount( outPointsCount, outCellsCount );
@@ -78,8 +78,8 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
    // set corner counts for cells
    NeighborCountsArray cellCornersCounts( outCellsCount );
    auto setCornersCount = [&] ( GlobalIndexType i ) mutable {
-      GlobalIndexType cellIndex = indeces[ i ].second;
-      const GlobalIndexType nextCellIndex = indeces[ i + 1 ].second;
+      GlobalIndexType cellIndex = indices[ i ].second;
+      const GlobalIndexType nextCellIndex = indices[ i + 1 ].second;
       const GlobalIndexType cellsCount = nextCellIndex - cellIndex;
 
       if( cellsCount == 1 ) { // cell is already planar (cell is copied)
@@ -99,8 +99,8 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
    // Decompose non-planar cells and copy the rest
    auto decomposeCell = [&] ( GlobalIndexType i ) mutable {
       const auto cell = inMesh.template getEntity< CellDimension >( i );
-      const auto& indexPair = indeces[ i ];
-      const auto& nextIndexPair = indeces[ i + 1 ];
+      const auto& indexPair = indices[ i ];
+      const auto& nextIndexPair = indices[ i + 1 ];
       const GlobalIndexType cellsCount = nextIndexPair.second - indexPair.second;
 
       if( cellsCount == 1 ) { // cell is already planar (cell is copied)
@@ -167,25 +167,25 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
    const GlobalIndexType inCellsCount = inMesh.template getEntitiesCount< CellDimension >();
 
    // Find the number of output points and faces as well as
-   // starting indeces at which every face will start writing new points and faces
+   // starting indices at which every face will start writing new points and faces
    using IndexPair = std::pair< GlobalIndexType, GlobalIndexType >;
-   Array< IndexPair, Devices::Host > indeces( inFacesCount + 1 );
+   Array< IndexPair, Devices::Host > indices( inFacesCount + 1 );
    auto setCounts = [&] ( GlobalIndexType i ) {
       const auto face = inMesh.template getEntity< FaceDimension >( i );
       if( isPlanar( inMesh, face, precision ) ) {
-         indeces[ i ] = { 0, 1 }; // face is not decomposed (0 extra points, 1 face)
+         indices[ i ] = { 0, 1 }; // face is not decomposed (0 extra points, 1 face)
       }
       else {
-         indeces[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( face );
+         indices[ i ] = EntityDecomposer::getExtraPointsAndEntitiesCount( face );
       }
    };
    ParallelFor< Devices::Host >::exec( GlobalIndexType{ 0 }, inFacesCount, setCounts );
-   indeces[ inFacesCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
+   indices[ inFacesCount ] = { 0, 0 }; // extend exclusive prefix sum by one element to also get result of reduce at the same time
    auto reduction = [] ( const IndexPair& a, const IndexPair& b ) -> IndexPair {
       return { a.first + b.first, a.second + b.second };
    };
-   inplaceExclusiveScan( indeces, 0, indeces.getSize(), reduction, std::make_pair( 0, 0 ) );
-   const auto& reduceResult = indeces[ inFacesCount ];
+   inplaceExclusiveScan( indices, 0, indices.getSize(), reduction, std::make_pair( 0, 0 ) );
+   const auto& reduceResult = indices[ inFacesCount ];
    const GlobalIndexType outPointsCount = inPointsCount + reduceResult.first;
    const GlobalIndexType outFacesCount = reduceResult.second;
    const GlobalIndexType outCellsCount = inCellsCount; // The number of cells stays the same
@@ -207,7 +207,7 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
       LocalIndexType cornersCount = 0;
       for( LocalIndexType j = 0; j < cellFacesCount; j++ ) {
          const GlobalIndexType faceIdx = cell.template getSubentityIndex< FaceDimension >( j );
-         cornersCount += indeces[ faceIdx + 1 ].second - indeces[ faceIdx ].second;
+         cornersCount += indices[ faceIdx + 1 ].second - indices[ faceIdx ].second;
       }
 
       cellCornersCounts[ i ] = cornersCount;
@@ -222,8 +222,8 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
       auto cellSeed = meshBuilder.getCellSeed( i );
       for( LocalIndexType j = 0, o = 0; j < cellFacesCount; j++ ) {
          const GlobalIndexType faceIdx = cell.template getSubentityIndex< FaceDimension >( j );
-         const GlobalIndexType endFaceIdx = indeces[ faceIdx + 1 ].second;
-         for( GlobalIndexType k = indeces[ faceIdx ].second; k < endFaceIdx; k++ ) {
+         const GlobalIndexType endFaceIdx = indices[ faceIdx + 1 ].second;
+         for( GlobalIndexType k = indices[ faceIdx ].second; k < endFaceIdx; k++ ) {
             cellSeed.setCornerId( o++, k );
          }
       }
@@ -233,8 +233,8 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
    // set corner counts for faces
    NeighborCountsArray faceCornersCounts( outFacesCount );
    auto setFaceCornersCount = [&] ( GlobalIndexType i ) mutable {
-      GlobalIndexType faceIndex = indeces[ i ].second;
-      const GlobalIndexType nextFaceIndex = indeces[ i + 1 ].second;
+      GlobalIndexType faceIndex = indices[ i ].second;
+      const GlobalIndexType nextFaceIndex = indices[ i + 1 ].second;
       const GlobalIndexType facesCount = nextFaceIndex - faceIndex;
       if( facesCount == 1 ) { // face is already planar (it is copied)
          const auto face = inMesh.template getEntity< FaceDimension >( i );
@@ -253,8 +253,8 @@ planarCorrection( const Mesh< MeshConfig, Devices::Host >& inMesh )
    // Decompose non-planar faces and copy the rest
    auto decomposeFace = [&] ( GlobalIndexType i ) mutable {
       const auto face = inMesh.template getEntity< FaceDimension >( i );
-      const auto& indexPair = indeces[ i ];
-      const auto& nextIndexPair = indeces[ i + 1 ];
+      const auto& indexPair = indices[ i ];
+      const auto& nextIndexPair = indices[ i + 1 ];
       const GlobalIndexType facesCount = nextIndexPair.second - indexPair.second;
 
       if( facesCount == 1 ) { // face is already planar (it is copied)
diff --git a/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h b/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h
index 268b9a1b17..36d31fcd06 100644
--- a/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h
+++ b/src/TNL/Meshes/MeshDetails/initializer/EntityInitializer.h
@@ -173,7 +173,7 @@ public:
          SubentitySeedsCreatorType::iterate( meshInitializer, mesh, superentityIndex, [&] ( SeedType& seed ) {
             const GlobalIndexType subentityIndex = meshInitializer.findEntitySeedIndex( seed );
 
-            // SubentityIndeces for SubdimensionTag::value == 0 of non-polyhedral meshes were already set up from seeds
+            // Subentity indices for SubdimensionTag::value == 0 of non-polyhedral meshes were already set up from seeds
             if( SubdimensionTag::value > 0 || std::is_same< SuperentityTopology, Topologies::Polyhedron >::value )
                meshInitializer.template setSubentityIndex< SuperdimensionTag::value, SubdimensionTag::value >( superentityIndex, i++, subentityIndex );
 
diff --git a/src/TNL/Meshes/Readers/VTKReader.h b/src/TNL/Meshes/Readers/VTKReader.h
index ccda6fc456..966e4f4677 100644
--- a/src/TNL/Meshes/Readers/VTKReader.h
+++ b/src/TNL/Meshes/Readers/VTKReader.h
@@ -204,7 +204,7 @@ public:
 
          // TODO: Polyhedrons will require to create polygon subentity seeds from given entityShapes
          //       and add their entries to faceConnectivityArray and faceOffsetsArray.
-         //       CellConnectivityArray and cellOffsetsArray will contain indeces addressing created polygon subentities.
+         //       CellConnectivityArray and cellOffsetsArray will contain indices addressing created polygon subentities.
          if( entityShape == cellShape ||
              PolygonShapeGroupChecker::bothBelong( cellShape, entityShape ) ) {
             iss.clear();
diff --git a/src/UnitTests/Meshes/MeshGeometryTest.h b/src/UnitTests/Meshes/MeshGeometryTest.h
index 2b6a1f03b0..146e04eaaf 100644
--- a/src/UnitTests/Meshes/MeshGeometryTest.h
+++ b/src/UnitTests/Meshes/MeshGeometryTest.h
@@ -617,7 +617,7 @@ TEST( MeshGeometryTest, PolyhedronDecompositionTest )
     *  21    20    11    12
     *  12     8    16    19    21
     *
-    * NOTE: indeces refer to the points
+    * NOTE: indices refer to the points
     */
 
    meshBuilder.setFaceCornersCounts( { 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 6, 3, 4, 4, 5 } );
@@ -734,7 +734,7 @@ TEST( MeshGeometryTest, PolyhedronDecompositionTest )
     *   0     1     2     3     4     5      6     7     8
     *   9    10    11    12    13     5     14    15
     *
-    * NOTE: indeces refer to the faces
+    * NOTE: indices refer to the faces
     */
 
    meshBuilder.setCellCornersCounts( { 9, 8 } );
@@ -945,7 +945,7 @@ TEST( MeshGeometryTest, PolyhedronGetPlanarMeshTest )
     *  21    20    11    12
     *  12     8    16    19    21
     *
-    * NOTE: indeces refer to the points
+    * NOTE: indices refer to the points
     */
 
    meshBuilder.setFaceCornersCounts( { 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 6, 3, 4, 4, 5 } );
@@ -1062,7 +1062,7 @@ TEST( MeshGeometryTest, PolyhedronGetPlanarMeshTest )
     *   0     1     2     3     4     5      6     7     8
     *   9    10    11    12    13     5     14    15
     *
-    * NOTE: indeces refer to the faces
+    * NOTE: indices refer to the faces
     */
 
    meshBuilder.setCellCornersCounts( { 9, 8 } );
diff --git a/src/UnitTests/Meshes/MeshTest.h b/src/UnitTests/Meshes/MeshTest.h
index bbeaf86841..b50e1f0232 100644
--- a/src/UnitTests/Meshes/MeshTest.h
+++ b/src/UnitTests/Meshes/MeshTest.h
@@ -2628,7 +2628,7 @@ TEST( MeshTest, TwoPolyhedronsTest )
     *  21    20    11    12
     *  12     8    16    19    21
     *
-    * NOTE: indeces refer to the points
+    * NOTE: indices refer to the points
     */
 
    meshBuilder.setFaceCornersCounts( { 5, 4, 5, 4, 5, 4, 5, 5, 5, 5, 5, 6, 3, 4, 4, 5 } );
@@ -2745,7 +2745,7 @@ TEST( MeshTest, TwoPolyhedronsTest )
     *   0     1     2     3     4     5      6     7     8
     *   9    10    11    12    13     5     14    15
     *
-    * NOTE: indeces refer to the faces
+    * NOTE: indices refer to the faces
     */
 
    meshBuilder.setCellCornersCounts( { 9, 8 } );
-- 
GitLab