From f9190a81c1659ba43b8059d100101c46d20d30d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Thu, 11 Apr 2019 19:37:43 +0200 Subject: [PATCH] Removed getSerializationType() methods from Vector - they should be saved as Array --- src/TNL/Containers/Vector.h | 6 ------ src/TNL/Containers/Vector.hpp | 20 -------------------- src/TNL/Containers/VectorView.h | 6 ------ src/Tools/tnl-diff.h | 9 ++++++--- src/Tools/tnl-init.h | 3 +-- src/Tools/tnl-view.h | 16 ++++++++++------ 6 files changed, 17 insertions(+), 43 deletions(-) diff --git a/src/TNL/Containers/Vector.h b/src/TNL/Containers/Vector.h index 30e399312a..afdcad9cec 100644 --- a/src/TNL/Containers/Vector.h +++ b/src/TNL/Containers/Vector.h @@ -51,12 +51,6 @@ public: /** \brief Returns type of vector Real value, Device type and the type of Index. */ virtual String getTypeVirtual() const; - /** \brief Returns (host) type of vector Real value, Device type and the type of Index. */ - static String getSerializationType(); - - /** \brief Returns (host) type of vector Real value, Device type and the type of Index. */ - virtual String getSerializationTypeVirtual() const; - /** * \brief Returns a modifiable view of the vector. */ diff --git a/src/TNL/Containers/Vector.hpp b/src/TNL/Containers/Vector.hpp index 5f15d9bae5..8dea039637 100644 --- a/src/TNL/Containers/Vector.hpp +++ b/src/TNL/Containers/Vector.hpp @@ -39,26 +39,6 @@ getTypeVirtual() const return this->getType(); } -template< typename Real, - typename Device, - typename Index > -String -Vector< Real, Device, Index >:: -getSerializationType() -{ - return HostType::getType(); -} - -template< typename Real, - typename Device, - typename Index > -String -Vector< Real, Device, Index >:: -getSerializationTypeVirtual() const -{ - return this->getSerializationType(); -} - template< typename Real, typename Device, typename Index > diff --git a/src/TNL/Containers/VectorView.h b/src/TNL/Containers/VectorView.h index 1e5f070486..0bf4ac0445 100644 --- a/src/TNL/Containers/VectorView.h +++ b/src/TNL/Containers/VectorView.h @@ -17,12 +17,6 @@ namespace TNL { namespace Containers { -template< typename Real, typename Device, typename Index > -class Vector; - -template< int Size, typename Real > -class StaticVector; - template< typename Real = double, typename Device = Devices::Host, typename Index = int > diff --git a/src/Tools/tnl-diff.h b/src/Tools/tnl-diff.h index 5443f953ac..3fc71893b5 100644 --- a/src/Tools/tnl-diff.h +++ b/src/Tools/tnl-diff.h @@ -436,7 +436,8 @@ bool computeDifference( const MeshPointer& meshPointer, const String& objectType { if( objectType == "Functions::MeshFunction" ) return computeDifferenceOfMeshFunctions< MeshPointer, Value, Real, Index >( meshPointer, parameters ); - if( objectType == "Containers::Vector" ) + if( objectType == "Containers::Array" || + objectType == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) return computeDifferenceOfVectors< MeshPointer, Value, Real, Index >( meshPointer, parameters ); std::cerr << "Unknown object type " << objectType << "." << std::endl; return false; @@ -450,7 +451,8 @@ bool setIndexType( const MeshPointer& meshPointer, const Config::ParameterContainer& parameters ) { String indexType; - if( parsedObjectType[ 0 ] == "Containers::Vector" ) + if( parsedObjectType[ 0 ] == "Containers::Array" || + parsedObjectType[ 0 ] == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) indexType = parsedObjectType[ 3 ]; if( parsedObjectType[ 0 ] == "Functions::MeshFunction" ) @@ -525,7 +527,8 @@ bool setValueType( const MeshPointer& meshPointer, if( parsedObjectType[ 0 ] == "Functions::MeshFunction" ) elementType = parsedObjectType[ 3 ]; - if( parsedObjectType[ 0 ] == "Containers::Vector" ) + if( parsedObjectType[ 0 ] == "Containers::Array" || + parsedObjectType[ 0 ] == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) elementType = parsedObjectType[ 1 ]; diff --git a/src/Tools/tnl-init.h b/src/Tools/tnl-init.h index a393a7a7cf..a1c0eb5faa 100644 --- a/src/Tools/tnl-init.h +++ b/src/Tools/tnl-init.h @@ -263,8 +263,7 @@ bool resolveMesh( const std::vector< String >& parsedMeshType, const Config::ParameterContainer& parameters ) { std::cout << "+ -> Setting mesh type to " << parsedMeshType[ 0 ] << " ... " << std::endl; - if( parsedMeshType[ 0 ] == "Meshes::Grid" || - parsedMeshType[ 0 ] == "tnlGrid" ) // TODO: remove deprecated type name + if( parsedMeshType[ 0 ] == "Meshes::Grid" ) { typedef Meshes::Grid< Dimension, RealType, Devices::Host, IndexType > MeshType; return resolveRealType< MeshType >( parameters ); diff --git a/src/Tools/tnl-view.h b/src/Tools/tnl-view.h index 64c09e32bb..9f2bc02b2c 100644 --- a/src/Tools/tnl-view.h +++ b/src/Tools/tnl-view.h @@ -250,7 +250,8 @@ bool convertObject( const MeshPointer& meshPointer, std::cout << " writing to " << outputFileName << " ... " << std::flush; - if( parsedObjectType[ 0 ] == "Containers::Vector" ) + if( parsedObjectType[ 0 ] == "Containers::Array" || + parsedObjectType[ 0 ] == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) { using MeshType = typename MeshPointer::ObjectType; // FIXME: why is MeshType::GlobalIndexType not the same as Index? @@ -271,7 +272,8 @@ bool setDimension( const MeshPointer& meshPointer, const Config::ParameterContainer& parameters ) { int dimensions( 0 ); - if( parsedObjectType[ 0 ] == "Containers::Vector" ) + if( parsedObjectType[ 0 ] == "Containers::Array" || + parsedObjectType[ 0 ] == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) dimensions = 1; switch( dimensions ) { @@ -293,7 +295,8 @@ bool setIndexType( const MeshPointer& meshPointer, const Config::ParameterContainer& parameters ) { String indexType; - if( parsedObjectType[ 0 ] == "Containers::Vector" ) + if( parsedObjectType[ 0 ] == "Containers::Array" || + parsedObjectType[ 0 ] == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) indexType = parsedObjectType[ 3 ]; if( indexType == "int" ) @@ -363,8 +366,8 @@ bool setValueType( const MeshPointer& meshPointer, { String elementType; - // TODO: Fix this even for arrays - if( parsedObjectType[ 0 ] == "Containers::Vector" ) + if( parsedObjectType[ 0 ] == "Containers::Array" || + parsedObjectType[ 0 ] == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) elementType = parsedObjectType[ 1 ]; if( elementType == "float" ) @@ -459,7 +462,8 @@ struct FilesProcessor error = true; continue; } - if( parsedObjectType[ 0 ] == "Containers::Vector" ) + if( parsedObjectType[ 0 ] == "Containers::Array" || + parsedObjectType[ 0 ] == "Containers::Vector" ) // TODO: remove deprecated names (Vector is saved as Array) setValueType< MeshPointer >( meshPointer, inputFiles[ i ], parsedObjectType, parameters ); if( parsedObjectType[ 0 ] == "Functions::MeshFunction" ) setMeshFunction< MeshPointer >( meshPointer, inputFiles[ i ], parsedObjectType, parameters ); -- GitLab