Commit 6221b196 authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Fixed methods save/load in Mesh

parent 6f291b2b
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -40,21 +40,17 @@ class DistributedGridIO< MeshFunctionType, Dummy >
    bool save(const String& fileName, MeshFunctionType &meshFunction)
    {
        return true;
    };
    }

    bool load(const String& fileName, MeshFunctionType &meshFunction)
    {
        return true;
    }
};
};





}
}
}
} // namespace DistributedMeshes
} // namespace Meshes
} // namespace TNL

//not clean logic of includes...
#include <TNL/Meshes/DistributedMeshes/DistributedGridIO_MeshFunction.h>
+5 −5
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#pragma once

#include <TNL/String.h>
#include <TNL/File.h>
#include <TNL/Devices/Host.h>

namespace TNL {
@@ -42,14 +43,13 @@ public:
                                                        const GridFunction& f2,
                                                        const typename GridFunction::RealType& p ) const { return 0.0; }

   bool save( File& file ) const { return true; }
   void save( File& file ) const {}

   //! Method for restoring the object from a file
   bool load( File& file ) { return true; }
   void load( File& file ) {}

   bool save( const String& fileName ) const { return true; }
   void save( const String& fileName ) const {}

   bool load( const String& fileName ) { return true; }
   void load( const String& fileName ) {}

   bool writeMesh( const String& fileName,
                   const String& format ) const { return true; }
+6 −12
Original line number Diff line number Diff line
@@ -100,23 +100,21 @@ getTypeVirtual() const
template< typename MeshConfig,
          typename Device,
          typename EntityTopology >
bool
void
MeshEntity< MeshConfig, Device, EntityTopology >::
save( File& file ) const
{
   // no I/O for subentities and superentities - not loaded anyway
   return true;
}

template< typename MeshConfig,
          typename Device,
          typename EntityTopology >
bool
void
MeshEntity< MeshConfig, Device, EntityTopology >::
load( File& file )
{
   // no I/O for subentities and superentities - Mesh::load has to rebind pointers
   return true;
}

template< typename MeshConfig,
@@ -258,25 +256,21 @@ getTypeVirtual() const
}

template< typename MeshConfig, typename Device >
bool
void
MeshEntity< MeshConfig, Device, Topologies::Vertex >::
save( File& file ) const
{
   // no I/O for superentities - not loaded anyway
   if( ! point.save( file ) )
      return false;
   return true;
   point.save( file );
}

template< typename MeshConfig, typename Device >
bool
void
MeshEntity< MeshConfig, Device, Topologies::Vertex >::
load( File& file )
{
   // no I/O for superentities - Mesh::load has to rebind pointers
   if( ! point.load( file ) )
      return false;
   return true;
   point.load( file );
}

template< typename MeshConfig, typename Device >
+6 −31
Original line number Diff line number Diff line
@@ -168,33 +168,15 @@ public:
      return interiorIndices[ i ];
   }

   bool save( File& file ) const
   {
      try
   void save( File& file ) const
   {
      boundaryTags.save( file );
   }
      catch(...)
      {
         std::cerr << "Failed to save the boundary tags of the entities with dimension " << DimensionTag::value << "." << std::endl;
         return false;
      }
      return true;
   }

   bool load( File& file )
   {
      try
   void load( File& file )
   {
      boundaryTags.load( file );
      }
      catch(...)
      {
         std::cerr << "Failed to load the boundary tags of the entities with dimension " << DimensionTag::value << "." << std::endl;
         return false;
      }
      updateBoundaryIndices( DimensionTag() );
      return true;
   }

   void print( std::ostream& str ) const
@@ -257,15 +239,8 @@ protected:
   void getInteriorEntitiesCount( DimensionTag ) const {}
   void getInteriorEntityIndex( DimensionTag, const GlobalIndexType& i ) const {}

   bool save( File& file ) const
   {
      return true;
   }

   bool load( File& file )
   {
      return true;
   }
   void save( File& file ) const {}
   void load( File& file ) {}

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

+8 −15
Original line number Diff line number Diff line
@@ -77,15 +77,15 @@ protected:
   }


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

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

@@ -124,15 +124,8 @@ protected:
   template< typename Device_ >
   LayerInheritor& operator=( const LayerInheritor< MeshConfig, Device_, DimensionTag< MeshConfig::meshDimension + 1 > >& other ) { return *this; }

   bool save( File& file ) const
   {
      return true;
   }

   bool load( File& file )
   {
      return true;
   }
   void save( File& file ) const {}
   void load( File& file ) {}

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

Loading