Commit 21a998ba authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Removed methods save and load from Mesh

parent 44bbad6f
Loading
Loading
Loading
Loading
+1 −14
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
#pragma once

#include <ostream>
#include <TNL/Object.h>
#include <TNL/Logger.h>
#include <TNL/Containers/Vector.h>
#include <TNL/Meshes/MeshDetails/ConfigValidator.h>
@@ -64,8 +63,7 @@ class MeshInitializableBase< MeshConfig, Devices::Cuda, MeshType >
template< typename MeshConfig,
          typename Device = Devices::Host >
class Mesh
   : public Object,
     public ConfigValidator< MeshConfig >,
   : public ConfigValidator< MeshConfig >,
     public MeshInitializableBase< MeshConfig, Device, Mesh< MeshConfig, Device > >,
     public StorageLayerFamily< MeshConfig, Device >,
     public EntityTags::LayerFamily< MeshConfig, Device, Mesh< MeshConfig, Device > >
@@ -110,10 +108,6 @@ class Mesh
      using Face = EntityType< getMeshDimension() - 1 >;
      using Vertex = EntityType< 0 >;

      static String getSerializationType();

      virtual String getSerializationTypeVirtual() const;

      /**
       * \brief Returns the count of mesh entities of the given dimension.
       */
@@ -265,13 +259,6 @@ class Mesh
                            const GlobalIndexArray& iperm );


      void save( File& file ) const;

      void load( File& file );

      using Object::load;
      using Object::save;

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

      bool operator==( const Mesh& mesh ) const;
+0 −53
Original line number Diff line number Diff line
@@ -85,22 +85,6 @@ getMeshDimension()
   return MeshTraitsType::meshDimension;
}

template< typename MeshConfig, typename Device >
String
Mesh< MeshConfig, Device >::
getSerializationType()
{
   return String( "Meshes::Mesh< ") + TNL::getType< MeshConfig >() + " >";
}

template< typename MeshConfig, typename Device >
String
Mesh< MeshConfig, Device >::
getSerializationTypeVirtual() const
{
   return this->getSerializationType();
}

template< typename MeshConfig, typename Device >
   template< int Dimension >
__cuda_callable__
@@ -341,43 +325,6 @@ reorderEntities( const GlobalIndexArray& perm,
}


template< typename MeshConfig, typename Device >
void
Mesh< MeshConfig, Device >::
save( File& file ) const
{
   // saving via host is necessary due to segment-based sparse matrices
   if( std::is_same< Device, Devices::Cuda >::value ) {
      Mesh< MeshConfig, Devices::Host > hostMesh;
      hostMesh = *this;
      hostMesh.save( file );
   }
   else {
      Object::save( file );
      StorageBaseType::save( file );
      EntityTagsLayerFamily::save( file );
   }
}

template< typename MeshConfig, typename Device >
void
Mesh< MeshConfig, Device >::
load( File& file )
{
   // loading via host is necessary for the initialization of the dual graph (and due to segment-based sparse matrices)
   if( std::is_same< Device, Devices::Cuda >::value ) {
      Mesh< MeshConfig, Devices::Host > hostMesh;
      hostMesh.load( file );
      *this = hostMesh;
   }
   else {
      Object::load( file );
      StorageBaseType::load( file );
      EntityTagsLayerFamily::load( file );
      this->initializeDualGraph( *this );
   }
}

template< typename MeshConfig, typename Device >
void
Mesh< MeshConfig, Device >::
+0 −14
Original line number Diff line number Diff line
@@ -206,17 +206,6 @@ public:
      return ghostsOffset;
   }

   void save( File& file ) const
   {
      file << tags;
   }

   void load( File& file )
   {
      file >> tags;
      updateEntityTagsLayer( DimensionTag() );
   }

   void print( std::ostream& str ) const
   {
      str << "Boundary tags for entities of dimension " << DimensionTag::value << " are: ";
@@ -285,9 +274,6 @@ protected:
   void getGhostEntitiesCount() const;
   void getGhostEntitiesOffset() const;

   void save( File& file ) const {}
   void load( File& file ) {}

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

   bool operator==( const Layer& layer ) const
+0 −15
Original line number Diff line number Diff line
@@ -83,18 +83,6 @@ protected:
   }


   void save( File& file ) const
   {
      LayerType::save( file );
      BaseType::save( file );
   }

   void load( File& file )
   {
      LayerType::load( file );
      BaseType::load( file );
   }

   void print( std::ostream& str ) const
   {
      LayerType::print( str );
@@ -133,9 +121,6 @@ protected:
   template< typename Device_ >
   LayerInheritor& operator=( const LayerInheritor< MeshConfig, Device_, DimensionTag< MeshConfig::meshDimension + 1 > >& other ) { return *this; }

   void save( File& file ) const {}
   void load( File& file ) {}

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

   bool operator==( const LayerInheritor& layer ) const
+0 −31
Original line number Diff line number Diff line
@@ -89,18 +89,6 @@ public:
               DualGraphLayer< MeshConfig, Device >::operator==( layer ) );
   }

   void save( File& file ) const
   {
      file << points;
      BaseType::save( file );
   }

   void load( File& file )
   {
      file >> points;
      BaseType::load( file );
   }

   void print( std::ostream& str ) const
   {
      str << "Vertex coordinates are: " << points << std::endl;
@@ -282,22 +270,6 @@ public:
      return *this;
   }

   void save( File& file ) const
   {
      SubentityStorageBaseType::save( file );
      SuperentityStorageBaseType::save( file );
      file.save( &entitiesCount, 1 );
      BaseType::save( file );
   }

   void load( File& file )
   {
      SubentityStorageBaseType::load( file );
      SuperentityStorageBaseType::load( file );
      file.load( &entitiesCount, 1 );
      BaseType::load( file );
   }

   void print( std::ostream& str ) const
   {
      str << "Number of entities with dimension " << DimensionTag::value << ": " << entitiesCount << std::endl;
@@ -367,9 +339,6 @@ protected:
   void setEntitiesCount() {}
   void getEntitiesCount() const {}

   void save( File& file ) const {}
   void load( File& file ) {}

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

   bool operator==( const StorageLayer& meshLayer ) const
Loading