Commit 38d4bde9 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Added missing assignment operators to Mesh

parent c0ecfe3d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -82,6 +82,11 @@ class Mesh
      template< typename Device_ >
      Mesh( const Mesh< MeshConfig, Device_ >& mesh );

      Mesh& operator=( const Mesh& mesh );

      template< typename Device_ >
      Mesh& operator=( const Mesh< MeshConfig, Device_ >& mesh );


      static constexpr int getMeshDimension();

+23 −0
Original line number Diff line number Diff line
@@ -58,6 +58,29 @@ Mesh( const Mesh< MeshConfig, Device_ >& mesh )
   MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this );
}

template< typename MeshConfig, typename Device >
Mesh< MeshConfig, Device >&
Mesh< MeshConfig, Device >::
operator=( const Mesh& mesh )
{
   StorageBaseType::operator=( *( (const MeshStorageLayers< MeshConfig, Device >*) &mesh ) );
   // update pointers from entities into the subentity and superentity storage networks
   MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this );
   return *this;
}

template< typename MeshConfig, typename Device >
   template< typename Device_ >
Mesh< MeshConfig, Device >&
Mesh< MeshConfig, Device >::
operator=( const Mesh< MeshConfig, Device_ >& mesh )
{
   StorageBaseType::operator=( *( (const MeshStorageLayers< MeshConfig, Device_ >*) &mesh ) );
   // update pointers from entities into the subentity and superentity storage networks
   MeshEntityStorageRebinder< Mesh< MeshConfig, Device > >::exec( *this );
   return *this;
}

template< typename MeshConfig, typename Device >
constexpr int
Mesh< MeshConfig, Device >::
+2 −0
Original line number Diff line number Diff line
@@ -91,6 +91,8 @@ void testCopyToCuda( const Mesh& mesh )
   dmesh2 = mesh;
   EXPECT_EQ( dmesh2, mesh );

   testCopyAssignment( dmesh1 );

   // copy back to host
   Mesh mesh2( dmesh1 );
   EXPECT_EQ( mesh2, mesh );