From 219db39d5be8d07c2fae64e4a9408cd96b338ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= <klinkjak@fjfi.cvut.cz> Date: Wed, 5 Sep 2018 22:13:07 +0200 Subject: [PATCH] Added convenient overload of the loadMesh function for non-distributed meshes --- src/TNL/Meshes/TypeResolver/TypeResolver_impl.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/TNL/Meshes/TypeResolver/TypeResolver_impl.h b/src/TNL/Meshes/TypeResolver/TypeResolver_impl.h index d45016af19..b094ffcaf6 100644 --- a/src/TNL/Meshes/TypeResolver/TypeResolver_impl.h +++ b/src/TNL/Meshes/TypeResolver/TypeResolver_impl.h @@ -19,6 +19,7 @@ #include <TNL/Meshes/Readers/VTKReader.h> #include <TNL/Meshes/TypeResolver/GridTypeResolver.h> #include <TNL/Meshes/TypeResolver/MeshTypeResolver.h> +#include <TNL/Communicators/NoDistrCommunicator.h> // TODO: implement this in TNL::String inline bool ends_with( const std::string& value, const std::string& ending ) @@ -278,5 +279,16 @@ decomposeMesh( const Config::ParameterContainer& parameters, return true; } +// convenient overload for non-distributed meshes +template< typename Mesh > +bool +loadMesh( const String& fileName, Mesh& mesh ) +{ + using Communicator = TNL::Communicators::NoDistrCommunicator; + using DistributedMesh = DistributedMeshes::DistributedMesh< Mesh>; + DistributedMesh distributedMesh; + return loadMesh< Communicator >( fileName, mesh, distributedMesh ); +} + } // namespace Meshes } // namespace TNL -- GitLab