diff --git a/src/TNL/Meshes/DistributedMeshes/DistributedGridIO.h b/src/TNL/Meshes/DistributedMeshes/DistributedGridIO.h index 49d7467e1f4cd701a5dedc8d7adb3b98fb39138b..38a7c04f0b5e1d3a86fe7cb30740dba2a242908d 100644 --- a/src/TNL/Meshes/DistributedMeshes/DistributedGridIO.h +++ b/src/TNL/Meshes/DistributedMeshes/DistributedGridIO.h @@ -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> diff --git a/src/TNL/Meshes/DummyMesh.h b/src/TNL/Meshes/DummyMesh.h index 4bff7ce1773978c95a9d16fa2edda1d0760ee7bd..96cd7e3a4287d5e600f47e0c27473d431a24380c 100644 --- a/src/TNL/Meshes/DummyMesh.h +++ b/src/TNL/Meshes/DummyMesh.h @@ -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; } diff --git a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h index 8a21168de1496d497c248d7cd8fb05c9787066e4..8bdd40570ab492484a2784791e1061a6f6fed6b5 100644 --- a/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h +++ b/src/TNL/Meshes/MeshDetails/MeshEntity_impl.h @@ -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 > diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/Layer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/Layer.h index 99a0e612667ed157f153d5a120ecd497cdc70110..ebbee9fdd6cd24055c5e3c65b9d912fb19a5457d 100644 --- a/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/Layer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/Layer.h @@ -168,33 +168,15 @@ public: return interiorIndices[ i ]; } - bool save( File& file ) const + void save( File& file ) const { - try - { - 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; + boundaryTags.save( file ); } - bool load( File& file ) + void load( File& file ) { - try - { - boundaryTags.load( file ); - } - catch(...) - { - std::cerr << "Failed to load the boundary tags of the entities with dimension " << DimensionTag::value << "." << std::endl; - return false; - } + boundaryTags.load( file ); updateBoundaryIndices( DimensionTag() ); - return true; } void print( std::ostream& str ) const @@ -257,16 +239,9 @@ protected: void getInteriorEntitiesCount( DimensionTag ) const {} void getInteriorEntityIndex( DimensionTag, const GlobalIndexType& i ) const {} - bool save( File& file ) const - { - return true; - } + void save( File& file ) const {} + void load( File& file ) {} - bool load( File& file ) - { - return true; - } - void print( std::ostream& str ) const {} bool operator==( const Layer& layer ) const diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/LayerFamily.h b/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/LayerFamily.h index 44f6cdc445d00a7f6ae49587500e20b950121873..d78ba1c523378e46e45e4792ee51759bb1f20541 100644 --- a/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/LayerFamily.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/BoundaryTags/LayerFamily.h @@ -77,16 +77,16 @@ protected: } - bool save( File& file ) const + void save( File& file ) const { - return LayerType::save( file ) && - BaseType::save( file ); + LayerType::save( file ); + BaseType::save( file ); } - bool load( File& file ) + void load( File& file ) { - return LayerType::load( file ) && - BaseType::load( file ); + LayerType::load( file ); + BaseType::load( file ); } void print( std::ostream& str ) const @@ -124,16 +124,9 @@ protected: template< typename Device_ > LayerInheritor& operator=( const LayerInheritor< MeshConfig, Device_, DimensionTag< MeshConfig::meshDimension + 1 > >& other ) { return *this; } - bool save( File& file ) const - { - return true; - } + void save( File& file ) const {} + void load( File& file ) {} - bool load( File& file ) - { - return true; - } - void print( std::ostream& str ) const {} bool operator==( const LayerInheritor& layer ) const diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h index a9d25d8438316f34782cb8d4cf14c97573dd0b96..618934ce5b592527ed17dc1beec25752de9209a9 100644 --- a/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/StorageLayer.h @@ -139,38 +139,20 @@ public: return *this; } - bool save( File& file ) const + void save( File& file ) const { - try - { - SubentityStorageBaseType::save( file ); - SuperentityStorageBaseType::save( file ); - this->entities.save( file ); - BaseType::save( file ); - } - catch(...) - { - std::cerr << "Saving of the mesh entities with dimension " << DimensionTag::value << " failed." << std::endl; - return false; - } - return true; + SubentityStorageBaseType::save( file ); + SuperentityStorageBaseType::save( file ); + this->entities.save( file ); + BaseType::save( file ); } - bool load( File& file ) + void load( File& file ) { - try - { - SubentityStorageBaseType::load( file ); - SuperentityStorageBaseType::load( file ); - this->entities.load( file ); - BaseType::load( file ); - } - catch(...) - { - std::cerr << "Loading of the mesh entities with dimension " << DimensionTag::value << " failed." << std::endl; - return false; - } - return true; + SubentityStorageBaseType::load( file ); + SuperentityStorageBaseType::load( file ); + this->entities.load( file ); + BaseType::load( file ); } void print( std::ostream& str ) const @@ -276,15 +258,8 @@ protected: void getEntitiesCount() const {} void getEntity() 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 {} diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h index cd4d9edf00c6da911b5bf172094dcc04df6d9aaf..a598289e5dd1457917734470192c6a3bf2cf9ae7 100644 --- a/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/SubentityStorageLayer.h @@ -105,34 +105,16 @@ protected: } - bool save( File& file ) const + void save( File& file ) const { - try - { - BaseType::save( file ); - this->storageNetwork.save( file ); - } - catch(...) - { - std::cerr << "Saving of the entity subentities layer with " << SubdimensionTag::value << " dimension failed." << std::endl; - return false; - } - return true; + BaseType::save( file ); + this->storageNetwork.save( file ); } - bool load( File& file ) + void load( File& file ) { - try - { - BaseType::load( file ); - this->storageNetwork.load( file ); - } - catch(...) - { - std::cerr << "Loading of the entity subentities layer with " << SubdimensionTag::value << " dimension failed." << std::endl; - return false; - } - return true; + BaseType::load( file ); + this->storageNetwork.load( file ); } void print( std::ostream& str ) const @@ -219,16 +201,9 @@ protected: return true; } - bool save( File& file ) const - { - return true; - } + void save( File& file ) const {} + void load( File& file ) {} - bool load( File& file ) - { - return true; - } - void getSubentityStorageNetwork( SubdimensionTag ) {} }; diff --git a/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h b/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h index 7e49a3155cc389d08655387874977e038db2cfa6..9cc1c5535b5d7aaedc89208532794b111b7a75fb 100644 --- a/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h +++ b/src/TNL/Meshes/MeshDetails/MeshLayers/SuperentityStorageLayer.h @@ -107,34 +107,16 @@ protected: } - bool save( File& file ) const + void save( File& file ) const { - try - { - BaseType::save( file ); - this->storageNetwork.save( file ); - } - catch(...) - { - std::cerr << "Saving of the entity superentities layer with " << SuperdimensionTag::value << " dimension failed." << std::endl; - return false; - } - return true; + BaseType::save( file ); + this->storageNetwork.save( file ); } - bool load( File& file ) + void load( File& file ) { - try - { - BaseType::load( file ); - this->storageNetwork.load( file ); - } - catch(...) - { - std::cerr << "Loading of the entity superentities layer with " << SuperdimensionTag::value << " dimension failed." << std::endl; - return false; - } - return true; + BaseType::load( file ); + this->storageNetwork.load( file ); } void print( std::ostream& str ) const @@ -212,16 +194,9 @@ protected: return true; } - bool save( File& file ) const - { - return true; - } + void save( File& file ) const {} + void load( File& file ) {} - bool load( File& file ) - { - return true; - } - void getSuperentityStorageNetwork( SuperdimensionTag ) {} }; diff --git a/src/TNL/Meshes/MeshEntity.h b/src/TNL/Meshes/MeshEntity.h index 7c97686808d3f670f51b0d0fdc9c9f3cd63a0049..6e0970ade32564f03aa16380f86164c109a79cb7 100644 --- a/src/TNL/Meshes/MeshEntity.h +++ b/src/TNL/Meshes/MeshEntity.h @@ -76,9 +76,9 @@ class MeshEntity String getTypeVirtual() const; - bool save( File& file ) const; + void save( File& file ) const; - bool load( File& file ); + void load( File& file ); void print( std::ostream& str ) const; @@ -170,9 +170,9 @@ class MeshEntity< MeshConfig, Device, Topologies::Vertex > String getTypeVirtual() const; - bool save( File& file ) const; + void save( File& file ) const; - bool load( File& file ); + void load( File& file ); void print( std::ostream& str ) const;