Commit 041d6070 authored by Ján Bobot's avatar Ján Bobot Committed by Jakub Klinkovský
Browse files

Moved the declaration of SubentityMatrixType from MeshSubentityTraits to MeshEntityTraits

parent 6a3e7796
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ class Initializer
      using NeighborCountsArray = typename MeshTraitsType::NeighborCountsArray;

      template< int Dimension, int Subdimension >
      using SubentityMatrixRowsCapacitiesType = typename MeshTraitsType::template SubentityMatrixType< Dimension, Subdimension >::RowsCapacitiesType;
      using SubentityMatrixRowsCapacitiesType = typename MeshTraitsType::template SubentityMatrixType< Dimension >::RowsCapacitiesType;

      // The points and cellSeeds arrays will be reset when not needed to save memory.
      void createMesh( PointArrayType& points,
+2 −2
Original line number Diff line number Diff line
@@ -113,7 +113,7 @@ public:

   template< int Dimension, int Subdimension >
   __cuda_callable__
   typename MeshTraitsType::template SubentityMatrixType< Dimension, Subdimension >&
   typename MeshTraitsType::template SubentityMatrixType< Dimension >&
   getSubentitiesMatrix()
   {
      static_assert( Dimension > Subdimension, "Invalid combination of Dimension and Subdimension." );
@@ -127,7 +127,7 @@ public:

   template< int Dimension, int Subdimension >
   __cuda_callable__
   const typename MeshTraitsType::template SubentityMatrixType< Dimension, Subdimension >&
   const typename MeshTraitsType::template SubentityMatrixType< Dimension >&
   getSubentitiesMatrix() const
   {
      static_assert( Dimension > Subdimension, "Invalid combination of Dimension and Subdimension." );
+6 −6
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ protected:

   template< int Subdimension >
   __cuda_callable__
   typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension, Subdimension >&
   typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension >&
   getSubentitiesMatrix()
   {
      static_assert( EntityTopology::dimension > Subdimension, "Invalid combination of Dimension and Subdimension." );
@@ -76,7 +76,7 @@ protected:

   template< int Subdimension >
   __cuda_callable__
   const typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension, Subdimension >&
   const typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension >&
   getSubentitiesMatrix() const
   {
      static_assert( EntityTopology::dimension > Subdimension, "Invalid combination of Dimension and Subdimension." );
@@ -108,7 +108,7 @@ class SubentityStorageLayer< MeshConfig,
protected:
   using GlobalIndexType    = typename MeshTraitsType::GlobalIndexType;
   using LocalIndexType     = typename MeshTraitsType::LocalIndexType;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension, SubdimensionTag::value >;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension >;

   SubentityStorageLayer() = default;

@@ -210,7 +210,7 @@ protected:
   using GlobalIndexType     = typename MeshTraitsType::GlobalIndexType;
   using LocalIndexType      = typename MeshTraitsType::LocalIndexType;
   using NeighborCountsArray = typename MeshTraitsType::NeighborCountsArray;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension, SubdimensionTag::value >;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension >;

   SubentityStorageLayer() = default;

@@ -330,7 +330,7 @@ protected:
   using GlobalIndexType     = typename MeshTraitsType::GlobalIndexType;
   using LocalIndexType      = typename MeshTraitsType::LocalIndexType;
   using NeighborCountsArray = typename MeshTraitsType::NeighborCountsArray;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension, SubdimensionTag::value >;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension >;

   SubentityStorageLayer() = default;

@@ -444,7 +444,7 @@ protected:
   using GlobalIndexType     = typename MeshTraitsType::GlobalIndexType;
   using LocalIndexType      = typename MeshTraitsType::LocalIndexType;
   using NeighborCountsArray = typename MeshTraitsType::NeighborCountsArray;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension, SubdimensionTag::value >;
   using SubentityMatrixType = typename MeshTraitsType::template SubentityMatrixType< EntityTopology::dimension >;

   SubentityStorageLayer() = default;

+32 −11
Original line number Diff line number Diff line
@@ -29,25 +29,43 @@ namespace Meshes {

template< typename MeshConfig, typename Device, typename EntityTopology > class MeshEntity;

/****
 *       Mesh entity traits with specializations
 *
 *  DYNAMIC TOPOLOGY
 *       FALSE
 */
template< typename MeshConfig,
          typename DimensionTag >
struct EntityTopologyGetter
          typename Device,
          int Dimension >
class MeshEntityTraits< MeshConfig, Device, Dimension, false >
{
   static_assert( DimensionTag::value <= MeshConfig::meshDimension, "There are no entities with dimension higher than the mesh dimension." );
   using Topology = typename Topologies::Subtopology< typename MeshConfig::CellTopology, DimensionTag::value >::Topology;
};
   using GlobalIndexType = typename MeshConfig::GlobalIndexType;

template< typename MeshConfig >
struct EntityTopologyGetter< MeshConfig, DimensionTag< MeshConfig::CellTopology::dimension > >
{
   using Topology = typename MeshConfig::CellTopology;
};
public:
   static_assert( 0 <= Dimension && Dimension <= MeshConfig::meshDimension, "invalid dimension" );

   using EntityTopology                = typename EntityTopologyGetter< MeshConfig, DimensionTag< Dimension > >::Topology;
   using EntityType                    = MeshEntity< MeshConfig, Device, EntityTopology >;
   using SeedType                      = EntitySeed< MeshConfig, EntityTopology >;

   using SeedIndexedSetType            = Containers::UnorderedIndexedSet< SeedType, GlobalIndexType, typename SeedType::HashType, typename SeedType::KeyEqual >;
   using SeedSetType                   = std::unordered_set< typename SeedIndexedSetType::key_type, typename SeedIndexedSetType::hasher, typename SeedIndexedSetType::key_equal >;

   // container for storing the subentity indices
   using SubentityMatrixType = Matrices::SparseMatrix< bool, Device, GlobalIndexType, Matrices::GeneralMatrix, EllpackSegments >;
};

/****
 *       Mesh entity traits with specializations
 *
 *  DYNAMIC TOPOLOGY
 *       TRUE
 */
template< typename MeshConfig,
          typename Device,
          int Dimension >
class MeshEntityTraits
class MeshEntityTraits< MeshConfig, Device, Dimension, true >
{
   using GlobalIndexType = typename MeshConfig::GlobalIndexType;

@@ -60,6 +78,9 @@ public:

   using SeedIndexedSetType            = Containers::UnorderedIndexedSet< SeedType, GlobalIndexType, typename SeedType::HashType, typename SeedType::KeyEqual >;
   using SeedSetType                   = std::unordered_set< typename SeedIndexedSetType::key_type, typename SeedIndexedSetType::hasher, typename SeedIndexedSetType::key_equal >;

   // container for storing the subentity indices
   using SubentityMatrixType = Matrices::SparseMatrix< bool, Device, GlobalIndexType, Matrices::GeneralMatrix, SlicedEllpackSegments >;
};

} // namespace Meshes
+0 −6
Original line number Diff line number Diff line
@@ -48,9 +48,6 @@ public:
   using SubentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology;
   using SubentityType     = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityType;

   // container for storing the subentity indices
   using SubentityMatrixType = Matrices::SparseMatrix< bool, Device, GlobalIndexType, Matrices::GeneralMatrix, EllpackSegments >;

   template< LocalIndexType subentityIndex,
             LocalIndexType subentityVertexIndex >
   struct Vertex
@@ -86,9 +83,6 @@ public:

   using SubentityTopology = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityTopology;
   using SubentityType     = typename MeshEntityTraits< MeshConfig, Device, Dimension >::EntityType;

   // container for storing the subentity indices
   using SubentityMatrixType = Matrices::SparseMatrix< bool, Device, GlobalIndexType, Matrices::GeneralMatrix, SlicedEllpackSegments >;
};

} // namespace Meshes
Loading