Commit 3c071cdf authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed comparison operators in MeshSuperentityAccess

parent 5423c970
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ class EllpackIndexMultimapValues

      const IndexType& operator[]( const LocalIndexType& portIndex ) const;

      bool operator==( const ThisType& other ) const;

      void print( std::ostream& str ) const;

   protected:
+15 −0
Original line number Diff line number Diff line
@@ -180,6 +180,21 @@ operator[]( const LocalIndexType& portIndex ) const
   return this->values[ portIndex ];
}

template< typename Index,
          typename Device,
          typename LocalIndex >
bool
EllpackIndexMultimapValues< Index, Device, LocalIndex >::
operator==( const ThisType& other ) const
{
   if( this->getSize() != other.getSize() )
      return false;
   for( LocalIndexType i = 0; i < this->getSize(); i++ )
      if( this->operator[]( i ) != other[ i ] )
         return false;
   return true;
}

template< typename Index,
          typename Device,
          typename LocalIndex >
+27 −9
Original line number Diff line number Diff line
@@ -47,13 +47,6 @@ class MeshSuperentityAccess
   using SuperentityTraits = typename MeshTraitsType::template SuperentityTraits< EntityTopology, Superdimensions >;

public:
   bool operator == ( const MeshSuperentityAccess< MeshConfig, EntityTopology >& a ) const { return true; } // TODO: fix

   void print( std::ostream& str ) const
   {
      BaseType::print( str );
   }

   template< int Superdimensions >
   void bindSuperentitiesStorageNetwork( const typename SuperentityTraits< Superdimensions >::SuperentityAccessorType& storage )
   {
@@ -97,6 +90,16 @@ public:
      return BaseType::getSuperentityIndex( MeshDimensionsTag< Superdimensions >(),
                                            localIndex );
   }

   bool operator==( const MeshSuperentityAccess& other ) const
   {
      return BaseType::operator==( other );
   }

   void print( std::ostream& str ) const
   {
      BaseType::print( str );
   }
};

template< typename MeshConfig,
@@ -128,6 +131,8 @@ public:
   using BaseType::setSuperentityIndex;
   using BaseType::getSuperentityIndex;

   MeshSuperentityAccessLayer& operator = ( const MeshSuperentityAccessLayer& layer ) = delete;

   /****
    * Define setter/getter for the current level of the superentities
    */
@@ -172,14 +177,17 @@ public:
      return this->superentityIndices;
   }

   bool operator==( const MeshSuperentityAccessLayer& other ) const
   {
      return ( BaseType::operator==( other ) && superentityIndices == other.superentityIndices );
   }

   void print( std::ostream& str ) const
   {
      BaseType::print( str );
      str << "\t Superentities with " << DimensionsTag::value << " dimensions are: " << this->superentityIndices << "." << std::endl;
   }

   //bool operator == ( const MeshSuperentityAccessLayer< MeshConfig, EntityTopology, Dimensions, tnlStorageTraits< true > >& l ) { return true; } // TODO: fix

private:
   SuperentityAccessorType superentityIndices;
};
@@ -228,6 +236,11 @@ protected:

   void getSuperentityIndices() {}

   bool operator==( const MeshSuperentityAccess< MeshConfig, EntityTopology >& other ) const
   {
      return true;
   }

   void print( std::ostream& str ) const {}
};

@@ -264,6 +277,11 @@ protected:

   void getSuperentityIndices() {}

   bool operator==( const MeshSuperentityAccessLayer& other ) const
   {
      return true;
   }

   void print( std::ostream& str ) const {}
};

+3 −3

File changed.

Contains only whitespace changes.