Commit 812c9d70 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed IdArrayAccessorType from MeshTraits

Its usage can be easily replaced with references to the actual array.
parent 920b3447
Loading
Loading
Loading
Loading
+12 −19
Original line number Diff line number Diff line
@@ -25,14 +25,13 @@ template< typename MeshConfig,
          typename EntityTopology >
class MeshEntitySeed
{
   typedef MeshTraits< MeshConfig >      MeshConfigTraits;
   typedef typename MeshTraits< MeshConfig >::template SubentityTraits< EntityTopology, 0 > SubvertexTraits;
   using MeshConfigTraits = MeshTraits< MeshConfig >;
   using SubvertexTraits = typename MeshTraits< MeshConfig >::template SubentityTraits< EntityTopology, 0 >;

   public:
      typedef typename MeshTraits< MeshConfig >::GlobalIndexType                                      GlobalIndexType;
      typedef typename MeshTraits< MeshConfig >::LocalIndexType                                       LocalIndexType;
      typedef typename MeshTraits< MeshConfig >::IdArrayAccessorType                                  IdArrayAccessorType;
      typedef typename SubvertexTraits::IdArrayType                                                      IdArrayType;
      using GlobalIndexType = typename MeshTraits< MeshConfig >::GlobalIndexType;
      using LocalIndexType  = typename MeshTraits< MeshConfig >::LocalIndexType;
      using IdArrayType     = typename SubvertexTraits::IdArrayType;

      static String getType() { return String( "MeshEntitySeed<>" ); }

@@ -41,7 +40,7 @@ class MeshEntitySeed
         return SubvertexTraits::count;
      }

      void setCornerId( LocalIndexType cornerIndex, GlobalIndexType pointIndex )
      void setCornerId( const LocalIndexType& cornerIndex, const GlobalIndexType& pointIndex )
      {
         TNL_ASSERT( 0 <= cornerIndex && cornerIndex < getCornersCount(), std::cerr << "cornerIndex = " << cornerIndex );
         TNL_ASSERT( 0 <= pointIndex, std::cerr << "pointIndex = " << pointIndex );
@@ -49,23 +48,17 @@ class MeshEntitySeed
         this->cornerIds[ cornerIndex ] = pointIndex;
      }

      IdArrayAccessorType getCornerIds()
      IdArrayType& getCornerIds()
      {
         IdArrayAccessorType accessor;
         accessor.bind( this->corners.getData(), this->corners.getSize() );
         return accessor;
         return cornerIds;
      }

 
      const IdArrayAccessorType getCornerIds() const
      const IdArrayType& getCornerIds() const
      {
         IdArrayAccessorType accessor;
         accessor.bind( this->cornerIds.getData(), this->cornerIds.getSize() );
         return accessor;
         return cornerIds;
      }

   private:
	
      IdArrayType cornerIds;
};

+6 −6
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ class MeshSubentitySeedsCreator
	typedef typename MeshTraits< MeshConfig >::LocalIndexType                                                      LocalIndexType;
	typedef typename MeshTraits< MeshConfig >::template SubentityTraits< EntityTopology, SubDimensionTag::value > SubentityTraits;
	typedef typename SubentityTraits::SubentityTopology                                                               SubentityTopology;
	typedef typename MeshTraits< MeshConfig >::IdArrayAccessorType                                                 IdArrayAccessorType;
	typedef typename MeshTraits< MeshConfig >::template SubentityTraits< SubentityTopology, 0 >                    SubentityVertexTraits;

	static const LocalIndexType SUBENTITIES_COUNT = SubentityTraits::count;
@@ -38,7 +37,8 @@ class MeshSubentitySeedsCreator
   public:
      typedef typename SubentityTraits::SeedArrayType SubentitySeedArray;
      typedef MeshEntitySeed< MeshConfig, EntityTopology >  EntitySeed;
      //typedef typename MeshEntityTraits< MeshConfig, SubDimensionTag >::SeedIndexedSetType                     SeedIndexedSet;
      typedef typename EntitySeed::IdArrayType IdArrayType;
      //typedef typename MeshEntityTraits< MeshConfig, SubDimensionsTag >::SeedIndexedSetType                     SeedIndexedSet;

      //template< typename SeedIndexedSet >
      static SubentitySeedArray create( const EntitySeed& entitySeed  )
@@ -57,8 +57,8 @@ class MeshSubentitySeedsCreator
      class CreateSubentitySeeds
      {
         public:
            static void exec( SubentitySeedArray &subentitySeeds, IdArrayAccessorType vertexIds )
            //static void exec( SeedIndexedSet& indexedSet, IdArrayAccessorType vertexIds )
            static void exec( SubentitySeedArray& subentitySeeds, const IdArrayType& vertexIds )
            //static void exec( SeedIndexedSet& indexedSet, const IdArrayType& vertexIds )
            {
               //EntitySeed seed;
               StaticFor< LocalIndexType, 0, SUBENTITY_VERTICES_COUNT, SetSubentitySeedVertex >::exec( subentitySeeds[ subentityIndex ], vertexIds );
@@ -70,7 +70,7 @@ class MeshSubentitySeedsCreator
            class SetSubentitySeedVertex
            {
               public:
                  static void exec( SubentitySeed &subentitySeed, IdArrayAccessorType vertexIds )
                  static void exec( SubentitySeed& subentitySeed, const IdArrayType& vertexIds )
                  {
                     static const LocalIndexType VERTEX_INDEX = SubentityTraits::template Vertex< subentityIndex, subentityVertexIndex >::index;
                     subentitySeed.setCornerId( subentityVertexIndex, vertexIds[ VERTEX_INDEX ] );
+0 −1
Original line number Diff line number Diff line
@@ -53,7 +53,6 @@ public:
   using PointArrayType                 = Containers::Array< PointType, Devices::Host, GlobalIndexType >;
   using CellSeedArrayType              = Containers::Array< CellSeedType, Devices::Host, GlobalIndexType >;
   using GlobalIdArrayType              = Containers::Array< GlobalIndexType, Devices::Host, GlobalIndexType >;
   using IdArrayAccessorType            = Containers::tnlConstSharedArray< GlobalIndexType, Devices::Host, LocalIndexType >;
   using IdPermutationArrayAccessorType = Containers::tnlConstSharedArray< LocalIndexType, Devices::Host, LocalIndexType >;

   template< int Dimensions >